summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x.gitlab/ci/ninja.ps14
-rwxr-xr-x.gitlab/ci/ninja.sh6
-rw-r--r--Help/command/get_property.rst5
-rw-r--r--Help/command/get_source_file_property.rst5
-rw-r--r--Help/command/set_property.rst5
-rw-r--r--Help/command/set_source_files_properties.rst5
-rw-r--r--Help/command/target_compile_definitions.rst9
-rw-r--r--Help/envvar/CUDAARCHS.rst13
-rw-r--r--Help/manual/cmake-env-variables.7.rst1
-rw-r--r--Help/manual/cmake-policies.7.rst1
-rw-r--r--Help/manual/cmake-presets.7.rst2
-rw-r--r--Help/manual/cmake-properties.7.rst4
-rw-r--r--Help/manual/cmake-variables.7.rst1
-rw-r--r--Help/policy/CMP0118.rst17
-rw-r--r--Help/prop_sf/GENERATED.rst11
-rw-r--r--Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY.rst8
-rw-r--r--Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY.rst8
-rw-r--r--Help/prop_tgt/XCODE_EMBED_type.rst14
-rw-r--r--Help/prop_tgt/XCODE_EMBED_type_PATH.rst9
-rw-r--r--Help/release/dev/cuda-archs-env.rst6
-rw-r--r--Help/release/dev/make-GENERATED-visible-from-any-scope.rst7
-rw-r--r--Help/release/dev/makefiles-dependencies-use-compiler.rst5
-rw-r--r--Help/release/dev/xcode-embed-frameworks.rst9
-rw-r--r--Help/variable/CMAKE_CUDA_ARCHITECTURES.rst3
-rw-r--r--Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst9
-rw-r--r--Modules/CMakeCCompilerId.c.in4
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in4
-rw-r--r--Modules/CMakeDetermineCUDACompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCompilerId.cmake5
-rw-r--r--Modules/CMakeFortranCompilerId.F.in2
-rw-r--r--Modules/CTest.cmake17
-rw-r--r--Modules/CheckPIESupported.cmake8
-rw-r--r--Modules/Compiler/ARMCC.cmake2
-rw-r--r--Modules/Compiler/AppleClang-C.cmake12
-rw-r--r--Modules/Compiler/AppleClang-CXX.cmake8
-rw-r--r--Modules/Compiler/AppleClang-OBJC.cmake9
-rw-r--r--Modules/Compiler/AppleClang-OBJCXX.cmake10
-rw-r--r--Modules/Compiler/Clang-C.cmake13
-rw-r--r--Modules/Compiler/Clang-CUDA.cmake8
-rw-r--r--Modules/Compiler/Clang-CXX.cmake13
-rw-r--r--Modules/Compiler/Clang-OBJC.cmake9
-rw-r--r--Modules/Compiler/Clang-OBJCXX.cmake8
-rw-r--r--Modules/Compiler/GNU-ASM.cmake2
-rw-r--r--Modules/Compiler/GNU-C.cmake10
-rw-r--r--Modules/Compiler/GNU-CXX.cmake10
-rw-r--r--Modules/Compiler/GNU-OBJC.cmake9
-rw-r--r--Modules/Compiler/GNU-OBJCXX.cmake9
-rw-r--r--Modules/Compiler/GNU.cmake3
-rw-r--r--Modules/Compiler/IAR.cmake4
-rw-r--r--Modules/Compiler/Intel-C.cmake8
-rw-r--r--Modules/Compiler/Intel-CXX.cmake8
-rw-r--r--Modules/Compiler/Intel-ISPC.cmake8
-rw-r--r--Modules/Compiler/NVIDIA-CUDA.cmake10
-rw-r--r--Modules/Compiler/QCC.cmake2
-rw-r--r--Modules/Compiler/SunPro-C.cmake2
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake2
-rw-r--r--Modules/Compiler/TI-C.cmake6
-rw-r--r--Modules/Compiler/TI.cmake2
-rw-r--r--Modules/Compiler/XL.cmake2
-rw-r--r--Modules/FindHDF5.cmake8
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake9
-rw-r--r--Modules/FindPython.cmake98
-rw-r--r--Modules/FindPython2.cmake85
-rw-r--r--Modules/FindPython3.cmake99
-rw-r--r--Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake (renamed from Modules/Internal/CMakeCheckCompilerFlag.cmake)6
-rw-r--r--Modules/Internal/CheckCompilerFlag.cmake14
-rw-r--r--Modules/Internal/CheckSourceCompiles.cmake14
-rw-r--r--Modules/Internal/CheckSourceRuns.cmake12
-rw-r--r--Modules/Platform/Windows-Clang-C.cmake16
-rw-r--r--Modules/Platform/Windows-Clang-CXX.cmake16
-rw-r--r--Modules/Platform/Windows-Clang.cmake7
-rw-r--r--Modules/Platform/Windows-Intel-C.cmake27
-rw-r--r--Modules/Platform/Windows-Intel-CXX.cmake27
-rw-r--r--Modules/Platform/Windows-Intel.cmake14
-rw-r--r--Modules/Platform/Windows-MSVC-C.cmake7
-rw-r--r--Modules/Platform/Windows-MSVC-CXX.cmake7
-rw-r--r--Modules/Platform/Windows-MSVC.cmake8
-rw-r--r--Source/CMakeLists.txt11
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx43
-rw-r--r--Source/cmCPluginAPI.cxx5
-rw-r--r--Source/cmCTest.cxx11
-rw-r--r--Source/cmDependsCompiler.cxx267
-rw-r--r--Source/cmDependsCompiler.h60
-rw-r--r--Source/cmExportBuildFileGenerator.cxx3
-rw-r--r--Source/cmExportInstallFileGenerator.cxx3
-rw-r--r--Source/cmGeneratorExpressionEvaluationFile.cxx7
-rw-r--r--Source/cmGetPropertyCommand.cxx2
-rw-r--r--Source/cmGetSourceFilePropertyCommand.cxx2
-rw-r--r--Source/cmGlobalGenerator.cxx11
-rw-r--r--Source/cmGlobalGenerator.h8
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx8
-rw-r--r--Source/cmGlobalNinjaGenerator.h5
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx1
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.h11
-rw-r--r--Source/cmGlobalWatcomWMakeGenerator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx134
-rw-r--r--Source/cmGlobalXCodeGenerator.h3
-rw-r--r--Source/cmInstallCommand.cxx19
-rw-r--r--Source/cmLocalGenerator.cxx6
-rw-r--r--Source/cmLocalGenerator.h7
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx551
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.h29
-rw-r--r--Source/cmMakefile.cxx8
-rw-r--r--Source/cmMakefileTargetGenerator.cxx167
-rw-r--r--Source/cmNinjaTargetGenerator.cxx65
-rw-r--r--Source/cmNinjaTargetGenerator.h2
-rw-r--r--Source/cmPolicies.h6
-rw-r--r--Source/cmQtAutoGenInitializer.cxx2
-rw-r--r--Source/cmRulePlaceholderExpander.cxx11
-rw-r--r--Source/cmRulePlaceholderExpander.h78
-rw-r--r--Source/cmSetPropertyCommand.cxx105
-rw-r--r--Source/cmSetPropertyCommand.h15
-rw-r--r--Source/cmSetSourceFilesPropertiesCommand.cxx11
-rw-r--r--Source/cmSourceFile.cxx77
-rw-r--r--Source/cmSourceFile.h36
-rw-r--r--Source/cmTargetExport.h2
-rw-r--r--Source/cmXCodeObject.h7
-rw-r--r--Source/cmake.cxx22
-rw-r--r--Source/cmcmd.cxx183
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt6
-rw-r--r--Tests/CudaOnly/CompileFlags/CMakeLists.txt1
-rw-r--r--Tests/CudaOnly/ExportPTX/CMakeLists.txt6
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/BuildDepends/CompilerDependencies.cmake46
-rw-r--r--Tests/RunCMake/BuildDepends/CompilerDependencies.step1.cmake9
-rw-r--r--Tests/RunCMake/BuildDepends/CompilerDependencies.step2.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake2
-rw-r--r--Tests/RunCMake/CMP0026/clear-cached-information.cmake2
-rw-r--r--Tests/RunCMake/CMP0104/CMP0104-OLD.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Helper.cmake14
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test1.cmake9
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test10.cmake65
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test11.cmake65
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test12.cmake65
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test13.cmake65
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test14.cmake65
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test15.cmake65
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake12
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake66
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake66
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake66
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake66
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake78
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake44
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake44
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake50
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake50
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-stderr.txt16
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test1.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt57
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test10.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt86
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test11.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test12.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-stderr.txt64
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test13.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt57
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test14.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt86
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test15.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test2.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt93
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt93
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-stderr.txt173
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-stderr.txt173
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt180
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test5.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test6.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-stderr.txt80
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test7.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test8.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-stderr.txt80
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt16
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt57
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test10.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt73
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test11.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test12.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test13.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt57
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test14.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt73
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test15.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test2.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt93
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test3.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt93
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt101
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test4.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt101
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt117
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test5.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test6.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt83
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test7.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test8.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt67
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test9.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-stderr.txt16
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test1.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-stderr.txt57
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test10.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt96
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test11.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test12-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test12-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test12.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test13.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-stderr.txt57
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test14.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt96
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test15.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test2-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test2.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt93
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test3.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt93
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt218
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test4.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt218
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt219
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test5.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test6.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt106
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test7.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test8.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-result.txt1
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt90
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-WARN-Test9.cmake1
-rw-r--r--Tests/RunCMake/CMP0118/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/CMP0118/RunCMakeTest.cmake55
-rw-r--r--Tests/RunCMake/CMP0118/source.cpp.in5
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test10/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test11/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test12/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test14/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test15/CMakeLists.txt33
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test6/CMakeLists.txt16
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test7/CMakeLists.txt16
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt30
-rw-r--r--Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt30
-rw-r--r--Tests/RunCMake/CMakeLists.txt14
-rw-r--r--Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt4
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake2
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake2
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake2
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake2
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake2
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake2
-rw-r--r--Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/InvalidArg1-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/InvalidArg1-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/InvalidArg2-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/InvalidArg2-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/Make/TargetMessages-OFF-build-check.cmake3
-rw-r--r--Tests/RunCMake/Make/TargetMessages-OFF-build-stdout.txt6
-rw-r--r--Tests/RunCMake/Make/TargetMessages-ON-build-check.cmake3
-rw-r--r--Tests/RunCMake/Make/TargetMessages-ON-build-stdout.txt9
-rw-r--r--Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-check.cmake3
-rw-r--r--Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-stdout.txt6
-rw-r--r--Tests/RunCMake/Make/TargetMessages-VAR-ON-build-check.cmake3
-rw-r--r--Tests/RunCMake/Make/TargetMessages-VAR-ON-build-stdout.txt9
-rw-r--r--Tests/RunCMake/Make/TargetMessages-validation.cmake10
-rw-r--r--Tests/RunCMake/Ninja/AssumedSources.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOff-check.cmake14
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOff.cmake7
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir-build-check.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir-check.cmake14
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir.cmake7
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir-build-check.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir-check.cmake14
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir.cmake8
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/ExternalFramework.cmake2
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake43
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/func.m6
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/main.m6
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake29
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeObjectLibsInTwoProjects.cmake5
-rw-r--r--Tests/RunCMake/XcodeProject/subproject_two_object_libs/CMakeLists.txt31
-rw-r--r--Tests/RunCMake/XcodeProject/subproject_two_object_libs/dummy.cpp5
-rw-r--r--Tests/RunCMake/export/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/export/SeparateNamelinkExport.cmake16
-rw-r--r--Tests/RunCMake/install/EXPORT-SeparateNamelink.cmake19
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake1
-rwxr-xr-xbootstrap2
371 files changed, 8276 insertions, 616 deletions
diff --git a/.gitlab/ci/ninja.ps1 b/.gitlab/ci/ninja.ps1
index 91f8b02..4cc6bcb 100755
--- a/.gitlab/ci/ninja.ps1
+++ b/.gitlab/ci/ninja.ps1
@@ -1,7 +1,7 @@
$erroractionpreference = "stop"
-$version = "1.10.0"
-$sha256sum = "919FD158C16BF135E8A850BB4046EC1CE28A7439EE08B977CD0B7F6B3463D178"
+$version = "1.10.2"
+$sha256sum = "BBDE850D247D2737C5764C927D1071CBB1F1957DCABDA4A130FA8547C12C695F"
$filename = "ninja-win"
$tarball = "$filename.zip"
diff --git a/.gitlab/ci/ninja.sh b/.gitlab/ci/ninja.sh
index 93c1ee9..9011bbc 100755
--- a/.gitlab/ci/ninja.sh
+++ b/.gitlab/ci/ninja.sh
@@ -2,17 +2,17 @@
set -e
-readonly version="1.10.0"
+readonly version="1.10.2"
case "$( uname -s )" in
Linux)
shatool="sha256sum"
- sha256sum="6566836ddf3d72ca06685b34814e0c6fa0f0943542d651d0dab3150f10307c82"
+ sha256sum="763464859c7ef2ea3a0a10f4df40d2025d3bb9438fcb1228404640410c0ec22d"
platform="linux"
;;
Darwin)
shatool="shasum -a 256"
- sha256sum="2ee405c0e205d55666c60cc9c0d8d04c8ede06d3ef2e2c2aabe08fd81c17d22e"
+ sha256sum="6fa359f491fac7e5185273c6421a000eea6a2f0febf0ac03ac900bd4d80ed2a5"
platform="mac"
;;
*)
diff --git a/Help/command/get_property.rst b/Help/command/get_property.rst
index 9ee7a4b..f77d8af 100644
--- a/Help/command/get_property.rst
+++ b/Help/command/get_property.rst
@@ -94,3 +94,8 @@ If ``BRIEF_DOCS`` or ``FULL_DOCS`` is given then the variable is set to a
string containing documentation for the requested property. If
documentation is requested for a property that has not been defined
``NOTFOUND`` is returned.
+
+.. note::
+
+ The :prop_sf:`GENERATED` source file property may be globally visible.
+ See its documentation for details.
diff --git a/Help/command/get_source_file_property.rst b/Help/command/get_source_file_property.rst
index 1e0ea9f..ae41565 100644
--- a/Help/command/get_source_file_property.rst
+++ b/Help/command/get_source_file_property.rst
@@ -40,3 +40,8 @@ file properties usually control how the file is built. One property that is
always there is :prop_sf:`LOCATION`.
See also the more general :command:`get_property` command.
+
+.. note::
+
+ The :prop_sf:`GENERATED` source file property may be globally visible.
+ See its documentation for details.
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index 22e0301..bf437b4 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -105,3 +105,8 @@ directly set in the nominated scope, the command will behave as though
See the :manual:`cmake-properties(7)` manual for a list of properties
in each scope.
+
+.. note::
+
+ The :prop_sf:`GENERATED` source file property may be globally visible.
+ See its documentation for details.
diff --git a/Help/command/set_source_files_properties.rst b/Help/command/set_source_files_properties.rst
index f8b05ac..61c69a2 100644
--- a/Help/command/set_source_files_properties.rst
+++ b/Help/command/set_source_files_properties.rst
@@ -36,3 +36,8 @@ See also the :command:`set_property(SOURCE)` command.
See :ref:`Source File Properties` for the list of properties known
to CMake.
+
+.. note::
+
+ The :prop_sf:`GENERATED` source file property may be globally visible.
+ See its documentation for details.
diff --git a/Help/command/target_compile_definitions.rst b/Help/command/target_compile_definitions.rst
index 09e2ded..3fb113a 100644
--- a/Help/command/target_compile_definitions.rst
+++ b/Help/command/target_compile_definitions.rst
@@ -39,3 +39,12 @@ For example, the following are all equivalent:
target_compile_definitions(foo PUBLIC -DFOO) # -D removed
target_compile_definitions(foo PUBLIC "" FOO) # "" ignored
target_compile_definitions(foo PUBLIC -D FOO) # -D becomes "", then ignored
+
+Definitions may optionally have values:
+
+.. code-block:: cmake
+
+ target_compile_definitions(foo PUBLIC FOO=1)
+
+Note that many compilers treat ``-DFOO`` as equivalent to ``-DFOO=1``, but
+other tools may not recognize this in all circumstances (e.g. IntelliSense).
diff --git a/Help/envvar/CUDAARCHS.rst b/Help/envvar/CUDAARCHS.rst
new file mode 100644
index 0000000..82369cd
--- /dev/null
+++ b/Help/envvar/CUDAARCHS.rst
@@ -0,0 +1,13 @@
+CUDAARCHS
+---------
+
+.. versionadded:: 3.20
+
+.. include:: ENV_VAR.txt
+
+Value used to initialize :variable:`CMAKE_CUDA_ARCHITECTURES` on the first
+configuration if it's not already defined. Subsequent runs will use the value
+stored in the cache.
+
+This is a semicolon-separated list of architectures as described in
+:prop_tgt:`CUDA_ARCHITECTURES`.
diff --git a/Help/manual/cmake-env-variables.7.rst b/Help/manual/cmake-env-variables.7.rst
index 13e0d39..26e0c48 100644
--- a/Help/manual/cmake-env-variables.7.rst
+++ b/Help/manual/cmake-env-variables.7.rst
@@ -56,6 +56,7 @@ Environment Variables for Languages
/envvar/CC
/envvar/CFLAGS
/envvar/CSFLAGS
+ /envvar/CUDAARCHS
/envvar/CUDACXX
/envvar/CUDAFLAGS
/envvar/CUDAHOSTCXX
diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 03eb93e..6f9a24a 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -57,6 +57,7 @@ Policies Introduced by CMake 3.20
.. toctree::
:maxdepth: 1
+ CMP0118: The GENERATED source file property is now visible in all directories. </policy/CMP0118>
CMP0117: MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default. </policy/CMP0117>
CMP0116: Ninja generators transform DEPFILEs from add_custom_command(). </policy/CMP0116>
CMP0115: Source file extensions must be explicit. </policy/CMP0115>
diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index 62c4b7c..6f137c4 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -93,7 +93,7 @@ Format
An optional array of strings representing the names of presets to inherit
from. The preset will inherit all of the fields from the ``inherits``
presets by default (except ``name``, ``hidden``, ``inherits``,
- ``description``, and ``longDescription``), but can override them as
+ ``description``, and ``displayName``), but can override them as
desired. If multiple ``inherits`` presets provide conflicting values for
the same field, the earlier preset in the ``inherits`` list will be
preferred. Presets in ``CMakePresets.json`` may not inherit from presets
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index cb9579e..f322f0b 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -396,6 +396,10 @@ Properties on Targets
/prop_tgt/WIN32_EXECUTABLE
/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS
/prop_tgt/XCODE_ATTRIBUTE_an-attribute
+ /prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY
+ /prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY
+ /prop_tgt/XCODE_EMBED_type
+ /prop_tgt/XCODE_EMBED_type_PATH
/prop_tgt/XCODE_EXPLICIT_FILE_TYPE
/prop_tgt/XCODE_GENERATE_SCHEME
/prop_tgt/XCODE_LINK_BUILD_PHASE_MODE
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index f0c9d99..28cd101 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -387,6 +387,7 @@ Variables that Control the Build
/variable/CMAKE_DEFAULT_BUILD_TYPE
/variable/CMAKE_DEFAULT_CONFIGS
/variable/CMAKE_DISABLE_PRECOMPILE_HEADERS
+ /variable/CMAKE_DEPENDS_USE_COMPILER
/variable/CMAKE_ENABLE_EXPORTS
/variable/CMAKE_EXE_LINKER_FLAGS
/variable/CMAKE_EXE_LINKER_FLAGS_CONFIG
diff --git a/Help/policy/CMP0118.rst b/Help/policy/CMP0118.rst
new file mode 100644
index 0000000..8e71320
--- /dev/null
+++ b/Help/policy/CMP0118.rst
@@ -0,0 +1,17 @@
+CMP0118
+-------
+
+The :prop_sf:`GENERATED` source file property is now visible in all directories.
+
+Whether or not a source file is generated is an all-or-nothing global
+property of the source. Consequently, the associated ``GENERATED``
+property is now visible from any directory scope, not only from the scope
+for which it was set.
+
+The ``OLD`` behavior of this policy is to only allow ``GENERATED`` to be
+visible from the directory scope for which it was set. The ``NEW``
+behavior on the other hand allows it to be visible from any scope.
+
+This policy was introduced in CMake version 3.20. 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.
diff --git a/Help/prop_sf/GENERATED.rst b/Help/prop_sf/GENERATED.rst
index 48ff70c..6ef4580 100644
--- a/Help/prop_sf/GENERATED.rst
+++ b/Help/prop_sf/GENERATED.rst
@@ -3,6 +3,9 @@ GENERATED
Is this source file generated as part of the build or CMake process.
+.. versionchanged:: 3.20
+ The GENERATED source file property is now visible in all directories.
+
Tells the internal CMake engine that a source file is generated by an outside
process such as another build step, or the execution of CMake itself.
This information is then used to exempt the file from any existence or
@@ -34,3 +37,11 @@ or :prop_tgt:`AUTORCC` functionality, the :prop_gbl:`AUTOGEN_SOURCE_GROUP`,
:prop_gbl:`AUTOMOC_SOURCE_GROUP` and :prop_gbl:`AUTORCC_SOURCE_GROUP` target
properties may influence where the generated sources are grouped in the project's
file lists.
+
+.. note::
+
+ Starting with CMake 3.20 the ``GENERATED`` source file property can be set
+ and retrieved from any directory scope. It is an all-or-nothing property.
+ It also can no longer be removed or unset if it was set to ``TRUE``. Policy
+ :policy:`CMP0118` was introduced to allow supporting the ``OLD`` behavior
+ for some time.
diff --git a/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY.rst b/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY.rst
new file mode 100644
index 0000000..7b68126
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY.rst
@@ -0,0 +1,8 @@
+XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY
+----------------------------------------
+
+.. versionadded:: 3.20
+
+Tell the :generator:`Xcode` generator to perform code signing for all the
+frameworks and libraries that are embedded using the
+:prop_tgt:`XCODE_EMBED_FRAMEWORKS <XCODE_EMBED_<type>>` property.
diff --git a/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY.rst b/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY.rst
new file mode 100644
index 0000000..29f8c5c
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY.rst
@@ -0,0 +1,8 @@
+XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY
+---------------------------------------------
+
+.. versionadded:: 3.20
+
+Tell the :generator:`Xcode` generator to remove headers from all the
+frameworks that are embedded using the
+:prop_tgt:`XCODE_EMBED_FRAMEWORKS <XCODE_EMBED_<type>>` property.
diff --git a/Help/prop_tgt/XCODE_EMBED_type.rst b/Help/prop_tgt/XCODE_EMBED_type.rst
new file mode 100644
index 0000000..90c5bc7
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EMBED_type.rst
@@ -0,0 +1,14 @@
+XCODE_EMBED_<type>
+------------------
+
+.. versionadded:: 3.20
+
+Tell the :generator:`Xcode` generator to embed the specified list of items into
+the target bundle. ``<type>`` specifies the embed build phase to use.
+
+Currently, the only supported value for ``<type>`` is ``FRAMEWORKS``.
+The specified items will be added to the ``Embed Frameworks`` build phase.
+The items can be CMake target names or paths to frameworks or libraries.
+See also :prop_tgt:`XCODE_EMBED_<type>_PATH`,
+:prop_tgt:`XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY` and
+:prop_tgt:`XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY`.
diff --git a/Help/prop_tgt/XCODE_EMBED_type_PATH.rst b/Help/prop_tgt/XCODE_EMBED_type_PATH.rst
new file mode 100644
index 0000000..887cf57
--- /dev/null
+++ b/Help/prop_tgt/XCODE_EMBED_type_PATH.rst
@@ -0,0 +1,9 @@
+XCODE_EMBED_<type>_PATH
+-----------------------
+
+.. versionadded:: 3.20
+
+Tell the :generator:`Xcode` generator the relative path to use when embedding
+the items specified by :prop_tgt:`XCODE_EMBED_<type>`. The path is relative
+to the base location of the ``Embed XXX`` build phase associated with
+``<type>``.
diff --git a/Help/release/dev/cuda-archs-env.rst b/Help/release/dev/cuda-archs-env.rst
new file mode 100644
index 0000000..a2afcbe
--- /dev/null
+++ b/Help/release/dev/cuda-archs-env.rst
@@ -0,0 +1,6 @@
+cuda-archs-env
+--------------
+
+* The :envvar:`CUDAARCHS` environment variable was added for initializing
+ :variable:`CMAKE_CUDA_ARCHITECTURES`. Useful in cases where the compiler
+ default is unsuitable for the machine's GPU.
diff --git a/Help/release/dev/make-GENERATED-visible-from-any-scope.rst b/Help/release/dev/make-GENERATED-visible-from-any-scope.rst
new file mode 100644
index 0000000..7757175
--- /dev/null
+++ b/Help/release/dev/make-GENERATED-visible-from-any-scope.rst
@@ -0,0 +1,7 @@
+make-GENERATED-visible-from-any-scope
+-------------------------------------
+
+* The :prop_sf:`GENERATED` source-file property is now visible
+ from any directory scope, regardles in which scope or for what
+ scope it was set.
+ See policy :policy:`CMP0118`.
diff --git a/Help/release/dev/makefiles-dependencies-use-compiler.rst b/Help/release/dev/makefiles-dependencies-use-compiler.rst
new file mode 100644
index 0000000..8170cda
--- /dev/null
+++ b/Help/release/dev/makefiles-dependencies-use-compiler.rst
@@ -0,0 +1,5 @@
+makefiles-dependencies-use-compiler
+-----------------------------------
+
+* The :ref:`Makefile Generators` gained the capability, for a selection of
+ compilers, to use the compiler itself to generate implicit dependencies.
diff --git a/Help/release/dev/xcode-embed-frameworks.rst b/Help/release/dev/xcode-embed-frameworks.rst
new file mode 100644
index 0000000..5573fcb
--- /dev/null
+++ b/Help/release/dev/xcode-embed-frameworks.rst
@@ -0,0 +1,9 @@
+xcode-embed-frameworks
+----------------------
+
+* When using the Xcode generator, it is now possible to embed frameworks
+ using the new :prop_tgt:`XCODE_EMBED_FRAMEWORKS <XCODE_EMBED_<type>>`
+ target property. Aspects of the embedding can be customized with the
+ :prop_tgt:`XCODE_EMBED_FRAMEWORKS_PATH <XCODE_EMBED_<type>>`,
+ :prop_tgt:`XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY` and
+ :prop_tgt:`XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY` target properties.
diff --git a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
index 985040d..7f7e679 100644
--- a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
+++ b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst
@@ -5,7 +5,8 @@ CMAKE_CUDA_ARCHITECTURES
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>`:
+Initialized by the :envvar:`CUDAARCHS` environment variable if set.
+Otherwise as follows depending on :variable:`CMAKE_CUDA_COMPILER_ID <CMAKE_<LANG>_COMPILER_ID>`:
- For ``Clang``: the oldest architecture that works.
diff --git a/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst b/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst
new file mode 100644
index 0000000..bdad59e
--- /dev/null
+++ b/Help/variable/CMAKE_DEPENDS_USE_COMPILER.rst
@@ -0,0 +1,9 @@
+CMAKE_DEPENDS_USE_COMPILER
+--------------------------
+
+.. versionadded:: 3.20
+
+For the :ref:`Makefile Generators`, source dependencies are now, for a
+selection of compilers, generated by the compiler itself. By defining this
+variable with value ``FALSE``, you can restore the legacy behavior (i.e. using
+``CMake`` for dependencies discovery).
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 2f6bdb4..8ba6abc 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -26,7 +26,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYC) || defined(__cray__)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
@@ -77,7 +77,7 @@ int main(int argc, char* argv[])
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYC) || defined(__cray__)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index a743ce7..672fff8 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -20,7 +20,7 @@ char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYC) || defined(__cray__)
char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]";
#endif
@@ -76,7 +76,7 @@ int main(int argc, char* argv[])
#ifdef SIMULATE_VERSION_MAJOR
require += info_simulate_version[argc];
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYC) || defined(__cray__)
require += info_cray[argc];
#endif
require += info_language_dialect_default[argc];
diff --git a/Modules/CMakeDetermineCUDACompiler.cmake b/Modules/CMakeDetermineCUDACompiler.cmake
index 972adef..578729c 100644
--- a/Modules/CMakeDetermineCUDACompiler.cmake
+++ b/Modules/CMakeDetermineCUDACompiler.cmake
@@ -47,6 +47,10 @@ if(NOT $ENV{CUDAHOSTCXX} STREQUAL "")
endif()
endif()
+if(NOT "$ENV{CUDAARCHS}" STREQUAL "")
+ set(CMAKE_CUDA_ARCHITECTURES "$ENV{CUDAARCHS}" CACHE STRING "CUDA architectures")
+endif()
+
# Build a small source file to identify the compiler.
if(NOT CMAKE_CUDA_COMPILER_ID_RUN)
set(CMAKE_CUDA_COMPILER_ID_RUN 1)
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake
index a982d2c..33ac07e 100644
--- a/Modules/CMakeDetermineCompilerId.cmake
+++ b/Modules/CMakeDetermineCompilerId.cmake
@@ -152,7 +152,10 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
endif()
- if(CMAKE_GENERATOR MATCHES "^Ninja" AND MSVC_${lang}_ARCHITECTURE_ID)
+ if((CMAKE_GENERATOR MATCHES "^Ninja"
+ OR ((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"))
+ AND MSVC_${lang}_ARCHITECTURE_ID)
foreach(userflags "${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}" "")
CMAKE_DETERMINE_MSVC_SHOWINCLUDES_PREFIX(${lang} "${userflags}")
endforeach()
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 30f8d4c..7e8828b 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -108,7 +108,7 @@
#else
PRINT *, 'INFO:compiler[]'
#endif
-#if defined(__CRAYXE) || defined(__CRAYXC)
+#if defined(_CRAYFTN)
PRINT *, 'INFO:compiler_wrapper[CrayPrgEnv]'
#endif
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index a18e85b..8f8ebb4 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -121,15 +121,6 @@ if(BUILD_TESTING)
string(APPEND SUBMIT_URL "${DROP_SITE}${DROP_LOCATION}")
endif()
- find_program(CVSCOMMAND cvs )
- set(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
- "Options passed to the cvs update command.")
- find_program(SVNCOMMAND svn)
- find_program(BZRCOMMAND bzr)
- find_program(HGCOMMAND hg)
- find_program(GITCOMMAND git)
- find_program(P4COMMAND p4)
-
if(NOT UPDATE_TYPE)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
set(UPDATE_TYPE cvs)
@@ -146,21 +137,29 @@ if(BUILD_TESTING)
string(TOLOWER "${UPDATE_TYPE}" _update_type)
if("${_update_type}" STREQUAL "cvs")
+ find_program(CVSCOMMAND cvs )
+ set(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
+ "Options passed to the cvs update command.")
set(UPDATE_COMMAND "${CVSCOMMAND}")
set(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "svn")
+ find_program(SVNCOMMAND svn)
set(UPDATE_COMMAND "${SVNCOMMAND}")
set(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "bzr")
+ find_program(BZRCOMMAND bzr)
set(UPDATE_COMMAND "${BZRCOMMAND}")
set(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "hg")
+ find_program(HGCOMMAND hg)
set(UPDATE_COMMAND "${HGCOMMAND}")
set(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "git")
+ find_program(GITCOMMAND git)
set(UPDATE_COMMAND "${GITCOMMAND}")
set(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "p4")
+ find_program(P4COMMAND p4)
set(UPDATE_COMMAND "${P4COMMAND}")
set(UPDATE_OPTIONS "${P4_UPDATE_OPTIONS}")
endif()
diff --git a/Modules/CheckPIESupported.cmake b/Modules/CheckPIESupported.cmake
index a99d8c4..fb87822 100644
--- a/Modules/CheckPIESupported.cmake
+++ b/Modules/CheckPIESupported.cmake
@@ -62,7 +62,7 @@ Examples
#]=======================================================================]
-include (Internal/CMakeCheckCompilerFlag)
+include (Internal/CMakeTryCompilerOrLinkerFlag)
function (check_pie_supported)
cmake_policy(GET CMP0083 cmp0083)
@@ -109,14 +109,16 @@ function (check_pie_supported)
foreach(lang IN LISTS CHECK_PIE_LANGUAGES)
if(_CMAKE_${lang}_PIE_MAY_BE_SUPPORTED_BY_LINKER)
- cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_PIE}"
+ cmake_try_compiler_or_linker_flag(${lang}
+ "${CMAKE_${lang}_LINK_OPTIONS_PIE}"
CMAKE_${lang}_LINK_PIE_SUPPORTED
OUTPUT_VARIABLE output)
if (NOT CMAKE_${lang}_LINK_PIE_SUPPORTED)
string (APPEND outputs "PIE (${lang}): ${output}\n")
endif()
- cmake_check_compiler_flag(${lang} "${CMAKE_${lang}_LINK_OPTIONS_NO_PIE}"
+ cmake_try_compiler_or_linker_flag(${lang}
+ "${CMAKE_${lang}_LINK_OPTIONS_NO_PIE}"
CMAKE_${lang}_LINK_NO_PIE_SUPPORTED
OUTPUT_VARIABLE output)
if (NOT CMAKE_${lang}_LINK_NO_PIE_SUPPORTED)
diff --git a/Modules/Compiler/ARMCC.cmake b/Modules/Compiler/ARMCC.cmake
index f949568..f4f1854 100644
--- a/Modules/Compiler/ARMCC.cmake
+++ b/Modules/Compiler/ARMCC.cmake
@@ -33,7 +33,7 @@ macro(__compiler_armcc lang)
set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_LINKER> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES> <OBJECTS> -o <TARGET> --list <TARGET_BASE>.map")
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_AR> --create -cr <TARGET> <LINK_FLAGS> <OBJECTS>")
- set(CMAKE_DEPFILE_FLAGS_${lang} "--depend=<DEPFILE> --depend_single_line --no_depend_system_headers")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--depend=<DEP_FILE> --depend_single_line --no_depend_system_headers")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
endmacro()
diff --git a/Modules/Compiler/AppleClang-C.cmake b/Modules/Compiler/AppleClang-C.cmake
index 2794f52..02d10d3 100644
--- a/Modules/Compiler/AppleClang-C.cmake
+++ b/Modules/Compiler/AppleClang-C.cmake
@@ -1,6 +1,18 @@
include(Compiler/Clang)
__compiler_clang(C)
+
+if(NOT "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPFILE_FORMAT gcc)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+ endif()
+endif()
+
+
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 15edc21..5282077 100644
--- a/Modules/Compiler/AppleClang-CXX.cmake
+++ b/Modules/Compiler/AppleClang-CXX.cmake
@@ -2,6 +2,14 @@ include(Compiler/Clang)
__compiler_clang(CXX)
if(NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+ endif()
+
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
diff --git a/Modules/Compiler/AppleClang-OBJC.cmake b/Modules/Compiler/AppleClang-OBJC.cmake
index d1f3706..d4eab4f 100644
--- a/Modules/Compiler/AppleClang-OBJC.cmake
+++ b/Modules/Compiler/AppleClang-OBJC.cmake
@@ -1,5 +1,14 @@
include(Compiler/Clang-OBJC)
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles"
+ AND CMAKE_DEPFILE_FLAGS_OBJC)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_OBJC_DEPFILE_FORMAT gcc)
+ set(CMAKE_OBJC_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+
if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_OBJC90_STANDARD_COMPILE_OPTION "-std=c90")
set(CMAKE_OBJC90_EXTENSION_COMPILE_OPTION "-std=gnu90")
diff --git a/Modules/Compiler/AppleClang-OBJCXX.cmake b/Modules/Compiler/AppleClang-OBJCXX.cmake
index 409bd4a..172a343 100644
--- a/Modules/Compiler/AppleClang-OBJCXX.cmake
+++ b/Modules/Compiler/AppleClang-OBJCXX.cmake
@@ -1,5 +1,15 @@
include(Compiler/Clang-OBJCXX)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles"
+ AND CMAKE_DEPFILE_FLAGS_OBJCXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_OBJCXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_OBJCXX_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+
set(CMAKE_OBJCXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 4.0)
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index 7c4a263..a631ac0 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -8,6 +8,19 @@ endif()
if("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
set(CMAKE_C_CLANG_TIDY_DRIVER_MODE "cl")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+ endif()
+elseif("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPFILE_FORMAT gcc)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+ endif()
endif()
if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
diff --git a/Modules/Compiler/Clang-CUDA.cmake b/Modules/Compiler/Clang-CUDA.cmake
index fd8c2b7..cafc7dd 100644
--- a/Modules/Compiler/Clang-CUDA.cmake
+++ b/Modules/Compiler/Clang-CUDA.cmake
@@ -2,7 +2,13 @@ include(Compiler/Clang)
__compiler_clang(CUDA)
# Set explicitly, because __compiler_clang() doesn't set this if we're simulating MSVC.
-set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT <OBJECT> -MF <DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CUDA_DEPFILE_FORMAT gcc)
+ set(CMAKE_CUDA_DEPENDS_USE_COMPILER TRUE)
+endif()
# C++03 isn't supported for CXX, but is for CUDA, so we need to set these manually.
# Do this before __compiler_clang_cxx_standards() since that adds the feature.
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index 789e991..430a91c 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -3,6 +3,14 @@ __compiler_clang(CXX)
__compiler_clang_cxx_standards(CXX)
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+ endif()
+
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
@@ -13,4 +21,9 @@ endif()
if("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
set(CMAKE_CXX_CLANG_TIDY_DRIVER_MODE "cl")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+ endif()
endif()
diff --git a/Modules/Compiler/Clang-OBJC.cmake b/Modules/Compiler/Clang-OBJC.cmake
index c61c497..19179e3 100644
--- a/Modules/Compiler/Clang-OBJC.cmake
+++ b/Modules/Compiler/Clang-OBJC.cmake
@@ -1,6 +1,15 @@
include(Compiler/Clang)
__compiler_clang(OBJC)
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_OBJC)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_OBJC_DEPFILE_FORMAT gcc)
+ set(CMAKE_OBJC_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+
if(NOT CMAKE_OBJC_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_OBJC90_STANDARD_COMPILE_OPTION "-std=c90")
set(CMAKE_OBJC90_EXTENSION_COMPILE_OPTION "-std=gnu90")
diff --git a/Modules/Compiler/Clang-OBJCXX.cmake b/Modules/Compiler/Clang-OBJCXX.cmake
index 453b5fd..9bdff66 100644
--- a/Modules/Compiler/Clang-OBJCXX.cmake
+++ b/Modules/Compiler/Clang-OBJCXX.cmake
@@ -1,3 +1,11 @@
include(Compiler/Clang)
__compiler_clang(OBJCXX)
__compiler_clang_cxx_standards(OBJCXX)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_OBJCXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_OBJCXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_OBJCXX_DEPENDS_USE_COMPILER TRUE)
+endif()
diff --git a/Modules/Compiler/GNU-ASM.cmake b/Modules/Compiler/GNU-ASM.cmake
index 94af401..a935416 100644
--- a/Modules/Compiler/GNU-ASM.cmake
+++ b/Modules/Compiler/GNU-ASM.cmake
@@ -6,7 +6,7 @@ set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm)
__compiler_gnu(ASM)
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH STREQUAL "GNU assembler")
- set(CMAKE_DEPFILE_FLAGS_ASM${ASM_DIALECT} "--MD <DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_ASM${ASM_DIALECT} "--MD <DEP_FILE>")
set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
"<CMAKE_LINKER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
set(CMAKE_ASM_DEFINE_FLAG "--defsym ")
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index ca286b3..1e6b61d 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -1,6 +1,16 @@
include(Compiler/GNU)
__compiler_gnu(C)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPFILE_FORMAT gcc)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+
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 fcaaeab..24be2d7 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -1,6 +1,16 @@
include(Compiler/GNU)
__compiler_gnu(CXX)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+
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/GNU-OBJC.cmake b/Modules/Compiler/GNU-OBJC.cmake
index fb9b0b2..7eeed83 100644
--- a/Modules/Compiler/GNU-OBJC.cmake
+++ b/Modules/Compiler/GNU-OBJC.cmake
@@ -1,2 +1,11 @@
include(Compiler/GNU)
__compiler_gnu(OBJC)
+
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_OBJC)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_OBJC_DEPFILE_FORMAT gcc)
+ set(CMAKE_OBJC_DEPENDS_USE_COMPILER TRUE)
+endif()
diff --git a/Modules/Compiler/GNU-OBJCXX.cmake b/Modules/Compiler/GNU-OBJCXX.cmake
index 06f0244..1047b5d 100644
--- a/Modules/Compiler/GNU-OBJCXX.cmake
+++ b/Modules/Compiler/GNU-OBJCXX.cmake
@@ -1,6 +1,15 @@
include(Compiler/GNU)
__compiler_gnu(OBJCXX)
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_OBJCXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_OBJCXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_OBJCXX_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+
if(NOT CMAKE_OBJCXX_COMPILER_VERSION VERSION_LESS 4.2)
set(CMAKE_OBJCXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 668a6a9..928e726 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -9,7 +9,6 @@ endif()
set(__COMPILER_GNU 1)
include(Compiler/CMakeCommonCompilerMacros)
-include(Internal/CMakeCheckCompilerFlag)
set(__pch_header_C "c-header")
set(__pch_header_CXX "c++-header")
@@ -49,7 +48,7 @@ macro(__compiler_gnu lang)
# distcc does not transform -o to -MT when invoking the preprocessor
# internally, as it ought to. Work around this bug by setting -MT here
# even though it isn't strictly necessary.
- set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <OBJECT> -MF <DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
endif()
# Initial configuration flags.
diff --git a/Modules/Compiler/IAR.cmake b/Modules/Compiler/IAR.cmake
index f3938a9..b8c0770 100644
--- a/Modules/Compiler/IAR.cmake
+++ b/Modules/Compiler/IAR.cmake
@@ -49,7 +49,7 @@ macro(__compiler_iar_ilink lang)
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
- set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ns <DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ns <DEP_FILE>")
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -r")
@@ -85,7 +85,7 @@ macro(__compiler_iar_xlink lang)
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> ${CMAKE_IAR_${lang}_FLAG} --silent <SOURCE> <DEFINES> <INCLUDES> <FLAGS> -lAH <ASSEMBLY_SOURCE> -o <OBJECT>.dummy")
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-f ")
- set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ns <DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "--dependencies=ns <DEP_FILE>")
string(APPEND CMAKE_${lang}_FLAGS_INIT " ")
string(APPEND CMAKE_${lang}_FLAGS_DEBUG_INIT " -r")
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index ec3bfd8..a7c71bd 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -5,7 +5,13 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG")
-set(CMAKE_DEPFILE_FLAGS_C "-MD -MT <OBJECT> -MF <DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_C "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPFILE_FORMAT gcc)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+endif()
if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index b71b946..dd9681e 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -5,7 +5,13 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -DNDEBUG")
-set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <OBJECT> -MF <DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_CXX "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+endif()
if("x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC")
diff --git a/Modules/Compiler/Intel-ISPC.cmake b/Modules/Compiler/Intel-ISPC.cmake
index 2e9792a..e4d5c97 100644
--- a/Modules/Compiler/Intel-ISPC.cmake
+++ b/Modules/Compiler/Intel-ISPC.cmake
@@ -3,7 +3,13 @@ include(Compiler/CMakeCommonCompilerMacros)
# Not aware of any verbose flag for ISPC
#set(CMAKE_ISPC_VERBOSE_FLAG )
-set(CMAKE_DEPFILE_FLAGS_ISPC "-M -MT <OBJECT> -MF <DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_ISPC "-M -MT <DEP_TARGET> -MF <DEP_FILE>")
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
+ # dependencies are computed by the compiler itself
+ set(CMAKE_ISPC_DEPFILE_FORMAT gcc)
+ set(CMAKE_ISPC_DEPENDS_USE_COMPILER TRUE)
+endif()
string(APPEND CMAKE_ISPC_FLAGS_INIT " ")
string(APPEND CMAKE_ISPC_FLAGS_DEBUG_INIT "-O0 -g")
diff --git a/Modules/Compiler/NVIDIA-CUDA.cmake b/Modules/Compiler/NVIDIA-CUDA.cmake
index 95a51f6..3e8d4eb 100644
--- a/Modules/Compiler/NVIDIA-CUDA.cmake
+++ b/Modules/Compiler/NVIDIA-CUDA.cmake
@@ -28,7 +28,15 @@ if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 10.2.89)
# The -MD flag was only added to nvcc in 10.2 so
# before that we had to invoke the compiler twice
# to get header dependency information
- set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT <OBJECT> -MF <DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
+endif()
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
+ if (NOT CMAKE_DEPFILE_FLAGS_CUDA)
+ set(CMAKE_CUDA_DEPENDS_EXTRA_COMMANDS "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} -M <SOURCE> -MT <OBJECT> -o <DEP_FILE>")
+ endif()
+ set(CMAKE_CUDA_DEPFILE_FORMAT gcc)
+ set(CMAKE_CUDA_DEPENDS_USE_COMPILER TRUE)
endif()
if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
diff --git a/Modules/Compiler/QCC.cmake b/Modules/Compiler/QCC.cmake
index 10e1389..7fbfd10 100644
--- a/Modules/Compiler/QCC.cmake
+++ b/Modules/Compiler/QCC.cmake
@@ -14,7 +14,7 @@ macro(__compiler_qcc lang)
set(CMAKE_${lang}_COMPILE_OPTIONS_SYSROOT "-Wc,-isysroot,")
set(CMAKE_INCLUDE_SYSTEM_FLAG_${lang} "-Wp,-isystem,")
- set(CMAKE_DEPFILE_FLAGS_${lang} "-Wp,-MD,<DEPFILE> -Wp,-MT,<OBJECT> -Wp,-MF,<DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-Wp,-MD,<DEP_FILE> -Wp,-MT,<DEP_TARGET> -Wp,-MF,<DEP_FILE>")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Wl,")
set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP ",")
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 7e962b8..c98656f 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -22,7 +22,7 @@ string(APPEND CMAKE_C_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
string(APPEND CMAKE_C_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
-set(CMAKE_DEPFILE_FLAGS_C "-xMD -xMF <DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_C "-xMD -xMF <DEP_FILE>")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index c946c64..aa8a9c5 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -22,7 +22,7 @@ string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL_INIT " -xO2 -xspace -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " -xO3 -DNDEBUG")
string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT " -g -xO2 -DNDEBUG")
-set(CMAKE_DEPFILE_FLAGS_CXX "-xMD -xMF <DEPFILE>")
+set(CMAKE_DEPFILE_FLAGS_CXX "-xMD -xMF <DEP_FILE>")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake
index 3c97afb..bd88989 100644
--- a/Modules/Compiler/TI-C.cmake
+++ b/Modules/Compiler/TI-C.cmake
@@ -26,7 +26,7 @@ else()
endif()
-if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C99_VERSION_${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}}")
+if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C99_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID}}")
set(CMAKE_C90_STANDARD_COMPILE_OPTION "--c89" "--strict_ansi")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "--c89" "--relaxed_ansi")
@@ -34,8 +34,8 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C99_VERSION_$
set(CMAKE_C99_STANDARD_COMPILE_OPTION "--c99" "--strict_ansi")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--c99" "--relaxed_ansi")
- if(DEFINED __COMPILER_TI_C11_VERSION_${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} AND
- CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C11_VERSION_${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}}")
+ if(DEFINED __COMPILER_TI_C11_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID} AND
+ CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C11_VERSION_${CMAKE_C_COMPILER_ARCHITECTURE_ID}}")
set(CMAKE_C11_STANDARD_COMPILE_OPTION "--c11" "--strict_ansi")
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "--c11" "--relaxed_ansi")
diff --git a/Modules/Compiler/TI.cmake b/Modules/Compiler/TI.cmake
index f631688..c8c1635 100644
--- a/Modules/Compiler/TI.cmake
+++ b/Modules/Compiler/TI.cmake
@@ -18,7 +18,7 @@ macro(__compiler_ti lang)
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_DEPFILE_FLAGS_${lang} "--preproc_with_compile --preproc_dependency=<DEP_FILE>")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> --preproc_only ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> --compile_only --skip_assembler ${__COMPILER_TI_SOURCE_FLAG_${lang}}=<SOURCE> <DEFINES> <INCLUDES> <FLAGS> --output_file=<ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/XL.cmake b/Modules/Compiler/XL.cmake
index fc71ab4..8b9d4a9 100644
--- a/Modules/Compiler/XL.cmake
+++ b/Modules/Compiler/XL.cmake
@@ -30,5 +30,5 @@ macro(__compiler_xl lang)
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
- set(CMAKE_DEPFILE_FLAGS_${lang} "-MF <DEPFILE> -qmakedep=gcc")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-MF <DEP_FILE> -qmakedep=gcc")
endmacro()
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 0a92c71..0c1e93b 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -1026,7 +1026,7 @@ if (HDF5_FOUND)
# Error if we still don't have the location.
message(SEND_ERROR
"HDF5 was found, but a different variable was set which contains "
- "its location.")
+ "the location of the `hdf5::${hdf5_target_name}` library.")
endif ()
add_library("hdf5::${hdf5_target_name}" UNKNOWN IMPORTED)
string(REPLACE "-D" "" _hdf5_definitions "${HDF5_${hdf5_lang}_DEFINITIONS}")
@@ -1057,12 +1057,14 @@ if (HDF5_FOUND)
continue ()
endif ()
+ set(hdf5_alt_target_name "")
if (hdf5_lang STREQUAL "C")
set(hdf5_target_name "hdf5_hl")
elseif (hdf5_lang STREQUAL "CXX")
set(hdf5_target_name "hdf5_hl_cpp")
elseif (hdf5_lang STREQUAL "Fortran")
set(hdf5_target_name "hdf5_hl_fortran")
+ set(hdf5_alt_target_name "hdf5hl_fortran")
else ()
continue ()
endif ()
@@ -1081,11 +1083,13 @@ if (HDF5_FOUND)
set(_hdf5_location "${HDF5_${hdf5_lang}_HL_LIBRARY}")
elseif (DEFINED "HDF5_${hdf5_lang}_LIBRARY_${hdf5_target_name}")
set(_hdf5_location "${HDF5_${hdf5_lang}_LIBRARY_${hdf5_target_name}}")
+ elseif (hdf5_alt_target_name AND DEFINED "HDF5_${hdf5_lang}_LIBRARY_${hdf5_alt_target_name}")
+ set(_hdf5_location "${HDF5_${hdf5_lang}_LIBRARY_${hdf5_alt_target_name}}")
else ()
# Error if we still don't have the location.
message(SEND_ERROR
"HDF5 was found, but a different variable was set which contains "
- "its location.")
+ "the location of the `hdf5::${hdf5_target_name}` library.")
endif ()
add_library("hdf5::${hdf5_target_name}" UNKNOWN IMPORTED)
string(REPLACE "-D" "" _hdf5_definitions "${HDF5_${hdf5_lang}_HL_DEFINITIONS}")
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 7af0171..7e17277 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -275,8 +275,10 @@ function(FIND_PACKAGE_CHECK_VERSION version result)
unset (${FPCV_RESULT_MESSAGE_VARIABLE} PARENT_SCOPE)
endif()
- if (CMAKE_FIND_PACKAGE_NAME)
- set (package ${CMAKE_FIND_PACKAGE_NAME})
+ if (_CMAKE_FPHSA_PACKAGE_NAME)
+ set (package "${_CMAKE_FPHSA_PACKAGE_NAME}")
+ elseif (CMAKE_FIND_PACKAGE_NAME)
+ set (package "${CMAKE_FIND_PACKAGE_NAME}")
else()
message (FATAL_ERROR "find_package_check_version(): Cannot be used outside a 'Find Module'")
endif()
@@ -436,6 +438,9 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
"will be used.")
endif()
+ # to propagate package name to FIND_PACKAGE_CHECK_VERSION
+ set(_CMAKE_FPHSA_PACKAGE_NAME "${_NAME}")
+
# now that we collected all arguments, process them
if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
diff --git a/Modules/FindPython.cmake b/Modules/FindPython.cmake
index e842e6b..b8b32c0 100644
--- a/Modules/FindPython.cmake
+++ b/Modules/FindPython.cmake
@@ -10,25 +10,32 @@ FindPython
Find Python interpreter, compiler and development environment (include
directories and libraries).
-When a version is requested, it can be specified as a simple value or as a
-range. For a detailed description of version range usage and capabilities,
-refer to the :command:`find_package` command.
+.. versionadded:: 3.19
+ When a version is requested, it can be specified as a simple value or as a
+ range. For a detailed description of version range usage and capabilities,
+ refer to the :command:`find_package` command.
The following components are supported:
* ``Interpreter``: search for Python interpreter.
* ``Compiler``: search for Python compiler. Only offered by IronPython.
* ``Development``: search for development artifacts (include directories and
- libraries). This component includes two sub-components which can be specified
- independently:
+ libraries).
- * ``Development.Module``: search for artifacts for Python module
- developments.
- * ``Development.Embed``: search for artifacts for Python embedding
- developments.
+ .. versionadded:: 3.18
+ This component includes two sub-components which can be specified
+ independently:
+
+ * ``Development.Module``: search for artifacts for Python module
+ developments.
+ * ``Development.Embed``: search for artifacts for Python embedding
+ developments.
* ``NumPy``: search for NumPy include directories.
+.. versionadded:: 3.14
+ Added ``NumPy`` component.
+
If no ``COMPONENTS`` are specified, ``Interpreter`` is assumed.
If component ``Development`` is specified, it implies sub-components
@@ -56,20 +63,30 @@ To manage concurrent versions 3 and 2 of Python, use :module:`FindPython3` and
Imported Targets
^^^^^^^^^^^^^^^^
-This module defines the following :ref:`Imported Targets <Imported Targets>`
-(when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
+This module defines the following :ref:`Imported Targets <Imported Targets>`:
+
+.. versionchanged:: 3.14
+ :ref:`Imported Targets <Imported Targets>` are only created when
+ :prop_gbl:`CMAKE_ROLE` is ``PROJECT``.
``Python::Interpreter``
Python interpreter. Target defined if component ``Interpreter`` is found.
``Python::Compiler``
Python compiler. Target defined if component ``Compiler`` is found.
+
``Python::Module``
+ .. versionadded:: 3.15
+
Python library for Python module. Target defined if component
``Development.Module`` is found.
+
``Python::Python``
Python library for Python embedding. Target defined if component
``Development.Embed`` is found.
+
``Python::NumPy``
+ .. versionadded:: 3.14
+
NumPy Python library. Target defined if component ``NumPy`` is found.
Result Variables
@@ -116,7 +133,10 @@ This module will set the following variables in your project
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``
or else ``sysconfig.get_path('platlib')``.
+
``Python_SOABI``
+ .. versionadded:: 3.17
+
Extension suffix for modules.
Information returned by
@@ -125,6 +145,7 @@ This module will set the following variables in your project
``python-config --extension-suffix``. If package ``distutils.sysconfig`` is
not available, ``sysconfig.get_config_var('SOABI')`` or
``sysconfig.get_config_var('EXT_SUFFIX')`` are used.
+
``Python_Compiler_FOUND``
System has the Python compiler.
``Python_COMPILER``
@@ -132,19 +153,35 @@ This module will set the following variables in your project
``Python_COMPILER_ID``
A short string unique to the compiler. Possible values include:
* IronPython
+
``Python_DOTNET_LAUNCHER``
+ .. versionadded:: 3.18
+
The ``.Net`` interpreter. Only used by ``IronPython`` implementation.
+
``Python_Development_FOUND``
System has the Python development artifacts.
+
``Python_Development.Module_FOUND``
+ .. versionadded:: 3.18
+
System has the Python development artifacts for Python module.
+
``Python_Development.Embed_FOUND``
+ .. versionadded:: 3.18
+
System has the Python development artifacts for Python embedding.
+
``Python_INCLUDE_DIRS``
+
The Python include directories.
+
``Python_LINK_OPTIONS``
+ .. versionadded:: 3.19
+
The Python link options. Some configurations require specific link options
for a correct build and execution.
+
``Python_LIBRARIES``
The Python libraries.
``Python_LIBRARY_DIRS``
@@ -159,13 +196,25 @@ This module will set the following variables in your project
Python minor version.
``Python_VERSION_PATCH``
Python patch version.
+
``Python_PyPy_VERSION``
+ .. versionadded:: 3.18
+
Python PyPy version.
+
``Python_NumPy_FOUND``
+ .. versionadded:: 3.14
+
System has the NumPy.
+
``Python_NumPy_INCLUDE_DIRS``
+ .. versionadded:: 3.14
+
The NumPy include directories.
+
``Python_NumPy_VERSION``
+ .. versionadded:: 3.14
+
The NumPy version.
Hints
@@ -181,6 +230,8 @@ Hints
* If set to FALSE, search **only** for shared libraries.
``Python_FIND_ABI``
+ .. versionadded:: 3.16
+
This variable defines which ABIs, as defined in
`PEP 3149 <https://www.python.org/dev/peps/pep-3149/>`_, should be searched.
@@ -226,6 +277,8 @@ Hints
each flag is ``OFF`` or ``ANY``.
``Python_FIND_STRATEGY``
+ .. versionadded:: 3.15
+
This variable defines how lookup will be done.
The ``Python_FIND_STRATEGY`` variable can be set to one of the following:
@@ -238,6 +291,8 @@ Hints
This is the default if policy :policy:`CMP0094` is set to ``NEW``.
``Python_FIND_REGISTRY``
+ .. versionadded:: 3.13
+
On Windows the ``Python_FIND_REGISTRY`` variable determine the order
of preference between registry and environment variables.
the ``Python_FIND_REGISTRY`` variable can be set to one of the following:
@@ -248,6 +303,8 @@ Hints
* ``NEVER``: Never try to use registry.
``Python_FIND_FRAMEWORK``
+ .. versionadded:: 3.15
+
On macOS the ``Python_FIND_FRAMEWORK`` variable determine the order of
preference between Apple-style and unix-style package components.
This variable can take same values as :variable:`CMAKE_FIND_FRAMEWORK`
@@ -261,6 +318,8 @@ Hints
variable will be used, if any.
``Python_FIND_VIRTUALENV``
+ .. versionadded:: 3.15
+
This variable defines the handling of virtual environments managed by
``virtualenv`` or ``conda``. It is meaningful only when a virtual environment
is active (i.e. the ``activate`` script has been evaluated). In this case, it
@@ -279,6 +338,9 @@ Hints
``NEVER`` to select preferably the interpreter from the virtual
environment.
+ .. versionadded:: 3.17
+ Added support for ``conda`` environments.
+
.. note::
If the component ``Development`` is requested, it is **strongly**
@@ -286,6 +348,8 @@ Hints
result.
``Python_FIND_IMPLEMENTATIONS``
+ .. versionadded:: 3.18
+
This variable defines, in an ordered list, the different implementations
which will be searched. The ``Python_FIND_IMPLEMENTATIONS`` variable can
hold the following values:
@@ -319,7 +383,6 @@ Hints
through the ``PATH`` variable.
``Python_FIND_UNVERSIONED_NAMES``
-
.. versionadded:: 3.20
This variable defines how the generic names will be searched. Currently, it
@@ -337,6 +400,8 @@ Hints
Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.16
+
To solve special cases, it is possible to specify directly the artifacts by
setting the following variables:
@@ -347,6 +412,8 @@ setting the following variables:
The path to the compiler.
``Python_DOTNET_LAUNCHER``
+ .. versionadded:: 3.18
+
The ``.Net`` interpreter. Only used by ``IronPython`` implementation.
``Python_LIBRARY``
@@ -383,6 +450,8 @@ specification. So, to enable also interactive specification, module behavior
can be controlled with the following variable:
``Python_ARTIFACTS_INTERACTIVE``
+ .. versionadded:: 3.18
+
Selects the behavior of the module. This is a boolean variable:
* If set to ``TRUE``: Create CMake cache entries for the above artifact
@@ -405,8 +474,9 @@ Python module naming rules::
If the library type is not specified, ``MODULE`` is assumed.
-For ``MODULE`` library type, if option ``WITH_SOABI`` is specified, the
-module suffix will include the ``Python_SOABI`` value, if any.
+.. versionadded:: 3.17
+ For ``MODULE`` library type, if option ``WITH_SOABI`` is specified, the
+ module suffix will include the ``Python_SOABI`` value, if any.
#]=======================================================================]
diff --git a/Modules/FindPython2.cmake b/Modules/FindPython2.cmake
index 5277e33..6b722ff 100644
--- a/Modules/FindPython2.cmake
+++ b/Modules/FindPython2.cmake
@@ -10,25 +10,32 @@ FindPython2
Find Python 2 interpreter, compiler and development environment (include
directories and libraries).
-When a version is requested, it can be specified as a simple value or as a
-range. For a detailed description of version range usage and capabilities,
-refer to the :command:`find_package` command.
+.. versionadded:: 3.19
+ When a version is requested, it can be specified as a simple value or as a
+ range. For a detailed description of version range usage and capabilities,
+ refer to the :command:`find_package` command.
The following components are supported:
* ``Interpreter``: search for Python 2 interpreter
* ``Compiler``: search for Python 2 compiler. Only offered by IronPython.
* ``Development``: search for development artifacts (include directories and
- libraries). This component includes two sub-components which can be specified
- independently:
+ libraries).
- * ``Development.Module``: search for artifacts for Python 2 module
- developments.
- * ``Development.Embed``: search for artifacts for Python 2 embedding
- developments.
+ .. versionadded:: 3.18
+ This component includes two sub-components which can be specified
+ independently:
+
+ * ``Development.Module``: search for artifacts for Python 2 module
+ developments.
+ * ``Development.Embed``: search for artifacts for Python 2 embedding
+ developments.
* ``NumPy``: search for NumPy include directories.
+.. versionadded:: 3.14
+ Added ``NumPy`` component.
+
If no ``COMPONENTS`` are specified, ``Interpreter`` is assumed.
If component ``Development`` is specified, it implies sub-components
@@ -57,20 +64,29 @@ for you.
Imported Targets
^^^^^^^^^^^^^^^^
-This module defines the following :ref:`Imported Targets <Imported Targets>`
-(when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
+This module defines the following :ref:`Imported Targets <Imported Targets>`:
+
+.. versionchanged:: 3.14
+ :ref:`Imported Targets <Imported Targets>` are only created when
+ :prop_gbl:`CMAKE_ROLE` is ``PROJECT``.
``Python2::Interpreter``
Python 2 interpreter. Target defined if component ``Interpreter`` is found.
``Python2::Compiler``
Python 2 compiler. Target defined if component ``Compiler`` is found.
``Python2::Module``
+ .. versionadded:: 3.15
+
Python 2 library for Python module. Target defined if component
``Development.Module`` is found.
+
``Python2::Python``
Python 2 library for Python embedding. Target defined if component
``Development.Embed`` is found.
+
``Python2::NumPy``
+ .. versionadded:: 3.14
+
NumPy library for Python 2. Target defined if component ``NumPy`` is found.
Result Variables
@@ -124,19 +140,34 @@ This module will set the following variables in your project
``Python2_COMPILER_ID``
A short string unique to the compiler. Possible values include:
* IronPython
+
``Python2_DOTNET_LAUNCHER``
+ .. versionadded:: 3.18
+
The ``.Net`` interpreter. Only used by ``IronPython`` implementation.
+
``Python2_Development_FOUND``
System has the Python 2 development artifacts.
+
``Python2_Development.Module_FOUND``
+ .. versionadded:: 3.18
+
System has the Python 2 development artifacts for Python module.
+
``Python2_Development.Embed_FOUND``
+ .. versionadded:: 3.18
+
System has the Python 2 development artifacts for Python embedding.
+
``Python2_INCLUDE_DIRS``
The Python 2 include directories.
+
``Python2_LINK_OPTIONS``
+ .. versionadded:: 3.19
+
The Python 2 link options. Some configurations require specific link options
for a correct build and execution.
+
``Python2_LIBRARIES``
The Python 2 libraries.
``Python2_LIBRARY_DIRS``
@@ -151,13 +182,25 @@ This module will set the following variables in your project
Python 2 minor version.
``Python2_VERSION_PATCH``
Python 2 patch version.
+
``Python2_PyPy_VERSION``
+ .. versionadded:: 3.18
+
Python 2 PyPy version.
+
``Python2_NumPy_FOUND``
+ .. versionadded:: 3.14
+
System has the NumPy.
+
``Python2_NumPy_INCLUDE_DIRS``
+ .. versionadded:: 3.14
+
The NumPy include directories.
+
``Python2_NumPy_VERSION``
+ .. versionadded:: 3.14
+
The NumPy version.
Hints
@@ -173,6 +216,8 @@ Hints
* If set to FALSE, search **only** for shared libraries.
``Python2_FIND_STRATEGY``
+ .. versionadded:: 3.15
+
This variable defines how lookup will be done.
The ``Python2_FIND_STRATEGY`` variable can be set to one of the following:
@@ -185,6 +230,8 @@ Hints
This is the default if policy :policy:`CMP0094` is set to ``NEW``.
``Python2_FIND_REGISTRY``
+ .. versionadded:: 3.13
+
On Windows the ``Python2_FIND_REGISTRY`` variable determine the order
of preference between registry and environment variables.
the ``Python2_FIND_REGISTRY`` variable can be set to one of the following:
@@ -195,6 +242,8 @@ Hints
* ``NEVER``: Never try to use registry.
``Python2_FIND_FRAMEWORK``
+ .. versionadded:: 3.15
+
On macOS the ``Python2_FIND_FRAMEWORK`` variable determine the order of
preference between Apple-style and unix-style package components.
This variable can take same values as :variable:`CMAKE_FIND_FRAMEWORK`
@@ -208,6 +257,8 @@ Hints
variable will be used, if any.
``Python2_FIND_VIRTUALENV``
+ .. versionadded:: 3.15
+
This variable defines the handling of virtual environments managed by
``virtualenv`` or ``conda``. It is meaningful only when a virtual environment
is active (i.e. the ``activate`` script has been evaluated). In this case, it
@@ -226,6 +277,9 @@ Hints
``NEVER`` to select preferably the interpreter from the virtual
environment.
+ .. versionadded:: 3.17
+ Added support for ``conda`` environments.
+
.. note::
If the component ``Development`` is requested, it is **strongly**
@@ -233,6 +287,8 @@ Hints
result.
``Python2_FIND_IMPLEMENTATIONS``
+ .. versionadded:: 3.18
+
This variable defines, in an ordered list, the different implementations
which will be searched. The ``Python2_FIND_IMPLEMENTATIONS`` variable can
hold the following values:
@@ -266,7 +322,6 @@ Hints
through the ``PATH`` variable.
``Python2_FIND_UNVERSIONED_NAMES``
-
.. versionadded:: 3.20
This variable defines how the generic names will be searched. Currently, it
@@ -284,6 +339,8 @@ Hints
Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.16
+
To solve special cases, it is possible to specify directly the artifacts by
setting the following variables:
@@ -294,6 +351,8 @@ setting the following variables:
The path to the compiler.
``Python2_DOTNET_LAUNCHER``
+ .. versionadded:: 3.18
+
The ``.Net`` interpreter. Only used by ``IronPython`` implementation.
``Python2_LIBRARY``
@@ -330,6 +389,8 @@ specification. So, to enable also interactive specification, module behavior
can be controlled with the following variable:
``Python2_ARTIFACTS_INTERACTIVE``
+ .. versionadded:: 3.18
+
Selects the behavior of the module. This is a boolean variable:
* If set to ``TRUE``: Create CMake cache entries for the above artifact
diff --git a/Modules/FindPython3.cmake b/Modules/FindPython3.cmake
index 2bd4d76..9e2133d 100644
--- a/Modules/FindPython3.cmake
+++ b/Modules/FindPython3.cmake
@@ -10,25 +10,32 @@ FindPython3
Find Python 3 interpreter, compiler and development environment (include
directories and libraries).
-When a version is requested, it can be specified as a simple value or as a
-range. For a detailed description of version range usage and capabilities,
-refer to the :command:`find_package` command.
+.. versionadded:: 3.19
+ When a version is requested, it can be specified as a simple value or as a
+ range. For a detailed description of version range usage and capabilities,
+ refer to the :command:`find_package` command.
The following components are supported:
* ``Interpreter``: search for Python 3 interpreter
* ``Compiler``: search for Python 3 compiler. Only offered by IronPython.
* ``Development``: search for development artifacts (include directories and
- libraries). This component includes two sub-components which can be specified
- independently:
+ libraries).
- * ``Development.Module``: search for artifacts for Python 3 module
- developments.
- * ``Development.Embed``: search for artifacts for Python 3 embedding
- developments.
+ .. versionadded:: 3.18
+ This component includes two sub-components which can be specified
+ independently:
+
+ * ``Development.Module``: search for artifacts for Python 3 module
+ developments.
+ * ``Development.Embed``: search for artifacts for Python 3 embedding
+ developments.
* ``NumPy``: search for NumPy include directories.
+.. versionadded:: 3.14
+ Added ``NumPy`` component.
+
If no ``COMPONENTS`` are specified, ``Interpreter`` is assumed.
If component ``Development`` is specified, it implies sub-components
@@ -57,20 +64,30 @@ for you.
Imported Targets
^^^^^^^^^^^^^^^^
-This module defines the following :ref:`Imported Targets <Imported Targets>`
-(when :prop_gbl:`CMAKE_ROLE` is ``PROJECT``):
+This module defines the following :ref:`Imported Targets <Imported Targets>`:
+
+.. versionchanged:: 3.14
+ :ref:`Imported Targets <Imported Targets>` are only created when
+ :prop_gbl:`CMAKE_ROLE` is ``PROJECT``.
``Python3::Interpreter``
Python 3 interpreter. Target defined if component ``Interpreter`` is found.
``Python3::Compiler``
Python 3 compiler. Target defined if component ``Compiler`` is found.
+
``Python3::Module``
+ .. versionadded:: 3.15
+
Python 3 library for Python module. Target defined if component
``Development.Module`` is found.
+
``Python3::Python``
Python 3 library for Python embedding. Target defined if component
``Development.Embed`` is found.
+
``Python3::NumPy``
+ .. versionadded:: 3.14
+
NumPy library for Python 3. Target defined if component ``NumPy`` is found.
Result Variables
@@ -117,7 +134,10 @@ This module will set the following variables in your project
Information returned by
``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``
or else ``sysconfig.get_path('platlib')``.
+
``Python3_SOABI``
+ .. versionadded:: 3.17
+
Extension suffix for modules.
Information returned by
@@ -126,6 +146,7 @@ This module will set the following variables in your project
``python3-config --extension-suffix``. If package ``distutils.sysconfig`` is
not available, ``sysconfig.get_config_var('SOABI')`` or
``sysconfig.get_config_var('EXT_SUFFIX')`` are used.
+
``Python3_Compiler_FOUND``
System has the Python 3 compiler.
``Python3_COMPILER``
@@ -133,19 +154,36 @@ This module will set the following variables in your project
``Python3_COMPILER_ID``
A short string unique to the compiler. Possible values include:
* IronPython
+
``Python3_DOTNET_LAUNCHER``
+ .. versionadded:: 3.18
+
The ``.Net`` interpreter. Only used by ``IronPython`` implementation.
+
``Python3_Development_FOUND``
+
System has the Python 3 development artifacts.
+
``Python3_Development.Module_FOUND``
+ .. versionadded:: 3.18
+
System has the Python 3 development artifacts for Python module.
+
``Python3_Development.Embed_FOUND``
+ .. versionadded:: 3.18
+
System has the Python 3 development artifacts for Python embedding.
+
``Python3_INCLUDE_DIRS``
+
The Python 3 include directories.
+
``Python3_LINK_OPTIONS``
+ .. versionadded:: 3.19
+
The Python 3 link options. Some configurations require specific link options
for a correct build and execution.
+
``Python3_LIBRARIES``
The Python 3 libraries.
``Python3_LIBRARY_DIRS``
@@ -160,13 +198,25 @@ This module will set the following variables in your project
Python 3 minor version.
``Python3_VERSION_PATCH``
Python 3 patch version.
+
``Python3_PyPy_VERSION``
+ .. versionadded:: 3.18
+
Python 3 PyPy version.
+
``Python3_NumPy_FOUND``
+ .. versionadded:: 3.14
+
System has the NumPy.
+
``Python3_NumPy_INCLUDE_DIRS``
+ .. versionadded:: 3.14
+
The NumPy include directories.
+
``Python3_NumPy_VERSION``
+ .. versionadded:: 3.14
+
The NumPy version.
Hints
@@ -182,6 +232,8 @@ Hints
* If set to FALSE, search **only** for shared libraries.
``Python3_FIND_ABI``
+ .. versionadded:: 3.16
+
This variable defines which ABIs, as defined in
`PEP 3149 <https://www.python.org/dev/peps/pep-3149/>`_, should be searched.
@@ -223,6 +275,8 @@ Hints
each flag is ``OFF`` or ``ANY``.
``Python3_FIND_STRATEGY``
+ .. versionadded:: 3.15
+
This variable defines how lookup will be done.
The ``Python3_FIND_STRATEGY`` variable can be set to one of the following:
@@ -235,6 +289,8 @@ Hints
This is the default if policy :policy:`CMP0094` is set to ``NEW``.
``Python3_FIND_REGISTRY``
+ .. versionadded:: 3.13
+
On Windows the ``Python3_FIND_REGISTRY`` variable determine the order
of preference between registry and environment variables.
The ``Python3_FIND_REGISTRY`` variable can be set to one of the following:
@@ -245,6 +301,8 @@ Hints
* ``NEVER``: Never try to use registry.
``Python3_FIND_FRAMEWORK``
+ .. versionadded:: 3.15
+
On macOS the ``Python3_FIND_FRAMEWORK`` variable determine the order of
preference between Apple-style and unix-style package components.
This variable can take same values as :variable:`CMAKE_FIND_FRAMEWORK`
@@ -258,6 +316,8 @@ Hints
variable will be used, if any.
``Python3_FIND_VIRTUALENV``
+ .. versionadded:: 3.15
+
This variable defines the handling of virtual environments managed by
``virtualenv`` or ``conda``. It is meaningful only when a virtual environment
is active (i.e. the ``activate`` script has been evaluated). In this case, it
@@ -276,6 +336,9 @@ Hints
``NEVER`` to select preferably the interpreter from the virtual
environment.
+ .. versionadded:: 3.17
+ Added support for ``conda`` environments.
+
.. note::
If the component ``Development`` is requested, it is **strongly**
@@ -283,6 +346,8 @@ Hints
result.
``Python3_FIND_IMPLEMENTATIONS``
+ .. versionadded:: 3.18
+
This variable defines, in an ordered list, the different implementations
which will be searched. The ``Python3_FIND_IMPLEMENTATIONS`` variable can
hold the following values:
@@ -316,7 +381,6 @@ Hints
through the ``PATH`` variable.
``Python3_FIND_UNVERSIONED_NAMES``
-
.. versionadded:: 3.20
This variable defines how the generic names will be searched. Currently, it
@@ -334,6 +398,8 @@ Hints
Artifacts Specification
^^^^^^^^^^^^^^^^^^^^^^^
+.. versionadded:: 3.16
+
To solve special cases, it is possible to specify directly the artifacts by
setting the following variables:
@@ -344,6 +410,8 @@ setting the following variables:
The path to the compiler.
``Python3_DOTNET_LAUNCHER``
+ .. versionadded:: 3.18
+
The ``.Net`` interpreter. Only used by ``IronPython`` implementation.
``Python3_LIBRARY``
@@ -380,6 +448,8 @@ specification. So, to enable also interactive specification, module behavior
can be controlled with the following variable:
``Python3_ARTIFACTS_INTERACTIVE``
+ .. versionadded:: 3.18
+
Selects the behavior of the module. This is a boolean variable:
* If set to ``TRUE``: Create CMake cache entries for the above artifact
@@ -402,8 +472,9 @@ of Python module naming rules::
If the library type is not specified, ``MODULE`` is assumed.
-For ``MODULE`` library type, if option ``WITH_SOABI`` is specified, the
-module suffix will include the ``Python3_SOABI`` value, if any.
+.. versionadded:: 3.17
+ For ``MODULE`` library type, if option ``WITH_SOABI`` is specified, the
+ module suffix will include the ``Python3_SOABI`` value, if any.
#]=======================================================================]
diff --git a/Modules/Internal/CMakeCheckCompilerFlag.cmake b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake
index 9c8dfb6..d6fa5f0 100644
--- a/Modules/Internal/CMakeCheckCompilerFlag.cmake
+++ b/Modules/Internal/CMakeTryCompilerOrLinkerFlag.cmake
@@ -6,13 +6,13 @@
NOTE: This function is used internally by CMake. Projects should not include
this file directly.
-The cmake_check_compiler_flag() function can be used to compile and link a
+The cmake_try_compiler_or_linker_flag() function can be used to compile and link a
source file to check whether a specific compiler or linker flag is supported.
The function does not use the try_compile() command so as to avoid infinite
recursion. It may not work for all platforms or toolchains, the caller is
responsible for ensuring it is only called in valid situations.
- cmake_check_compiler_flag(<lang> <flag> <result>
+ cmake_try_compiler_or_linker_flag(<lang> <flag> <result>
[SRC_EXT <ext>] [COMMAND_PATTERN <pattern>]
[FAIL_REGEX <regex> ...]
[OUTPUT_VARIABLE <output>])
@@ -39,7 +39,7 @@ Optional parameters:
include_guard(GLOBAL)
include(CMakeCheckCompilerFlagCommonPatterns)
-function(CMAKE_CHECK_COMPILER_FLAG lang flag result)
+function(CMAKE_TRY_COMPILER_OR_LINKER_FLAG lang flag result)
# Cache results between runs similar to check_<lang>_source_compiles()
if(DEFINED ${result})
return()
diff --git a/Modules/Internal/CheckCompilerFlag.cmake b/Modules/Internal/CheckCompilerFlag.cmake
index f790d87..6b2a11e 100644
--- a/Modules/Internal/CheckCompilerFlag.cmake
+++ b/Modules/Internal/CheckCompilerFlag.cmake
@@ -11,20 +11,20 @@ cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
function(CMAKE_CHECK_COMPILER_FLAG _lang _flag _var)
- if(_lang STREQUAL C)
+ if(_lang STREQUAL "C")
set(_lang_src "int main(void) { return 0; }")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C")
- elseif(_lang STREQUAL CXX)
+ elseif(_lang STREQUAL "CXX")
set(_lang_src "int main() { return 0; }")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+")
- elseif(_lang STREQUAL CUDA)
+ elseif(_lang STREQUAL "CUDA")
set(_lang_src "__host__ int main() { return 0; }")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU
FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL Fortran)
+ elseif(_lang STREQUAL "Fortran")
set(_lang_src " program test\n stop\n end program")
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran")
- elseif(_lang STREQUAL OBJC)
+ elseif(_lang STREQUAL "OBJC")
set(_lang_src [=[
#ifndef __OBJC__
# error "Not an Objective-C compiler"
@@ -32,7 +32,7 @@ function(CMAKE_CHECK_COMPILER_FLAG _lang _flag _var)
int main(void) { return 0; }]=])
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU
FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL OBJCXX)
+ elseif(_lang STREQUAL "OBJCXX")
set(_lang_src [=[
#ifndef __OBJC__
# error "Not an Objective-C++ compiler"
@@ -40,7 +40,7 @@ int main(void) { return 0; }]=])
int main(void) { return 0; }]=])
set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU
FAIL_REGEX "argument unused during compilation: .*") # Clang
- elseif(_lang STREQUAL ISPC)
+ elseif(_lang STREQUAL "ISPC")
set(_lang_src "float func(uniform int32, float a) { return a / 2.25; }")
else()
message (SEND_ERROR "check_compiler_flag: ${_lang}: unknown language.")
diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake
index 91c8964..3b2152a 100644
--- a/Modules/Internal/CheckSourceCompiles.cmake
+++ b/Modules/Internal/CheckSourceCompiles.cmake
@@ -10,25 +10,25 @@ cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var)
if(NOT DEFINED "${_var}")
- if(_lang STREQUAL C)
+ if(_lang STREQUAL "C")
set(_lang_textual "C")
set(_lang_ext "c")
- elseif(_lang STREQUAL CXX)
+ elseif(_lang STREQUAL "CXX")
set(_lang_textual "C++")
set(_lang_ext "cxx")
- elseif(_lang STREQUAL CUDA)
+ elseif(_lang STREQUAL "CUDA")
set(_lang_textual "CUDA")
set(_lang_ext "cu")
- elseif(_lang STREQUAL Fortran)
+ elseif(_lang STREQUAL "Fortran")
set(_lang_textual "Fortran")
set(_lang_ext "F90")
- elseif(_lang STREQUAL ISPC)
+ elseif(_lang STREQUAL "ISPC")
set(_lang_textual "ISPC")
set(_lang_ext "ispc")
- elseif(_lang STREQUAL OBJC)
+ elseif(_lang STREQUAL "OBJC")
set(_lang_textual "Objective-C")
set(_lang_ext "m")
- elseif(_lang STREQUAL OBJCXX)
+ elseif(_lang STREQUAL "OBJCXX")
set(_lang_textual "Objective-C++")
set(_lang_ext "mm")
else()
diff --git a/Modules/Internal/CheckSourceRuns.cmake b/Modules/Internal/CheckSourceRuns.cmake
index 3a4b758..676f3d0 100644
--- a/Modules/Internal/CheckSourceRuns.cmake
+++ b/Modules/Internal/CheckSourceRuns.cmake
@@ -10,22 +10,22 @@ cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST
function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var)
if(NOT DEFINED "${_var}")
- if(_lang STREQUAL C)
+ if(_lang STREQUAL "C")
set(_lang_textual "C")
set(_lang_ext "c")
- elseif(_lang STREQUAL CXX)
+ elseif(_lang STREQUAL "CXX")
set(_lang_textual "C++")
set(_lang_ext "cxx")
- elseif(_lang STREQUAL CUDA)
+ elseif(_lang STREQUAL "CUDA")
set(_lang_textual "CUDA")
set(_lang_ext "cu")
- elseif(_lang STREQUAL Fortran)
+ elseif(_lang STREQUAL "Fortran")
set(_lang_textual "Fortran")
set(_lang_ext "F90")
- elseif(_lang STREQUAL OBJC)
+ elseif(_lang STREQUAL "OBJC")
set(_lang_textual "Objective-C")
set(_lang_ext "m")
- elseif(_lang STREQUAL OBJCXX)
+ elseif(_lang STREQUAL "OBJCXX")
set(_lang_textual "Objective-C++")
set(_lang_ext "mm")
else()
diff --git a/Modules/Platform/Windows-Clang-C.cmake b/Modules/Platform/Windows-Clang-C.cmake
index d007105..322e3fb 100644
--- a/Modules/Platform/Windows-Clang-C.cmake
+++ b/Modules/Platform/Windows-Clang-C.cmake
@@ -1,2 +1,18 @@
include(Platform/Windows-Clang)
__windows_compiler_clang(C)
+
+if("x${MAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+ endif()
+elseif("x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPFILE_FORMAT gcc)
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+ endif()
+endif()
diff --git a/Modules/Platform/Windows-Clang-CXX.cmake b/Modules/Platform/Windows-Clang-CXX.cmake
index f1d40f2..b4aaf1e 100644
--- a/Modules/Platform/Windows-Clang-CXX.cmake
+++ b/Modules/Platform/Windows-Clang-CXX.cmake
@@ -1,3 +1,19 @@
include(Platform/Windows-Clang)
set(_COMPILE_CXX_MSVC " -TP")
__windows_compiler_clang(CXX)
+
+if("x${MAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+ endif()
+elseif("x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+ endif()
+endif()
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 6275043..2c6ee19 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -27,7 +27,7 @@ macro(__windows_compiler_clang_gnu lang)
set(CMAKE_SHARED_MODULE_SUFFIX ".dll")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
if(NOT "${lang}" STREQUAL "ASM")
- set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <OBJECT> -MF <DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_${lang} "-MD -MT <DEP_TARGET> -MF <DEP_FILE>")
endif()
set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
@@ -35,6 +35,9 @@ macro(__windows_compiler_clang_gnu lang)
set(CMAKE_SUPPORT_WINDOWS_EXPORT_ALL_SYMBOLS 1)
set (CMAKE_LINK_DEF_FILE_FLAG "-Xlinker /DEF:")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG "-Xlinker" " ")
+ set(CMAKE_${lang}_LINKER_WRAPPER_FLAG_SEP)
+
if("${CMAKE_${lang}_SIMULATE_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)")
math(EXPR MSVC_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}")
endif()
@@ -111,7 +114,7 @@ macro(__enable_llvm_rc_preprocessing clang_option_prefix)
set(CMAKE_RC_PREPROCESSOR CMAKE_CXX_COMPILER)
endif()
if(DEFINED CMAKE_RC_PREPROCESSOR)
- set(CMAKE_DEPFILE_FLAGS_RC "${clang_option_prefix}-MD ${clang_option_prefix}-MF ${clang_option_prefix}<DEPFILE>")
+ set(CMAKE_DEPFILE_FLAGS_RC "${clang_option_prefix}-MD ${clang_option_prefix}-MF ${clang_option_prefix}<DEP_FILE>")
# The <FLAGS> are passed to the preprocess and the resource compiler to pick
# up the eventual -D / -C options passed through the CMAKE_RC_FLAGS.
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_COMMAND> -E cmake_llvm_rc <SOURCE> <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> -E -- <SOURCE> ++ <CMAKE_RC_COMPILER> <DEFINES> -I <SOURCE_DIR> <INCLUDES> <FLAGS> /fo <OBJECT> <OBJECT>.pp")
diff --git a/Modules/Platform/Windows-Intel-C.cmake b/Modules/Platform/Windows-Intel-C.cmake
index 06d8f50..152b27c 100644
--- a/Modules/Platform/Windows-Intel-C.cmake
+++ b/Modules/Platform/Windows-Intel-C.cmake
@@ -1,4 +1,27 @@
include(Platform/Windows-Intel)
__windows_compiler_intel(C)
-set(CMAKE_NINJA_DEPTYPE_C intel) # special value handled by CMake
-set(CMAKE_DEPFILE_FLAGS_C "-QMMD -QMT <OBJECT> -QMF <DEPFILE>")
+
+set(CMAKE_DEPFILE_FLAGS_C "-QMMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
+set(CMAKE_C_DEPFILE_FORMAT gcc)
+
+if(CMAKE_GENERATOR MATCHES "^Ninja")
+ if(_CMAKE_NINJA_VERSION VERSION_LESS 1.9)
+ # This ninja version is too old to support the Intel depfile format.
+ # Fall back to msvc depfile format.
+ set(CMAKE_DEPFILE_FLAGS_C "/showIncludes")
+ set(CMAKE_C_DEPFILE_FORMAT msvc)
+ endif()
+endif()
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+if("${CMAKE_SOURCE_DIR}${CMAKE_BINARY_DIR}" MATCHES " ")
+ # The Intel compiler does not properly escape spaces in a depfile.
+ # Fall back to msvc depfile format.
+ set(CMAKE_DEPFILE_FLAGS_C "/showIncludes")
+ set(CMAKE_C_DEPFILE_FORMAT msvc)
+endif()
diff --git a/Modules/Platform/Windows-Intel-CXX.cmake b/Modules/Platform/Windows-Intel-CXX.cmake
index 666de6e..ce33ae1 100644
--- a/Modules/Platform/Windows-Intel-CXX.cmake
+++ b/Modules/Platform/Windows-Intel-CXX.cmake
@@ -1,5 +1,28 @@
include(Platform/Windows-Intel)
set(_COMPILE_CXX " /TP")
__windows_compiler_intel(CXX)
-set(CMAKE_NINJA_DEPTYPE_CXX intel) # special value handled by CMake
-set(CMAKE_DEPFILE_FLAGS_CXX "-QMMD -QMT <OBJECT> -QMF <DEPFILE>")
+
+set(CMAKE_DEPFILE_FLAGS_CXX "-QMMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
+set(CMAKE_CXX_DEPFILE_FORMAT gcc)
+
+if(CMAKE_GENERATOR MATCHES "^Ninja")
+ if(_CMAKE_NINJA_VERSION VERSION_LESS 1.9)
+ # This ninja version is too old to support the Intel depfile format.
+ # Fall back to msvc depfile format.
+ set(CMAKE_DEPFILE_FLAGS_CXX "/showIncludes")
+ set(CMAKE_CXX_DEPFILE_FORMAT msvc)
+ endif()
+endif()
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake")
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+endif()
+
+if("${CMAKE_SOURCE_DIR}${CMAKE_BINARY_DIR}" MATCHES " ")
+ # The Intel compiler does not properly escape spaces in a depfile.
+ # Fall back to msvc depfile format.
+ set(CMAKE_DEPFILE_FLAGS_CXX "/showIncludes")
+ set(CMAKE_CXX_DEPFILE_FORMAT msvc)
+endif()
diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake
index 5d8f7fc..01f8dd0 100644
--- a/Modules/Platform/Windows-Intel.cmake
+++ b/Modules/Platform/Windows-Intel.cmake
@@ -8,6 +8,20 @@ if(__WINDOWS_INTEL)
endif()
set(__WINDOWS_INTEL 1)
+
+if (CMAKE_GENERATOR MATCHES "^Ninja")
+ # retrieve ninja version to enable dependencies configuration
+ # against Ninja capabilities
+ execute_process(COMMAND "${CMAKE_MAKE_PROGRAM}" --version
+ RESULT_VARIABLE _CMAKE_NINJA_RESULT
+ OUTPUT_VARIABLE _CMAKE_NINJA_VERSION
+ ERROR_VARIABLE _CMAKE_NINJA_VERSION)
+ if (NOT _CMAKE_NINJA_RESULT AND _CMAKE_NINJA_VERSION MATCHES "[0-9]+(\\.[0-9]+)*")
+ set (_CMAKE_NINJA_VERSION "${CMAKE_MATCH_0}")
+ endif()
+ unset(_CMAKE_NINJA_RESULT)
+endif()
+
include(Platform/Windows-MSVC)
macro(__windows_compiler_intel lang)
__windows_compiler_msvc(${lang})
diff --git a/Modules/Platform/Windows-MSVC-C.cmake b/Modules/Platform/Windows-MSVC-C.cmake
index cbe1586..67b6827 100644
--- a/Modules/Platform/Windows-MSVC-C.cmake
+++ b/Modules/Platform/Windows-MSVC-C.cmake
@@ -3,3 +3,10 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0)
set(_FS_C " /FS")
endif()
__windows_compiler_msvc(C)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_C)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_C_DEPENDS_USE_COMPILER TRUE)
+endif()
diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake
index 0e85005..6fea617 100644
--- a/Modules/Platform/Windows-MSVC-CXX.cmake
+++ b/Modules/Platform/Windows-MSVC-CXX.cmake
@@ -4,3 +4,10 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
set(_FS_CXX " /FS")
endif()
__windows_compiler_msvc(CXX)
+
+if((NOT DEFINED CMAKE_DEPENDS_USE_COMPILER OR CMAKE_DEPENDS_USE_COMPILER)
+ AND CMAKE_GENERATOR MATCHES "Makefiles|WMake"
+ AND CMAKE_DEPFILE_FLAGS_CXX)
+ # dependencies are computed by the compiler itself
+ set(CMAKE_CXX_DEPENDS_USE_COMPILER TRUE)
+endif()
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 3f65475..08afd61 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -435,8 +435,14 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL -MDd)
endif()
set(CMAKE_${lang}_LINKER_SUPPORTS_PDB ON)
- set(CMAKE_NINJA_DEPTYPE_${lang} msvc)
+
__windows_compiler_msvc_enable_rc("${_PLATFORM_DEFINES} ${_PLATFORM_DEFINES_${lang}}")
+
+ # define generic information about compiler dependencies
+ if (MSVC_VERSION GREATER 1300)
+ set(CMAKE_DEPFILE_FLAGS_${lang} "/showIncludes")
+ set(CMAKE_${lang}_DEPFILE_FORMAT msvc)
+ endif()
endmacro()
macro(__windows_compiler_msvc_enable_rc flags)
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index d1616ad..c3b7e50 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -2,9 +2,12 @@
# file Copyright.txt or https://cmake.org/licensing for details.
# To ensure maximum portability across various compilers and platforms
-# deactivate any compiler extensions
-set(CMAKE_C_EXTENSIONS FALSE)
-set(CMAKE_CXX_EXTENSIONS FALSE)
+# deactivate any compiler extensions. Skip this for QNX, where additional
+# work is needed to build without compiler extensions.
+if (NOT CMAKE_SYSTEM_NAME STREQUAL "QNX")
+ set(CMAKE_C_EXTENSIONS FALSE)
+ set(CMAKE_CXX_EXTENSIONS FALSE)
+endif()
include(CheckIncludeFile)
# Check if we can build support for ELF parsing.
@@ -224,6 +227,8 @@ set(SRCS
cmDependsJava.h
cmDependsJavaParserHelper.cxx
cmDependsJavaParserHelper.h
+ cmDependsCompiler.cxx
+ cmDependsCompiler.h
cmDocumentation.cxx
cmDocumentationFormatter.cxx
cmDocumentationSection.cxx
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index a7871a9..464e138 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,7 +1,7 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 19)
-set(CMake_VERSION_PATCH 20201127)
+set(CMake_VERSION_PATCH 20201202)
#set(CMake_VERSION_RC 0)
set(CMake_VERSION_IS_DIRTY 0)
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 1cc267e..4151fde 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -54,22 +54,21 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
//
cmProp ctestBuildConfiguration =
this->Makefile->GetDefinition("CTEST_BUILD_CONFIGURATION");
- const std::string* cmakeBuildConfiguration = !this->Configuration.empty()
- ? &this->Configuration
- : (cmNonempty(ctestBuildConfiguration) ? ctestBuildConfiguration
- : &this->CTest->GetConfigType());
-
- const std::string* cmakeBuildAdditionalFlags = !this->Flags.empty()
- ? &this->Flags
- : this->Makefile->GetDefinition("CTEST_BUILD_FLAGS");
- const std::string* cmakeBuildTarget = !this->Target.empty()
- ? &this->Target
- : this->Makefile->GetDefinition("CTEST_BUILD_TARGET");
+ std::string cmakeBuildConfiguration = cmNonempty(this->Configuration)
+ ? this->Configuration
+ : cmNonempty(ctestBuildConfiguration) ? *ctestBuildConfiguration
+ : this->CTest->GetConfigType();
+
+ const std::string& cmakeBuildAdditionalFlags = cmNonempty(this->Flags)
+ ? this->Flags
+ : this->Makefile->GetSafeDefinition("CTEST_BUILD_FLAGS");
+ const std::string& cmakeBuildTarget = cmNonempty(this->Target)
+ ? this->Target
+ : this->Makefile->GetSafeDefinition("CTEST_BUILD_TARGET");
if (cmNonempty(cmakeGeneratorName)) {
- if (!cmakeBuildConfiguration) {
- static const std::string sRelease = "Release";
- cmakeBuildConfiguration = &sRelease;
+ if (cmakeBuildConfiguration.empty()) {
+ cmakeBuildConfiguration = "Release";
}
if (this->GlobalGenerator) {
if (this->GlobalGenerator->GetName() != *cmakeGeneratorName) {
@@ -88,24 +87,18 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
return nullptr;
}
}
- if (cmakeBuildConfiguration->empty()) {
- const std::string* config = nullptr;
+ if (cmakeBuildConfiguration.empty()) {
#ifdef CMAKE_INTDIR
- static const std::string sIntDir = CMAKE_INTDIR;
- config = &sIntDir;
+ cmakeBuildConfiguration = CMAKE_INTDIR;
+#else
+ cmakeBuildConfiguration = "Debug";
#endif
- if (!config) {
- static const std::string sDebug = "Debug";
- config = &sDebug;
- }
- cmakeBuildConfiguration = config;
}
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
std::string buildCommand =
this->GlobalGenerator->GenerateCMakeBuildCommand(
- cmakeBuildTarget ? *cmakeBuildTarget : "", *cmakeBuildConfiguration,
- cmakeBuildAdditionalFlags ? *cmakeBuildAdditionalFlags : "",
+ cmakeBuildTarget, cmakeBuildConfiguration, cmakeBuildAdditionalFlags,
this->Makefile->IgnoreErrorsCMP0061());
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:" << buildCommand << "\n",
diff --git a/Source/cmCPluginAPI.cxx b/Source/cmCPluginAPI.cxx
index 968fa54..9e3582c 100644
--- a/Source/cmCPluginAPI.cxx
+++ b/Source/cmCPluginAPI.cxx
@@ -550,6 +550,11 @@ void* CCONV cmAddSource(void* arg, void* arg2)
// Create the real cmSourceFile instance and copy over saved information.
cmSourceFile* rsf = mf->GetOrCreateSource(osf->FullPath);
rsf->SetProperties(osf->Properties);
+ // In case the properties contain the GENERATED property,
+ // mark the real cmSourceFile as generated.
+ if (rsf->GetIsGenerated()) {
+ rsf->MarkAsGenerated();
+ }
for (std::string const& d : osf->Depends) {
rsf->AddDepend(d);
}
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 8cf5ae9..8479458 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -1017,6 +1017,17 @@ int cmCTest::ProcessSteps()
}
if (res != 0) {
cmCTestLog(this, ERROR_MESSAGE, "Errors while running CTest" << std::endl);
+ if (!this->Impl->OutputTestOutputOnTestFailure) {
+ const std::string lastTestLog =
+ this->GetBinaryDir() + "/Testing/Temporary/LastTest.log";
+ cmCTestLog(this, ERROR_MESSAGE,
+ "Output from these tests are in: " << lastTestLog
+ << std::endl);
+ cmCTestLog(this, ERROR_MESSAGE,
+ "Use \"--rerun-failed --output-on-failure\" to re-run the "
+ "failed cases verbosely."
+ << std::endl);
+ }
}
return res;
}
diff --git a/Source/cmDependsCompiler.cxx b/Source/cmDependsCompiler.cxx
new file mode 100644
index 0000000..eb0f1d5
--- /dev/null
+++ b/Source/cmDependsCompiler.cxx
@@ -0,0 +1,267 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include "cmDependsCompiler.h"
+
+#include <algorithm>
+#include <map>
+#include <string>
+#include <unordered_set>
+#include <utility>
+
+#include <cm/string_view>
+#include <cm/vector>
+#include <cmext/string_view>
+
+#include "cmsys/FStream.hxx"
+
+#include "cmFileTime.h"
+#include "cmGlobalUnixMakefileGenerator3.h"
+#include "cmLocalUnixMakefileGenerator3.h"
+#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
+
+namespace {
+std::string& ReplaceAll(std::string& data, const std::string& toSearch,
+ const std::string& replaceStr)
+{
+ // Get the first occurrence
+ auto pos = data.find(toSearch);
+ // Repeat until the end is reached
+ while (pos != std::string::npos) {
+ // Replace this occurrence of Sub String
+ data.replace(pos, toSearch.size(), replaceStr);
+ // Get the next occurrence from the current position
+ pos = data.find(toSearch, pos + replaceStr.size());
+ }
+
+ return data;
+}
+
+std::string& NormalizePath(std::string& item)
+{
+ ReplaceAll(item, "$$", "$");
+ ReplaceAll(item, "\\ ", " ");
+ ReplaceAll(item, "\\#", "#");
+ ReplaceAll(item, "\\", "/");
+
+ return item;
+}
+
+void ParseLine(const std::string& line, std::vector<std::string>& depends)
+{
+ auto start = line.find_first_not_of(' ');
+ if (start == std::string::npos || line[start] == '#') {
+ return;
+ }
+
+ auto index = start;
+ while ((index = line.find(' ', index)) != std::string::npos) {
+ if (line[index - 1] == '\\') {
+ index += 1;
+ continue;
+ }
+
+ auto item = line.substr(start, index - start);
+ if (item.back() != ':') {
+ // check that ':' is not present after some spaces
+ auto index2 = line.find_first_not_of(' ', index + 1);
+ if (index2 == std::string::npos || line[index2] != ':') {
+ // this is a dependency, add it
+ depends.emplace_back(std::move(NormalizePath(item)));
+ } else {
+ index = index2;
+ }
+ }
+
+ start = line.find_first_not_of(' ', index + 1);
+ index = start;
+ }
+ if (start != std::string::npos) {
+ auto item = line.substr(start);
+ if (line.back() != ':') {
+ // this is a dependency, add it
+ depends.emplace_back(std::move(NormalizePath(item)));
+ }
+ }
+}
+}
+
+bool cmDependsCompiler::CheckDependencies(
+ const std::string& internalDepFile, const std::vector<std::string>& depFiles,
+ cmDepends::DependencyMap& dependencies,
+ const std::function<bool(const std::string&)>& isValidPath)
+{
+ bool status = true;
+ bool forceReadDeps = true;
+
+ cmFileTime internalDepFileTime;
+ // read cached dependencies stored in internal file
+ if (cmSystemTools::FileExists(internalDepFile)) {
+ internalDepFileTime.Load(internalDepFile);
+ forceReadDeps = false;
+
+ // read current dependencies
+ cmsys::ifstream fin(internalDepFile.c_str());
+ if (fin) {
+ std::string line;
+ std::string depender;
+ std::vector<std::string>* currentDependencies = nullptr;
+ while (std::getline(fin, line)) {
+ if (line.empty() || line.front() == '#') {
+ continue;
+ }
+ // Drop carriage return character at the end
+ if (line.back() == '\r') {
+ line.pop_back();
+ if (line.empty()) {
+ continue;
+ }
+ }
+ // Check if this a depender line
+ if (line.front() != ' ') {
+ depender = std::move(line);
+ currentDependencies = &dependencies[depender];
+ continue;
+ }
+ // This is a dependee line
+ if (currentDependencies != nullptr) {
+ currentDependencies->emplace_back(line.substr(1));
+ }
+ }
+ fin.close();
+ }
+ }
+
+ // Now, update dependencies map with all new compiler generated
+ // dependencies files
+ cmFileTime depFileTime;
+ for (auto dep = depFiles.begin(); dep != depFiles.end(); dep++) {
+ const auto& source = *dep++;
+ const auto& target = *dep++;
+ const auto& format = *dep++;
+ const auto& depFile = *dep;
+
+ if (!cmSystemTools::FileExists(depFile)) {
+ continue;
+ }
+
+ if (!forceReadDeps) {
+ depFileTime.Load(depFile);
+ }
+ if (forceReadDeps || depFileTime.Newer(internalDepFileTime)) {
+ status = false;
+ if (this->Verbose) {
+ cmSystemTools::Stdout(cmStrCat("Dependencies file \"", depFile,
+ "\" is newer than depends file \"",
+ internalDepFile, "\".\n"));
+ }
+ cmsys::ifstream fin(depFile.c_str());
+ if (!fin) {
+ continue;
+ }
+
+ std::vector<std::string> depends;
+ std::string line;
+ if (format == "msvc"_s) {
+ if (!isValidPath) {
+ // insert source as first dependency
+ depends.push_back(source);
+ }
+ while (cmSystemTools::GetLineFromStream(fin, line)) {
+ depends.emplace_back(std::move(line));
+ }
+ } else {
+ while (cmSystemTools::GetLineFromStream(fin, line)) {
+ if (line.empty()) {
+ continue;
+ }
+ if (line.back() == '\\') {
+ line.pop_back();
+ }
+ ParseLine(line, depends);
+ }
+
+ // depending of the effective format of the dependencies file generated
+ // by the compiler, the target can be wrongly identified as a
+ // dependency so remove it from the list
+ if (depends.front() == target) {
+ depends.erase(depends.begin());
+ }
+
+ if (isValidPath) {
+ // remove first dependency because it must not be filtered out
+ depends.erase(depends.begin());
+ }
+ }
+
+ if (isValidPath) {
+ cm::erase_if(depends, isValidPath);
+ // insert source as first dependency
+ depends.insert(depends.begin(), source);
+ }
+
+ dependencies[target] = std::move(depends);
+ }
+ }
+
+ return status;
+}
+
+void cmDependsCompiler::WriteDependencies(
+ const cmDepends::DependencyMap& dependencies, std::ostream& makeDepends,
+ std::ostream& internalDepends)
+{
+ // dependencies file consumed by make tool
+ const auto& lineContinue = static_cast<cmGlobalUnixMakefileGenerator3*>(
+ this->LocalGenerator->GetGlobalGenerator())
+ ->LineContinueDirective;
+ const auto& binDir = this->LocalGenerator->GetBinaryDirectory();
+ cmDepends::DependencyMap makeDependencies(dependencies);
+ std::unordered_set<cm::string_view> phonyTargets;
+
+ // external dependencies file
+ for (auto& node : makeDependencies) {
+ auto& deps = node.second;
+ std::transform(
+ deps.cbegin(), deps.cend(), deps.begin(),
+ [this, &binDir](const std::string& dep) {
+ return LocalGenerator->ConvertToMakefilePath(
+ this->LocalGenerator->MaybeConvertToRelativePath(binDir, dep));
+ });
+
+ makeDepends << this->LocalGenerator->ConvertToMakefilePath(node.first)
+ << ": " << deps.front();
+ // first dependency is the source, remove it because should not be declared
+ // as phony target
+ deps.erase(deps.begin());
+ for (const auto& dep : deps) {
+ makeDepends << ' ' << lineContinue << " " << dep;
+ phonyTargets.emplace(dep.data(), dep.length());
+ }
+ makeDepends << std::endl << std::endl;
+ }
+
+ // add phony targets
+ for (const auto& target : phonyTargets) {
+ makeDepends << std::endl << target << ':' << std::endl;
+ }
+
+ // internal dependencies file
+ for (const auto& node : dependencies) {
+ internalDepends << node.first << std::endl;
+ for (const auto& dep : node.second) {
+ internalDepends << ' ' << dep << std::endl;
+ }
+ internalDepends << std::endl;
+ }
+}
+
+void cmDependsCompiler::ClearDependencies(
+ const std::vector<std::string>& depFiles)
+{
+ for (auto dep = depFiles.begin(); dep != depFiles.end(); dep++) {
+ dep += 3;
+ cmSystemTools::RemoveFile(*dep);
+ }
+}
diff --git a/Source/cmDependsCompiler.h b/Source/cmDependsCompiler.h
new file mode 100644
index 0000000..838156d
--- /dev/null
+++ b/Source/cmDependsCompiler.h
@@ -0,0 +1,60 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+#pragma once
+
+#include "cmConfigure.h" // IWYU pragma: keep
+
+#include <functional>
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+#include "cmDepends.h"
+
+class cmLocalUnixMakefileGenerator3;
+
+/** \class cmDepends
+ * \brief Dependencies files manager.
+ *
+ * This class is responsible for maintaining a compiler_depends.make file in
+ * the build tree corresponding to an object file.
+ */
+class cmDependsCompiler
+{
+public:
+ cmDependsCompiler() = default;
+ ~cmDependsCompiler() = default;
+
+ /** should this be verbose in its output */
+ void SetVerbose(bool verb) { this->Verbose = verb; }
+
+ /** Set the local generator for the directory in which we are
+ scanning dependencies. This is not a full local generator; it
+ has been setup to do relative path conversions for the current
+ directory. */
+ void SetLocalGenerator(cmLocalUnixMakefileGenerator3* lg)
+ {
+ this->LocalGenerator = lg;
+ }
+
+ /** Read dependencies for the target file. Return true if
+ dependencies didn't changed and false if not.
+ Up-to-date Dependencies will be stored in deps. */
+ bool CheckDependencies(
+ const std::string& internalDepFile,
+ const std::vector<std::string>& depFiles,
+ cmDepends::DependencyMap& dependencies,
+ const std::function<bool(const std::string&)>& isValidPath);
+
+ /** Write dependencies for the target file. */
+ void WriteDependencies(const cmDepends::DependencyMap& dependencies,
+ std::ostream& makeDepends,
+ std::ostream& internalDepends);
+
+ /** Clear dependencies for the target so they will be regenerated. */
+ void ClearDependencies(const std::vector<std::string>& depFiles);
+
+private:
+ bool Verbose = false;
+ cmLocalUnixMakefileGenerator3* LocalGenerator = nullptr;
+};
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index dd700c5..1a31ae4 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -288,6 +288,9 @@ void cmExportBuildFileGenerator::GetTargets(
if (this->ExportSet) {
for (std::unique_ptr<cmTargetExport> const& te :
this->ExportSet->GetTargetExports()) {
+ if (te->NamelinkOnly) {
+ continue;
+ }
targets.push_back(te->TargetName);
}
return;
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 987ec9e..0b9b183 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -42,6 +42,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
std::string sep;
for (std::unique_ptr<cmTargetExport> const& te :
this->IEGen->GetExportSet()->GetTargetExports()) {
+ if (te->NamelinkOnly) {
+ continue;
+ }
expectedTargets += sep + this->Namespace + te->Target->GetExportName();
sep = " ";
if (this->ExportedTargets.insert(te->Target).second) {
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index 9e5023d..3c17b54 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -15,7 +15,6 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmSourceFile.h"
-#include "cmSourceFileLocationKind.h"
#include "cmSystemTools.h"
cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
@@ -99,11 +98,7 @@ void cmGeneratorExpressionEvaluationFile::CreateOutputFile(
for (std::string const& le : enabledLanguages) {
std::string const name = this->GetOutputFileName(lg, target, config, le);
- cmSourceFile* sf = lg->GetMakefile()->GetOrCreateSource(
- name, false, cmSourceFileLocationKind::Known);
- // Tell TraceDependencies that the file is not expected to exist
- // on disk yet. We generate it after that runs.
- sf->SetProperty("GENERATED", "1");
+ cmSourceFile* sf = lg->GetMakefile()->GetOrCreateGeneratedSource(name);
// Tell the build system generators that there is no build rule
// to generate the file.
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index e755399..cb657f9 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -172,7 +172,7 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
std::vector<cmMakefile*> source_file_directory_makefiles;
bool file_scopes_handled =
- SetPropertyCommand::HandleAndValidateSourceFileDirectortoryScopes(
+ SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
status, source_file_directory_option_enabled,
source_file_target_option_enabled, source_file_directories,
source_file_target_directories, source_file_directory_makefiles);
diff --git a/Source/cmGetSourceFilePropertyCommand.cxx b/Source/cmGetSourceFilePropertyCommand.cxx
index 212a968..5301b66 100644
--- a/Source/cmGetSourceFilePropertyCommand.cxx
+++ b/Source/cmGetSourceFilePropertyCommand.cxx
@@ -35,7 +35,7 @@ bool cmGetSourceFilePropertyCommand(std::vector<std::string> const& args,
std::vector<cmMakefile*> source_file_directory_makefiles;
bool file_scopes_handled =
- SetPropertyCommand::HandleAndValidateSourceFileDirectortoryScopes(
+ SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
status, source_file_directory_option_enabled,
source_file_target_option_enabled, source_file_directories,
source_file_target_directories, source_file_directory_makefiles);
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 9d84313..63aaf27 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1821,6 +1821,7 @@ void cmGlobalGenerator::ClearGeneratorMembers()
this->RuleHashes.clear();
this->DirectoryContentMap.clear();
this->BinaryDirectories.clear();
+ this->GeneratedFiles.clear();
}
void cmGlobalGenerator::ComputeTargetObjectDirectory(
@@ -2146,6 +2147,16 @@ void cmGlobalGenerator::AddInstallComponent(const std::string& component)
}
}
+void cmGlobalGenerator::MarkAsGeneratedFile(const std::string& filepath)
+{
+ this->GeneratedFiles.insert(filepath);
+}
+
+bool cmGlobalGenerator::IsGeneratedFile(const std::string& filepath)
+{
+ return this->GeneratedFiles.find(filepath) != this->GeneratedFiles.end();
+}
+
void cmGlobalGenerator::EnableInstallTarget()
{
this->InstallTargetEnabled = true;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index c1813d0..69373bd 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -11,6 +11,7 @@
#include <set>
#include <string>
#include <unordered_map>
+#include <unordered_set>
#include <utility>
#include <vector>
@@ -290,6 +291,11 @@ public:
void AddInstallComponent(const std::string& component);
+ /** Mark the (absolute path to a) file as generated. */
+ void MarkAsGeneratedFile(const std::string& filepath);
+ /** Determine if the absolute filepath belongs to a generated file. */
+ bool IsGeneratedFile(const std::string& filepath);
+
const std::set<std::string>* GetInstallComponents() const
{
return &this->InstallComponents;
@@ -733,6 +739,8 @@ private:
std::map<std::string, std::string> RealPaths;
+ std::unordered_set<std::string> GeneratedFiles;
+
#if !defined(CMAKE_BOOTSTRAP)
// Pool of file locks
cmFileLockPool FileLockPool;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 7ef69f4..4147ba8 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -540,10 +540,11 @@ void cmGlobalNinjaGenerator::Generate()
this->CloseBuildFileStreams();
#ifdef _WIN32
- // The ninja tools will not be able to update metadata on Windows
+ // Older ninja tools will not be able to update metadata on Windows
// when we are re-generating inside an existing 'ninja' invocation
// because the outer tool has the files open for write.
- if (!this->GetCMakeInstance()->GetRegenerateDuringBuild())
+ if (this->NinjaSupportsMetadataOnRegeneration ||
+ !this->GetCMakeInstance()->GetRegenerateDuringBuild())
#endif
{
this->CleanMetaData();
@@ -692,6 +693,9 @@ void cmGlobalNinjaGenerator::CheckNinjaFeatures()
this->NinjaSupportsMultipleOutputs = !cmSystemTools::VersionCompare(
cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
RequiredNinjaVersionForMultipleOutputs().c_str());
+ this->NinjaSupportsMetadataOnRegeneration = !cmSystemTools::VersionCompare(
+ cmSystemTools::OP_LESS, this->NinjaVersion.c_str(),
+ RequiredNinjaVersionForMetadataOnRegeneration().c_str());
}
bool cmGlobalNinjaGenerator::CheckLanguages(
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index 40d3cfc..8df0372 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -377,6 +377,10 @@ public:
{
return "1.10";
}
+ static std::string RequiredNinjaVersionForMetadataOnRegeneration()
+ {
+ return "1.10.2";
+ }
bool SupportsConsolePool() const;
bool SupportsImplicitOuts() const;
bool SupportsManifestRestat() const;
@@ -542,6 +546,7 @@ private:
bool NinjaSupportsUnconditionalRecompactTool = false;
bool NinjaSupportsCleanDeadTool = false;
bool NinjaSupportsMultipleOutputs = false;
+ bool NinjaSupportsMetadataOnRegeneration = false;
private:
void InitOutputPathPrefix();
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 9c3a533..11e2cd6 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -44,6 +44,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3(cmake* cm)
#endif
this->IncludeDirective = "include";
+ this->LineContinueDirective = "\\\n";
this->DefineWindowsNULL = false;
this->PassMakeflags = false;
this->UnixCD = true;
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index 77d0827..6459771 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -127,6 +127,12 @@ public:
void WriteConvenienceRules(std::ostream& ruleFileStream,
std::set<std::string>& emitted);
+ // Make tool supports dependency files generated by compiler
+ bool SupportsCompilerDependencies()
+ {
+ return this->ToolSupportsCompilerDependencies;
+ }
+
/** Get the command to use for a target that has no rule. This is
used for multiple output dependencies and for cmake_force. */
std::string GetEmptyRuleHackCommand() { return this->EmptyRuleHackCommand; }
@@ -170,6 +176,7 @@ public:
void ComputeTargetObjectDirectory(cmGeneratorTarget* gt) const override;
std::string IncludeDirective;
+ std::string LineContinueDirective;
bool DefineWindowsNULL;
bool PassMakeflags;
bool UnixCD;
@@ -218,6 +225,10 @@ protected:
bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS() const override { return true; }
+ // Specify if the make tool is able to consume dependency files
+ // generated by the compiler
+ bool ToolSupportsCompilerDependencies = true;
+
// Some make programs (Borland) do not keep a rule if there are no
// dependencies or commands. This is a problem for creating rules
// that might not do anything but might have other dependencies
diff --git a/Source/cmGlobalWatcomWMakeGenerator.cxx b/Source/cmGlobalWatcomWMakeGenerator.cxx
index d6a7afa..3e2d92d 100644
--- a/Source/cmGlobalWatcomWMakeGenerator.cxx
+++ b/Source/cmGlobalWatcomWMakeGenerator.cxx
@@ -25,6 +25,7 @@ cmGlobalWatcomWMakeGenerator::cmGlobalWatcomWMakeGenerator(cmake* cm)
#endif
cm->GetState()->SetWatcomWMake(true);
this->IncludeDirective = "!include";
+ this->LineContinueDirective = "&\n";
this->DefineWindowsNULL = true;
this->UnixCD = false;
this->MakeSilentFlag = "-h";
@@ -37,7 +38,6 @@ void cmGlobalWatcomWMakeGenerator::EnableLanguage(
mf->AddDefinition("WATCOM", "1");
mf->AddDefinition("CMAKE_QUOTE_INCLUDE_PATHS", "1");
mf->AddDefinition("CMAKE_MANGLE_OBJECT_FILE_NAMES", "1");
- mf->AddDefinition("CMAKE_MAKE_LINE_CONTINUE", "&");
mf->AddDefinition("CMAKE_MAKE_SYMBOLIC_RULE", ".SYMBOLIC");
mf->AddDefinition("CMAKE_GENERATOR_CC", "wcl386");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "wcl386");
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index a881b74..78c7538 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -773,7 +773,9 @@ void cmGlobalXCodeGenerator::ClearXCodeObjects()
this->TargetGroup.clear();
this->FileRefs.clear();
this->ExternalLibRefs.clear();
+ this->EmbeddedLibRefs.clear();
this->FileRefToBuildFileMap.clear();
+ this->FileRefToEmbedBuildFileMap.clear();
this->CommandsVisited.clear();
}
@@ -1197,7 +1199,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeFileReferenceFromPath(
}
}
// Make a copy so that we can override it later
- std::string path = fullpath;
+ std::string path = cmSystemTools::CollapseFullPath(fullpath);
// Compute the extension without leading '.'.
std::string ext = cmSystemTools::GetFilenameLastExtension(path);
if (!ext.empty()) {
@@ -1793,6 +1795,10 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(
if (frameworkBuildPhase) {
buildPhases->AddObject(frameworkBuildPhase);
}
+
+ // When this build phase is present, it must be last. More build phases may
+ // be added later for embedding things and they will insert themselves just
+ // before this last build phase.
if (postBuildPhase) {
buildPhases->AddObject(postBuildPhase);
}
@@ -3632,6 +3638,130 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
}
}
+void cmGlobalXCodeGenerator::AddEmbeddedFrameworks(cmXCodeObject* target)
+{
+ cmGeneratorTarget* gt = target->GetTarget();
+ if (!gt) {
+ cmSystemTools::Error("Error no target on xobject\n");
+ return;
+ }
+ if (!gt->IsInBuildSystem()) {
+ return;
+ }
+ bool isFrameworkTarget = gt->IsFrameworkOnApple();
+ bool isBundleTarget = gt->GetPropertyAsBool("MACOSX_BUNDLE");
+ bool isCFBundleTarget = gt->IsCFBundleOnApple();
+ if (!(isFrameworkTarget || isBundleTarget || isCFBundleTarget)) {
+ return;
+ }
+ cmProp files = gt->GetProperty("XCODE_EMBED_FRAMEWORKS");
+ if (!files) {
+ return;
+ }
+
+ // Create an "Embedded Frameworks" build phase
+ auto* copyFilesBuildPhase =
+ this->CreateObject(cmXCodeObject::PBXCopyFilesBuildPhase);
+ std::string copyFilesBuildPhaseName = "Embed Frameworks";
+ std::string destinationFrameworks = "10";
+ copyFilesBuildPhase->SetComment(copyFilesBuildPhaseName);
+ copyFilesBuildPhase->AddAttribute("buildActionMask",
+ this->CreateString("2147483647"));
+ copyFilesBuildPhase->AddAttribute("dstSubfolderSpec",
+ this->CreateString(destinationFrameworks));
+ copyFilesBuildPhase->AddAttribute(
+ "name", this->CreateString(copyFilesBuildPhaseName));
+ if (cmProp fwEmbedPath = gt->GetProperty("XCODE_EMBED_FRAMEWORKS_PATH")) {
+ copyFilesBuildPhase->AddAttribute("dstPath",
+ this->CreateString(*fwEmbedPath));
+ } else {
+ copyFilesBuildPhase->AddAttribute("dstPath", this->CreateString(""));
+ }
+ copyFilesBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
+ this->CreateString("0"));
+ cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
+ // Collect all embedded frameworks and add them to build phase
+ std::vector<std::string> relFiles = cmExpandedList(*files);
+ for (std::string const& relFile : relFiles) {
+ cmXCodeObject* buildFile{ nullptr };
+ std::string filePath = relFile;
+ auto* genTarget = FindGeneratorTarget(relFile);
+ if (genTarget) {
+ // This is a target - get it's product path reference
+ auto* xcTarget = FindXCodeTarget(genTarget);
+ if (!xcTarget) {
+ cmSystemTools::Error("Can not find a target for " +
+ genTarget->GetName());
+ continue;
+ }
+ // Add the target output file as a build reference for other targets
+ // to link against
+ auto* fileRefObject = xcTarget->GetAttribute("productReference");
+ if (!fileRefObject) {
+ cmSystemTools::Error("Target " + genTarget->GetName() +
+ " is missing product reference");
+ continue;
+ }
+ auto it = FileRefToEmbedBuildFileMap.find(fileRefObject);
+ if (it == FileRefToEmbedBuildFileMap.end()) {
+ buildFile = this->CreateObject(cmXCodeObject::PBXBuildFile);
+ buildFile->AddAttribute("fileRef", fileRefObject);
+ FileRefToEmbedBuildFileMap[fileRefObject] = buildFile;
+ } else {
+ buildFile = it->second;
+ }
+ } else if (cmSystemTools::IsPathToFramework(relFile)) {
+ // This is a regular string path - create file reference
+ auto it = EmbeddedLibRefs.find(relFile);
+ if (it == EmbeddedLibRefs.end()) {
+ cmXCodeObject* fileRef =
+ this->CreateXCodeFileReferenceFromPath(relFile, gt, "", nullptr);
+ if (fileRef) {
+ buildFile = this->CreateObject(cmXCodeObject::PBXBuildFile);
+ buildFile->SetComment(fileRef->GetComment());
+ buildFile->AddAttribute("fileRef",
+ this->CreateObjectReference(fileRef));
+ }
+ if (!buildFile) {
+ cmSystemTools::Error("Can't create build file for " + relFile);
+ continue;
+ }
+ this->EmbeddedLibRefs.emplace(filePath, buildFile);
+ } else {
+ buildFile = it->second;
+ }
+ }
+ if (!buildFile) {
+ cmSystemTools::Error("Can't find a build file for " + relFile);
+ continue;
+ }
+ // Set build file configuration
+ cmXCodeObject* settings =
+ this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
+ cmXCodeObject* attrs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
+ const auto& rmHeadersProp =
+ gt->GetSafeProperty("XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY");
+ if (cmIsOn(rmHeadersProp)) {
+ attrs->AddObject(this->CreateString("RemoveHeadersOnCopy"));
+ }
+ const auto& codeSignProp =
+ gt->GetSafeProperty("XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY");
+ if (cmIsOn(codeSignProp)) {
+ attrs->AddObject(this->CreateString("CodeSignOnCopy"));
+ }
+ settings->AddAttributeIfNotEmpty("ATTRIBUTES", attrs);
+ buildFile->AddAttributeIfNotEmpty("settings", settings);
+ if (!buildFiles->HasObject(buildFile)) {
+ buildFiles->AddObject(buildFile);
+ }
+ }
+ copyFilesBuildPhase->AddAttribute("files", buildFiles);
+ auto* buildPhases = target->GetAttribute("buildPhases");
+ // Insert embed build phase right before the post-build command
+ buildPhases->InsertObject(buildPhases->GetObjectCount() - 1,
+ copyFilesBuildPhase);
+}
+
bool cmGlobalXCodeGenerator::CreateGroups(
std::vector<cmLocalGenerator*>& generators)
{
@@ -4010,7 +4140,9 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
// loop over all targets and add link and depend info
for (auto t : targets) {
this->AddDependAndLinkInformation(t);
+ this->AddEmbeddedFrameworks(t);
}
+
if (this->XcodeBuildSystem == BuildSystem::One) {
this->CreateXCodeDependHackMakefile(targets);
}
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index ab5eeb2..3cc4efe 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -187,6 +187,7 @@ private:
const std::string& configName);
cmXCodeObject* CreateUtilityTarget(cmGeneratorTarget* gtgt);
void AddDependAndLinkInformation(cmXCodeObject* target);
+ void AddEmbeddedFrameworks(cmXCodeObject* target);
void AddPositionIndependentLinkAttribute(cmGeneratorTarget* target,
cmXCodeObject* buildSettings,
const std::string& configName);
@@ -324,8 +325,10 @@ private:
std::map<std::string, cmXCodeObject*> TargetGroup;
std::map<std::string, cmXCodeObject*> FileRefs;
std::map<std::string, cmXCodeObject*> ExternalLibRefs;
+ std::map<std::string, cmXCodeObject*> EmbeddedLibRefs;
std::map<cmGeneratorTarget const*, cmXCodeObject*> XCodeObjectMap;
std::map<cmXCodeObject*, cmXCodeObject*> FileRefToBuildFileMap;
+ std::map<cmXCodeObject*, cmXCodeObject*> FileRefToEmbedBuildFileMap;
std::vector<std::string> Architectures;
std::string ObjectDirArchDefault;
std::string ObjectDirArch;
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index b99e6a3..ff08ee4 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -461,6 +461,13 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
std::unique_ptr<cmInstallFilesGenerator> publicHeaderGenerator;
std::unique_ptr<cmInstallFilesGenerator> resourceGenerator;
+ // Avoid selecting default destinations for PUBLIC_HEADER and
+ // PRIVATE_HEADER if any artifacts are specified.
+ bool artifactsSpecified = false;
+
+ // Track whether this is a namelink-only rule.
+ bool namelinkOnly = false;
+
auto addTargetExport = [&]() {
// Add this install rule to an export if one was specified.
if (!exports.empty()) {
@@ -475,20 +482,13 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
te->ObjectsGenerator = objectGenerator.get();
te->InterfaceIncludeDirectories =
cmJoin(includesArgs.GetIncludeDirs(), ";");
-
+ te->NamelinkOnly = namelinkOnly;
helper.Makefile->GetGlobalGenerator()
->GetExportSets()[exports]
.AddTargetExport(std::move(te));
}
};
- // Avoid selecting default destinations for PUBLIC_HEADER and
- // PRIVATE_HEADER if any artifacts are specified.
- bool artifactsSpecified = false;
-
- // Track whether this is a namelink-only rule.
- bool namelinkOnly = false;
-
switch (target.GetType()) {
case cmStateEnums::SHARED_LIBRARY: {
// Shared libraries are handled differently on DLL and non-DLL
@@ -497,6 +497,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
if (target.IsDLLPlatform()) {
// When in namelink only mode skip all libraries on Windows.
if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) {
+ namelinkOnly = true;
addTargetExport();
continue;
}
@@ -529,6 +530,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
if (target.IsFrameworkOnApple()) {
// When in namelink only mode skip frameworks.
if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) {
+ namelinkOnly = true;
addTargetExport();
continue;
}
@@ -574,6 +576,7 @@ bool HandleTargetsMode(std::vector<std::string> const& args,
if (target.IsFrameworkOnApple()) {
// When in namelink only mode skip frameworks.
if (namelinkMode == cmInstallTargetGenerator::NamelinkModeOnly) {
+ namelinkOnly = true;
addTargetExport();
continue;
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8a3f285..f582701 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2503,8 +2503,10 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
}
if (!useMultiArchPch.empty()) {
- target->Target->SetProperty(
- cmStrCat(lang, "_COMPILE_OPTIONS_USE_PCH"), useMultiArchPch);
+
+ target->Target->AppendProperty(
+ cmStrCat(lang, "_COMPILE_OPTIONS_USE_PCH"),
+ cmStrCat("$<$<CONFIG:", config, ">:", useMultiArchPch, ">"));
}
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 30371c5..09e820a 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -43,6 +43,13 @@ enum class cmSourceOutputKind
OutputOrByproduct
};
+/** What scanner to use for dependencies lookup. */
+enum class cmDependencyScannerKind
+{
+ CMake,
+ Compiler
+};
+
/** Target and source file which have a specific output. */
struct cmSourcesWithOutput
{
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index dd27084..08cefb7 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -5,18 +5,22 @@
#include <algorithm>
#include <cassert>
#include <cstdio>
+#include <functional>
#include <sstream>
#include <utility>
#include <cm/memory>
+#include <cm/string_view>
#include <cm/vector>
#include <cmext/algorithm>
#include "cmsys/FStream.hxx"
#include "cmsys/Terminal.h"
+#include "cmCMakePath.h"
#include "cmCustomCommand.h" // IWYU pragma: keep
#include "cmCustomCommandGenerator.h"
+#include "cmDependsCompiler.h"
#include "cmFileTimeCache.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorExpression.h"
@@ -50,8 +54,9 @@
# include "cmDependsJava.h"
#endif
+namespace {
// Helper function used below.
-static std::string cmSplitExtension(std::string const& in, std::string& base)
+std::string cmSplitExtension(std::string const& in, std::string& base)
{
std::string ext;
std::string::size_type dot_pos = in.rfind('.');
@@ -65,6 +70,43 @@ static std::string cmSplitExtension(std::string const& in, std::string& base)
return ext;
}
+// Helper predicate for removing absolute paths that don't point to the
+// source or binary directory. It is used when CMAKE_DEPENDS_IN_PROJECT_ONLY
+// is set ON, to only consider in-project dependencies during the build.
+class NotInProjectDir
+{
+public:
+ // Constructor with the source and binary directory's path
+ NotInProjectDir(cm::string_view sourceDir, cm::string_view binaryDir)
+ : SourceDir(sourceDir)
+ , BinaryDir(binaryDir)
+ {
+ }
+
+ // Operator evaluating the predicate
+ bool operator()(const std::string& p) const
+ {
+ auto path = cmCMakePath(p).Normal();
+
+ // Keep all relative paths:
+ if (path.IsRelative()) {
+ return false;
+ }
+
+ // If it's an absolute path, check if it starts with the source
+ // directory:
+ return !(cmCMakePath(SourceDir).IsPrefix(path) ||
+ cmCMakePath(BinaryDir).IsPrefix(path));
+ }
+
+private:
+ // The path to the source directory
+ cm::string_view SourceDir;
+ // The path to the binary directory
+ cm::string_view BinaryDir;
+};
+}
+
cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3(
cmGlobalGenerator* gg, cmMakefile* mf)
: cmLocalCommonGenerator(gg, mf, mf->GetCurrentBinaryDirectory())
@@ -552,8 +594,10 @@ void cmLocalUnixMakefileGenerator3::WriteMakeRule(
}
}
- // Write the list of commands.
- os << cmWrap("\t", commands, "", "\n") << "\n";
+ if (!commands.empty()) {
+ // Write the list of commands.
+ os << cmWrap("\t", commands, "", "\n") << "\n";
+ }
if (symbolic && !this->IsWatcomWMake()) {
os << ".PHONY : " << tgt << "\n";
}
@@ -1298,91 +1342,153 @@ bool cmLocalUnixMakefileGenerator3::UpdateDependencies(
cmSystemTools::Error("Target DependInfo.cmake file not found");
}
+ bool status = true;
+
// Check if any multiple output pairs have a missing file.
this->CheckMultipleOutputs(verbose);
std::string const targetDir = cmSystemTools::GetFilenamePath(tgtInfo);
- std::string const internalDependFile = targetDir + "/depend.internal";
- std::string const dependFile = targetDir + "/depend.make";
-
- // If the target DependInfo.cmake file has changed since the last
- // time dependencies were scanned then force rescanning. This may
- // happen when a new source file is added and CMake regenerates the
- // project but no other sources were touched.
- bool needRescanDependInfo = false;
- cmFileTimeCache* ftc =
- this->GlobalGenerator->GetCMakeInstance()->GetFileTimeCache();
- {
- int result;
- if (!ftc->Compare(internalDependFile, tgtInfo, &result) || result < 0) {
- if (verbose) {
- cmSystemTools::Stdout(cmStrCat("Dependee \"", tgtInfo,
- "\" is newer than depender \"",
- internalDependFile, "\".\n"));
+ if (!this->Makefile->GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES").empty()) {
+ // dependencies are managed by CMake itself
+
+ std::string const internalDependFile = targetDir + "/depend.internal";
+ std::string const dependFile = targetDir + "/depend.make";
+
+ // If the target DependInfo.cmake file has changed since the last
+ // time dependencies were scanned then force rescanning. This may
+ // happen when a new source file is added and CMake regenerates the
+ // project but no other sources were touched.
+ bool needRescanDependInfo = false;
+ cmFileTimeCache* ftc =
+ this->GlobalGenerator->GetCMakeInstance()->GetFileTimeCache();
+ {
+ int result;
+ if (!ftc->Compare(internalDependFile, tgtInfo, &result) || result < 0) {
+ if (verbose) {
+ cmSystemTools::Stdout(cmStrCat("Dependee \"", tgtInfo,
+ "\" is newer than depender \"",
+ internalDependFile, "\".\n"));
+ }
+ needRescanDependInfo = true;
}
- needRescanDependInfo = true;
}
- }
- // If the directory information is newer than depend.internal, include dirs
- // may have changed. In this case discard all old dependencies.
- bool needRescanDirInfo = false;
- {
- std::string dirInfoFile =
- cmStrCat(this->GetCurrentBinaryDirectory(),
- "/CMakeFiles/CMakeDirectoryInformation.cmake");
- int result;
- if (!ftc->Compare(internalDependFile, dirInfoFile, &result) ||
- result < 0) {
- if (verbose) {
- cmSystemTools::Stdout(cmStrCat("Dependee \"", dirInfoFile,
- "\" is newer than depender \"",
- internalDependFile, "\".\n"));
+ // If the directory information is newer than depend.internal, include
+ // dirs may have changed. In this case discard all old dependencies.
+ bool needRescanDirInfo = false;
+ {
+ std::string dirInfoFile =
+ cmStrCat(this->GetCurrentBinaryDirectory(),
+ "/CMakeFiles/CMakeDirectoryInformation.cmake");
+ int result;
+ if (!ftc->Compare(internalDependFile, dirInfoFile, &result) ||
+ result < 0) {
+ if (verbose) {
+ cmSystemTools::Stdout(cmStrCat("Dependee \"", dirInfoFile,
+ "\" is newer than depender \"",
+ internalDependFile, "\".\n"));
+ }
+ needRescanDirInfo = true;
}
- needRescanDirInfo = true;
+ }
+
+ // Check the implicit dependencies to see if they are up to date.
+ // The build.make file may have explicit dependencies for the object
+ // files but these will not affect the scanning process so they need
+ // not be considered.
+ cmDepends::DependencyMap validDependencies;
+ bool needRescanDependencies = false;
+ if (!needRescanDirInfo) {
+ cmDependsC checker;
+ checker.SetVerbose(verbose);
+ checker.SetFileTimeCache(ftc);
+ // cmDependsC::Check() fills the vector validDependencies() with the
+ // dependencies for those files where they are still valid, i.e.
+ // neither the files themselves nor any files they depend on have
+ // changed. We don't do that if the CMakeDirectoryInformation.cmake
+ // file has changed, because then potentially all dependencies have
+ // changed. This information is given later on to cmDependsC, which
+ // then only rescans the files where it did not get valid dependencies
+ // via this dependency vector. This means that in the normal case, when
+ // only few or one file have been edited, then also only this one file
+ // is actually scanned again, instead of all files for this target.
+ needRescanDependencies =
+ !checker.Check(dependFile, internalDependFile, validDependencies);
+ }
+
+ if (needRescanDependInfo || needRescanDirInfo || needRescanDependencies) {
+ // The dependencies must be regenerated.
+ std::string targetName = cmSystemTools::GetFilenameName(targetDir);
+ targetName = targetName.substr(0, targetName.length() - 4);
+ std::string message =
+ cmStrCat("Scanning dependencies of target ", targetName);
+ cmSystemTools::MakefileColorEcho(cmsysTerminal_Color_ForegroundMagenta |
+ cmsysTerminal_Color_ForegroundBold,
+ message.c_str(), true, color);
+
+ status = this->ScanDependencies(targetDir, dependFile,
+ internalDependFile, validDependencies);
}
}
- // Check the implicit dependencies to see if they are up to date.
- // The build.make file may have explicit dependencies for the object
- // files but these will not affect the scanning process so they need
- // not be considered.
- cmDepends::DependencyMap validDependencies;
- bool needRescanDependencies = false;
- if (!needRescanDirInfo) {
- cmDependsC checker;
- checker.SetVerbose(verbose);
- checker.SetFileTimeCache(ftc);
- // cmDependsC::Check() fills the vector validDependencies() with the
- // dependencies for those files where they are still valid, i.e. neither
- // the files themselves nor any files they depend on have changed.
- // We don't do that if the CMakeDirectoryInformation.cmake file has
- // changed, because then potentially all dependencies have changed.
- // This information is given later on to cmDependsC, which then only
- // rescans the files where it did not get valid dependencies via this
- // dependency vector. This means that in the normal case, when only
- // few or one file have been edited, then also only this one file is
- // actually scanned again, instead of all files for this target.
- needRescanDependencies =
- !checker.Check(dependFile, internalDependFile, validDependencies);
- }
-
- if (needRescanDependInfo || needRescanDirInfo || needRescanDependencies) {
- // The dependencies must be regenerated.
- std::string targetName = cmSystemTools::GetFilenameName(targetDir);
- targetName = targetName.substr(0, targetName.length() - 4);
- std::string message =
- cmStrCat("Scanning dependencies of target ", targetName);
- cmSystemTools::MakefileColorEcho(cmsysTerminal_Color_ForegroundMagenta |
- cmsysTerminal_Color_ForegroundBold,
- message.c_str(), true, color);
-
- return this->ScanDependencies(targetDir, dependFile, internalDependFile,
- validDependencies);
+ auto depends =
+ this->Makefile->GetSafeDefinition("CMAKE_DEPENDS_DEPENDENCY_FILES");
+ if (!depends.empty()) {
+ // dependencies are managed by compiler
+ auto depFiles = cmExpandedList(depends);
+ std::string const internalDepFile =
+ targetDir + "/compiler_depend.internal";
+ std::string const depFile = targetDir + "/compiler_depend.make";
+ cmDepends::DependencyMap dependencies;
+ cmDependsCompiler depsManager;
+ bool projectOnly = cmIsOn(
+ this->Makefile->GetSafeDefinition("CMAKE_DEPENDS_IN_PROJECT_ONLY"));
+
+ depsManager.SetVerbose(verbose);
+ depsManager.SetLocalGenerator(this);
+
+ if (!depsManager.CheckDependencies(
+ internalDepFile, depFiles, dependencies,
+ projectOnly ? NotInProjectDir(this->GetSourceDirectory(),
+ this->GetBinaryDirectory())
+ : std::function<bool(const std::string&)>())) {
+ // regenerate dependencies files
+ std::string targetName =
+ cmCMakePath(targetDir).GetFileName().RemoveExtension().GenericString();
+ auto message = cmStrCat(
+ "Consolidate compiler generated dependencies of target ", targetName);
+ cmSystemTools::MakefileColorEcho(cmsysTerminal_Color_ForegroundMagenta |
+ cmsysTerminal_Color_ForegroundBold,
+ message.c_str(), true, color);
+
+ // Open the make depends file. This should be copy-if-different
+ // because the make tool may try to reload it needlessly otherwise.
+ cmGeneratedFileStream ruleFileStream(
+ depFile, false, this->GlobalGenerator->GetMakefileEncoding());
+ ruleFileStream.SetCopyIfDifferent(true);
+ if (!ruleFileStream) {
+ return false;
+ }
+
+ // Open the cmake dependency tracking file. This should not be
+ // copy-if-different because dependencies are re-scanned when it is
+ // older than the DependInfo.cmake.
+ cmGeneratedFileStream internalRuleFileStream(
+ internalDepFile, false, this->GlobalGenerator->GetMakefileEncoding());
+ if (!internalRuleFileStream) {
+ return false;
+ }
+
+ this->WriteDisclaimer(ruleFileStream);
+ this->WriteDisclaimer(internalRuleFileStream);
+
+ depsManager.WriteDependencies(dependencies, ruleFileStream,
+ internalRuleFileStream);
+ }
}
// The dependencies are already up-to-date.
- return true;
+ return status;
}
bool cmLocalUnixMakefileGenerator3::ScanDependencies(
@@ -1721,178 +1827,193 @@ void cmLocalUnixMakefileGenerator3::ClearDependencies(cmMakefile* mf,
cmDepends clearer;
clearer.SetVerbose(verbose);
for (std::string const& file : files) {
- std::string dir = cmSystemTools::GetFilenamePath(file);
+ auto snapshot = mf->GetState()->CreateBaseSnapshot();
+ cmMakefile lmf(mf->GetGlobalGenerator(), snapshot);
+ lmf.ReadListFile(file);
- // Clear the implicit dependency makefile.
- std::string dependFile = dir + "/depend.make";
- clearer.Clear(dependFile);
+ if (!lmf.GetSafeDefinition("CMAKE_DEPENDS_LANGUAGES").empty()) {
+ std::string dir = cmSystemTools::GetFilenamePath(file);
- // Remove the internal dependency check file to force
- // regeneration.
- std::string internalDependFile = dir + "/depend.internal";
- cmSystemTools::RemoveFile(internalDependFile);
- }
-}
-
-namespace {
-// Helper predicate for removing absolute paths that don't point to the
-// source or binary directory. It is used when CMAKE_DEPENDS_IN_PROJECT_ONLY
-// is set ON, to only consider in-project dependencies during the build.
-class NotInProjectDir
-{
-public:
- // Constructor with the source and binary directory's path
- NotInProjectDir(std::string sourceDir, std::string binaryDir)
- : SourceDir(std::move(sourceDir))
- , BinaryDir(std::move(binaryDir))
- {
- }
+ // Clear the implicit dependency makefile.
+ std::string dependFile = dir + "/depend.make";
+ clearer.Clear(dependFile);
- // Operator evaluating the predicate
- bool operator()(const std::string& path) const
- {
- // Keep all relative paths:
- if (!cmSystemTools::FileIsFullPath(path)) {
- return false;
+ // Remove the internal dependency check file to force
+ // regeneration.
+ std::string internalDependFile = dir + "/depend.internal";
+ cmSystemTools::RemoveFile(internalDependFile);
}
- // If it's an absolute path, check if it starts with the source
- // directory:
- return (
- !(IsInDirectory(SourceDir, path) || IsInDirectory(BinaryDir, path)));
- }
-private:
- // Helper function used by the predicate
- static bool IsInDirectory(const std::string& baseDir,
- const std::string& testDir)
- {
- // First check if the test directory "starts with" the base directory:
- if (!cmHasPrefix(testDir, baseDir)) {
- return false;
+ auto depsFiles = lmf.GetSafeDefinition("CMAKE_DEPENDS_DEPENDENCY_FILES");
+ if (!depsFiles.empty()) {
+ auto dir = cmCMakePath(file).GetParentPath();
+ // Clear the implicit dependency makefile.
+ auto depFile = cmCMakePath(dir).Append("compiler_depend.make");
+ clearer.Clear(depFile.GenericString());
+
+ // Remove the internal dependency check file
+ auto internalDepFile =
+ cmCMakePath(dir).Append("compiler_depend.internal");
+ cmSystemTools::RemoveFile(internalDepFile.GenericString());
+
+ // Touch timestamp file to force dependencies regeneration
+ auto DepTimestamp = cmCMakePath(dir).Append("compiler_depend.ts");
+ cmSystemTools::Touch(DepTimestamp.GenericString(), true);
+
+ // clear the dependencies files generated by the compiler
+ std::vector<std::string> dependencies = cmExpandedList(depsFiles);
+ cmDependsCompiler depsManager;
+ depsManager.SetVerbose(verbose);
+ depsManager.ClearDependencies(dependencies);
}
- // If it does, then check that it's either the same string, or that the
- // next character is a slash:
- return ((testDir.size() == baseDir.size()) ||
- (testDir[baseDir.size()] == '/'));
}
-
- // The path to the source directory
- std::string SourceDir;
- // The path to the binary directory
- std::string BinaryDir;
-};
}
void cmLocalUnixMakefileGenerator3::WriteDependLanguageInfo(
std::ostream& cmakefileStream, cmGeneratorTarget* target)
{
- ImplicitDependLanguageMap const& implicitLangs =
- this->GetImplicitDepends(target);
+ // To enable dependencies filtering
+ cmakefileStream << "\n"
+ << "# Consider dependencies only in project.\n"
+ << "set(CMAKE_DEPENDS_IN_PROJECT_ONLY "
+ << (cmIsOn(this->Makefile->GetSafeDefinition(
+ "CMAKE_DEPENDS_IN_PROJECT_ONLY"))
+ ? "ON"
+ : "OFF")
+ << ")\n\n";
+
+ auto const& implicitLangs =
+ this->GetImplicitDepends(target, cmDependencyScannerKind::CMake);
// list the languages
- cmakefileStream
- << "# The set of languages for which implicit dependencies are needed:\n";
+ cmakefileStream << "# The set of languages for which implicit "
+ "dependencies are needed:\n";
cmakefileStream << "set(CMAKE_DEPENDS_LANGUAGES\n";
for (auto const& implicitLang : implicitLangs) {
cmakefileStream << " \"" << implicitLang.first << "\"\n";
}
cmakefileStream << " )\n";
- // now list the files for each language
- cmakefileStream
- << "# The set of files for implicit dependencies of each language:\n";
- for (auto const& implicitLang : implicitLangs) {
- cmakefileStream << "set(CMAKE_DEPENDS_CHECK_" << implicitLang.first
- << "\n";
- ImplicitDependFileMap const& implicitPairs = implicitLang.second;
-
- // for each file pair
- for (auto const& implicitPair : implicitPairs) {
- for (auto const& di : implicitPair.second) {
- cmakefileStream << " \"" << di << "\" ";
- cmakefileStream << "\"" << implicitPair.first << "\"\n";
+ if (!implicitLangs.empty()) {
+ // now list the files for each language
+ cmakefileStream
+ << "# The set of files for implicit dependencies of each language:\n";
+ for (auto const& implicitLang : implicitLangs) {
+ const auto& lang = implicitLang.first;
+
+ cmakefileStream << "set(CMAKE_DEPENDS_CHECK_" << lang << "\n";
+ auto const& implicitPairs = implicitLang.second;
+
+ // for each file pair
+ for (auto const& implicitPair : implicitPairs) {
+ for (auto const& di : implicitPair.second) {
+ cmakefileStream << " \"" << di << "\" ";
+ cmakefileStream << "\"" << implicitPair.first << "\"\n";
+ }
}
- }
- cmakefileStream << " )\n";
-
- // Tell the dependency scanner what compiler is used.
- std::string cidVar =
- cmStrCat("CMAKE_", implicitLang.first, "_COMPILER_ID");
- cmProp cid = this->Makefile->GetDefinition(cidVar);
- if (cmNonempty(cid)) {
- cmakefileStream << "set(CMAKE_" << implicitLang.first
- << "_COMPILER_ID \"" << *cid << "\")\n";
- }
+ cmakefileStream << " )\n";
- if (implicitLang.first == "Fortran") {
- std::string smodSep =
- this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_SEP");
- std::string smodExt =
- this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_EXT");
- cmakefileStream << "set(CMAKE_Fortran_SUBMODULE_SEP \"" << smodSep
- << "\")\n";
- cmakefileStream << "set(CMAKE_Fortran_SUBMODULE_EXT \"" << smodExt
- << "\")\n";
- }
+ // Tell the dependency scanner what compiler is used.
+ std::string cidVar = cmStrCat("CMAKE_", lang, "_COMPILER_ID");
+ cmProp cid = this->Makefile->GetDefinition(cidVar);
+ if (cmNonempty(cid)) {
+ cmakefileStream << "set(CMAKE_" << lang << "_COMPILER_ID \"" << *cid
+ << "\")\n";
+ }
- // Build a list of preprocessor definitions for the target.
- std::set<std::string> defines;
- this->GetTargetDefines(target, this->GetConfigName(), implicitLang.first,
- defines);
- if (!defines.empty()) {
- /* clang-format off */
+ if (lang == "Fortran") {
+ std::string smodSep =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_SEP");
+ std::string smodExt =
+ this->Makefile->GetSafeDefinition("CMAKE_Fortran_SUBMODULE_EXT");
+ cmakefileStream << "set(CMAKE_Fortran_SUBMODULE_SEP \"" << smodSep
+ << "\")\n";
+ cmakefileStream << "set(CMAKE_Fortran_SUBMODULE_EXT \"" << smodExt
+ << "\")\n";
+ }
+
+ // Build a list of preprocessor definitions for the target.
+ std::set<std::string> defines;
+ this->GetTargetDefines(target, this->GetConfigName(), lang, defines);
+ if (!defines.empty()) {
+ /* clang-format off */
cmakefileStream
<< "\n"
<< "# Preprocessor definitions for this target.\n"
- << "set(CMAKE_TARGET_DEFINITIONS_" << implicitLang.first << "\n";
- /* clang-format on */
- for (std::string const& define : defines) {
- cmakefileStream << " " << cmOutputConverter::EscapeForCMake(define)
- << "\n";
+ << "set(CMAKE_TARGET_DEFINITIONS_" << lang << "\n";
+ /* clang-format on */
+ for (std::string const& define : defines) {
+ cmakefileStream << " " << cmOutputConverter::EscapeForCMake(define)
+ << "\n";
+ }
+ cmakefileStream << " )\n";
+ }
+
+ // Target-specific include directories:
+ cmakefileStream << "\n"
+ << "# The include file search paths:\n";
+ cmakefileStream << "set(CMAKE_" << lang << "_TARGET_INCLUDE_PATH\n";
+ std::vector<std::string> includes;
+
+ this->GetIncludeDirectories(includes, target, lang,
+ this->GetConfigName());
+ std::string const& binaryDir = this->GetState()->GetBinaryDirectory();
+ if (this->Makefile->IsOn("CMAKE_DEPENDS_IN_PROJECT_ONLY")) {
+ std::string const& sourceDir = this->GetState()->GetSourceDirectory();
+ cm::erase_if(includes, ::NotInProjectDir(sourceDir, binaryDir));
+ }
+ for (std::string const& include : includes) {
+ cmakefileStream << " \""
+ << this->MaybeConvertToRelativePath(binaryDir, include)
+ << "\"\n";
}
cmakefileStream << " )\n";
}
- // Target-specific include directories:
- cmakefileStream << "\n"
- << "# The include file search paths:\n";
- cmakefileStream << "set(CMAKE_" << implicitLang.first
- << "_TARGET_INCLUDE_PATH\n";
- std::vector<std::string> includes;
-
- this->GetIncludeDirectories(includes, target, implicitLang.first,
- this->GetConfigName());
- std::string binaryDir = this->GetState()->GetBinaryDirectory();
- if (this->Makefile->IsOn("CMAKE_DEPENDS_IN_PROJECT_ONLY")) {
- std::string const& sourceDir = this->GetState()->GetSourceDirectory();
- cm::erase_if(includes, ::NotInProjectDir(sourceDir, binaryDir));
+ // Store include transform rule properties. Write the directory
+ // rules first because they may be overridden by later target rules.
+ std::vector<std::string> transformRules;
+ if (cmProp xform =
+ this->Makefile->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")) {
+ cmExpandList(*xform, transformRules);
+ }
+ if (cmProp xform =
+ target->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")) {
+ cmExpandList(*xform, transformRules);
}
- for (std::string const& include : includes) {
- cmakefileStream << " \""
- << this->MaybeConvertToRelativePath(binaryDir, include)
- << "\"\n";
+ if (!transformRules.empty()) {
+ cmakefileStream << "\nset(CMAKE_INCLUDE_TRANSFORMS\n";
+ for (std::string const& tr : transformRules) {
+ cmakefileStream << " " << cmOutputConverter::EscapeForCMake(tr)
+ << "\n";
+ }
+ cmakefileStream << " )\n";
}
- cmakefileStream << " )\n";
}
- // Store include transform rule properties. Write the directory
- // rules first because they may be overridden by later target rules.
- std::vector<std::string> transformRules;
- if (cmProp xform =
- this->Makefile->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")) {
- cmExpandList(*xform, transformRules);
- }
- if (cmProp xform =
- target->GetProperty("IMPLICIT_DEPENDS_INCLUDE_TRANSFORM")) {
- cmExpandList(*xform, transformRules);
- }
- if (!transformRules.empty()) {
- cmakefileStream << "set(CMAKE_INCLUDE_TRANSFORMS\n";
- for (std::string const& tr : transformRules) {
- cmakefileStream << " " << cmOutputConverter::EscapeForCMake(tr) << "\n";
+ auto const& compilerLangs =
+ this->GetImplicitDepends(target, cmDependencyScannerKind::Compiler);
+
+ // list the dependency files managed by the compiler
+ cmakefileStream << "\n# The set of dependency files which are needed:\n";
+ cmakefileStream << "set(CMAKE_DEPENDS_DEPENDENCY_FILES\n";
+ for (auto const& compilerLang : compilerLangs) {
+ auto depFormat = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", compilerLang.first, "_DEPFILE_FORMAT"));
+ auto const& compilerPairs = compilerLang.second;
+ for (auto const& compilerPair : compilerPairs) {
+ for (auto const& src : compilerPair.second) {
+ cmakefileStream << " \"" << src << "\" \""
+ << this->MaybeConvertToRelativePath(
+ this->GetBinaryDirectory(), compilerPair.first)
+ << "\" \"" << depFormat << "\" \""
+ << this->MaybeConvertToRelativePath(
+ this->GetBinaryDirectory(), compilerPair.first)
+ << ".d\"\n";
+ }
}
- cmakefileStream << " )\n";
}
+ cmakefileStream << " )\n";
}
void cmLocalUnixMakefileGenerator3::WriteDisclaimer(std::ostream& os)
@@ -2049,16 +2170,18 @@ std::string cmLocalUnixMakefileGenerator3::GetTargetDirectory(
}
cmLocalUnixMakefileGenerator3::ImplicitDependLanguageMap const&
-cmLocalUnixMakefileGenerator3::GetImplicitDepends(const cmGeneratorTarget* tgt)
+cmLocalUnixMakefileGenerator3::GetImplicitDepends(
+ const cmGeneratorTarget* tgt, cmDependencyScannerKind scanner)
{
- return this->ImplicitDepends[tgt->GetName()];
+ return this->ImplicitDepends[tgt->GetName()][scanner];
}
void cmLocalUnixMakefileGenerator3::AddImplicitDepends(
const cmGeneratorTarget* tgt, const std::string& lang,
- const std::string& obj, const std::string& src)
+ const std::string& obj, const std::string& src,
+ cmDependencyScannerKind scanner)
{
- this->ImplicitDepends[tgt->GetName()][lang][obj].push_back(src);
+ this->ImplicitDepends[tgt->GetName()][scanner][lang][obj].push_back(src);
}
void cmLocalUnixMakefileGenerator3::CreateCDCommand(
diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h
index 5edca2a..14dd0ba 100644
--- a/Source/cmLocalUnixMakefileGenerator3.h
+++ b/Source/cmLocalUnixMakefileGenerator3.h
@@ -13,6 +13,7 @@
#include "cmDepends.h"
#include "cmLocalCommonGenerator.h"
+#include "cmLocalGenerator.h"
class cmCustomCommand;
class cmCustomCommandGenerator;
@@ -152,23 +153,21 @@ public:
// File pairs for implicit dependency scanning. The key of the map
// is the depender and the value is the explicit dependee.
- struct ImplicitDependFileMap : public cmDepends::DependencyMap
- {
- };
- struct ImplicitDependLanguageMap
- : public std::map<std::string, ImplicitDependFileMap>
- {
- };
- struct ImplicitDependTargetMap
- : public std::map<std::string, ImplicitDependLanguageMap>
- {
- };
+ using ImplicitDependFileMap = cmDepends::DependencyMap;
+ using ImplicitDependLanguageMap =
+ std::map<std::string, ImplicitDependFileMap>;
+ using ImplicitDependScannerMap =
+ std::map<cmDependencyScannerKind, ImplicitDependLanguageMap>;
+ using ImplicitDependTargetMap =
+ std::map<std::string, ImplicitDependScannerMap>;
ImplicitDependLanguageMap const& GetImplicitDepends(
- cmGeneratorTarget const* tgt);
+ cmGeneratorTarget const* tgt,
+ cmDependencyScannerKind scanner = cmDependencyScannerKind::CMake);
- void AddImplicitDepends(cmGeneratorTarget const* tgt,
- const std::string& lang, const std::string& obj,
- const std::string& src);
+ void AddImplicitDepends(
+ cmGeneratorTarget const* tgt, const std::string& lang,
+ const std::string& obj, const std::string& src,
+ cmDependencyScannerKind scanner = cmDependencyScannerKind::CMake);
// write the target rules for the local Makefile into the stream
void WriteLocalAllRules(std::ostream& ruleFileStream);
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 50a7d27..4e93785 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3406,11 +3406,7 @@ cmSourceFile* cmMakefile::CreateSource(const std::string& sourceName,
bool generated,
cmSourceFileLocationKind kind)
{
- auto sf = cm::make_unique<cmSourceFile>(this, sourceName, kind);
- if (generated) {
- sf->SetProperty("GENERATED", "1");
- }
-
+ auto sf = cm::make_unique<cmSourceFile>(this, sourceName, generated, kind);
auto name =
this->GetCMakeInstance()->StripExtension(sf->GetLocation().GetName());
#if defined(_WIN32) || defined(__APPLE__)
@@ -3442,7 +3438,7 @@ cmSourceFile* cmMakefile::GetOrCreateGeneratedSource(
{
cmSourceFile* sf =
this->GetOrCreateSource(sourceName, true, cmSourceFileLocationKind::Known);
- sf->SetProperty("GENERATED", "1");
+ sf->MarkAsGenerated(); // In case we did not create the source file.
return sf;
}
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 71660a0..155a097 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -12,7 +12,9 @@
#include <utility>
#include <cm/memory>
+#include <cm/string_view>
#include <cmext/algorithm>
+#include <cmext/string_view>
#include "cmComputeLinkInformation.h"
#include "cmCustomCommand.h"
@@ -23,6 +25,7 @@
#include "cmGlobalUnixMakefileGenerator3.h"
#include "cmLinkLineComputer.h" // IWYU pragma: keep
#include "cmLocalCommonGenerator.h"
+#include "cmLocalGenerator.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
#include "cmMakefileExecutableTargetGenerator.h"
@@ -325,7 +328,45 @@ void cmMakefileTargetGenerator::WriteCommonCodeRules()
<< cmSystemTools::ConvertToOutputPath(
this->LocalGenerator->MaybeConvertToRelativePath(
this->LocalGenerator->GetBinaryDirectory(), dependFileNameFull))
- << "\n\n";
+ << "\n";
+
+ std::string depsUseCompiler = "CMAKE_DEPENDS_USE_COMPILER";
+ if (!this->Makefile->IsDefinitionSet(depsUseCompiler) ||
+ this->Makefile->IsOn(depsUseCompiler)) {
+ std::string compilerDependFile =
+ cmStrCat(this->TargetBuildDirectoryFull, "/compiler_depend.make");
+ *this->BuildFileStream
+ << "# Include any dependencies generated by the "
+ "compiler for this target.\n"
+ << this->GlobalGenerator->IncludeDirective << " " << root
+ << cmSystemTools::ConvertToOutputPath(
+ this->LocalGenerator->MaybeConvertToRelativePath(
+ this->LocalGenerator->GetBinaryDirectory(), compilerDependFile))
+ << "\n\n";
+
+ if (!cmSystemTools::FileExists(compilerDependFile)) {
+ // Write an empty dependency file.
+ cmGeneratedFileStream depFileStream(
+ compilerDependFile, false,
+ this->GlobalGenerator->GetMakefileEncoding());
+ depFileStream << "# Empty compiler generated dependencies file for "
+ << this->GeneratorTarget->GetName() << ".\n"
+ << "# This may be replaced when dependencies are built.\n";
+ }
+
+ std::string compilerDependTimestamp =
+ cmStrCat(this->TargetBuildDirectoryFull, "/compiler_depend.ts");
+ if (!cmSystemTools::FileExists(compilerDependTimestamp)) {
+ // Write a dependency timestamp file.
+ cmGeneratedFileStream depFileStream(
+ compilerDependTimestamp, false,
+ this->GlobalGenerator->GetMakefileEncoding());
+ depFileStream << "# CMAKE generated file: DO NOT EDIT!\n"
+ << "# Timestamp file for compiler generated dependencies "
+ "management for "
+ << this->GeneratorTarget->GetName() << ".\n";
+ }
+ }
if (!this->NoRuleMessages) {
// Include the progress variables for the target.
@@ -472,6 +513,14 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
return;
}
+ // Use compiler to generate dependencies, if supported.
+ bool compilerGenerateDeps =
+ this->GlobalGenerator->SupportsCompilerDependencies() &&
+ cmIsOn(this->Makefile->GetDefinition(
+ cmStrCat("CMAKE_", lang, "_DEPENDS_USE_COMPILER")));
+ auto scanner = compilerGenerateDeps ? cmDependencyScannerKind::Compiler
+ : cmDependencyScannerKind::CMake;
+
// Get the full path name of the object file.
std::string const& objectName =
this->GeneratorTarget->GetObjectName(&source);
@@ -511,7 +560,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
std::string srcFullPath =
cmSystemTools::CollapseFullPath(source.GetFullPath());
this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, lang,
- objFullPath, srcFullPath);
+ objFullPath, srcFullPath, scanner);
this->LocalGenerator->AppendRuleDepend(depends,
this->FlagFileNameFull.c_str());
@@ -553,8 +602,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
depends.push_back(
this->GeneratorTarget->GetPchFile(config, lang, arch));
}
- this->LocalGenerator->AddImplicitDepends(this->GeneratorTarget, lang,
- objFullPath, pchHeader);
+ this->LocalGenerator->AddImplicitDepends(
+ this->GeneratorTarget, lang, objFullPath, pchHeader, scanner);
}
}
@@ -688,7 +737,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
source.GetFullPath(), cmOutputConverter::SHELL);
// Construct the build message.
- std::vector<std::string> no_commands;
+ std::vector<std::string> no_depends;
std::vector<std::string> commands;
// add in a progress call if needed
@@ -782,6 +831,26 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
"$(" + lang + "_INCLUDES)");
vars.Includes = includesString.c_str();
+ std::string dependencyTarget;
+ std::string shellDependencyFile;
+ std::string dependencyTimestamp;
+ if (compilerGenerateDeps) {
+ dependencyTarget = this->LocalGenerator->EscapeForShell(
+ this->LocalGenerator->ConvertToMakefilePath(
+ this->LocalGenerator->MaybeConvertToRelativePath(
+ this->LocalGenerator->GetBinaryDirectory(), relativeObj)));
+ vars.DependencyTarget = dependencyTarget.c_str();
+
+ auto depFile = cmStrCat(obj, ".d");
+ shellDependencyFile = this->LocalGenerator->ConvertToOutputFormat(
+ depFile, cmOutputConverter::SHELL);
+ vars.DependencyFile = shellDependencyFile.c_str();
+
+ dependencyTimestamp = this->LocalGenerator->MaybeConvertToRelativePath(
+ this->LocalGenerator->GetBinaryDirectory(),
+ cmStrCat(this->TargetBuildDirectoryFull, "/compiler_depend.ts"));
+ }
+
// At the moment, it is assumed that C, C++, Fortran, and CUDA have both
// assembly and preprocessor capabilities. The same is true for the
// ability to export compile commands
@@ -953,6 +1022,53 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
}
}
+ std::string flagsWithDeps(flags);
+
+ if (compilerGenerateDeps) {
+ // Injects dependency computation
+ auto depFlags = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_DEPFILE_FLAGS_", lang));
+
+ if (!depFlags.empty()) {
+ // Add dependency flags
+ rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator,
+ depFlags, vars);
+ flagsWithDeps.append(1, ' ');
+ flagsWithDeps.append(depFlags);
+ }
+ vars.Flags = flagsWithDeps.c_str();
+
+ const auto& extraCommands = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", lang, "_DEPENDS_EXTRA_COMMANDS"));
+ if (!extraCommands.empty()) {
+ auto commandList = cmExpandedList(extraCommands);
+ compileCommands.insert(compileCommands.end(), commandList.cbegin(),
+ commandList.cend());
+ }
+
+ const auto& depFormat = this->Makefile->GetRequiredDefinition(
+ cmStrCat("CMAKE_", lang, "_DEPFILE_FORMAT"));
+
+ if (depFormat == "msvc"_s) {
+ // compiler must be launched through a wrapper to pick-up dependencies
+ std::string depFilter =
+ "$(CMAKE_COMMAND) -E cmake_cl_compile_depends ";
+ depFilter += cmStrCat("--dep-file=", shellDependencyFile);
+ depFilter +=
+ cmStrCat(" --working-dir=",
+ this->LocalGenerator->ConvertToOutputFormat(
+ this->LocalGenerator->GetCurrentBinaryDirectory(),
+ cmOutputConverter::SHELL));
+ const auto& prefix = this->Makefile->GetSafeDefinition(
+ cmStrCat("CMAKE_", lang, "_CL_SHOWINCLUDES_PREFIX"));
+ depFilter += cmStrCat(" --filter-prefix=",
+ this->LocalGenerator->ConvertToOutputFormat(
+ prefix, cmOutputConverter::SHELL));
+ depFilter += " -- ";
+ compileCommands.front().insert(0, depFilter);
+ }
+ }
+
// Expand placeholders in the commands.
for (std::string& compileCommand : compileCommands) {
compileCommand = cmStrCat(launcher, compileCommand);
@@ -978,8 +1094,8 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
cmExpandList(evaluated_outputs, outputs);
}
}
- if (!ispcHeaderRelative
- .empty()) { // can't move ispcHeader as vars is using it
+ if (!ispcHeaderRelative.empty()) {
+ // can't move ispcHeader as vars is using it
outputs.emplace_back(ispcHeaderRelative);
}
@@ -987,10 +1103,19 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(
this->CleanFiles.insert(outputs.begin() + 1, outputs.end());
}
+ if (compilerGenerateDeps) {
+ depends.push_back(dependencyTimestamp);
+ }
+
// Write the rule.
this->WriteMakeRule(*this->BuildFileStream, nullptr, outputs, depends,
commands);
+ if (compilerGenerateDeps) {
+ // set back flags without dependency generation
+ vars.Flags = flags.c_str();
+ }
+
bool do_preprocess_rules = lang_has_preprocessor &&
this->LocalGenerator->GetCreatePreprocessedSourceRules();
bool do_assembly_rules =
@@ -1387,10 +1512,10 @@ void cmMakefileTargetGenerator::WriteDeviceLinkRule(
std::string registerFileCmd;
- // The generated register file contains macros that when expanded register
- // the device routines. Because the routines are the same for all
- // architectures the register file will be the same too. Thus generate it
- // only on the first invocation to reduce overhead.
+ // The generated register file contains macros that when expanded
+ // register the device routines. Because the routines are the same for
+ // all architectures the register file will be the same too. Thus
+ // generate it only on the first invocation to reduce overhead.
if (fatbinaryDepends.size() == 1) {
std::string registerFileRel =
this->LocalGenerator->MaybeConvertToRelativePath(
@@ -1425,7 +1550,8 @@ void cmMakefileTargetGenerator::WriteDeviceLinkRule(
fatbinaryOutputRel, fatbinaryDepends,
{ fatbinaryCommand }, false);
- // Compile the stub that registers the kernels and contains the fatbinaries.
+ // Compile the stub that registers the kernels and contains the
+ // fatbinaries.
cmRulePlaceholderExpander::RuleVariables vars;
vars.CMTargetName = this->GetGeneratorTarget()->GetName().c_str();
vars.CMTargetType =
@@ -1543,12 +1669,7 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
<< this->GeneratorTarget->GetName() << "\n"
<< variableName << " =";
std::string object;
- std::string lineContinue;
- if (cmProp p = this->Makefile->GetDefinition("CMAKE_MAKE_LINE_CONTINUE")) {
- lineContinue = *p;
- } else {
- lineContinue = "\\";
- }
+ const auto& lineContinue = this->GlobalGenerator->LineContinueDirective;
cmProp pchExtension = this->Makefile->GetDefinition("CMAKE_PCH_EXTENSION");
@@ -1556,7 +1677,7 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
if (cmSystemTools::StringEndsWith(obj, cmToCStr(pchExtension))) {
continue;
}
- *this->BuildFileStream << " " << lineContinue << "\n";
+ *this->BuildFileStream << " " << lineContinue;
*this->BuildFileStream
<< cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
obj, useWatcomQuote);
@@ -1579,7 +1700,7 @@ void cmMakefileTargetGenerator::WriteObjectsVariable(
for (std::string const& obj : this->ExternalObjects) {
object =
this->LocalGenerator->MaybeConvertToRelativePath(currentBinDir, obj);
- *this->BuildFileStream << " " << lineContinue << "\n";
+ *this->BuildFileStream << " " << lineContinue;
*this->BuildFileStream
<< cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(
obj, useWatcomQuote);
@@ -1843,9 +1964,9 @@ bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
if (size_t const limit = cmSystemTools::CalculateCommandLineLengthLimit()) {
// Compute the total length of our list of object files with room
// for argument separation and quoting. This does not convert paths
- // relative to CMAKE_CURRENT_BINARY_DIR like the final list will be, so the
- // actual list will likely be much shorter than this. However, in the
- // worst case all objects will remain as absolute paths.
+ // relative to CMAKE_CURRENT_BINARY_DIR like the final list will be, so
+ // the actual list will likely be much shorter than this. However, in
+ // the worst case all objects will remain as absolute paths.
size_t length = 0;
for (std::string const& obj : this->Objects) {
length += obj.size() + 3;
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 6085b25..99f1b45 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -12,7 +12,9 @@
#include <utility>
#include <cm/memory>
+#include <cm/string_view>
#include <cmext/algorithm>
+#include <cmext/string_view>
#include <cm3p/json/value.h>
#include <cm3p/json/writer.h>
@@ -245,32 +247,6 @@ void cmNinjaTargetGenerator::AddIncludeFlags(std::string& languageFlags,
this->LocalGenerator->AppendFlags(languageFlags, includeFlags);
}
-bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const
-{
- std::string const& deptype = this->GetMakefile()->GetSafeDefinition(
- cmStrCat("CMAKE_NINJA_DEPTYPE_", lang));
- if (deptype == "msvc") {
- return true;
- }
- if (deptype == "intel") {
- // Ninja does not really define "intel", but we use it to switch based
- // on whether this environment supports "gcc" or "msvc" deptype.
- if (!this->GetGlobalGenerator()->SupportsMultilineDepfile()) {
- // This ninja version is too old to support the Intel depfile format.
- // Fall back to msvc deptype.
- return true;
- }
- if ((this->Makefile->GetHomeDirectory().find(' ') != std::string::npos) ||
- (this->Makefile->GetHomeOutputDirectory().find(' ') !=
- std::string::npos)) {
- // The Intel compiler does not properly escape spaces in a depfile.
- // Fall back to msvc deptype.
- return true;
- }
- }
- return false;
-}
-
// TODO: Refactor with
// void cmMakefileTargetGenerator::WriteTargetLanguageFlags().
std::string cmNinjaTargetGenerator::ComputeDefines(cmSourceFile const* source,
@@ -548,6 +524,7 @@ cmNinjaRule GetScanRule(
scanVars.Object = "$out"; // for RULE_LAUNCH_COMPILE
scanVars.PreprocessedSource = "$out";
scanVars.DependencyFile = rule.DepFile.c_str();
+ scanVars.DependencyTarget = "$out";
// Scanning needs the same preprocessor settings as direct compilation would.
scanVars.Source = vars.Source;
@@ -726,10 +703,6 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
std::string cldeps;
if (!compilationPreprocesses) {
// The compiler will not do preprocessing, so it has no such dependencies.
- } else if (this->NeedDepTypeMSVC(lang)) {
- rule.DepType = "msvc";
- rule.DepFile.clear();
- flags += " /showIncludes";
} else if (mf->IsOn(cmStrCat("CMAKE_NINJA_CMCLDEPS_", lang))) {
// For the MS resource compiler we need cmcldeps, but skip dependencies
// for source-file try_compile cases because they are always fresh.
@@ -745,16 +718,23 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
"\" \"", cl, "\" ");
}
} else {
- rule.DepType = "gcc";
- rule.DepFile = "$DEP_FILE";
+ const auto& depType = this->GetMakefile()->GetSafeDefinition(
+ cmStrCat("CMAKE_", lang, "_DEPFILE_FORMAT"));
+ if (depType == "msvc"_s) {
+ rule.DepType = "msvc";
+ rule.DepFile.clear();
+ } else {
+ rule.DepType = "gcc";
+ rule.DepFile = "$DEP_FILE";
+ }
+ vars.DependencyFile = rule.DepFile.c_str();
+ vars.DependencyTarget = "$out";
+
const std::string flagsName = cmStrCat("CMAKE_DEPFILE_FLAGS_", lang);
std::string depfileFlags = mf->GetSafeDefinition(flagsName);
if (!depfileFlags.empty()) {
- cmSystemTools::ReplaceString(depfileFlags, "<DEPFILE>", "$DEP_FILE");
- cmSystemTools::ReplaceString(depfileFlags, "<OBJECT>", "$out");
- cmSystemTools::ReplaceString(
- depfileFlags, "<CMAKE_C_COMPILER>",
- cmToCStr(mf->GetDefinition("CMAKE_C_COMPILER")));
+ rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(),
+ depfileFlags, vars);
flags += cmStrCat(' ', depfileFlags);
}
}
@@ -874,6 +854,14 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang,
compileCmds.front().insert(0, cldeps);
}
+ const auto& extraCommands = this->GetMakefile()->GetSafeDefinition(
+ cmStrCat("CMAKE_", lang, "_DEPENDS_EXTRA_COMMANDS"));
+ if (!extraCommands.empty()) {
+ auto commandList = cmExpandedList(extraCommands);
+ compileCmds.insert(compileCmds.end(), commandList.cbegin(),
+ commandList.cend());
+ }
+
for (std::string& i : compileCmds) {
i = cmStrCat(launcher, i);
rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(), i,
@@ -1160,7 +1148,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
vars["DEFINES"] = this->ComputeDefines(source, language, config);
vars["INCLUDES"] = this->ComputeIncludes(source, language, config);
- if (!this->NeedDepTypeMSVC(language)) {
+ if (this->GetMakefile()->GetSafeDefinition(
+ cmStrCat("CMAKE_", language, "_DEPFILE_FORMAT")) != "msvc"_s) {
bool replaceExt(false);
if (!language.empty()) {
std::string repVar =
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 4ba37ad..83a4342 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -42,8 +42,6 @@ public:
std::string GetTargetName() const;
- bool NeedDepTypeMSVC(const std::string& lang) const;
-
protected:
bool SetMsvcTargetPdbVariable(cmNinjaVars&, const std::string& config) const;
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 30cd4b7..646e226 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -348,7 +348,11 @@ class cmMakefile;
20, 0, cmPolicies::WARN) \
SELECT(POLICY, CMP0117, \
"MSVC RTTI flag /GR is not added to CMAKE_CXX_FLAGS by default.", 3, \
- 20, 0, cmPolicies::WARN)
+ 20, 0, cmPolicies::WARN) \
+ SELECT( \
+ POLICY, CMP0118, \
+ "The GENERATED source file property is now visible in all directories.", \
+ 3, 20, 0, cmPolicies::WARN)
#define CM_SELECT_ID(F, A1, A2, A3, A4, A5, A6) F(A1)
#define CM_FOR_EACH_POLICY_ID(POLICY) \
diff --git a/Source/cmQtAutoGenInitializer.cxx b/Source/cmQtAutoGenInitializer.cxx
index f2696a6..f27b788 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -1624,7 +1624,7 @@ cmSourceFile* cmQtAutoGenInitializer::RegisterGeneratedSource(
std::string const& filename)
{
cmSourceFile* gFile = this->Makefile->GetOrCreateSource(filename, true);
- gFile->SetProperty("GENERATED", "1");
+ gFile->MarkAsGenerated();
gFile->SetProperty("SKIP_AUTOGEN", "1");
return gFile;
}
diff --git a/Source/cmRulePlaceholderExpander.cxx b/Source/cmRulePlaceholderExpander.cxx
index f5f9c67..5363fef 100644
--- a/Source/cmRulePlaceholderExpander.cxx
+++ b/Source/cmRulePlaceholderExpander.cxx
@@ -3,7 +3,6 @@
#include "cmRulePlaceholderExpander.h"
#include <cctype>
-#include <cstring>
#include <utility>
#include "cmOutputConverter.h"
@@ -20,11 +19,6 @@ cmRulePlaceholderExpander::cmRulePlaceholderExpander(
{
}
-cmRulePlaceholderExpander::RuleVariables::RuleVariables()
-{
- memset(this, 0, sizeof(*this));
-}
-
std::string cmRulePlaceholderExpander::ExpandRuleVariable(
cmOutputConverter* outputConverter, std::string const& variable,
const RuleVariables& replaceValues)
@@ -141,6 +135,11 @@ std::string cmRulePlaceholderExpander::ExpandRuleVariable(
return replaceValues.DependencyFile;
}
}
+ if (replaceValues.DependencyTarget) {
+ if (variable == "DEP_TARGET") {
+ return replaceValues.DependencyTarget;
+ }
+ }
if (replaceValues.Fatbinary) {
if (variable == "FATBINARY") {
return replaceValues.Fatbinary;
diff --git a/Source/cmRulePlaceholderExpander.h b/Source/cmRulePlaceholderExpander.h
index c8d107d..710f8a6 100644
--- a/Source/cmRulePlaceholderExpander.h
+++ b/Source/cmRulePlaceholderExpander.h
@@ -27,45 +27,45 @@ public:
// ExpandRuleVariables
struct RuleVariables
{
- RuleVariables();
- const char* CMTargetName;
- const char* CMTargetType;
- const char* TargetPDB;
- const char* TargetCompilePDB;
- const char* TargetVersionMajor;
- const char* TargetVersionMinor;
- const char* Language;
- const char* AIXExports;
- const char* Objects;
- const char* Target;
- const char* LinkLibraries;
- const char* Source;
- const char* AssemblySource;
- const char* PreprocessedSource;
- const char* Output;
- const char* Object;
- const char* ObjectDir;
- const char* ObjectFileDir;
- const char* Flags;
- const char* ObjectsQuoted;
- const char* SONameFlag;
- const char* TargetSOName;
- const char* TargetInstallNameDir;
- const char* LinkFlags;
- const char* Manifests;
- const char* LanguageCompileFlags;
- const char* Defines;
- const char* Includes;
- const char* DependencyFile;
- const char* FilterPrefix;
- const char* SwiftLibraryName;
- const char* SwiftModule;
- const char* SwiftModuleName;
- const char* SwiftOutputFileMap;
- const char* SwiftSources;
- const char* ISPCHeader;
- const char* Fatbinary;
- const char* RegisterFile;
+ const char* CMTargetName = nullptr;
+ const char* CMTargetType = nullptr;
+ const char* TargetPDB = nullptr;
+ const char* TargetCompilePDB = nullptr;
+ const char* TargetVersionMajor = nullptr;
+ const char* TargetVersionMinor = nullptr;
+ const char* Language = nullptr;
+ const char* AIXExports = nullptr;
+ const char* Objects = nullptr;
+ const char* Target = nullptr;
+ const char* LinkLibraries = nullptr;
+ const char* Source = nullptr;
+ const char* AssemblySource = nullptr;
+ const char* PreprocessedSource = nullptr;
+ const char* Output = nullptr;
+ const char* Object = nullptr;
+ const char* ObjectDir = nullptr;
+ const char* ObjectFileDir = nullptr;
+ const char* Flags = nullptr;
+ const char* ObjectsQuoted = nullptr;
+ const char* SONameFlag = nullptr;
+ const char* TargetSOName = nullptr;
+ const char* TargetInstallNameDir = nullptr;
+ const char* LinkFlags = nullptr;
+ const char* Manifests = nullptr;
+ const char* LanguageCompileFlags = nullptr;
+ const char* Defines = nullptr;
+ const char* Includes = nullptr;
+ const char* DependencyFile = nullptr;
+ const char* DependencyTarget = nullptr;
+ const char* FilterPrefix = nullptr;
+ const char* SwiftLibraryName = nullptr;
+ const char* SwiftModule = nullptr;
+ const char* SwiftModuleName = nullptr;
+ const char* SwiftOutputFileMap = nullptr;
+ const char* SwiftSources = nullptr;
+ const char* ISPCHeader = nullptr;
+ const char* Fatbinary = nullptr;
+ const char* RegisterFile = nullptr;
};
// Expand rule variables in CMake of the type found in language rules
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index df6a38a..970564d 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -10,9 +10,12 @@
#include "cmGlobalGenerator.h"
#include "cmInstalledFile.h"
#include "cmMakefile.h"
+#include "cmMessageType.h"
+#include "cmPolicies.h"
#include "cmProperty.h"
#include "cmRange.h"
#include "cmSourceFile.h"
+#include "cmSourceFileLocation.h"
#include "cmState.h"
#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
@@ -157,7 +160,7 @@ bool HandleSourceFileDirectoryScopeValidation(
return true;
}
-bool HandleAndValidateSourceFileDirectortoryScopes(
+bool HandleAndValidateSourceFileDirectoryScopes(
cmExecutionStatus& status, bool source_file_directory_option_enabled,
bool source_file_target_option_enabled,
std::vector<std::string>& source_file_directories,
@@ -216,8 +219,92 @@ void MakeSourceFilePathsAbsoluteIfNeeded(
source_files_absolute_paths.push_back(absolute_file_path);
}
}
+
+bool HandleAndValidateSourceFilePropertyGENERATED(
+ cmSourceFile* sf, std::string const& propertyValue, PropertyOp op)
+{
+ auto& mf = *sf->GetLocation().GetMakefile();
+ auto policyStatus = mf.GetPolicyStatus(cmPolicies::CMP0118);
+
+ const bool policyWARN = policyStatus == cmPolicies::WARN;
+ const bool policyNEW = policyStatus != cmPolicies::OLD && !policyWARN;
+
+ if (policyWARN) {
+ if (!cmIsOn(propertyValue) && !cmIsOff(propertyValue)) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0118),
+ "\nAttempt to set property 'GENERATED' with the following "
+ "non-boolean value (which will be interpreted as \"0\"):\n",
+ propertyValue,
+ "\nThat exact value will not be retrievable. A value of "
+ "\"0\" will be returned instead.\n"
+ "This will be an error under policy CMP0118.\n"));
+ }
+ if (cmIsOff(propertyValue)) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0118),
+ "\nUnsetting property 'GENERATED' will not be allowed under "
+ "policy CMP0118!\n"));
+ }
+ if (op == PropertyOp::Append || op == PropertyOp::AppendAsString) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_WARNING,
+ cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0118),
+ "\nAppending to property 'GENERATED' will not be allowed "
+ "under policy CMP0118!\n"));
+ }
+ } else if (policyNEW) {
+ if (!cmIsOn(propertyValue) && !cmIsOff(propertyValue)) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_ERROR,
+ cmStrCat(
+ "Policy CMP0118 is set to NEW and the following non-boolean value "
+ "given for property 'GENERATED' is therefore not allowed:\n",
+ propertyValue, "\nReplace it with a boolean value!\n"));
+ return true;
+ }
+ if (cmIsOff(propertyValue)) {
+ mf.IssueMessage(
+ MessageType::AUTHOR_ERROR,
+ "Unsetting the 'GENERATED' property is not allowed under CMP0118!\n");
+ return true;
+ }
+ if (op == PropertyOp::Append || op == PropertyOp::AppendAsString) {
+ mf.IssueMessage(MessageType::AUTHOR_ERROR,
+ "Policy CMP0118 is set to NEW and appending to the "
+ "'GENERATED' property is therefore not allowed. Only "
+ "setting it to \"1\" is allowed!\n");
+ return true;
+ }
+ }
+
+ // Set property.
+ if (!policyNEW) {
+ // Do it the traditional way.
+ switch (op) {
+ case PropertyOp::Append:
+ sf->AppendProperty("GENERATED", propertyValue, false);
+ break;
+ case PropertyOp::AppendAsString:
+ sf->AppendProperty("GENERATED", propertyValue, true);
+ break;
+ case PropertyOp::Remove:
+ sf->SetProperty("GENERATED", nullptr);
+ break;
+ case PropertyOp::Set:
+ sf->SetProperty("GENERATED", propertyValue.c_str());
+ break;
+ }
+ } else {
+ sf->MarkAsGenerated();
+ }
+ return true;
}
+} // END: namespace SetPropertyCommand
+
bool cmSetPropertyCommand(std::vector<std::string> const& args,
cmExecutionStatus& status)
{
@@ -324,7 +411,7 @@ bool cmSetPropertyCommand(std::vector<std::string> const& args,
std::vector<cmMakefile*> source_file_directory_makefiles;
bool file_scopes_handled =
- SetPropertyCommand::HandleAndValidateSourceFileDirectortoryScopes(
+ SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
status, source_file_directory_option_enabled,
source_file_target_option_enabled, source_file_directories,
source_file_target_directories, source_file_directory_makefiles);
@@ -367,7 +454,7 @@ bool cmSetPropertyCommand(std::vector<std::string> const& args,
return true;
}
-namespace {
+namespace /* anonymous */ {
bool HandleGlobalMode(cmExecutionStatus& status,
const std::set<std::string>& names,
const std::string& propertyName,
@@ -525,6 +612,18 @@ bool HandleSource(cmSourceFile* sf, const std::string& propertyName,
const std::string& propertyValue, bool appendAsString,
bool appendMode, bool remove)
{
+ // Special validation and handling of GENERATED flag?
+ if (propertyName == "GENERATED") {
+ SetPropertyCommand::PropertyOp op = (remove)
+ ? SetPropertyCommand::PropertyOp::Remove
+ : (appendAsString)
+ ? SetPropertyCommand::PropertyOp::AppendAsString
+ : (appendMode) ? SetPropertyCommand::PropertyOp::Append
+ : SetPropertyCommand::PropertyOp::Set;
+ return SetPropertyCommand::HandleAndValidateSourceFilePropertyGENERATED(
+ sf, propertyValue, op);
+ }
+
// Set or append the property.
if (appendMode) {
sf->AppendProperty(propertyName, propertyValue, appendAsString);
diff --git a/Source/cmSetPropertyCommand.h b/Source/cmSetPropertyCommand.h
index 89fdd9a..05c4873 100644
--- a/Source/cmSetPropertyCommand.h
+++ b/Source/cmSetPropertyCommand.h
@@ -9,6 +9,7 @@
class cmMakefile;
class cmExecutionStatus;
+class cmSourceFile;
bool cmSetPropertyCommand(std::vector<std::string> const& args,
cmExecutionStatus& status);
@@ -25,7 +26,7 @@ bool HandleSourceFileDirectoryScopeValidation(
std::vector<std::string>& source_file_directories,
std::vector<std::string>& source_file_target_directories);
-bool HandleAndValidateSourceFileDirectortoryScopes(
+bool HandleAndValidateSourceFileDirectoryScopes(
cmExecutionStatus& status, bool source_directories_option_encountered,
bool source_target_directories_option_encountered,
std::vector<std::string>& source_directories,
@@ -39,4 +40,16 @@ void MakeSourceFilePathsAbsoluteIfNeeded(
std::vector<std::string>& source_files_absolute_paths,
std::vector<std::string>::const_iterator files_it_begin,
std::vector<std::string>::const_iterator files_it_end, bool needed);
+
+enum class PropertyOp
+{
+ Remove,
+ Set,
+ Append,
+ AppendAsString
+};
+
+bool HandleAndValidateSourceFilePropertyGENERATED(
+ cmSourceFile* sf, std::string const& propertyValue,
+ PropertyOp op = PropertyOp::Set);
}
diff --git a/Source/cmSetSourceFilesPropertiesCommand.cxx b/Source/cmSetSourceFilesPropertiesCommand.cxx
index c1b0c28..742aa96 100644
--- a/Source/cmSetSourceFilesPropertiesCommand.cxx
+++ b/Source/cmSetSourceFilesPropertiesCommand.cxx
@@ -7,6 +7,7 @@
#include <cm/string_view>
#include <cmext/algorithm>
+#include <cmext/string_view>
#include "cmExecutionStatus.h"
#include "cmMakefile.h"
@@ -82,7 +83,7 @@ bool cmSetSourceFilesPropertiesCommand(std::vector<std::string> const& args,
const auto props_begin = options_it;
bool file_scopes_handled =
- SetPropertyCommand::HandleAndValidateSourceFileDirectortoryScopes(
+ SetPropertyCommand::HandleAndValidateSourceFileDirectoryScopes(
status, source_file_directory_option_enabled,
source_file_target_option_enabled, source_file_directories,
source_file_target_directories, source_file_directory_makefiles);
@@ -167,7 +168,13 @@ static bool RunCommandForScope(
if (cmSourceFile* sf = mf->GetOrCreateSource(sfname)) {
// loop through the props and set them
for (auto k = propertyPairs.begin(); k != propertyPairs.end(); k += 2) {
- sf->SetProperty(*k, (k + 1)->c_str());
+ // Special handling for GENERATED property?
+ if (*k == "GENERATED"_s) {
+ SetPropertyCommand::HandleAndValidateSourceFilePropertyGENERATED(
+ sf, *(k + 1));
+ } else {
+ sf->SetProperty(*k, (k + 1)->c_str());
+ }
}
}
}
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 39074a5..9d9a7c3 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -16,9 +16,12 @@
#include "cmake.h"
cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name,
- cmSourceFileLocationKind kind)
- : Location(mf, name, kind)
+ bool generated, cmSourceFileLocationKind kind)
+ : Location(mf, name, (!generated) ? kind : cmSourceFileLocationKind::Known)
{
+ if (generated) {
+ this->MarkAsGenerated();
+ }
}
std::string const& cmSourceFile::GetExtension() const
@@ -26,6 +29,8 @@ std::string const& cmSourceFile::GetExtension() const
return this->Extension;
}
+const std::string propTRUE = "1";
+const std::string propFALSE = "0";
const std::string cmSourceFile::propLANGUAGE = "LANGUAGE";
const std::string cmSourceFile::propLOCATION = "LOCATION";
const std::string cmSourceFile::propGENERATED = "GENERATED";
@@ -55,16 +60,14 @@ std::string const& cmSourceFile::GetOrDetermineLanguage()
}
// Perform computation needed to get the language if necessary.
- if (this->FullPath.empty() && this->Language.empty()) {
- // If a known extension is given or a known full path is given
- // then trust that the current extension is sufficient to
- // determine the language. This will fail only if the user
- // specifies a full path to the source but leaves off the
- // extension, which is kind of weird.
- if (this->Location.ExtensionIsAmbiguous() &&
+ if (this->Language.empty()) {
+ // If a known extension is given or a known full path is given then trust
+ // that the current extension is sufficient to determine the language. This
+ // will fail only if the user specifies a full path to the source but
+ // leaves off the extension, which is kind of weird.
+ if (this->FullPath.empty() && this->Location.ExtensionIsAmbiguous() &&
this->Location.DirectoryIsAmbiguous()) {
- // Finalize the file location to get the extension and set the
- // language.
+ // Finalize the file location to get the extension and set the language.
this->ResolveFullPath();
} else {
// Use the known extension to get the language if possible.
@@ -114,11 +117,14 @@ bool cmSourceFile::FindFullPath(std::string* error,
std::string* cmp0115Warning)
{
// If the file is generated compute the location without checking on disk.
- if (this->GetIsGenerated()) {
+ // Note: We also check for a locally set GENERATED property, because
+ // it might have been set before policy CMP0118 was set to NEW.
+ if (this->GetIsGenerated(CheckScope::GlobalAndLocal)) {
// The file is either already a full path or is relative to the
// build directory for the target.
this->Location.DirectoryUseBinary();
this->FullPath = this->Location.GetFullPath();
+ this->FindFullPathFailed = false;
return true;
}
@@ -275,11 +281,6 @@ void cmSourceFile::SetProperty(const std::string& prop, const char* value)
} else {
this->Properties.SetProperty(prop, value);
}
-
- // Update IsGenerated flag
- if (prop == propGENERATED) {
- this->IsGenerated = cmIsOn(value);
- }
}
void cmSourceFile::AppendProperty(const std::string& prop,
@@ -303,11 +304,6 @@ void cmSourceFile::AppendProperty(const std::string& prop,
} else {
this->Properties.AppendProperty(prop, value, asString);
}
-
- // Update IsGenerated flag
- if (prop == propGENERATED) {
- this->IsGenerated = this->GetPropertyAsBool(propGENERATED);
- }
}
cmProp cmSourceFile::GetPropertyForUser(const std::string& prop)
@@ -338,6 +334,21 @@ cmProp cmSourceFile::GetPropertyForUser(const std::string& prop)
return &this->GetOrDetermineLanguage();
}
+ // Special handling for GENERATED property.
+ if (prop == propGENERATED) {
+ // We need to check policy CMP0118 in order to determine if we need to
+ // possibly consider the value of a locally set GENERATED property, too.
+ auto policyStatus =
+ this->Location.GetMakefile()->GetPolicyStatus(cmPolicies::CMP0118);
+ if (this->GetIsGenerated(
+ (policyStatus == cmPolicies::WARN || policyStatus == cmPolicies::OLD)
+ ? CheckScope::GlobalAndLocal
+ : CheckScope::Global)) {
+ return &propTRUE;
+ }
+ return &propFALSE;
+ }
+
// Perform the normal property lookup.
return this->GetProperty(prop);
}
@@ -413,11 +424,29 @@ bool cmSourceFile::GetPropertyAsBool(const std::string& prop) const
return cmIsOn(this->GetProperty(prop));
}
+void cmSourceFile::MarkAsGenerated()
+{
+ this->IsGenerated = true;
+ auto& mf = *this->Location.GetMakefile();
+ mf.GetGlobalGenerator()->MarkAsGeneratedFile(this->ResolveFullPath());
+}
+
+bool cmSourceFile::GetIsGenerated(CheckScope checkScope) const
+{
+ if (this->IsGenerated) {
+ // Globally marked as generated!
+ return true;
+ }
+ if (checkScope == CheckScope::GlobalAndLocal) {
+ // Check locally stored properties.
+ return this->GetPropertyAsBool(propGENERATED);
+ }
+ return false;
+}
+
void cmSourceFile::SetProperties(cmPropertyMap properties)
{
this->Properties = std::move(properties);
-
- this->IsGenerated = this->GetPropertyAsBool(propGENERATED);
}
cmCustomCommand* cmSourceFile::GetCustomCommand() const
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 3ad2664..94b5cc8 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -20,18 +20,18 @@ class cmMakefile;
/** \class cmSourceFile
* \brief Represent a class loaded from a makefile.
*
- * cmSourceFile is represents a class loaded from
- * a makefile.
+ * cmSourceFile represents a class loaded from a makefile.
*/
class cmSourceFile
{
public:
/**
- * Construct with the makefile storing the source and the initial
- * name referencing it.
+ * Construct with the makefile storing the source and the initial name
+ * referencing it. If it shall be marked as generated, this source file's
+ * kind is assumed to be known, regardless of the given value.
*/
cmSourceFile(
- cmMakefile* mf, const std::string& name,
+ cmMakefile* mf, const std::string& name, bool generated,
cmSourceFileLocationKind kind = cmSourceFileLocationKind::Ambiguous);
/**
@@ -54,9 +54,29 @@ public:
command like get_property or get_source_file_property. */
cmProp GetPropertyForUser(const std::string& prop);
- //! Checks is the GENERATED property is set and true
- /// @return Equivalent to GetPropertyAsBool("GENERATED")
- bool GetIsGenerated() const { return this->IsGenerated; }
+ /// Marks this file as generated
+ /**
+ * This stores this file's path in the global table for all generated source
+ * files.
+ */
+ void MarkAsGenerated();
+ enum class CheckScope
+ {
+ Global,
+ GlobalAndLocal
+ };
+ /// Determines if this source file is marked as generated.
+ /**
+ * This will check if this file's path is stored in the global table of all
+ * generated source files. If that is not the case and checkScope is set to
+ * GlobalAndLocal the value of the possibly existing local GENERATED property
+ * is returned instead.
+ * @param checkScope Determines if alternatively for backwards-compatibility
+ * a local GENERATED property should be considered, too.
+ * @return true if this source file is marked as generated, otherwise false.
+ */
+ bool GetIsGenerated(
+ CheckScope checkScope = CheckScope::GlobalAndLocal) const;
const std::vector<BT<std::string>>& GetCompileOptions() const
{
diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h
index cb4d8da..1e38d84 100644
--- a/Source/cmTargetExport.h
+++ b/Source/cmTargetExport.h
@@ -31,4 +31,6 @@ public:
cmInstallFilesGenerator* HeaderGenerator;
std::string InterfaceIncludeDirectories;
///@}
+
+ bool NamelinkOnly = false;
};
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index 78d4727..ab7f99e 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -81,6 +81,13 @@ public:
void SetObject(cmXCodeObject* value) { this->Object = value; }
cmXCodeObject* GetObject() { return this->Object; }
void AddObject(cmXCodeObject* value) { this->List.push_back(value); }
+ size_t GetObjectCount() { return this->List.size(); }
+ void InsertObject(size_t position, cmXCodeObject* value)
+ {
+ if (position < GetObjectCount()) {
+ this->List.insert(this->List.begin() + position, value);
+ }
+ }
void PrependObject(cmXCodeObject* value)
{
this->List.insert(this->List.begin(), value);
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 5524d4e..cfd724b 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -846,6 +846,8 @@ void cmake::SetArgs(const std::vector<std::string>& args)
bool haveToolset = false;
bool havePlatform = false;
bool haveBArg = false;
+ bool scriptMode = false;
+ std::string possibleUnknownArg;
#if !defined(CMAKE_BOOTSTRAP)
std::string profilingFormat;
std::string profilingOutput;
@@ -898,7 +900,11 @@ void cmake::SetArgs(const std::vector<std::string>& args)
CommandArgument{ "-B", "No build directory specified for -B",
CommandArgument::Values::One, BuildArgLambda },
CommandArgument{ "-P", "-P must be followed by a file name.",
- CommandArgument::Values::One, IgnoreAndTrueLambda },
+ CommandArgument::Values::One,
+ [&](std::string const&, cmake*) -> bool {
+ scriptMode = true;
+ return true;
+ } },
CommandArgument{ "-D", "-D must be followed with VAR=VALUE.",
CommandArgument::Values::One, IgnoreAndTrueLambda },
CommandArgument{ "-C", "-C must be followed by a file name.",
@@ -1145,14 +1151,28 @@ void cmake::SetArgs(const std::vector<std::string>& args)
break;
}
}
+
+ // We have an issue where arguments to a "-P" script mode
+ // can be provided before the "-P" argument. This means
+ // that we need to lazily check this argument after checking
+ // all args.
+ // Additionally it can't be the source/binary tree location
if (!parsedCorrectly) {
cmSystemTools::Error("Run 'cmake --help' for all supported options.");
exit(1);
+ } else if (!matched && cmHasLiteralPrefix(arg, "-")) {
+ possibleUnknownArg = arg;
} else if (!matched) {
this->SetDirectoriesFromFile(arg);
}
}
+ if (!possibleUnknownArg.empty() && !scriptMode) {
+ cmSystemTools::Error(cmStrCat("Unknown argument ", possibleUnknownArg));
+ cmSystemTools::Error("Run 'cmake --help' for all supported options.");
+ exit(1);
+ }
+
// Empty instance, platform and toolset if only a generator is specified
if (this->GlobalGenerator) {
this->GeneratorInstance = "";
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 81374a1..b8464f2 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -33,6 +33,13 @@
# include "bindexplib.h"
#endif
+#if !defined(CMAKE_BOOTSTRAP) || defined(CMAKE_BOOTSTRAP_MAKEFILES)
+# include <algorithm>
+
+# include "cmCMakePath.h"
+# include "cmProcessTools.h"
+#endif
+
#if !defined(CMAKE_BOOTSTRAP) && defined(_WIN32) && !defined(__CYGWIN__)
# include "cmVisualStudioWCEPlatformParser.h"
#endif
@@ -66,6 +73,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg,
int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
std::vector<std::string>::const_iterator argEnd);
+namespace {
void CMakeCommandUsage(const char* program)
{
std::ostringstream errorStream;
@@ -144,8 +152,7 @@ void CMakeCommandUsage(const char* program)
cmSystemTools::Error(errorStream.str());
}
-static bool cmTarFilesFrom(std::string const& file,
- std::vector<std::string>& files)
+bool cmTarFilesFrom(std::string const& file, std::vector<std::string>& files)
{
if (cmSystemTools::FileIsDirectory(file)) {
std::ostringstream e;
@@ -180,7 +187,7 @@ static bool cmTarFilesFrom(std::string const& file,
return true;
}
-static void cmCatFile(const std::string& fileToAppend)
+void cmCatFile(const std::string& fileToAppend)
{
#ifdef _WIN32
_setmode(fileno(stdout), _O_BINARY);
@@ -190,7 +197,7 @@ static void cmCatFile(const std::string& fileToAppend)
std::cout << source.rdbuf();
}
-static bool cmRemoveDirectory(const std::string& dir, bool recursive = true)
+bool cmRemoveDirectory(const std::string& dir, bool recursive = true)
{
if (cmSystemTools::FileIsSymlink(dir)) {
if (!cmSystemTools::RemoveFile(dir)) {
@@ -208,9 +215,123 @@ static bool cmRemoveDirectory(const std::string& dir, bool recursive = true)
return true;
}
-static int HandleIWYU(const std::string& runCmd,
- const std::string& /* sourceFile */,
- const std::vector<std::string>& orig_cmd)
+#if !defined(CMAKE_BOOTSTRAP) || defined(CMAKE_BOOTSTRAP_MAKEFILES)
+class CLIncludeParser : public cmProcessTools::LineParser
+{
+public:
+ CLIncludeParser(cm::string_view includePrefix, cmsys::ofstream& depFile,
+ std::ostream& output)
+ : IncludePrefix(includePrefix)
+ , DepFile(depFile)
+ , Output(output)
+ {
+ }
+
+private:
+ bool ProcessLine() override
+ {
+ if (cmHasPrefix(this->Line, this->IncludePrefix)) {
+ this->DepFile << cmCMakePath(
+ cmTrimWhitespace(this->Line.c_str() +
+ this->IncludePrefix.size()))
+ .GenericString()
+ << std::endl;
+ } else {
+ this->Output << this->Line << std::endl << std::flush;
+ }
+
+ return true;
+ }
+
+ cm::string_view IncludePrefix;
+ cmsys::ofstream& DepFile;
+ std::ostream& Output;
+};
+
+class CLOutputLogger : public cmProcessTools::OutputLogger
+{
+public:
+ CLOutputLogger(std::ostream& log)
+ : cmProcessTools::OutputLogger(log)
+ {
+ }
+
+ bool ProcessLine() override
+ {
+ *this->Log << std::flush;
+ return true;
+ }
+};
+
+int CLCompileAndDependencies(const std::vector<std::string>& args)
+{
+ std::string depFile;
+ std::string currentBinaryDir;
+ std::string filterPrefix;
+ std::vector<std::string> command;
+ for (auto it = args.cbegin() + 2; it != args.cend(); it++) {
+ if (cmHasLiteralPrefix(*it, "--dep-file=")) {
+ depFile = it->substr(11);
+ } else if (cmHasLiteralPrefix(*it, "--working-dir=")) {
+ currentBinaryDir = it->substr(14);
+ } else if (cmHasLiteralPrefix(*it, "--filter-prefix=")) {
+ filterPrefix = it->substr(16);
+ } else if (*it == "--") {
+ command.insert(command.begin(), ++it, args.cend());
+ break;
+ } else {
+ return 1;
+ }
+ }
+
+ std::unique_ptr<cmsysProcess, void (*)(cmsysProcess*)> cp(
+ cmsysProcess_New(), cmsysProcess_Delete);
+ std::vector<const char*> argv(command.size() + 1);
+ std::transform(command.begin(), command.end(), argv.begin(),
+ [](std::string const& s) { return s.c_str(); });
+ argv.back() = nullptr;
+ cmsysProcess_SetCommand(cp.get(), argv.data());
+ cmsysProcess_SetWorkingDirectory(cp.get(), currentBinaryDir.c_str());
+
+ cmsys::ofstream fout(depFile.c_str());
+ if (!fout) {
+ return 3;
+ }
+
+ CLIncludeParser includeParser(filterPrefix, fout, std::cout);
+ CLOutputLogger errLogger(std::cerr);
+
+ // Start the process.
+ cmProcessTools::RunProcess(cp.get(), &includeParser, &errLogger);
+
+ int status = 0;
+ // handle status of process
+ switch (cmsysProcess_GetState(cp.get())) {
+ case cmsysProcess_State_Exited:
+ status = cmsysProcess_GetExitValue(cp.get());
+ break;
+ case cmsysProcess_State_Exception:
+ status = 1;
+ break;
+ case cmsysProcess_State_Error:
+ status = 2;
+ break;
+ default:
+ break;
+ }
+
+ if (status != 0) {
+ // remove the dependencies file because potentially invalid
+ fout.close();
+ cmSystemTools::RemoveFile(depFile);
+ }
+
+ return status;
+}
+#endif
+
+int HandleIWYU(const std::string& runCmd, const std::string& /* sourceFile */,
+ const std::vector<std::string>& orig_cmd)
{
// Construct the iwyu command line by taking what was given
// and adding all the arguments we give to the compiler.
@@ -235,8 +356,8 @@ static int HandleIWYU(const std::string& runCmd,
return 0;
}
-static int HandleTidy(const std::string& runCmd, const std::string& sourceFile,
- const std::vector<std::string>& orig_cmd)
+int HandleTidy(const std::string& runCmd, const std::string& sourceFile,
+ const std::vector<std::string>& orig_cmd)
{
// Construct the clang-tidy command line by taking what was given
// and adding our compiler command line. The clang-tidy tool will
@@ -265,9 +386,8 @@ static int HandleTidy(const std::string& runCmd, const std::string& sourceFile,
return ret;
}
-static int HandleLWYU(const std::string& runCmd,
- const std::string& /* sourceFile */,
- const std::vector<std::string>&)
+int HandleLWYU(const std::string& runCmd, const std::string& /* sourceFile */,
+ const std::vector<std::string>&)
{
// Construct the ldd -r -u (link what you use lwyu) command line
// ldd -u -r lwuy target
@@ -298,9 +418,8 @@ static int HandleLWYU(const std::string& runCmd,
return 0;
}
-static int HandleCppLint(const std::string& runCmd,
- const std::string& sourceFile,
- const std::vector<std::string>&)
+int HandleCppLint(const std::string& runCmd, const std::string& sourceFile,
+ const std::vector<std::string>&)
{
// Construct the cpplint command line.
std::vector<std::string> cpplint_cmd = cmExpandedList(runCmd, true);
@@ -326,9 +445,8 @@ static int HandleCppLint(const std::string& runCmd,
return 0;
}
-static int HandleCppCheck(const std::string& runCmd,
- const std::string& sourceFile,
- const std::vector<std::string>& orig_cmd)
+int HandleCppCheck(const std::string& runCmd, const std::string& sourceFile,
+ const std::vector<std::string>& orig_cmd)
{
// Construct the cpplint command line.
std::vector<std::string> cppcheck_cmd = cmExpandedList(runCmd, true);
@@ -391,7 +509,7 @@ struct CoCompiler
bool NoOriginalCommand;
};
-static const std::array<CoCompiler, 5> CoCompilers = {
+const std::array<CoCompiler, 5> CoCompilers = {
{ // Table of options and handlers.
{ "--cppcheck=", HandleCppCheck, false },
{ "--cpplint=", HandleCppLint, false },
@@ -405,6 +523,7 @@ struct CoCompileJob
std::string Command;
CoCompileHandler Handler;
};
+}
// called when args[0] == "__run_co_compile"
int cmcmd::HandleCoCompileCommands(std::vector<std::string> const& args)
@@ -586,7 +705,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
} else if (args[2] == "--ignore-eol") {
filesDiffer = cmsys::SystemTools::TextFilesDiffer(args[3], args[4]);
} else {
- ::CMakeCommandUsage(args[0].c_str());
+ CMakeCommandUsage(args[0].c_str());
return 2;
}
@@ -621,8 +740,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
}
}
if (outValid) {
- // The def file already exists and all input files are older than the
- // existing def file.
+ // The def file already exists and all input files are older than
+ // the existing def file.
return 0;
}
}
@@ -1162,6 +1281,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
return 1;
}
+#if !defined(CMAKE_BOOTSTRAP) || defined(CMAKE_BOOTSTRAP_MAKEFILES)
+ // Internal CMake compiler dependencies filtering
+ if (args[1] == "cmake_cl_compile_depends") {
+ return CLCompileAndDependencies(args);
+ }
+#endif
+
// Internal CMake link script support.
if (args[1] == "cmake_link_script" && args.size() >= 3) {
return cmcmd::ExecuteLinkScript(args);
@@ -1412,7 +1538,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args,
}
}
- ::CMakeCommandUsage(args[0].c_str());
+ CMakeCommandUsage(args[0].c_str());
return 1;
}
@@ -1779,8 +1905,8 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args)
skipNextArg = false;
continue;
}
- // We use ++ as seperator between the preprocessing step definition and the
- // rc compilation step becase we need to prepend a -- to seperate the
+ // We use ++ as seperator between the preprocessing step definition and
+ // the rc compilation step becase we need to prepend a -- to seperate the
// source file properly from other options when using clang-cl for
// preprocessing.
if (arg == "++") {
@@ -1830,7 +1956,8 @@ int cmcmd::RunLLVMRC(std::vector<std::string> const& args)
return 1;
}
// Since we might have skipped the last argument to llvm-rc
- // we need to make sure the llvm-rc source file is present in the commandline
+ // we need to make sure the llvm-rc source file is present in the
+ // commandline
if (resource_compile.back() != intermediate_file) {
resource_compile.push_back(intermediate_file);
}
@@ -2123,8 +2250,8 @@ int cmVSLink::LinkIncremental()
// http://blogs.msdn.com/zakramer/archive/2006/05/22/603558.aspx
// 1. Compiler compiles the application and generates the *.obj files.
- // 2. An empty manifest file is generated if this is a clean build and if
- // not the previous one is reused.
+ // 2. An empty manifest file is generated if this is a clean build and
+ // if not the previous one is reused.
// 3. The resource compiler (rc.exe) compiles the *.manifest file to a
// *.res file.
// 4. Linker generates the binary (EXE or DLL) with the /incremental
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index c438e1d..c2576f3 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -102,6 +102,12 @@ target_link_libraries(zot zot_pch)
if(NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
target_precompile_headers(zot_pch PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/zot_pch.hxx)
endif()
+if (CMAKE_CXX_DEPENDS_USE_COMPILER AND
+ CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.4")
+ # Mixing pre-compile headers and flags to generate dependencies (-M options family)
+ # causes the compiler to crash
+ set_property(TARGET zot_pch PROPERTY DISABLE_PRECOMPILE_HEADERS ON)
+endif()
# Test the #include line macro transformation rule support.
set_property(
diff --git a/Tests/CudaOnly/CompileFlags/CMakeLists.txt b/Tests/CudaOnly/CompileFlags/CMakeLists.txt
index 5e8a8e4..38765ec 100644
--- a/Tests/CudaOnly/CompileFlags/CMakeLists.txt
+++ b/Tests/CudaOnly/CompileFlags/CMakeLists.txt
@@ -8,6 +8,7 @@ if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
target_compile_options(CudaOnlyCompileFlags PRIVATE
-gencode arch=compute_50,code=compute_50
)
+ set_property(TARGET CudaOnlyCompileFlags PROPERTY CUDA_ARCHITECTURES)
else()
set_property(TARGET CudaOnlyCompileFlags PROPERTY CUDA_ARCHITECTURES 50-real)
endif()
diff --git a/Tests/CudaOnly/ExportPTX/CMakeLists.txt b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
index ee5f54d..e7e7bc4 100644
--- a/Tests/CudaOnly/ExportPTX/CMakeLists.txt
+++ b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.8)
+cmake_minimum_required(VERSION 3.19)
project (ExportPTX CUDA)
#Goal for this example:
@@ -6,6 +6,10 @@ project (ExportPTX CUDA)
# How to reference PTX files for custom commands
# How to install PTX files
+# PTX can be compiled only for a single virtual architecture at a time
+list(SUBLIST CMAKE_CUDA_ARCHITECTURES 0 1 CMAKE_CUDA_ARCHITECTURES)
+string(APPEND CMAKE_CUDA_ARCHITECTURES "-virtual")
+
add_library(CudaPTX OBJECT kernelA.cu kernelB.cu)
set_property(TARGET CudaPTX PROPERTY CUDA_PTX_COMPILATION ON)
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index 1f5b664..d4c19c7 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -67,7 +67,11 @@ else()
endif()
# Test escaping of special characters in include directory paths.
-set(special_chars "~@%&{}()!'")
+set(special_chars "~@&{}()!'")
+if(NOT CMAKE_GENERATOR MATCHES "(Unix|MinGW|MSYS) Makefiles")
+ # when compiler is used for dependencies, special characters for make are not escaped
+ string(APPEND special_chars "%")
+endif()
if(NOT CMAKE_GENERATOR STREQUAL "Watcom WMake")
# Watcom seems to have no way to encode these characters.
string(APPEND special_chars "#=[]")
diff --git a/Tests/RunCMake/BuildDepends/CompilerDependencies.cmake b/Tests/RunCMake/BuildDepends/CompilerDependencies.cmake
new file mode 100644
index 0000000..8a9e600
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CompilerDependencies.cmake
@@ -0,0 +1,46 @@
+enable_language(C)
+
+add_executable(main ${CMAKE_CURRENT_BINARY_DIR}/main.c)
+
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+set(check_pairs
+ \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.c\"
+ \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.h\"
+ )
+set(check_exes
+ \"$<TARGET_FILE:main>\"
+ )
+
+if (check_step EQUAL 2)
+ include(\"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Makefile.cmake\")
+ if (NOT CMAKE_DEPEND_INFO_FILES)
+ set(RunCMake_TEST_FAILED \"Variable CMAKE_DEPEND_INFO_FILES not found.\")
+ else()
+ include(\"${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_DEPEND_INFO_FILES}\")
+ if (NOT CMAKE_DEPENDS_DEPENDENCY_FILES)
+ set(RunCMake_TEST_FAILED \"Variable CMAKE_DEPENDS_DEPENDENCY_FILES not found.\")
+ else()
+ list(GET CMAKE_DEPENDS_DEPENDENCY_FILES 1 OBJECT_FILE)
+ list(GET CMAKE_DEPENDS_DEPENDENCY_FILES 3 DEP_FILE)
+ if (NOT EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/\${DEP_FILE}\")
+ set(RunCMake_TEST_FAILED \"File \${DEP_FILE} not found.\")
+ else()
+ set (TARGET_DEP_FILE \"${CMAKE_CURRENT_BINARY_DIR}/\${DEP_FILE}\")
+ cmake_path(REPLACE_FILENAME TARGET_DEP_FILE \"compiler_depend.make\")
+ file(READ \"\${TARGET_DEP_FILE}\" DEPENDS_CONTENT)
+ if (WIN32)
+ string (REPLACE \"\\\\\" \"/\" DEPENDS_CONTENT \"\${DEPENDS_CONTENT}\")
+ string (TOLOWER \"\${DEPENDS_CONTENT}\" DEPENDS_CONTENT)
+ string (TOLOWER \"\${OBJECT_FILE}\" OBJECT_FILE)
+ else()
+ string(REPLACE \"\\\\ \" \" \" DEPENDS_CONTENT \"\${DEPENDS_CONTENT}\")
+ endif()
+ if(NOT DEPENDS_CONTENT MATCHES \"\${OBJECT_FILE} *:.+main.c\"
+ OR NOT DEPENDS_CONTENT MATCHES \"main.h\")
+ set(RunCMake_TEST_FAILED \"Dependency file '\${TARGET_DEP_FILE}' badly generated.\")
+ endif()
+ endif()
+ endif()
+ endif()
+endif()
+")
diff --git a/Tests/RunCMake/BuildDepends/CompilerDependencies.step1.cmake b/Tests/RunCMake/BuildDepends/CompilerDependencies.step1.cmake
new file mode 100644
index 0000000..1da2593
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CompilerDependencies.step1.cmake
@@ -0,0 +1,9 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.h" [[
+#define COUNT 1
+]])
+
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.c" [[
+#include "main.h"
+
+int main(void) { return COUNT; }
+]])
diff --git a/Tests/RunCMake/BuildDepends/CompilerDependencies.step2.cmake b/Tests/RunCMake/BuildDepends/CompilerDependencies.step2.cmake
new file mode 100644
index 0000000..e983665
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CompilerDependencies.step2.cmake
@@ -0,0 +1,3 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.h" [[
+#define COUNT 2
+]])
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 7a68c4b..23e222a 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -113,3 +113,13 @@ if(CMake_TEST_BuildDepends_GNU_AS)
set(ENV{ASM} "${CMake_TEST_BuildDepends_GNU_AS}")
run_BuildDepends(GNU-AS)
endif()
+
+if ((RunCMake_GENERATOR STREQUAL "Unix Makefiles"
+ AND (CMAKE_C_COMPILER_ID STREQUAL "GNU"
+ OR CMAKE_C_COMPILER_ID STREQUAL "Clang"
+ OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang"))
+ OR (RunCMake_GENERATOR STREQUAL "NMake Makefiles"
+ AND MSVC_VERSION GREATER 1300
+ AND CMAKE_C_COMPILER_ID STREQUAL "MSVC"))
+ run_BuildDepends(CompilerDependencies)
+endif()
diff --git a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake
index 3d8eb73..ee5ed5b 100644
--- a/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake
+++ b/Tests/RunCMake/CMP0026/LOCATION-and-TARGET_OBJECTS.cmake
@@ -1,4 +1,4 @@
-
+cmake_policy(SET CMP0118 NEW)
enable_language(CXX)
add_library(foo OBJECT empty.cpp)
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information.cmake b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
index dd2dd72..9916948 100644
--- a/Tests/RunCMake/CMP0026/clear-cached-information.cmake
+++ b/Tests/RunCMake/CMP0026/clear-cached-information.cmake
@@ -1,4 +1,4 @@
-
+cmake_policy(SET CMP0118 NEW)
enable_language(C)
cmake_policy(SET CMP0026 OLD)
diff --git a/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake b/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake
index 415eecc..6988447 100644
--- a/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake
+++ b/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake
@@ -1,3 +1,5 @@
+set(ENV{CUDAARCHS})
+
cmake_policy(SET CMP0104 OLD)
include(CMP0104-Common.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Helper.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Helper.cmake
new file mode 100644
index 0000000..b237b7f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Helper.cmake
@@ -0,0 +1,14 @@
+macro(get_and_print_GENERATED_property filename)
+ get_property(prop SOURCE "${CMAKE_CURRENT_BINARY_DIR}/${filename}" PROPERTY GENERATED)
+ message(NOTICE "${filename}: # 1a # GENERATED = `${prop}`")
+ get_source_file_property(prop "${CMAKE_CURRENT_BINARY_DIR}/${filename}" GENERATED)
+ message(NOTICE "${filename}: # 1b # GENERATED = `${prop}`")
+ get_property(prop SOURCE "${filename}" PROPERTY GENERATED)
+ message(NOTICE "${filename}: # 2a # GENERATED = `${prop}`")
+ get_source_file_property(prop "${filename}" GENERATED)
+ message(NOTICE "${filename}: # 2b # GENERATED = `${prop}`")
+ get_property(prop SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/${filename}" PROPERTY GENERATED)
+ message(NOTICE "${filename}: # 3a # GENERATED = `${prop}`")
+ get_source_file_property(prop "${CMAKE_CURRENT_SOURCE_DIR}/${filename}" GENERATED)
+ message(NOTICE "${filename}: # 3b # GENERATED = `${prop}`")
+endmacro()
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test1.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test1.cmake
new file mode 100644
index 0000000..fc4f5ec
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test1.cmake
@@ -0,0 +1,9 @@
+add_executable(executable)
+target_sources(executable PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+)
+
+get_property(prop SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+ PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test10.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test10.cmake
new file mode 100644
index 0000000..d0b2044
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test10.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test10)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test11.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test11.cmake
new file mode 100644
index 0000000..f21a7b1
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test11.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test11)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test12.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test12.cmake
new file mode 100644
index 0000000..280edca
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test12.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_command(TARGET executable0 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_command(TARGET executable1 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_command(TARGET executable2 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_command(TARGET executable3 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test12)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test13.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test13.cmake
new file mode 100644
index 0000000..e1dfa11
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test13.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_command(TARGET executable0 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_command(TARGET executable1 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_command(TARGET executable2 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_command(TARGET executable3 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test13)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test14.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test14.cmake
new file mode 100644
index 0000000..5222353
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test14.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_target(executable0_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_target(executable1_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_target(executable2_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_target(executable3_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test14)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test15.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test15.cmake
new file mode 100644
index 0000000..c2c55af
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test15.cmake
@@ -0,0 +1,65 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+# The sources of executable0 will not be modified by set_property!
+add_executable(executable0)
+target_sources(executable0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+# The sources of executable[1-6] will (tried to) be modified by set_property!
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+add_custom_target(executable0_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.cpp"
+)
+add_custom_target(executable1_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_custom_target(executable2_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_custom_target(executable3_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+
+add_subdirectory(subdir-Common-Test15)
+
+get_and_print_GENERATED_property("Generated_source0.cpp")
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake
new file mode 100644
index 0000000..feb66e3
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake
@@ -0,0 +1,12 @@
+add_executable(executable)
+target_sources(executable PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+)
+
+set_property(SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+ PROPERTY GENERATED "1")
+get_property(prop SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.cpp"
+ PROPERTY GENERATED)
+message(NOTICE "prop: `${prop}`")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
new file mode 100644
index 0000000..b12834d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "Generated_with_relative_path1.cpp"
+ "Generated_with_relative_path2.cpp"
+ "Generated_with_relative_path3.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_path2.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_source_path2.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
new file mode 100644
index 0000000..3e4a280
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_path2.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_source_path2.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "Generated_with_relative_path1.cpp"
+ "Generated_with_relative_path2.cpp"
+ "Generated_with_relative_path3.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
new file mode 100644
index 0000000..81f1254
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "Generated_with_relative_path1.cpp"
+ "Generated_with_relative_path2.cpp"
+ "Generated_with_relative_path3.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_path2.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_source_path2.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
new file mode 100644
index 0000000..439f456
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_path2.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "Generated_with_full_source_path2.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "Generated_with_relative_path1.cpp"
+ "Generated_with_relative_path2.cpp"
+ "Generated_with_relative_path3.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
new file mode 100644
index 0000000..1bf9aaa
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
@@ -0,0 +1,78 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "Generated_with_relative_path1.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "Generated_with_relative_path2.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "Generated_with_relative_path3.cpp"
+)
+add_executable(executable7)
+target_sources(executable7 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.cpp"
+)
+add_executable(executable8)
+target_sources(executable8 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+)
+add_executable(executable9)
+target_sources(executable9 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.cpp"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_full_path1.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.cpp"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_full_path2.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.cpp"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_full_path3.cpp")
+
+
+set_property(SOURCE "Generated_with_relative_path1.cpp"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_relative_path1.cpp")
+
+set_property(SOURCE "Generated_with_relative_path2.cpp"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_relative_path2.cpp")
+
+set_property(SOURCE "Generated_with_relative_path3.cpp"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_relative_path3.cpp")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.cpp"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.cpp")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.cpp"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.cpp")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.cpp"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake
new file mode 100644
index 0000000..7715e78
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake
@@ -0,0 +1,44 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ PROPERTY GENERATED "1")
+
+add_subdirectory(subdir-Common-Test6)
+
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake
new file mode 100644
index 0000000..96bb590
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake
@@ -0,0 +1,44 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ PROPERTY GENERATED "1")
+
+add_subdirectory(subdir-Common-Test7)
+
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
new file mode 100644
index 0000000..2c87b65
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
@@ -0,0 +1,50 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test8)
+
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
new file mode 100644
index 0000000..e302f5c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
@@ -0,0 +1,50 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_executable(executable1)
+target_sources(executable1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+)
+add_executable(executable2)
+target_sources(executable2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+)
+add_executable(executable3)
+target_sources(executable3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+)
+add_executable(executable4)
+target_sources(executable4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+)
+add_executable(executable5)
+target_sources(executable5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+)
+add_executable(executable6)
+target_sources(executable6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+)
+
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test9)
+
+get_and_print_GENERATED_property("Generated_source1.cpp")
+get_and_print_GENERATED_property("Generated_source2.cpp")
+get_and_print_GENERATED_property("Generated_source3.cpp")
+get_and_print_GENERATED_property("Generated_source4.cpp")
+get_and_print_GENERATED_property("Generated_source5.cpp")
+get_and_print_GENERATED_property("Generated_source6.cpp")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-stderr.txt
new file mode 100644
index 0000000..85ff65c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-stderr.txt
@@ -0,0 +1,16 @@
+^prop: `0`
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-build/GeneratedMain\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1.cmake
new file mode 100644
index 0000000..bbbee43
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test1.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt
new file mode 100644
index 0000000..024d263
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt
@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test10\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test10\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10.cmake
new file mode 100644
index 0000000..15a7178
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test10.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt
new file mode 100644
index 0000000..7e660ad
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt
@@ -0,0 +1,86 @@
+^(CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11.cmake
new file mode 100644
index 0000000..cb87a86
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test11.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-stderr.txt
new file mode 100644
index 0000000..404787c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12.cmake
new file mode 100644
index 0000000..61bf977
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test12.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-stderr.txt
new file mode 100644
index 0000000..92ac33e
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-stderr.txt
@@ -0,0 +1,64 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+(CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test13\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13.cmake
new file mode 100644
index 0000000..569e4c6
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test13.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt
new file mode 100644
index 0000000..cd14945
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt
@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test14\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test14\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14.cmake
new file mode 100644
index 0000000..e7d8d77
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test14.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt
new file mode 100644
index 0000000..6c66392
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt
@@ -0,0 +1,86 @@
+^(CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15.cmake
new file mode 100644
index 0000000..93513ae
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test15.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2.cmake
new file mode 100644
index 0000000..ee8233d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test2.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test2.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
new file mode 100644
index 0000000..4002989
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
@@ -0,0 +1,93 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[13-5]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3.cmake
new file mode 100644
index 0000000..b9533fd
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test3.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
new file mode 100644
index 0000000..21177bc
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
@@ -0,0 +1,93 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[13-5]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b.cmake
new file mode 100644
index 0000000..79631e7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test3b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-stderr.txt
new file mode 100644
index 0000000..42c19a5
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-stderr.txt
@@ -0,0 +1,173 @@
+^CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[1-5]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4.cmake
new file mode 100644
index 0000000..8a7d35a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test4.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-stderr.txt
new file mode 100644
index 0000000..58f8d89
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-stderr.txt
@@ -0,0 +1,173 @@
+^CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[1-5]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b.cmake
new file mode 100644
index 0000000..c03a39d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test4b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
new file mode 100644
index 0000000..0d26a57
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
@@ -0,0 +1,180 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is set to NEW and the following non-boolean value given for
+ property 'GENERATED' is therefore not allowed:
+
+ Junk-value
+
+ Replace it with a boolean value!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[235-9]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5.cmake
new file mode 100644
index 0000000..691f94a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test5.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt
new file mode 100644
index 0000000..c3fdd96
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test6\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test6\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6.cmake
new file mode 100644
index 0000000..09b87a5
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test6.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-stderr.txt
new file mode 100644
index 0000000..4c2a2ae
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-stderr.txt
@@ -0,0 +1,80 @@
+^(CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7.cmake
new file mode 100644
index 0000000..ceb8beb
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test7.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt
new file mode 100644
index 0000000..44f94d4
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `0`
+Generated_source1\.cpp: # 1b # GENERATED = `0`
+Generated_source1\.cpp: # 2a # GENERATED = `0`
+Generated_source1\.cpp: # 2b # GENERATED = `0`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test8\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test8\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8.cmake
new file mode 100644
index 0000000..6878b94
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test8.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-stderr.txt
new file mode 100644
index 0000000..53e1399
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-stderr.txt
@@ -0,0 +1,80 @@
+^(CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+(CMake Warning \(dev\) at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+ Unsetting the 'GENERATED' property is not allowed under CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.cpp: # 1a # GENERATED = `0`
+Generated_source1\.cpp: # 1b # GENERATED = `0`
+Generated_source1\.cpp: # 2a # GENERATED = `0`
+Generated_source1\.cpp: # 2b # GENERATED = `0`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `0`
+Generated_source2\.cpp: # 1b # GENERATED = `0`
+Generated_source2\.cpp: # 2a # GENERATED = `0`
+Generated_source2\.cpp: # 2b # GENERATED = `0`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `0`
+Generated_source3\.cpp: # 1b # GENERATED = `0`
+Generated_source3\.cpp: # 2a # GENERATED = `0`
+Generated_source3\.cpp: # 2b # GENERATED = `0`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-NEW-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9.cmake b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9.cmake
new file mode 100644
index 0000000..00b05fd
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 NEW)
+include(CMP0118-Common-Test9.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt
new file mode 100644
index 0000000..491489d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt
@@ -0,0 +1,16 @@
+^prop: `0`
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-build/GeneratedMain\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1.cmake
new file mode 100644
index 0000000..c18dd25
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test1.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt
new file mode 100644
index 0000000..12dd48f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt
@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test10\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test10\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10.cmake
new file mode 100644
index 0000000..b96973f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test10.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt
new file mode 100644
index 0000000..91db26a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt
@@ -0,0 +1,73 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11.cmake
new file mode 100644
index 0000000..d6ad7d2
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test11.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt
new file mode 100644
index 0000000..404787c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12.cmake
new file mode 100644
index 0000000..b87b03a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test12.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test12.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt
new file mode 100644
index 0000000..07f2f10
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13.cmake
new file mode 100644
index 0000000..17a135b
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test13.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test13.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt
new file mode 100644
index 0000000..395637a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt
@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test14\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test14\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14.cmake
new file mode 100644
index 0000000..0702291
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test14.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt
new file mode 100644
index 0000000..d6799b4
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt
@@ -0,0 +1,73 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15.cmake
new file mode 100644
index 0000000..c330d4e
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test15.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2.cmake
new file mode 100644
index 0000000..3ea8800
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test2.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test2.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt
new file mode 100644
index 0000000..4764494
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt
@@ -0,0 +1,93 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[13-5]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3.cmake
new file mode 100644
index 0000000..c8f5a0e
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test3.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt
new file mode 100644
index 0000000..33c4375
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt
@@ -0,0 +1,93 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[13-5]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b.cmake
new file mode 100644
index 0000000..0b046b4
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test3b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt
new file mode 100644
index 0000000..1723ece
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt
@@ -0,0 +1,101 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[1-5]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4.cmake
new file mode 100644
index 0000000..2f77397
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test4.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt
new file mode 100644
index 0000000..b7b37e9
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt
@@ -0,0 +1,101 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[1-5]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b.cmake
new file mode 100644
index 0000000..ce6726d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test4b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt
new file mode 100644
index 0000000..3ad00b7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt
@@ -0,0 +1,117 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[235-9]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5.cmake
new file mode 100644
index 0000000..2de6d89
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test5.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt
new file mode 100644
index 0000000..475c559
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test6\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test6\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6.cmake
new file mode 100644
index 0000000..b571052
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test6.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt
new file mode 100644
index 0000000..5f490ee
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt
@@ -0,0 +1,83 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `0`
+Generated_source2\.cpp: # 1b # GENERATED = `0`
+Generated_source2\.cpp: # 2a # GENERATED = `0`
+Generated_source2\.cpp: # 2b # GENERATED = `0`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `0`
+Generated_source3\.cpp: # 1b # GENERATED = `0`
+Generated_source3\.cpp: # 2a # GENERATED = `0`
+Generated_source3\.cpp: # 2b # GENERATED = `0`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[2-6]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7.cmake
new file mode 100644
index 0000000..551da23
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test7.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt
new file mode 100644
index 0000000..bd82224
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `0`
+Generated_source1\.cpp: # 1b # GENERATED = `0`
+Generated_source1\.cpp: # 2a # GENERATED = `0`
+Generated_source1\.cpp: # 2b # GENERATED = `0`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test8\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test8\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8.cmake
new file mode 100644
index 0000000..2d9e3d3
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test8.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt
new file mode 100644
index 0000000..172e4eb
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt
@@ -0,0 +1,67 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `0`
+Generated_source1\.cpp: # 1b # GENERATED = `0`
+Generated_source1\.cpp: # 2a # GENERATED = `0`
+Generated_source1\.cpp: # 2b # GENERATED = `0`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `0`
+Generated_source2\.cpp: # 1b # GENERATED = `0`
+Generated_source2\.cpp: # 2a # GENERATED = `0`
+Generated_source2\.cpp: # 2b # GENERATED = `0`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `0`
+Generated_source3\.cpp: # 1b # GENERATED = `0`
+Generated_source3\.cpp: # 2a # GENERATED = `0`
+Generated_source3\.cpp: # 2b # GENERATED = `0`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-OLD-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9.cmake b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9.cmake
new file mode 100644
index 0000000..53f73d9
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0118 OLD)
+include(CMP0118-Common-Test9.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-stderr.txt
new file mode 100644
index 0000000..bb19577
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-stderr.txt
@@ -0,0 +1,16 @@
+^prop: `0`
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-build/GeneratedMain\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test1\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1.cmake
new file mode 100644
index 0000000..3c82f8e
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test1.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-stderr.txt
new file mode 100644
index 0000000..f9ceb89
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-stderr.txt
@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test10\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test10\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10.cmake
new file mode 100644
index 0000000..c639c40
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test10.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt
new file mode 100644
index 0000000..0d4e924
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt
@@ -0,0 +1,96 @@
+^((CMake Warning \(dev\) at subdir-Common-Test11/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test11\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11.cmake
new file mode 100644
index 0000000..4c9735d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test11.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12-stderr.txt
new file mode 100644
index 0000000..404787c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12-stderr.txt
@@ -0,0 +1,51 @@
+^CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12.cmake
new file mode 100644
index 0000000..79fa00a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test12.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test12.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt
new file mode 100644
index 0000000..cb31858
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13-stderr.txt
@@ -0,0 +1,74 @@
+^CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'executable[4-6]' was not created in this directory\.
++
+((CMake Warning \(dev\) at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0118-Common-Test13\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test13\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13.cmake
new file mode 100644
index 0000000..27f71c7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test13.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test13.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-stderr.txt
new file mode 100644
index 0000000..35f858c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-stderr.txt
@@ -0,0 +1,57 @@
+^Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test14\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test14\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14.cmake
new file mode 100644
index 0000000..056f0ad
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test14.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt
new file mode 100644
index 0000000..0b0e608
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt
@@ -0,0 +1,96 @@
+^((CMake Warning \(dev\) at subdir-Common-Test15/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source0\.cpp: # 1a # GENERATED = `1`
+Generated_source0\.cpp: # 1b # GENERATED = `1`
+Generated_source0\.cpp: # 2a # GENERATED = `1`
+Generated_source0\.cpp: # 2b # GENERATED = `1`
+Generated_source0\.cpp: # 3a # GENERATED = `0`
+Generated_source0\.cpp: # 3b # GENERATED = `0`
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test15\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15.cmake
new file mode 100644
index 0000000..acc8bf6
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test15.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2-stderr.txt
new file mode 100644
index 0000000..403ce5a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2-stderr.txt
@@ -0,0 +1 @@
+^prop: `1`$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2.cmake
new file mode 100644
index 0000000..5a67974
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test2.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test2.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt
new file mode 100644
index 0000000..ca08216
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt
@@ -0,0 +1,93 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test3-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[13-5]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3.cmake
new file mode 100644
index 0000000..7cdfacb
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test3.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt
new file mode 100644
index 0000000..ee4b71e
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt
@@ -0,0 +1,93 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[13-5]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test3b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b.cmake
new file mode 100644
index 0000000..6dfc16a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test3b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt
new file mode 100644
index 0000000..5e8ecf5
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt
@@ -0,0 +1,218 @@
+^CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[1-5]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4.cmake
new file mode 100644
index 0000000..9d432a4
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test4.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt
new file mode 100644
index 0000000..7a685d1
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt
@@ -0,0 +1,218 @@
+^CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test4b\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.cpp|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[1-5]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test4b\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b.cmake
new file mode 100644
index 0000000..2e2c2bd
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test4b.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt
new file mode 100644
index 0000000..c258ba0
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt
@@ -0,0 +1,219 @@
+^Generated_with_full_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_relative_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.cpp: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path2\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.cpp: # 3b # GENERATED = `0`
+CMake Warning \(dev\) at CMP0118-Common-Test5\.cmake:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Attempt to set property 'GENERATED' with the following non-boolean value
+ \(which will be interpreted as "0"\):
+
+ Junk-value
+
+ That exact value will not be retrievable\. A value of "0" will be returned
+ instead\.
+
+ This will be an error under policy CMP0118\.
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+Generated_with_full_source_path3\.cpp: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.cpp|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.cpp)
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[235-9]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test5\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5.cmake
new file mode 100644
index 0000000..87e965e
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test5.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-stderr.txt
new file mode 100644
index 0000000..25de751
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test6\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test6\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6.cmake
new file mode 100644
index 0000000..6f1edbc
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test6.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt
new file mode 100644
index 0000000..1d9ac49
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt
@@ -0,0 +1,106 @@
+^((CMake Warning \(dev\) at subdir-Common-Test7/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.cpp: # 1a # GENERATED = `1`
+Generated_source1\.cpp: # 1b # GENERATED = `1`
+Generated_source1\.cpp: # 2a # GENERATED = `1`
+Generated_source1\.cpp: # 2b # GENERATED = `1`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `0`
+Generated_source2\.cpp: # 1b # GENERATED = `0`
+Generated_source2\.cpp: # 2a # GENERATED = `0`
+Generated_source2\.cpp: # 2b # GENERATED = `0`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `0`
+Generated_source3\.cpp: # 1b # GENERATED = `0`
+Generated_source3\.cpp: # 2a # GENERATED = `0`
+Generated_source3\.cpp: # 2b # GENERATED = `0`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[2-6]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test7\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7.cmake
new file mode 100644
index 0000000..86af20d
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test7.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-stderr.txt
new file mode 100644
index 0000000..5aaf6c6
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source1\.cpp: # 1a # GENERATED = `0`
+Generated_source1\.cpp: # 1b # GENERATED = `0`
+Generated_source1\.cpp: # 2a # GENERATED = `0`
+Generated_source1\.cpp: # 2b # GENERATED = `0`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `1`
+Generated_source2\.cpp: # 1b # GENERATED = `1`
+Generated_source2\.cpp: # 2a # GENERATED = `1`
+Generated_source2\.cpp: # 2b # GENERATED = `1`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `1`
+Generated_source3\.cpp: # 1b # GENERATED = `1`
+Generated_source3\.cpp: # 2a # GENERATED = `1`
+Generated_source3\.cpp: # 2b # GENERATED = `1`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `1`
+Generated_source5\.cpp: # 1b # GENERATED = `1`
+Generated_source5\.cpp: # 2a # GENERATED = `1`
+Generated_source5\.cpp: # 2b # GENERATED = `1`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `1`
+Generated_source6\.cpp: # 1b # GENERATED = `1`
+Generated_source6\.cpp: # 2a # GENERATED = `1`
+Generated_source6\.cpp: # 2b # GENERATED = `1`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-build/Generated_source4\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test8\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable4
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test8\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8.cmake
new file mode 100644
index 0000000..6a0bb4c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test8.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-result.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt
new file mode 100644
index 0000000..a4edec0
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt
@@ -0,0 +1,90 @@
+^((CMake Warning \(dev\) at subdir-Common-Test9/CMakeLists\.txt:[0-9]+ \(set_property\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+
+(CMake Warning \(dev\) at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_subdirectory\):
+ Policy CMP0118 is not set: The GENERATED source file property is now
+ visible in all directories\. Run "cmake --help-policy CMP0118" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+
+ Unsetting property 'GENERATED' will not be allowed under policy CMP0118!
+
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+)+
+Generated_source1\.cpp: # 1a # GENERATED = `0`
+Generated_source1\.cpp: # 1b # GENERATED = `0`
+Generated_source1\.cpp: # 2a # GENERATED = `0`
+Generated_source1\.cpp: # 2b # GENERATED = `0`
+Generated_source1\.cpp: # 3a # GENERATED = `0`
+Generated_source1\.cpp: # 3b # GENERATED = `0`
+Generated_source2\.cpp: # 1a # GENERATED = `0`
+Generated_source2\.cpp: # 1b # GENERATED = `0`
+Generated_source2\.cpp: # 2a # GENERATED = `0`
+Generated_source2\.cpp: # 2b # GENERATED = `0`
+Generated_source2\.cpp: # 3a # GENERATED = `0`
+Generated_source2\.cpp: # 3b # GENERATED = `0`
+Generated_source3\.cpp: # 1a # GENERATED = `0`
+Generated_source3\.cpp: # 1b # GENERATED = `0`
+Generated_source3\.cpp: # 2a # GENERATED = `0`
+Generated_source3\.cpp: # 2b # GENERATED = `0`
+Generated_source3\.cpp: # 3a # GENERATED = `0`
+Generated_source3\.cpp: # 3b # GENERATED = `0`
+Generated_source4\.cpp: # 1a # GENERATED = `0`
+Generated_source4\.cpp: # 1b # GENERATED = `0`
+Generated_source4\.cpp: # 2a # GENERATED = `0`
+Generated_source4\.cpp: # 2b # GENERATED = `0`
+Generated_source4\.cpp: # 3a # GENERATED = `0`
+Generated_source4\.cpp: # 3b # GENERATED = `0`
+Generated_source5\.cpp: # 1a # GENERATED = `0`
+Generated_source5\.cpp: # 1b # GENERATED = `0`
+Generated_source5\.cpp: # 2a # GENERATED = `0`
+Generated_source5\.cpp: # 2b # GENERATED = `0`
+Generated_source5\.cpp: # 3a # GENERATED = `0`
+Generated_source5\.cpp: # 3b # GENERATED = `0`
+Generated_source6\.cpp: # 1a # GENERATED = `0`
+Generated_source6\.cpp: # 1b # GENERATED = `0`
+Generated_source6\.cpp: # 2a # GENERATED = `0`
+Generated_source6\.cpp: # 2b # GENERATED = `0`
+Generated_source6\.cpp: # 3a # GENERATED = `0`
+Generated_source6\.cpp: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-build/Generated_source[4-6]\.cpp
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+(CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: executable[4-6]
+Call Stack \(most recent call first\):
+ CMP0118-WARN-Test9\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
++)+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9.cmake b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9.cmake
new file mode 100644
index 0000000..c48c64e
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9.cmake
@@ -0,0 +1 @@
+include(CMP0118-Common-Test9.cmake)
diff --git a/Tests/RunCMake/CMP0118/CMakeLists.txt b/Tests/RunCMake/CMP0118/CMakeLists.txt
new file mode 100644
index 0000000..3e06bbc
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.19)
+cmake_policy(SET CMP0115 NEW)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0118/RunCMakeTest.cmake b/Tests/RunCMake/CMP0118/RunCMakeTest.cmake
new file mode 100644
index 0000000..72064bd
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/RunCMakeTest.cmake
@@ -0,0 +1,55 @@
+include(RunCMake)
+
+run_cmake(CMP0118-OLD-Test1)
+run_cmake(CMP0118-OLD-Test2)
+run_cmake(CMP0118-OLD-Test3)
+run_cmake(CMP0118-OLD-Test3b)
+run_cmake(CMP0118-OLD-Test4)
+run_cmake(CMP0118-OLD-Test4b)
+run_cmake(CMP0118-OLD-Test5)
+run_cmake(CMP0118-OLD-Test6)
+run_cmake(CMP0118-OLD-Test7)
+run_cmake(CMP0118-OLD-Test8)
+run_cmake(CMP0118-OLD-Test9)
+run_cmake(CMP0118-OLD-Test10)
+run_cmake(CMP0118-OLD-Test11)
+run_cmake(CMP0118-OLD-Test12)
+run_cmake(CMP0118-OLD-Test13)
+run_cmake(CMP0118-OLD-Test14)
+run_cmake(CMP0118-OLD-Test15)
+
+run_cmake(CMP0118-WARN-Test1)
+run_cmake(CMP0118-WARN-Test2)
+run_cmake(CMP0118-WARN-Test3)
+run_cmake(CMP0118-WARN-Test3b)
+run_cmake(CMP0118-WARN-Test4)
+run_cmake(CMP0118-WARN-Test4b)
+run_cmake(CMP0118-WARN-Test5)
+run_cmake(CMP0118-WARN-Test6)
+run_cmake(CMP0118-WARN-Test7)
+run_cmake(CMP0118-WARN-Test8)
+run_cmake(CMP0118-WARN-Test9)
+run_cmake(CMP0118-WARN-Test10)
+run_cmake(CMP0118-WARN-Test11)
+run_cmake(CMP0118-WARN-Test12)
+run_cmake(CMP0118-WARN-Test13)
+run_cmake(CMP0118-WARN-Test14)
+run_cmake(CMP0118-WARN-Test15)
+
+run_cmake(CMP0118-NEW-Test1)
+run_cmake(CMP0118-NEW-Test2)
+run_cmake(CMP0118-NEW-Test3)
+run_cmake(CMP0118-NEW-Test3b)
+run_cmake(CMP0118-NEW-Test4)
+run_cmake(CMP0118-NEW-Test4b)
+run_cmake(CMP0118-NEW-Test5)
+run_cmake(CMP0118-NEW-Test6)
+run_cmake(CMP0118-NEW-Test7)
+run_cmake(CMP0118-NEW-Test8)
+run_cmake(CMP0118-NEW-Test9)
+run_cmake(CMP0118-NEW-Test10)
+run_cmake(CMP0118-NEW-Test11)
+run_cmake(CMP0118-NEW-Test12)
+run_cmake(CMP0118-NEW-Test13)
+run_cmake(CMP0118-NEW-Test14)
+run_cmake(CMP0118-NEW-Test15)
diff --git a/Tests/RunCMake/CMP0118/source.cpp.in b/Tests/RunCMake/CMP0118/source.cpp.in
new file mode 100644
index 0000000..678cd7a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/source.cpp.in
@@ -0,0 +1,5 @@
+int func();
+int main()
+{
+ return func();
+}
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test10/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test10/CMakeLists.txt
new file mode 100644
index 0000000..fbd42ac
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test10/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test11/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test11/CMakeLists.txt
new file mode 100644
index 0000000..fc72dd7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test11/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test12/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test12/CMakeLists.txt
new file mode 100644
index 0000000..034f69c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test12/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(TARGET executable4 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+)
+add_custom_command(TARGET executable5 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+)
+add_custom_command(TARGET executable6 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt
new file mode 100644
index 0000000..a0a0808
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(TARGET executable4 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+)
+add_custom_command(TARGET executable5 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+)
+add_custom_command(TARGET executable6 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test14/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test14/CMakeLists.txt
new file mode 100644
index 0000000..5d47115
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test14/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_target(executable4_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+)
+add_custom_target(executable5_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+)
+add_custom_target(executable6_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test15/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test15/CMakeLists.txt
new file mode 100644
index 0000000..0ad62f7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test15/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_target(executable4_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+)
+add_custom_target(executable5_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+)
+add_custom_target(executable6_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test6/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test6/CMakeLists.txt
new file mode 100644
index 0000000..d35a030
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test6/CMakeLists.txt
@@ -0,0 +1,16 @@
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test7/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test7/CMakeLists.txt
new file mode 100644
index 0000000..2f28178
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test7/CMakeLists.txt
@@ -0,0 +1,16 @@
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt
new file mode 100644
index 0000000..bcc1ebe
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt
@@ -0,0 +1,30 @@
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "1")
diff --git a/Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt b/Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt
new file mode 100644
index 0000000..a50d02a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt
@@ -0,0 +1,30 @@
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.cpp"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.cpp"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.cpp"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.cpp"
+ TARGET_DIRECTORY executable1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 5b0b055..1995e4b 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -129,6 +129,7 @@ add_RunCMake_test(CMP0115)
if(CMAKE_GENERATOR MATCHES "Ninja")
add_RunCMake_test(CMP0116)
endif()
+add_RunCMake_test(CMP0118)
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
@@ -203,7 +204,10 @@ if(NOT DEFINED CMake_TEST_BuildDepends_GNU_AS
set(CMake_TEST_BuildDepends_GNU_AS "${_gnu_as}")
endif()
endif()
+
add_RunCMake_test(BuildDepends
+ -DMSVC_VERSION=${MSVC_VERSION}
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMake_TEST_BuildDepends_GNU_AS=${CMake_TEST_BuildDepends_GNU_AS}
)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
@@ -513,6 +517,7 @@ endif()
if(XCODE_VERSION)
add_RunCMake_test(XcodeProject -DXCODE_VERSION=${XCODE_VERSION})
+ add_RunCMake_test(XcodeProject-Embed)
# This test can take a very long time due to lots of combinations.
# Use a long default timeout and provide an option to customize it.
@@ -548,10 +553,13 @@ add_RunCMake_test(target_compile_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILE
add_RunCMake_test(target_include_directories)
add_RunCMake_test(target_sources)
add_RunCMake_test(CheckCompilerFlag -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
- -DCMake_TEST_ISPC=${CMake_TEST_ISPC})
+ -DCMake_TEST_ISPC=${CMake_TEST_ISPC}
+ -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID})
add_RunCMake_test(CheckSourceCompiles -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
- -DCMake_TEST_ISPC=${CMake_TEST_ISPC})
-add_RunCMake_test(CheckSourceRuns -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
+ -DCMake_TEST_ISPC=${CMake_TEST_ISPC}
+ -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID})
+add_RunCMake_test(CheckSourceRuns -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
+ -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID})
set_property(TEST RunCMake.CheckCompilerFlag
RunCMake.CheckSourceCompiles
RunCMake.CheckSourceRuns
diff --git a/Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt b/Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt
index 97e2a10..b27da43 100644
--- a/Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt
+++ b/Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt
@@ -1,4 +1,6 @@
^CMake Error at CTestTestfile.cmake:[0-9]+ \(subdirs\):
subdirs called with incorrect number of arguments
+
-Errors while running CTest$
+Errors while running CTest
+Output from these tests are in: .*/Testing/Temporary/LastTest.log
+Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt
index 7593783..a993ac6 100644
--- a/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt
@@ -1 +1,3 @@
-^Errors while running CTest$
+^Errors while running CTest
+Output from these tests are in: .*/Testing/Temporary/LastTest.log
+Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.$
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
index 095fd54..6483f11 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake
@@ -2,6 +2,8 @@
enable_language (C)
include(CheckCompilerFlag)
+set(C 1) # test that this is tolerated
+
check_compiler_flag(C "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid C compile flag didn't fail.")
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake
index a40699c..681a546 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake
@@ -2,6 +2,8 @@
enable_language (CUDA)
include(CheckCompilerFlag)
+set(CUDA 1) # test that this is tolerated
+
check_compiler_flag(CUDA "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CUDA compile flag didn't fail.")
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake
index bbc104e..60e9755 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake
@@ -2,6 +2,8 @@
enable_language (CXX)
include(CheckCompilerFlag)
+set(CXX 1) # test that this is tolerated
+
check_compiler_flag(CXX "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CXX compile flag didn't fail.")
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake
index 220ee29..7bb88b1 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake
@@ -1,6 +1,8 @@
enable_language (Fortran)
include(CheckCompilerFlag)
+set(Fortran 1) # test that this is tolerated
+
check_compiler_flag(Fortran "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid Fortran compile flag didn't fail.")
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake
index e9344ca..f250f8d 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake
@@ -1,6 +1,8 @@
enable_language (OBJC)
include(CheckCompilerFlag)
+set(OBJC 1) # test that this is tolerated
+
check_compiler_flag(OBJC "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid OBJC compile flag didn't fail.")
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake
index 503a1de..bc940a6 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake
@@ -1,6 +1,8 @@
enable_language (OBJCXX)
include(CheckCompilerFlag)
+set(OBJCXX 1) # test that this is tolerated
+
check_compiler_flag(OBJCXX "-_this_is_not_a_flag_" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid OBJCXX compile flag didn't fail.")
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake
index cf46189..4f73622 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake
@@ -2,6 +2,8 @@
enable_language (C)
include(CheckSourceCompiles)
+set(C 1) # test that this is tolerated
+
check_source_compiles(C "I don't build" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid C source didn't fail.")
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake
index 1e6e6b2..2190649 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake
@@ -2,6 +2,8 @@
enable_language (CUDA)
include(CheckSourceCompiles)
+set(CUDA 1) # test that this is tolerated
+
check_source_compiles(CUDA "I don't build" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CUDA source didn't fail.")
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake
index ec01d42..97c9c30 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake
@@ -2,6 +2,8 @@
enable_language (CXX)
include(CheckSourceCompiles)
+set(CXX 1) # test that this is tolerated
+
check_source_compiles(CXX "I don't build" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "invalid CXX source didn't fail.")
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake
index 1d4e16d..48dc525 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake
@@ -3,6 +3,8 @@
enable_language (Fortran)
include(CheckSourceCompiles)
+set(Fortran 1) # test that this is tolerated
+
check_source_compiles(Fortran [=[
PROGRAM TEST_HAVE_PRINT
PRINT *, 'Hello'
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake
index 2f53cfc4..76a5009 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake
@@ -1,6 +1,8 @@
enable_language (OBJC)
include(CheckSourceCompiles)
+set(OBJC 1) # test that this is tolerated
+
check_source_compiles(OBJC [[
#import <Foundation/Foundation.h>
int main() {
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake
index 805d513..814237e 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake
@@ -1,6 +1,8 @@
enable_language (OBJCXX)
include(CheckSourceCompiles)
+set(OBJCXX 1) # test that this is tolerated
+
check_source_compiles(OBJCXX [[
#include <vector>
#import <Foundation/Foundation.h>
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake
index 3029ac2..96a1027 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake
@@ -2,6 +2,8 @@
enable_language (C)
include(CheckSourceRuns)
+set(C 1) # test that this is tolerated
+
check_source_runs(C "int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "C check_source_runs succeeded, but should have failed.")
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake
index 01e5ac8..ea5f4f9 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake
@@ -2,6 +2,8 @@
enable_language (CUDA)
include(CheckSourceRuns)
+set(CUDA 1) # test that this is tolerated
+
check_source_runs(CUDA "int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "CUDA check_source_runs succeeded, but should have failed.")
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake
index d47ddda..c4bef6e 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake
@@ -2,6 +2,8 @@
enable_language (CXX)
include(CheckSourceRuns)
+set(CXX 1) # test that this is tolerated
+
check_source_runs(CXX "int main() {return 2;}" SHOULD_FAIL)
if(SHOULD_FAIL)
message(SEND_ERROR "CXX check_source_runs succeeded, but should have failed.")
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake
index 2a1fdfe..50e8ec8 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake
@@ -3,6 +3,8 @@
enable_language (Fortran)
include(CheckSourceRuns)
+set(Fortran 1) # test that this is tolerated
+
check_source_runs(Fortran [=[
PROGRAM TEST_HAVE_PRINT
PRINT *, 'Hello'
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake
index 55f28f3..b828352 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake
@@ -1,6 +1,8 @@
enable_language (OBJC)
include(CheckSourceRuns)
+set(OBJC 1) # test that this is tolerated
+
check_source_runs(OBJC [[
#import <Foundation/Foundation.h>
int main() {
diff --git a/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake
index a218acd..8a56f13 100644
--- a/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake
+++ b/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake
@@ -1,6 +1,8 @@
enable_language (OBJCXX)
include(CheckSourceRuns)
+set(OBJCXX 1) # test that this is tolerated
+
check_source_runs(OBJCXX [[
#include <vector>
#import <Foundation/Foundation.h>
diff --git a/Tests/RunCMake/CommandLine/InvalidArg1-result.txt b/Tests/RunCMake/CommandLine/InvalidArg1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/InvalidArg1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/InvalidArg1-stderr.txt b/Tests/RunCMake/CommandLine/InvalidArg1-stderr.txt
new file mode 100644
index 0000000..6b825bb
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/InvalidArg1-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Unknown argument -invalid
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CommandLine/InvalidArg2-result.txt b/Tests/RunCMake/CommandLine/InvalidArg2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/InvalidArg2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/InvalidArg2-stderr.txt b/Tests/RunCMake/CommandLine/InvalidArg2-stderr.txt
new file mode 100644
index 0000000..eb1488c
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/InvalidArg2-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: Unknown argument --invalid
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index bb40c52..51754fc 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.1)
include(RunCMake)
run_cmake_command(NoArgs ${CMAKE_COMMAND})
+run_cmake_command(InvalidArg1 ${CMAKE_COMMAND} -invalid)
+run_cmake_command(InvalidArg2 ${CMAKE_COMMAND} --invalid)
run_cmake_command(Wizard ${CMAKE_COMMAND} -i)
run_cmake_command(C-no-arg ${CMAKE_COMMAND} -B DummyBuildDir -C)
run_cmake_command(C-no-file ${CMAKE_COMMAND} -B DummyBuildDir -C nosuchcachefile.txt)
diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
index 4449ff1..2bb2765 100644
--- a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
@@ -50,7 +50,9 @@ run_cmake(ClientStateful)
function(run_object object)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${object}-build)
+ list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0118=NEW)
run_cmake(${object})
+ list(POP_BACK RunCMake_TEST_OPTIONS)
set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(${object}-SharedStateless ${CMAKE_COMMAND} .)
run_cmake_command(${object}-ClientStateless ${CMAKE_COMMAND} .)
diff --git a/Tests/RunCMake/Make/TargetMessages-OFF-build-check.cmake b/Tests/RunCMake/Make/TargetMessages-OFF-build-check.cmake
new file mode 100644
index 0000000..74a0564
--- /dev/null
+++ b/Tests/RunCMake/Make/TargetMessages-OFF-build-check.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_TARGET_MESSAGES OFF)
+include ("${CMAKE_CURRENT_LIST_DIR}/TargetMessages-validation.cmake")
diff --git a/Tests/RunCMake/Make/TargetMessages-OFF-build-stdout.txt b/Tests/RunCMake/Make/TargetMessages-OFF-build-stdout.txt
index 77a582a..8d98f9d 100644
--- a/Tests/RunCMake/Make/TargetMessages-OFF-build-stdout.txt
+++ b/Tests/RunCMake/Make/TargetMessages-OFF-build-stdout.txt
@@ -1,5 +1 @@
-^(([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*
-)*Scanning dependencies of target CustomTarget(
-([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*)*$
+.*
diff --git a/Tests/RunCMake/Make/TargetMessages-ON-build-check.cmake b/Tests/RunCMake/Make/TargetMessages-ON-build-check.cmake
new file mode 100644
index 0000000..afd8efb
--- /dev/null
+++ b/Tests/RunCMake/Make/TargetMessages-ON-build-check.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_TARGET_MESSAGES ON)
+include ("${CMAKE_CURRENT_LIST_DIR}/TargetMessages-validation.cmake")
diff --git a/Tests/RunCMake/Make/TargetMessages-ON-build-stdout.txt b/Tests/RunCMake/Make/TargetMessages-ON-build-stdout.txt
index a827624..8d98f9d 100644
--- a/Tests/RunCMake/Make/TargetMessages-ON-build-stdout.txt
+++ b/Tests/RunCMake/Make/TargetMessages-ON-build-stdout.txt
@@ -1,8 +1 @@
-^(([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*
-)*Scanning dependencies of target CustomTarget(
-([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*)*
-Built target CustomTarget(
-([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*)*$
+.*
diff --git a/Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-check.cmake b/Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-check.cmake
new file mode 100644
index 0000000..74a0564
--- /dev/null
+++ b/Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-check.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_TARGET_MESSAGES OFF)
+include ("${CMAKE_CURRENT_LIST_DIR}/TargetMessages-validation.cmake")
diff --git a/Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-stdout.txt b/Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-stdout.txt
index 77a582a..8d98f9d 100644
--- a/Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-stdout.txt
+++ b/Tests/RunCMake/Make/TargetMessages-VAR-OFF-build-stdout.txt
@@ -1,5 +1 @@
-^(([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*
-)*Scanning dependencies of target CustomTarget(
-([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*)*$
+.*
diff --git a/Tests/RunCMake/Make/TargetMessages-VAR-ON-build-check.cmake b/Tests/RunCMake/Make/TargetMessages-VAR-ON-build-check.cmake
new file mode 100644
index 0000000..afd8efb
--- /dev/null
+++ b/Tests/RunCMake/Make/TargetMessages-VAR-ON-build-check.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_TARGET_MESSAGES ON)
+include ("${CMAKE_CURRENT_LIST_DIR}/TargetMessages-validation.cmake")
diff --git a/Tests/RunCMake/Make/TargetMessages-VAR-ON-build-stdout.txt b/Tests/RunCMake/Make/TargetMessages-VAR-ON-build-stdout.txt
index a827624..8d98f9d 100644
--- a/Tests/RunCMake/Make/TargetMessages-VAR-ON-build-stdout.txt
+++ b/Tests/RunCMake/Make/TargetMessages-VAR-ON-build-stdout.txt
@@ -1,8 +1 @@
-^(([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*
-)*Scanning dependencies of target CustomTarget(
-([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*)*
-Built target CustomTarget(
-([^B]|B[^u]|Bu[^i]|Bui[^l]|Buil[^t]|Built[^ ])[^
-]*)*$
+.*
diff --git a/Tests/RunCMake/Make/TargetMessages-validation.cmake b/Tests/RunCMake/Make/TargetMessages-validation.cmake
new file mode 100644
index 0000000..f3d7af1
--- /dev/null
+++ b/Tests/RunCMake/Make/TargetMessages-validation.cmake
@@ -0,0 +1,10 @@
+
+if (CHECK_TARGET_MESSAGES)
+ if (NOT actual_stdout MATCHES "Built target CustomTarget")
+ set (RunCMake_TEST_FAILED "Not found expected 'Built target' message.")
+ endif()
+else()
+ if (actual_stdout MATCHES "Built target CustomTarget")
+ set (RunCMake_TEST_FAILED "Found unexpected 'Built target' message.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/Ninja/AssumedSources.cmake b/Tests/RunCMake/Ninja/AssumedSources.cmake
index 5fb0219..d5364f0 100644
--- a/Tests/RunCMake/Ninja/AssumedSources.cmake
+++ b/Tests/RunCMake/Ninja/AssumedSources.cmake
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.8)
+cmake_policy(SET CMP0118 NEW)
project(AssumedSources)
set_source_files_properties(
diff --git a/Tests/RunCMake/XcodeProject-Embed/CMakeLists.txt b/Tests/RunCMake/XcodeProject-Embed/CMakeLists.txt
new file mode 100644
index 0000000..0400d1a
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.19)
+project(${RunCMake_TEST} LANGUAGES C)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOff-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOff-check.cmake
new file mode 100644
index 0000000..9cc03b9
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOff-check.cmake
@@ -0,0 +1,14 @@
+function(findAttribute project attr)
+ execute_process(
+ COMMAND grep ${attr} ${RunCMake_TEST_BINARY_DIR}/${project}.xcodeproj/project.pbxproj
+ OUTPUT_VARIABLE output_var
+ RESULT_VARIABLE result_var
+ )
+
+ if(NOT result_var)
+ set(RunCMake_TEST_FAILED "${attr} attribute is set" PARENT_SCOPE)
+ endif()
+endfunction()
+
+findAttribute(${test} "RemoveHeadersOnCopy")
+findAttribute(${test} "CodeSignOnCopy")
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOff.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOff.cmake
new file mode 100644
index 0000000..f4fe07f
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOff.cmake
@@ -0,0 +1,7 @@
+add_executable(app MACOSX_BUNDLE main.m)
+
+set_target_properties(app PROPERTIES
+ XCODE_EMBED_FRAMEWORKS "${EXTERNAL_FWK}"
+ XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY OFF
+ XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY OFF
+)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir-build-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir-build-check.cmake
new file mode 100644
index 0000000..e4ea55d
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir-build-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/Debug/app.app/Contents/Frameworks/sharedFrameworkExt.framework)
+ set(RunCMake_TEST_FAILED "Framework was not embedded at the expected location")
+endif()
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir-check.cmake
new file mode 100644
index 0000000..3f62640
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir-check.cmake
@@ -0,0 +1,14 @@
+function(findAttribute project attr)
+ execute_process(
+ COMMAND grep ${attr} ${RunCMake_TEST_BINARY_DIR}/${project}.xcodeproj/project.pbxproj
+ OUTPUT_VARIABLE output_var
+ RESULT_VARIABLE result_var
+ )
+
+ if(result_var)
+ set(RunCMake_TEST_FAILED "${attr} attribute not set" PARENT_SCOPE)
+ endif()
+endfunction()
+
+findAttribute(${test} "RemoveHeadersOnCopy")
+findAttribute(${test} "CodeSignOnCopy")
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir.cmake
new file mode 100644
index 0000000..79d8d77
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnNoSubdir.cmake
@@ -0,0 +1,7 @@
+add_executable(app MACOSX_BUNDLE main.m)
+
+set_target_properties(app PROPERTIES
+ XCODE_EMBED_FRAMEWORKS "${EXTERNAL_FWK}"
+ XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY ON
+ XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON
+)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir-build-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir-build-check.cmake
new file mode 100644
index 0000000..57c79ea
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir-build-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/Debug/app.app/Contents/Frameworks/subdir/sharedFrameworkExt.framework)
+ set(RunCMake_TEST_FAILED "Framework was not embedded at the expected location")
+endif()
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir-check.cmake
new file mode 100644
index 0000000..3f62640
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir-check.cmake
@@ -0,0 +1,14 @@
+function(findAttribute project attr)
+ execute_process(
+ COMMAND grep ${attr} ${RunCMake_TEST_BINARY_DIR}/${project}.xcodeproj/project.pbxproj
+ OUTPUT_VARIABLE output_var
+ RESULT_VARIABLE result_var
+ )
+
+ if(result_var)
+ set(RunCMake_TEST_FAILED "${attr} attribute not set" PARENT_SCOPE)
+ endif()
+endfunction()
+
+findAttribute(${test} "RemoveHeadersOnCopy")
+findAttribute(${test} "CodeSignOnCopy")
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir.cmake
new file mode 100644
index 0000000..4c78199
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedFrameworksFlagsOnWithSubdir.cmake
@@ -0,0 +1,8 @@
+add_executable(app MACOSX_BUNDLE main.m)
+
+set_target_properties(app PROPERTIES
+ XCODE_EMBED_FRAMEWORKS "${EXTERNAL_FWK}"
+ XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY ON
+ XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY ON
+ XCODE_EMBED_FRAMEWORKS_PATH "subdir"
+)
diff --git a/Tests/RunCMake/XcodeProject-Embed/ExternalFramework.cmake b/Tests/RunCMake/XcodeProject-Embed/ExternalFramework.cmake
new file mode 100644
index 0000000..64e2f95
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/ExternalFramework.cmake
@@ -0,0 +1,2 @@
+add_library(sharedFrameworkExt SHARED func.m)
+set_target_properties(sharedFrameworkExt PROPERTIES FRAMEWORK TRUE)
diff --git a/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake
new file mode 100644
index 0000000..0dc1cf3
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake
@@ -0,0 +1,43 @@
+include(RunCMake)
+
+# Build a framework that the other tests will use and treat as external.
+# Always build in the Debug configuration so that the path to the framework
+# is predictable.
+function(ExternalFramework)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ExternalFramework-build)
+ set(externalFramework ${RunCMake_TEST_BINARY_DIR}/Debug/sharedFrameworkExt.framework PARENT_SCOPE)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(ExternalFramework)
+ run_cmake_command(ExternalFramework-build
+ ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR}
+ --config Debug
+ --target sharedFrameworkExt
+ )
+endfunction()
+ExternalFramework()
+
+set(RunCMake_TEST_OPTIONS -DEXTERNAL_FWK=${externalFramework})
+
+run_cmake(EmbedFrameworksFlagsOff)
+
+function(TestFlagsOn testName)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${testName}-build)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(${testName})
+ run_cmake_command(${testName}-build
+ ${CMAKE_COMMAND} --build ${RunCMake_TEST_BINARY_DIR}
+ --config Debug
+ --target app
+ )
+endfunction()
+
+TestFlagsOn(EmbedFrameworksFlagsOnNoSubdir)
+TestFlagsOn(EmbedFrameworksFlagsOnWithSubdir)
diff --git a/Tests/RunCMake/XcodeProject-Embed/func.m b/Tests/RunCMake/XcodeProject-Embed/func.m
new file mode 100644
index 0000000..29c6689
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/func.m
@@ -0,0 +1,6 @@
+#import <CoreFoundation/CoreFoundation.h>
+
+int func()
+{
+ return 1;
+}
diff --git a/Tests/RunCMake/XcodeProject-Embed/main.m b/Tests/RunCMake/XcodeProject-Embed/main.m
new file mode 100644
index 0000000..72e425d
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/main.m
@@ -0,0 +1,6 @@
+#import <CoreFoundation/CoreFoundation.h>
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 62163ac..abba741 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -51,6 +51,35 @@ run_cmake(PerConfigPerSourceOptions)
run_cmake(PerConfigPerSourceDefinitions)
run_cmake(PerConfigPerSourceIncludeDirs)
+if(XCODE_VERSION VERSION_GREATER_EQUAL 12)
+
+ function(XcodeObjectLibsInTwoProjectsiOS)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeObjectLibsInTwoProjects-build-ios)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_SYSTEM_NAME=iOS")
+
+ run_cmake(XcodeObjectLibsInTwoProjects)
+
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ run_cmake_command(XcodeObjectLibsInTwoProjects-build-ios ${CMAKE_COMMAND} --build . --target shared_lib -- -sdk iphonesimulator)
+ endfunction()
+
+ XcodeObjectLibsInTwoProjectsiOS()
+
+ function(XcodeObjectLibsInTwoProjectsMacOS)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeObjectLibsInTwoProjects-build-macos)
+
+ run_cmake(XcodeObjectLibsInTwoProjects)
+
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ run_cmake_command(XcodeObjectLibsInTwoProjects-build-macos ${CMAKE_COMMAND} --build . --target shared_lib)
+ endfunction()
+
+ XcodeObjectLibsInTwoProjectsMacOS()
+
+endif()
+
function(XcodeSchemaGeneration)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build)
set(RunCMake_TEST_NO_CLEAN 1)
diff --git a/Tests/RunCMake/XcodeProject/XcodeObjectLibsInTwoProjects.cmake b/Tests/RunCMake/XcodeProject/XcodeObjectLibsInTwoProjects.cmake
new file mode 100644
index 0000000..3ca24af
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeObjectLibsInTwoProjects.cmake
@@ -0,0 +1,5 @@
+cmake_minimum_required (VERSION 3.19)
+
+project (test_xcode_fail NONE)
+
+add_subdirectory(subproject_two_object_libs)
diff --git a/Tests/RunCMake/XcodeProject/subproject_two_object_libs/CMakeLists.txt b/Tests/RunCMake/XcodeProject/subproject_two_object_libs/CMakeLists.txt
new file mode 100644
index 0000000..e55836d
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/subproject_two_object_libs/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_minimum_required (VERSION 3.16)
+
+enable_language(CXX)
+
+project (subproject_two_object_libs)
+
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED NO)
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+
+if(IOS)
+ set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+
+ set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
+endif()
+
+# Hierarchy of libraries looks like:
+#
+# OBJECT-1 ---> STATIC--\
+# |---> SHARED
+# OBJECT-2 -------------/
+
+add_library(object_lib_dependency1 OBJECT dummy.cpp)
+
+add_library(static_lib_dependency STATIC dummy.cpp $<TARGET_OBJECTS:object_lib_dependency1>)
+
+add_library(object_lib_dependency2 OBJECT dummy.cpp)
+target_link_libraries(object_lib_dependency2 PRIVATE static_lib_dependency)
+
+add_library(shared_lib SHARED dummy.cpp)
+target_link_libraries(shared_lib PRIVATE static_lib_dependency)
+target_sources(shared_lib PRIVATE $<TARGET_OBJECTS:object_lib_dependency2>)
diff --git a/Tests/RunCMake/XcodeProject/subproject_two_object_libs/dummy.cpp b/Tests/RunCMake/XcodeProject/subproject_two_object_libs/dummy.cpp
new file mode 100644
index 0000000..8082abc
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/subproject_two_object_libs/dummy.cpp
@@ -0,0 +1,5 @@
+namespace {
+void foo()
+{
+}
+}
diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake
index 95c8d5c..0e6020f 100644
--- a/Tests/RunCMake/export/RunCMakeTest.cmake
+++ b/Tests/RunCMake/export/RunCMakeTest.cmake
@@ -17,3 +17,4 @@ run_cmake(DependOnNotExport)
run_cmake(DependOnDoubleExport)
run_cmake(UnknownExport)
run_cmake(NamelinkOnlyExport)
+run_cmake(SeparateNamelinkExport)
diff --git a/Tests/RunCMake/export/SeparateNamelinkExport.cmake b/Tests/RunCMake/export/SeparateNamelinkExport.cmake
new file mode 100644
index 0000000..b006aea
--- /dev/null
+++ b/Tests/RunCMake/export/SeparateNamelinkExport.cmake
@@ -0,0 +1,16 @@
+enable_language(CXX)
+add_library(foo SHARED empty.cpp)
+install(TARGETS foo EXPORT fooExport
+ RUNTIME DESTINATION bin
+ LIBRARY
+ DESTINATION lib
+ COMPONENT runtime
+ NAMELINK_SKIP
+)
+install(TARGETS foo EXPORT fooExport
+ LIBRARY
+ DESTINATION lib
+ COMPONENT development
+ NAMELINK_ONLY
+)
+export(EXPORT fooExport FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake")
diff --git a/Tests/RunCMake/install/EXPORT-SeparateNamelink.cmake b/Tests/RunCMake/install/EXPORT-SeparateNamelink.cmake
new file mode 100644
index 0000000..5c6fa10
--- /dev/null
+++ b/Tests/RunCMake/install/EXPORT-SeparateNamelink.cmake
@@ -0,0 +1,19 @@
+enable_language(C)
+add_library(foo SHARED empty.c)
+install(TARGETS foo EXPORT fooExport
+ RUNTIME DESTINATION bin
+ LIBRARY
+ DESTINATION lib
+ COMPONENT runtime
+ NAMELINK_SKIP
+)
+install(TARGETS foo EXPORT fooExport
+ LIBRARY
+ DESTINATION lib
+ COMPONENT development
+ NAMELINK_ONLY
+)
+install(EXPORT fooExport
+ DESTINATION "lib/cmake/"
+ FILE "foo.cmake"
+)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index 5aab88c..d64d88b 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -78,6 +78,7 @@ run_cmake(TARGETS-DESTINATION-bad)
run_cmake(EXPORT-OldIFace)
run_cmake(EXPORT-UnknownExport)
run_cmake(EXPORT-NamelinkOnly)
+run_cmake(EXPORT-SeparateNamelink)
run_cmake(CMP0062-OLD)
run_cmake(CMP0062-NEW)
run_cmake(CMP0062-WARN)
diff --git a/bootstrap b/bootstrap
index b7fcd7e..c342f10 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1054,12 +1054,14 @@ else
CMAKE_CXX_SOURCES="${CMAKE_CXX_SOURCES} \
cmDepends \
cmDependsC \
+ cmDependsCompiler \
cmGlobalUnixMakefileGenerator3 \
cmLocalUnixMakefileGenerator3 \
cmMakefileExecutableTargetGenerator \
cmMakefileLibraryTargetGenerator \
cmMakefileTargetGenerator \
cmMakefileUtilityTargetGenerator \
+ cmProcessTools \
"
JSONCPP_CXX_SOURCES=