summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Architecture/CMakeLists.txt2
-rw-r--r--Tests/ArgumentExpansion/CMakeLists.txt2
-rw-r--r--Tests/Assembler/CMakeLists.txt2
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt6
-rw-r--r--Tests/BundleTest/BundleLib.cxx4
-rw-r--r--Tests/BundleTest/BundleSubDir/CMakeLists.txt8
-rw-r--r--Tests/BundleTest/CMakeLists.txt17
-rw-r--r--Tests/BundleUtilities/CMakeLists.txt11
-rw-r--r--Tests/CFBundleTest/CMakeLists.txt2
-rw-r--r--Tests/CMakeCommands/add_compile_options/CMakeLists.txt2
-rw-r--r--Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt2
-rw-r--r--Tests/CMakeCommands/target_compile_options/CMakeLists.txt2
-rw-r--r--Tests/CMakeCommands/target_include_directories/CMakeLists.txt2
-rw-r--r--Tests/CMakeCommands/target_link_libraries/CMakeLists.txt3
-rw-r--r--Tests/CMakeLib/run_compile_commands.cxx52
-rw-r--r--Tests/CMakeLib/testCMExtMemory.cxx4
-rw-r--r--Tests/CMakeLib/testGccDepfileReader.cxx21
-rw-r--r--Tests/CMakeLib/testGccDepfileReader_data/deps4.d1
-rw-r--r--Tests/CMakeLib/testGccDepfileReader_data/deps5.d0
-rw-r--r--Tests/CMakeLib/testGccDepfileReader_data/deps5.txt2
-rw-r--r--Tests/CMakeLib/testGccDepfileReader_data/deps7.d6
-rw-r--r--Tests/CMakeLib/testGccDepfileReader_data/deps7.txt10
-rw-r--r--Tests/CMakeLib/testOptional.cxx28
-rw-r--r--Tests/CMakeLib/testRST.expect22
-rw-r--r--Tests/CMakeLib/testRST.rst22
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx4
-rw-r--r--Tests/CMakeLists.txt65
-rw-r--r--Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt2
-rw-r--r--Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt2
-rw-r--r--Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt2
-rw-r--r--Tests/CMakeOnly/find_library/CMakeLists.txt2
-rw-r--r--Tests/CMakeOnly/find_path/CMakeLists.txt2
-rw-r--r--Tests/CMakeServerLib/CMakeLists.txt21
-rw-r--r--Tests/CMakeServerLib/testServerBuffering.cpp87
-rw-r--r--Tests/CMakeTestMultipleConfigures/RunCMake.cmake165
-rw-r--r--Tests/CMakeTests/CMakeLists.txt4
-rw-r--r--Tests/CMakeTests/EndStuffTestScript.cmake60
-rw-r--r--Tests/CMakeTests/FileDownloadTest.cmake.in3
-rw-r--r--Tests/CMakeTests/ListTest.cmake.in3
-rw-r--r--Tests/CPackComponentsDEB/CMakeLists.txt14
-rw-r--r--Tests/CPackComponentsDEB/MyLibCPackConfig-shlibdeps-with-private-lib-failure.cmake.in24
-rw-r--r--Tests/CPackComponentsDEB/MyLibCPackConfig-shlibdeps-with-private-lib-success.cmake.in33
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-shlibdeps-with-private-lib-failure.cmake19
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-shlibdeps-with-private-lib-success.cmake75
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake13
-rw-r--r--Tests/CPackComponentsDEB/mylibapp.cpp15
-rw-r--r--Tests/CPackComponentsDEB/shlibdeps-with-private-lib/CMakeLists.txt5
-rw-r--r--Tests/CPackComponentsDEB/shlibdeps-with-private-lib/myprivatelib.cpp8
-rw-r--r--Tests/CPackComponentsDEB/shlibdeps-with-private-lib/myprivatelib.h1
-rw-r--r--Tests/CPackNSISGenerator/CMakeLists.txt2
-rw-r--r--Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake8
-rw-r--r--Tests/CPackTestAllGenerators/CMakeLists.txt2
-rw-r--r--Tests/CPackWiXGenerator/CMakeLists.txt2
-rw-r--r--Tests/CTestCoverageCollectGCOV/test.cmake.in19
-rw-r--r--Tests/CTestLimitDashJ/CMakeLists.txt2
-rw-r--r--Tests/CTestTest/SmallAndFast/CMakeLists.txt2
-rw-r--r--Tests/CTestUpdateCVS.cmake.in18
-rw-r--r--Tests/CTestUpdateGIT.cmake.in32
-rw-r--r--Tests/CheckCompilerRelatedVariables/CMakeLists.txt2
-rw-r--r--Tests/CompileDefinitions/CMakeLists.txt2
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt11
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp6
-rw-r--r--Tests/CompileFeatures/genex_test.cpp6
-rw-r--r--Tests/CompileOptions/CMakeLists.txt2
-rw-r--r--Tests/ConfigSources/CMakeLists.txt76
-rw-r--r--Tests/ConfigSources/custom1.cpp.in13
-rw-r--r--Tests/ConfigSources/custom2.cpp.in13
-rw-r--r--Tests/ConfigSources/custom3.cpp.in13
-rw-r--r--Tests/ConfigSources/custom4.cpp.in13
-rw-r--r--Tests/ConfigSources/custom5.cpp.in13
-rw-r--r--Tests/ConfigSources/main_debug.cpp9
-rw-r--r--Tests/ConfigSources/main_other.cpp9
-rw-r--r--Tests/Contracts/Trilinos/CMakeLists.txt2
-rw-r--r--Tests/Contracts/VTK/CMakeLists.txt2
-rw-r--r--Tests/Cuda/Toolkit/CMakeLists.txt4
-rw-r--r--Tests/CudaOnly/CMakeLists.txt1
-rw-r--r--Tests/CudaOnly/CompileFlags/CMakeLists.txt1
-rw-r--r--Tests/CudaOnly/ExportPTX/CMakeLists.txt6
-rw-r--r--Tests/CudaOnly/Toolkit/CMakeLists.txt4
-rw-r--r--Tests/CudaOnly/ToolkitBeforeLang/CMakeLists.txt26
-rw-r--r--Tests/CudaOnly/ToolkitBeforeLang/main.cu8
-rw-r--r--Tests/CustomCommand/CMakeLists.txt4
-rw-r--r--Tests/CustomCommand/empty_command.cxx (renamed from Tests/Server/empty.cpp)1
-rw-r--r--Tests/EmptyDepends/CMakeLists.txt2
-rw-r--r--Tests/ExportImport/Import/try_compile/CMakeLists.txt2
-rw-r--r--Tests/ExternalProject/CMakeLists.txt32
-rw-r--r--Tests/ExternalProject/Example/CMakeLists.txt2
-rw-r--r--Tests/ExternalProject/gitrepo-sub-rec.tgzbin9008 -> 2086 bytes
-rw-r--r--Tests/ExternalProject/gitrepo-sub.tgzbin1911 -> 2229 bytes
-rwxr-xr-xTests/ExternalProject/gitrepo.bash129
-rw-r--r--Tests/ExternalProject/gitrepo.tgzbin1934 -> 1817 bytes
-rw-r--r--Tests/ExternalProjectLocal/CMakeLists.txt2
-rw-r--r--Tests/ExternalProjectUpdate/CMakeLists.txt17
-rw-r--r--Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake33
-rw-r--r--Tests/ExternalProjectUpdate/gitrepo.tgzbin3057 -> 3397 bytes
-rw-r--r--Tests/FindGTK2/atk/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/atkmm/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/cairo/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/cairomm/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gdk/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gdk_pixbuf/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gdkmm/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gio/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/giomm/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/glib/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/glibmm/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gmodule/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gobject/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gthread/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gtk/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/gtkmm/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/pango/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/pangocairo/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/pangoft2/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/pangomm/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/pangoxft/CMakeLists.txt2
-rw-r--r--Tests/FindGTK2/sigc++/CMakeLists.txt2
-rw-r--r--Tests/FindIntl/CMakeLists.txt10
-rw-r--r--Tests/FindIntl/Test/CMakeLists.txt14
-rw-r--r--Tests/FindIntl/Test/main.cxx11
-rw-r--r--Tests/FindPostgreSQL/Test/CMakeLists.txt2
-rw-r--r--Tests/FindPython/CMakeLists.txt12
-rw-r--r--Tests/FindPython/UnversionedNames/CMakeLists.txt66
-rw-r--r--Tests/Fortran/CMakeLists.txt2
-rw-r--r--Tests/Fortran/myc.c4
-rw-r--r--Tests/FortranC/CMakeLists.txt2
-rw-r--r--Tests/FortranOnly/CMakeLists.txt6
-rw-r--r--Tests/Fuzzing/README.rst8
-rw-r--r--Tests/Fuzzing/xml_parser_fuzzer.cc27
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt6
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt2
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt2
-rw-r--r--Tests/InterfaceLibrary/CMakeLists.txt2
-rw-r--r--Tests/JavaNativeHeaders/CMakeLists.txt9
-rw-r--r--Tests/JavaNativeHeaders/Import/CMakeLists.txt19
-rw-r--r--Tests/LinkDirectory/CMakeLists.txt2
-rw-r--r--Tests/LinkDirectory/External/CMakeLists.txt2
-rw-r--r--Tests/LinkFlags/CMakeLists.txt2
-rw-r--r--Tests/MFC/CMakeLists.txt2
-rw-r--r--Tests/MFC/CMakeLists.txt.in2
-rw-r--r--Tests/MFC/try_compile/CMakeLists.txt2
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt5
-rw-r--r--Tests/MacRuntimePath/A/CMakeLists.txt2
-rw-r--r--Tests/MacRuntimePath/B/CMakeLists.txt2
-rw-r--r--Tests/MissingSourceFile/CMakeLists.txt2
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt4
-rw-r--r--Tests/ObjectLibrary/CMakeLists.txt2
-rw-r--r--Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt2
-rw-r--r--Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt2
-rw-r--r--Tests/PDBDirectoryAndName/CMakeLists.txt7
-rw-r--r--Tests/Plugin/PluginTest/CMakeLists.txt2
-rw-r--r--Tests/PositionIndependentTargets/CMakeLists.txt2
-rw-r--r--Tests/Preprocess/CMakeLists.txt7
-rw-r--r--Tests/Qt4Targets/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt13
-rw-r--r--Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt8
-rw-r--r--Tests/QtAutogen/MocOnly/CMakeLists.txt12
-rw-r--r--Tests/QtAutogen/MocOnly/CfgDebug.cpp5
-rw-r--r--Tests/QtAutogen/MocOnly/CfgDebug.hpp15
-rw-r--r--Tests/QtAutogen/MocOnly/CfgOther.cpp5
-rw-r--r--Tests/QtAutogen/MocOnly/CfgOther.hpp15
-rw-r--r--Tests/QtAutogen/MocOnly/main.cpp8
-rw-r--r--Tests/QtAutogen/RerunMocBasic/CMakeLists.txt79
-rw-r--r--Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt7
-rw-r--r--Tests/QtAutogen/RerunMocBasic/MocBasic/main.cpp.in2
-rw-r--r--Tests/QtAutogen/RerunMocBasic/MocBasic/myobject3a.h.in13
-rw-r--r--Tests/QtAutogen/RerunMocBasic/MocBasic/plainobject.cpp12
-rw-r--r--Tests/QtAutogen/RerunMocBasic/MocBasic/plainobject.h12
-rw-r--r--Tests/QtAutogen/RerunMocBasic/MocBasic/test1c.h.in6
-rw-r--r--Tests/QtAutogen/TestMacros.cmake10
-rw-r--r--Tests/QtAutomocNoQt/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/ABI/C-stdout.txt1
-rw-r--r--Tests/RunCMake/ABI/C.cmake22
-rw-r--r--Tests/RunCMake/ABI/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ABI/CUDA.cmake13
-rw-r--r--Tests/RunCMake/ABI/CXX-stdout.txt1
-rw-r--r--Tests/RunCMake/ABI/CXX.cmake22
-rw-r--r--Tests/RunCMake/ABI/OBJC.cmake13
-rw-r--r--Tests/RunCMake/ABI/OBJCXX.cmake13
-rw-r--r--Tests/RunCMake/ABI/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/ABI/TestBigEndian-NoLang-result.txt (renamed from Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-wrong-path-result.txt)0
-rw-r--r--Tests/RunCMake/ABI/TestBigEndian-NoLang-stderr.txt8
-rw-r--r--Tests/RunCMake/ABI/TestBigEndian-NoLang.cmake2
-rw-r--r--Tests/RunCMake/Android/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/Android/common.cmake15
-rw-r--r--Tests/RunCMake/Android/ndk-search-order.cmake17
-rw-r--r--Tests/RunCMake/ArtifactOutputDirs/ArtifactOutputDirs.cmake27
-rw-r--r--Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake19
-rw-r--r--Tests/RunCMake/ArtifactOutputDirs/check.cmake21
-rw-r--r--Tests/RunCMake/ArtifactOutputDirs/lib.c (renamed from Tests/RunCMake/TargetObjects/empty.cpp)2
-rw-r--r--Tests/RunCMake/ArtifactOutputDirs/main.c (renamed from Tests/Server/buildsystem1/foo.cpp)3
-rw-r--r--Tests/RunCMake/BuildDepends/CMakeLists.txt2
-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/CustomCommandDependencies-BadArgs-result.txt (renamed from Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-unexpected-arg-result.txt)0
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs.cmake10
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDependencies.cmake73
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDependencies.step1.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDependencies.step2.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDepfile.cmake61
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDepfile.step1.cmake10
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDepfile.step2.cmake6
-rw-r--r--Tests/RunCMake/BuildDepends/CustomCommandDepfile.step3.cmake1
-rw-r--r--Tests/RunCMake/BuildDepends/DepfileSubdir/CMakeLists.txt22
-rw-r--r--Tests/RunCMake/BuildDepends/GenerateDepFile.cmake6
-rw-r--r--Tests/RunCMake/BuildDepends/MakeDependencies.cmake13
-rw-r--r--Tests/RunCMake/BuildDepends/MakeDependencies.step1.cmake18
-rw-r--r--Tests/RunCMake/BuildDepends/MakeDependencies.step2.cmake3
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake34
-rw-r--r--Tests/RunCMake/BuildDepends/WriteDepfile.cmake8
-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/CMP0106/CMP0106-NEW-stderr.txt2
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt4
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-NEW-result.txt (renamed from Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-missing-output-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-NEW-stderr.txt17
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-NEW.cmake1
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-OLD-result.txt (renamed from Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-invalid-output-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt22
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-OLD.cmake1
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-WARN-result.txt (renamed from Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-wrong-path-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-WARN-stderr.txt36
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115-WARN.cmake1
-rw-r--r--Tests/RunCMake/CMP0115/CMP0115.cmake3
-rw-r--r--Tests/RunCMake/CMP0115/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0115/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/CMP0115/main.c (renamed from Tests/Server/buildsystem1/subdir/empty.cpp)3
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt17
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake18
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-NEW-NOWARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-NEW-WARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-OLD-WARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-WARN-NOWARN-stderr.txt7
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-WARN-NOWARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-WARN-WARN-stderr.txt16
-rw-r--r--Tests/RunCMake/CMP0116/CMP0116-WARN-WARN.cmake3
-rw-r--r--Tests/RunCMake/CMP0116/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0116/Common.cmake8
-rw-r--r--Tests/RunCMake/CMP0116/RunCMakeTest.cmake52
-rw-r--r--Tests/RunCMake/CMP0116/Subdirectory/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/CMP0116/WriteDepfile.cmake3
-rw-r--r--Tests/RunCMake/CMP0116/check.cmake18
-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.txt (renamed from Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-unexpected-arg-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test1.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt (renamed from Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-missing-output-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test10.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt (renamed from Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-invalid-output-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt80
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test11.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt (renamed from Tests/RunCMake/cmake_path/CONCAT-wrong-path-result.txt)0
-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.txt (renamed from Tests/RunCMake/cmake_path/CONCAT-OUTPUT_VARIABLE-no-arg-result.txt)0
-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.txt (renamed from Tests/RunCMake/cmake_path/CONCAT-OUTPUT_VARIABLE-invalid-arg-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test14.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt (renamed from Tests/RunCMake/cmake_path/COMPARE-NOT_EQUAL-wrong-path-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt80
-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.txt (renamed from Tests/RunCMake/cmake_path/COMPARE-EQUAL-wrong-path-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt87
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt (renamed from Tests/RunCMake/cmake_path/CMAKE_PATH-wrong-path-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt87
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt (renamed from Tests/RunCMake/cmake_path/CMAKE_PATH-unexpected-arg-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-stderr.txt167
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt (renamed from Tests/RunCMake/cmake_path/CMAKE_PATH-missing-output-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-stderr.txt167
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt (renamed from Tests/RunCMake/cmake_path/CMAKE_PATH-invalid-output-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt174
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test5.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt (renamed from Tests/RunCMake/cmake_path/CMAKE_PATH-OUTPUT_VARIABLE-no-arg-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test6.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt (renamed from Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test7.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt (renamed from Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt45
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test8.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt (renamed from Tests/RunCMake/File_Configure/BadArg-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-stderr.txt74
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-NEW-Test9.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt (renamed from Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test1.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt (renamed from Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt51
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test10.cmake2
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt (renamed from Tests/RunCMake/CommandLine/E_server-arg-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt67
-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.txt51
-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.txt67
-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.txt87
-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.txt87
-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.txt95
-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.txt95
-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.txt111
-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.txt45
-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.txt77
-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.txt45
-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.txt61
-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.txt10
-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.txt51
-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.txt90
-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.txt51
-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.txt90
-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.txt87
-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.txt87
-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.txt212
-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.txt212
-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.txt213
-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.txt45
-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.txt100
-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.txt45
-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.txt84
-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/CMP0119/AltExtC.zzz4
-rw-r--r--Tests/RunCMake/CMP0119/AltExtCXX.zzz3
-rw-r--r--Tests/RunCMake/CMP0119/CMP0119-Common.cmake4
-rw-r--r--Tests/RunCMake/CMP0119/CMP0119-NEW.cmake6
-rw-r--r--Tests/RunCMake/CMP0119/CMP0119-OLD-build-result.txt1
-rw-r--r--Tests/RunCMake/CMP0119/CMP0119-OLD-build-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0119/CMP0119-OLD.cmake2
-rw-r--r--Tests/RunCMake/CMP0119/CMP0119-WARN-build-result.txt1
-rw-r--r--Tests/RunCMake/CMP0119/CMP0119-WARN-build-stderr.txt1
-rw-r--r--Tests/RunCMake/CMP0119/CMP0119-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0119/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0119/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/CMakeLists.txt38
-rw-r--r--Tests/RunCMake/CMakePresets/CMakePresets.json.in8
-rw-r--r--Tests/RunCMake/CMakePresets/GoodSpaces-stdout.txt3
-rw-r--r--Tests/RunCMake/CMakePresets/GoodSpacesEq-stdout.txt3
-rw-r--r--Tests/RunCMake/CMakePresets/GoodSpacesEq.cmake0
-rw-r--r--Tests/RunCMake/CMakePresets/ListPresets-stdout.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/NoPresetArgument-stderr.txt3
-rw-r--r--Tests/RunCMake/CMakePresets/NoPresetArgumentEq-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresets/NoPresetArgumentEq-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresets/RunCMakeTest.cmake22
-rw-r--r--Tests/RunCMake/CMakePresets/validate_schema.cmake19
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/CMakeLists.txt.in3
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Good-build-build-other-check.cmake5
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Good-build-macros-check.cmake14
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Good-build-noEnvironment-check.cmake6
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Good-build-withEnvironment-check.cmake8
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Good.cmake3
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Good.json.in78
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Invalid-build-badConfigurePreset-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Invalid-build-badConfigurePreset-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Invalid-build-hidden-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Invalid-build-hidden-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Invalid-build-vendorMacro-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Invalid-build-vendorMacro-stderr.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Invalid.cmake0
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/Invalid.json.in27
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/ListPresets-build-x-stdout.txt5
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/ListPresets.cmake0
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/ListPresets.json.in31
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset-build-noConfigurePreset-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset-build-noConfigurePreset-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset.cmake0
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset.json.in15
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported-build-x-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported-build-x-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported.json.in7
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake75
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/TestVariable.cmake14
-rw-r--r--Tests/RunCMake/CMakePresetsBuild/check.cmake3
-rw-r--r--Tests/RunCMake/CMakePresetsTest/CMakeLists.txt.in3
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-indexFile.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-config-debug-stdout.txt5
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-config-release-stdout.txt5
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-exclude-stdout.txt7
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-index-stdout.txt7
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-indexFile-stdout.txt7
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-noEnvironment-stdout.txt8
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-test-showOnly-stdout.txt8
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good-withEnvironment-check.cmake8
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good.cmake27
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Good.json.in175
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Invalid-test-badConfigurePreset-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Invalid-test-badConfigurePreset-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Invalid-test-hidden-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Invalid-test-hidden-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Invalid-test-vendorMacro-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Invalid-test-vendorMacro-stderr.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Invalid.cmake0
-rw-r--r--Tests/RunCMake/CMakePresetsTest/Invalid.json.in27
-rw-r--r--Tests/RunCMake/CMakePresetsTest/ListPresets-test-x-stdout.txt12
-rw-r--r--Tests/RunCMake/CMakePresetsTest/ListPresets.cmake0
-rw-r--r--Tests/RunCMake/CMakePresetsTest/NoConfigurePreset-test-noConfigurePreset-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/NoConfigurePreset-test-noConfigurePreset-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsTest/NoConfigurePreset.cmake0
-rw-r--r--Tests/RunCMake/CMakePresetsTest/NoConfigurePreset.json.in15
-rw-r--r--Tests/RunCMake/CMakePresetsTest/NoTestsAction-test-noTestsAction-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/NoTestsAction-test-noTestsAction-stderr.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/NoTestsAction.cmake0
-rw-r--r--Tests/RunCMake/CMakePresetsTest/NoTestsAction.json.in19
-rw-r--r--Tests/RunCMake/CMakePresetsTest/PresetsUnsupported-test-x-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresetsTest/PresetsUnsupported-test-x-stderr.txt2
-rw-r--r--Tests/RunCMake/CMakePresetsTest/PresetsUnsupported.json.in7
-rw-r--r--Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake102
-rw-r--r--Tests/RunCMake/CMakePresetsTest/check.cmake3
-rw-r--r--Tests/RunCMake/CPack/CPackTestHelpers.cmake6
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/CPack/VerifyResult.cmake5
-rw-r--r--Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake5
-rw-r--r--Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake9
-rw-r--r--Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt6
-rw-r--r--Tests/RunCMake/CPack/tests/THREADED/DEB-Prerequirements.cmake1
-rw-r--r--Tests/RunCMake/CPack/tests/THREADED/test.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/THREADED_ALL/DEB-Prerequirements.cmake1
-rw-r--r--Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake2
-rw-r--r--Tests/RunCMake/CTest/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/CTest/Site.cmake5
-rw-r--r--Tests/RunCMake/CTestCommandLine/BadCTestTestfile-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-fail-ctest-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stdout.txt1
-rw-r--r--Tests/RunCMake/CheckModules/CMP0075-stderr.txt13
-rw-r--r--Tests/RunCMake/ClangTidy/OBJC-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/ClangTidy/OBJC-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/ClangTidy/OBJC-launch.cmake3
-rw-r--r--Tests/RunCMake/ClangTidy/OBJC.cmake3
-rw-r--r--Tests/RunCMake/ClangTidy/OBJCXX-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/ClangTidy/OBJCXX-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/ClangTidy/OBJCXX-launch.cmake3
-rw-r--r--Tests/RunCMake/ClangTidy/OBJCXX.cmake3
-rw-r--r--Tests/RunCMake/ClangTidy/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/ClangTidy/main.m4
-rw-r--r--Tests/RunCMake/ClangTidy/main.mm (renamed from Tests/Server/buildsystem1/main.cpp)1
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/C-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/D-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_server-arg-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_server-pipe-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_server-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_server-stderr.txt1
-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.cmake15
-rw-r--r--Tests/RunCMake/CommandLine/U-no-arg-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/build-no-dir-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends-check.cmake5
-rw-r--r--Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ExportCompileCommands/Properties.cmake22
-rw-r--r--Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand-check.cmake32
-rw-r--r--Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake7
-rw-r--r--Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/ExportCompileCommands/expected_file.c0
-rw-r--r--Tests/RunCMake/ExternalData/BadArguments-stderr.txt7
-rw-r--r--Tests/RunCMake/ExternalData/BadArguments.cmake5
-rw-r--r--Tests/RunCMake/ExternalData/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD-rebuild-check.cmake19
-rw-r--r--Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake28
-rw-r--r--Tests/RunCMake/ExternalProject/FetchGitTags.cmake67
-rw-r--r--Tests/RunCMake/ExternalProject/FetchGitTags/CMakeLists.txt15
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt7
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake12
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt7
-rw-r--r--Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake13
-rw-r--r--Tests/RunCMake/ExternalProject/RunCMakeTest.cmake41
-rw-r--r--Tests/RunCMake/FileAPI/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json8
-rw-r--r--Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-prep.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/toolchains-v1-ClientStateless-check.cmake11
-rw-r--r--Tests/RunCMake/FileAPI/toolchains-v1-ClientStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/toolchains-v1-SharedStateless-check.cmake10
-rw-r--r--Tests/RunCMake/FileAPI/toolchains-v1-SharedStateless-prep.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/toolchains-v1-check.py86
-rw-r--r--Tests/RunCMake/FileAPI/toolchains-v1.cmake22
-rw-r--r--Tests/RunCMake/File_Configure/AtOnly.cmake12
-rw-r--r--Tests/RunCMake/File_Configure/BadArg-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Configure/BadArgContent-result.txt0
-rw-r--r--Tests/RunCMake/File_Configure/BadArgContent-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Configure/BadArgContent.cmake1
-rw-r--r--Tests/RunCMake/File_Configure/BadArgOutput-result.txt1
-rw-r--r--Tests/RunCMake/File_Configure/BadArgOutput-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Configure/BadArgOutput.cmake (renamed from Tests/RunCMake/File_Configure/BadArg.cmake)0
-rw-r--r--Tests/RunCMake/File_Configure/EscapeQuotes.cmake12
-rw-r--r--Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake11
-rw-r--r--Tests/RunCMake/File_Configure/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/File_Configure/UnrecognizedArgs-result.txt1
-rw-r--r--Tests/RunCMake/File_Configure/UnrecognizedArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Configure/UnrecognizedArgs.cmake1
-rw-r--r--Tests/RunCMake/File_Generate/CustomFilePermissions.cmake15
-rw-r--r--Tests/RunCMake/File_Generate/CustomFilePermissionsVerify.cmake36
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-Default.cmake35
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg.cmake7
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-NoArg-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-NoArg-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-NoArg.cmake7
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-Unix.cmake33
-rw-r--r--Tests/RunCMake/File_Generate/NewLineStyle-Win32.cmake33
-rw-r--r--Tests/RunCMake/File_Generate/NoSourcePermissions.cmake10
-rw-r--r--Tests/RunCMake/File_Generate/NoSourcePermissionsVerify.cmake36
-rw-r--r--Tests/RunCMake/File_Generate/RunCMakeTest.cmake32
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions1-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions1-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions1.cmake5
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions2-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions2-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions2.cmake5
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions3-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions3-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions3.cmake5
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions4-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions4-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions4.cmake4
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions5-result.txt1
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions5-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Generate/SourcePermissions5.cmake4
-rw-r--r--Tests/RunCMake/File_Generate/UseSourcePermissions.cmake11
-rw-r--r--Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake51
-rw-r--r--Tests/RunCMake/File_Generate/VerifyContent.cmake4
-rw-r--r--Tests/RunCMake/FindOpenSSL/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/FindOpenSSL/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/FindOpenSSL/version-exact.cmake19
-rw-r--r--Tests/RunCMake/FindOpenSSL/version-range.cmake37
-rw-r--r--Tests/RunCMake/FindOpenSSL/version.cmake19
-rw-r--r--Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt12
-rw-r--r--Tests/RunCMake/GNUInstallDirs/GetAbs.cmake11
-rw-r--r--Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/GenerateExportHeader/GEH.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target-check.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target.cmake8
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target-check.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target-check.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target.cmake4
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt46
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt54
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest.cmake8
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake5
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake5
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestXML.cmake5
-rw-r--r--Tests/RunCMake/GoogleTest/fake_gtest.cpp3
-rw-r--r--Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake8
-rw-r--r--Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-NEW.cmake2
-rw-r--r--Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD.cmake2
-rw-r--r--Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-WARN.cmake2
-rw-r--r--Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-common.cmake12
-rw-r--r--Tests/RunCMake/MSVCRuntimeTypeInfo/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/MSVCRuntimeTypeInfo/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt5
-rw-r--r--Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake8
-rw-r--r--Tests/RunCMake/Make/MakefileConflict.cmake5
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake9
-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/Ninja/Qt5AutoMocDeps.cmake4
-rw-r--r--Tests/RunCMake/Ninja/QtSubDir1/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/Ninja/QtSubDir2/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/Ninja/QtSubDir3/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake13
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-again-ninja-check.cmake (renamed from Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake)0
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt5
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-in-release-graph-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake167
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/PostBuild-debug-in-release-graph-build-stdout.txt2
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/PostBuild-release-build-stdout.txt3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/PostBuild.cmake6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Qt5.cmake3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake107
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-targets-debug-ninja-stdout.txt3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-targets-default-ninja-stdout.txt3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-targets-release-ninja-stdout.txt3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/echo.c21
-rw-r--r--Tests/RunCMake/ObjectLibrary/ImportMultiArch-check.cmake15
-rw-r--r--Tests/RunCMake/ObjectLibrary/ImportMultiArch.cmake13
-rw-r--r--Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt5
-rw-r--r--Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake1
-rw-r--r--Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake6
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake29
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output1
-rw-r--r--Tests/RunCMake/Policy/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Policy/InvalidMaxVersion-result.txt1
-rw-r--r--Tests/RunCMake/Policy/InvalidMaxVersion-stderr.txt5
-rw-r--r--Tests/RunCMake/Policy/InvalidMaxVersion.cmake5
-rw-r--r--Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven-result.txt0
-rw-r--r--Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven-stderr.txt5
-rw-r--r--Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven.cmake1
-rw-r--r--Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven-result.txt1
-rw-r--r--Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven-stderr.txt5
-rw-r--r--Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven.cmake1
-rw-r--r--Tests/RunCMake/Policy/InvalidVersion-result.txt0
-rw-r--r--Tests/RunCMake/Policy/InvalidVersion-stderr.txt5
-rw-r--r--Tests/RunCMake/Policy/InvalidVersion.cmake5
-rw-r--r--Tests/RunCMake/Policy/MinVersionLargerThanMax-result.txt1
-rw-r--r--Tests/RunCMake/Policy/MinVersionLargerThanMax-stderr.txt4
-rw-r--r--Tests/RunCMake/Policy/MinVersionLargerThanMax.cmake1
-rw-r--r--Tests/RunCMake/Policy/RunCMakeTest.cmake19
-rw-r--r--Tests/RunCMake/Policy/TooManyVersionsGiven-result.txt1
-rw-r--r--Tests/RunCMake/Policy/TooManyVersionsGiven-stderr.txt4
-rw-r--r--Tests/RunCMake/Policy/TooManyVersionsGiven.cmake1
-rw-r--r--Tests/RunCMake/Policy/VersionLowerThan2_4-result.txt1
-rw-r--r--Tests/RunCMake/Policy/VersionLowerThan2_4-stderr.txt6
-rw-r--r--Tests/RunCMake/Policy/VersionLowerThan2_4.cmake1
-rw-r--r--Tests/RunCMake/Policy/VersionNotGiven-result.txt1
-rw-r--r--Tests/RunCMake/Policy/VersionNotGiven-stderr.txt4
-rw-r--r--Tests/RunCMake/Policy/VersionNotGiven.cmake1
-rw-r--r--Tests/RunCMake/Policy/VeryHighVersion-result.txt1
-rw-r--r--Tests/RunCMake/Policy/VeryHighVersion-stderr.txt7
-rw-r--r--Tests/RunCMake/Policy/VeryHighVersion.cmake1
-rw-r--r--Tests/RunCMake/PrecompileHeaders/CXXnotC.cmake15
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFromObjLib.cmake131
-rw-r--r--Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/include/cxx_pch.h1
-rw-r--r--Tests/RunCMake/PrecompileHeaders/no_pch.c7
-rw-r--r--Tests/RunCMake/PrecompileHeaders/use_pch.cxx9
-rw-r--r--Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt10
-rw-r--r--Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt10
-rw-r--r--Tests/RunCMake/Syntax/ImproperNesting-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/ImproperNesting-stderr.txt4
-rw-r--r--Tests/RunCMake/Syntax/ImproperNesting.cmake7
-rw-r--r--Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt10
-rw-r--r--Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt10
-rw-r--r--Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt2
-rw-r--r--Tests/RunCMake/Syntax/NameWithTabs-stderr.txt2
-rw-r--r--Tests/RunCMake/Syntax/Override.cmake6
-rw-r--r--Tests/RunCMake/Syntax/OverrideBreak-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideContinue-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideElse-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideElseIf-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndForeach-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndFunction-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndIf-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndMacro-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideEndWhile-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideForeach-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideFunction-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideIf-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideMacro-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideReturn-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/OverrideWhile-result.txt1
-rw-r--r--Tests/RunCMake/Syntax/ParenInENV-stderr.txt4
-rw-r--r--Tests/RunCMake/Syntax/RunCMakeTest.cmake28
-rw-r--r--Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt2
-rw-r--r--Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt2
-rw-r--r--Tests/RunCMake/TargetObjects/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/TargetObjects/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion-result.txt1
-rw-r--r--Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion-stderr.txt10
-rw-r--r--Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion.cmake12
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake16
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt4
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt4
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt1
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt4
-rw-r--r--Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake2
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/ToolchainFile/CheckLanguage-stdout.txt1
-rw-r--r--Tests/RunCMake/ToolchainFile/CheckLanguage-toolchain.cmake4
-rw-r--r--Tests/RunCMake/ToolchainFile/CheckLanguage.cmake2
-rw-r--r--Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/TransformDepfile/RunCMakeTest.cmake21
-rw-r--r--Tests/RunCMake/TransformDepfile/deps-unix.d6
-rw-r--r--Tests/RunCMake/TransformDepfile/deps-unix.d.txt8
-rw-r--r--Tests/RunCMake/TransformDepfile/deps-unix.tlog.txt6
-rw-r--r--Tests/RunCMake/TransformDepfile/deps-windows.d6
-rw-r--r--Tests/RunCMake/TransformDepfile/deps-windows.d.txt8
-rw-r--r--Tests/RunCMake/TransformDepfile/deps-windows.tlog.txt6
-rw-r--r--Tests/RunCMake/TransformDepfile/empty.d0
-rw-r--r--Tests/RunCMake/TransformDepfile/empty.d.txt0
-rw-r--r--Tests/RunCMake/TransformDepfile/empty.tlog.txt0
-rw-r--r--Tests/RunCMake/TransformDepfile/gccdepfile.cmake16
-rw-r--r--Tests/RunCMake/TransformDepfile/invalid-gcc-result.txt (renamed from Tests/RunCMake/CommandLine/E_server-pipe-result.txt)0
-rw-r--r--Tests/RunCMake/TransformDepfile/invalid-tlog-result.txt1
-rw-r--r--Tests/RunCMake/TransformDepfile/invalid.d1
-rw-r--r--Tests/RunCMake/TransformDepfile/noexist.d.txt0
-rw-r--r--Tests/RunCMake/TransformDepfile/noexist.tlog.txt0
-rw-r--r--Tests/RunCMake/TransformDepfile/vstlog.cmake16
-rw-r--r--Tests/RunCMake/UnityBuild/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/UnityBuild/f.cxx5
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_anon_ns-build-check.cmake10
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_anon_ns.cmake11
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_anon_ns_group_mode.cmake19
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_anon_ns_no_unity_build.cmake11
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_anon_ns_test_files.cmake31
-rw-r--r--Tests/RunCMake/VS10Project/CustomCommandGenex-check.cmake37
-rw-r--r--Tests/RunCMake/VS10Project/CustomCommandGenex.cmake21
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-result.txt1
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-stderr.txt6
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct.cmake2
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-result.txt1
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-stderr.txt6
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW.cmake2
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct.cmake2
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD.cmake2
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct-stderr.txt9
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct.cmake2
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-stderr.txt18
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN.cmake2
-rw-r--r--Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake7
-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.cmake30
-rw-r--r--Tests/RunCMake/XcodeProject/SearchPaths-check.cmake76
-rw-r--r--Tests/RunCMake/XcodeProject/SearchPaths.cmake21
-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/add_custom_command/AppendNotOutput-stderr.txt2
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt53
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct.cmake3
-rw-r--r--Tests/RunCMake/add_custom_command/BadCommand-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/BadCommand-stderr.txt21
-rw-r--r--Tests/RunCMake/add_custom_command/BadCommand.cmake3
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput-stderr.txt53
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput.cmake3
-rw-r--r--Tests/RunCMake/add_custom_command/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt53
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct.cmake3
-rw-r--r--Tests/RunCMake/add_custom_target/BadCommand-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_target/BadCommand-stderr.txt21
-rw-r--r--Tests/RunCMake/add_custom_target/BadCommand.cmake4
-rw-r--r--Tests/RunCMake/add_custom_target/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/add_library/CMP0073-stderr.txt10
-rw-r--r--Tests/RunCMake/cmake_path/APPEND_STRING-OUTPUT_VARIABLE-invalid-arg-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/APPEND_STRING-OUTPUT_VARIABLE-no-arg-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/APPEND_STRING-wrong-path-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/APPEND_STRING.cmake (renamed from Tests/RunCMake/cmake_path/CONCAT.cmake)6
-rw-r--r--Tests/RunCMake/cmake_path/COMPARE.cmake8
-rw-r--r--Tests/RunCMake/cmake_path/GET-RELATIVE_PART-invalid-output-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/GET-RELATIVE_PART-missing-output-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/GET-RELATIVE_PART-unexpected-arg-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/GET-RELATIVE_PART-wrong-path-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/GET.cmake12
-rw-r--r--Tests/RunCMake/cmake_path/HASH.cmake5
-rw-r--r--Tests/RunCMake/cmake_path/HAS_ITEM.cmake20
-rw-r--r--Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-invalid-output-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-missing-output-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-unexpected-arg-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-wrong-path-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/IS_PREFIX.cmake5
-rw-r--r--Tests/RunCMake/cmake_path/PROXIMATE_PATH.cmake41
-rw-r--r--Tests/RunCMake/cmake_path/RunCMakeTest.cmake46
-rw-r--r--Tests/RunCMake/cmake_path/SET-missing-output-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/SET-unexpected-arg-result.txt1
-rw-r--r--Tests/RunCMake/cmake_path/SET.cmake (renamed from Tests/RunCMake/cmake_path/CMAKE_PATH.cmake)18
-rw-r--r--Tests/RunCMake/configure_file/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissions-result.txt0
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissions-stderr.txt0
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissions.cmake34
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-stderr.txt5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1.cmake5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-stderr.txt5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2.cmake5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-stderr.txt5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3.cmake5
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-stderr.txt4
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4.cmake4
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-result.txt1
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-stderr.txt4
-rw-r--r--Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5.cmake6
-rw-r--r--Tests/RunCMake/configure_file/UseSourcePermissions.cmake40
-rw-r--r--Tests/RunCMake/configure_file/sourcefile.txt1
-rw-r--r--Tests/RunCMake/ctest_submit/CTestConfig.cmake.in4
-rw-r--r--Tests/RunCMake/file-RPATH/Common.cmake (renamed from Tests/CMakeTests/ELFTest.cmake.in)13
-rw-r--r--Tests/RunCMake/file-RPATH/ELF.cmake9
-rwxr-xr-x[-rw-r--r--]Tests/RunCMake/file-RPATH/ELF/elf32lsb.bin (renamed from Tests/CMakeTests/ELF/elf32lsb.bin)bin2824 -> 2824 bytes
-rwxr-xr-x[-rw-r--r--]Tests/RunCMake/file-RPATH/ELF/elf32msb.bin (renamed from Tests/CMakeTests/ELF/elf32msb.bin)bin17984 -> 17984 bytes
-rwxr-xr-x[-rw-r--r--]Tests/RunCMake/file-RPATH/ELF/elf64lsb.bin (renamed from Tests/CMakeTests/ELF/elf64lsb.bin)bin4320 -> 4320 bytes
-rwxr-xr-x[-rw-r--r--]Tests/RunCMake/file-RPATH/ELF/elf64msb.bin (renamed from Tests/CMakeTests/ELF/elf64msb.bin)bin18704 -> 18704 bytes
-rw-r--r--Tests/RunCMake/file-RPATH/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/file-RPATH/XCOFF.cmake7
-rw-r--r--Tests/RunCMake/file-RPATH/XCOFF/xcoff32.binbin0 -> 1706 bytes
-rw-r--r--Tests/RunCMake/file-RPATH/XCOFF/xcoff64.binbin0 -> 2291 bytes
-rw-r--r--Tests/RunCMake/get_property/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_empty-result.txt1
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_empty-stderr.txt4
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_empty.cmake1
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_missing-result.txt1
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_missing-stderr.txt4
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_missing.cmake1
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_missingWithDir-result.txt1
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_missingWithDir-stderr.txt4
-rw-r--r--Tests/RunCMake/get_property/get_directory_property_missingWithDir.cmake1
-rw-r--r--Tests/RunCMake/if/duplicate-deep-else-stderr.txt6
-rw-r--r--Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt6
-rw-r--r--Tests/RunCMake/if/duplicate-else-stderr.txt6
-rw-r--r--Tests/RunCMake/if/misplaced-elseif-stderr.txt6
-rw-r--r--Tests/RunCMake/include/ExportExportInclude-stderr.txt2
-rw-r--r--Tests/RunCMake/include/IncludeIsDirectory-result.txt1
-rw-r--r--Tests/RunCMake/include/IncludeIsDirectory-stderr.txt6
-rw-r--r--Tests/RunCMake/include/IncludeIsDirectory.cmake1
-rw-r--r--Tests/RunCMake/include/IncludeMalformed-result.txt1
-rw-r--r--Tests/RunCMake/include/IncludeMalformed-stderr.txt13
-rw-r--r--Tests/RunCMake/include/IncludeMalformed.cmake1
-rw-r--r--Tests/RunCMake/include/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/include/malformedInclude.cmake1
-rw-r--r--Tests/RunCMake/install/FILES-RENAME-all-check.cmake1
-rw-r--r--Tests/RunCMake/install/FILES-RENAME-bad-result.txt1
-rw-r--r--Tests/RunCMake/install/FILES-RENAME-bad-stderr.txt6
-rw-r--r--Tests/RunCMake/install/FILES-RENAME-bad.cmake4
-rw-r--r--Tests/RunCMake/install/FILES-RENAME.cmake4
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake2
-rw-r--r--Tests/RunCMake/list/REMOVE_ITEM-NoItemArg.cmake5
-rw-r--r--Tests/RunCMake/list/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt4
-rw-r--r--Tests/RunCMake/pseudo_llvm-rc.c30
-rw-r--r--Tests/RunCMake/separate_arguments/ProgramCommand.cmake2
-rw-r--r--Tests/RunCMake/separate_arguments/ProgramCommandWithSeparateArgs.cmake2
-rw-r--r--Tests/RunCMake/target_include_directories/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/target_include_directories/include_after.cmake18
-rw-r--r--Tests/RunCMake/target_include_directories/include_before.cmake18
-rw-r--r--Tests/RunCMake/target_include_directories/include_default.cmake18
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx17
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake9
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c12
-rw-r--r--Tests/RunCMake/try_run/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/try_run/WorkingDirArg.cmake9
-rw-r--r--Tests/RunCMake/while/EndAlone-stderr.txt7
-rw-r--r--Tests/RunCMake/while/EndAloneArgs-stderr.txt7
-rw-r--r--Tests/RunCMake/while/EndMissing-stderr.txt10
-rw-r--r--Tests/RunCMake/while/MissingArgument-stderr.txt11
-rw-r--r--Tests/RunCMake/while/MissingArgument.cmake1
-rw-r--r--Tests/Server/CMakeLists.txt28
-rw-r--r--Tests/Server/buildsystem1/CMakeLists.txt22
-rw-r--r--Tests/Server/buildsystem1/subdir/CMakeLists.txt5
-rw-r--r--Tests/Server/cmakelib.py380
-rw-r--r--Tests/Server/server-test.py105
-rw-r--r--Tests/Server/tc_buildsystem1.json27
-rw-r--r--Tests/Server/tc_cache.json24
-rw-r--r--Tests/Server/tc_globalSettings.json140
-rw-r--r--Tests/Server/tc_handshake.json75
-rw-r--r--Tests/SetLang/CMakeLists.txt8
-rw-r--r--Tests/SetLang/bar.c14
-rw-r--r--Tests/SetLang/zoom.zzz7
-rw-r--r--Tests/UseSWIG/BasicPerl/CMakeLists.txt2
-rw-r--r--Tests/UseSWIG/BasicPython/CMakeLists.txt2
-rw-r--r--Tests/UseSWIG/CMakeLists.txt24
-rw-r--r--Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt4
-rw-r--r--Tests/VSMidl/CMakeLists.txt2
-rw-r--r--Tests/VSMidl/src/CMakeLists.txt2
-rw-r--r--Tests/VSWinStorePhone/CMakeLists.txt4
1074 files changed, 12007 insertions, 1854 deletions
diff --git a/Tests/Architecture/CMakeLists.txt b/Tests/Architecture/CMakeLists.txt
index ea5fc0b..96def00 100644
--- a/Tests/Architecture/CMakeLists.txt
+++ b/Tests/Architecture/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(Architecture C)
function(test_for_xcode4 result_var)
diff --git a/Tests/ArgumentExpansion/CMakeLists.txt b/Tests/ArgumentExpansion/CMakeLists.txt
index 1735400..da3bb4c 100644
--- a/Tests/ArgumentExpansion/CMakeLists.txt
+++ b/Tests/ArgumentExpansion/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(ArgumentExpansion)
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
index a574c4e..0a2c819 100644
--- a/Tests/Assembler/CMakeLists.txt
+++ b/Tests/Assembler/CMakeLists.txt
@@ -9,7 +9,7 @@ set(SRCS)
# and also generate assembler files from C:
if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND
NOT CMAKE_OSX_ARCHITECTURES MATCHES ";")
- if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX)
+ if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID MATCHES "Intel" AND UNIX)
AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"))
set(C_FLAGS "${CMAKE_C_FLAGS}")
separate_arguments(C_FLAGS)
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/BundleTest/BundleLib.cxx b/Tests/BundleTest/BundleLib.cxx
index b7fd70d..d25ad27 100644
--- a/Tests/BundleTest/BundleLib.cxx
+++ b/Tests/BundleTest/BundleLib.cxx
@@ -52,8 +52,8 @@ int foo(char* exec)
(void)br;
int res1 = findBundleFile(exec, "Resources/randomResourceFile.plist");
- int res2 = findBundleFile(exec, "MacOS/SomeRandomFile.txt");
- int res3 = findBundleFile(exec, "MacOS/README.rst");
+ int res2 = findBundleFile(exec, "Other/SomeRandomFile.txt");
+ int res3 = findBundleFile(exec, "Other/README.rst");
if (!res1 || !res2 || !res3) {
return 1;
}
diff --git a/Tests/BundleTest/BundleSubDir/CMakeLists.txt b/Tests/BundleTest/BundleSubDir/CMakeLists.txt
index 5f91f20..ceb5216 100644
--- a/Tests/BundleTest/BundleSubDir/CMakeLists.txt
+++ b/Tests/BundleTest/BundleSubDir/CMakeLists.txt
@@ -16,7 +16,7 @@ set_source_files_properties(
"${BundleTest_SOURCE_DIR}/SomeRandomFile.txt"
"${BundleTest_SOURCE_DIR}/../../README.rst"
PROPERTIES
- MACOSX_PACKAGE_LOCATION MacOS
+ MACOSX_PACKAGE_LOCATION Other
)
add_executable(SecondBundle
@@ -35,11 +35,7 @@ install(TARGETS SecondBundle DESTINATION Applications)
# installed into a location that uses this output name this will fail if the
# bundle does not respect the name. Also the executable will not be found by
# the test driver if this does not work.
-set_target_properties(SecondBundle PROPERTIES
- OUTPUT_NAME SecondBundleExe
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
- XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO"
- )
+set_target_properties(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe)
# Express one app bundle in terms of another's SOURCES to verify that
# the generators do not expose the Info.plist of one to the other.
diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt
index 1bedc70..c63461a 100644
--- a/Tests/BundleTest/CMakeLists.txt
+++ b/Tests/BundleTest/CMakeLists.txt
@@ -3,6 +3,15 @@ project(BundleTest)
set(MACOSX_BUNDLE_INFO_STRING "bundle_info_string")
set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
+if(CMAKE_GENERATOR STREQUAL "Xcode" AND
+ "${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64")
+ # Tell Xcode to pretend the linker signed binaries so that
+ # editing with install_name_tool preserves ad-hoc signatures.
+ # See CMake Issue 21854.
+ # This option is supported by codesign on macOS 11 or higher.
+ set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "-o linker-signed")
+endif()
+
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist"
COMMAND /bin/cp
@@ -19,7 +28,7 @@ set_source_files_properties(
SomeRandomFile.txt
"${BundleTest_SOURCE_DIR}/../../README.rst"
PROPERTIES
- MACOSX_PACKAGE_LOCATION MacOS
+ MACOSX_PACKAGE_LOCATION Other
)
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar")
@@ -56,11 +65,7 @@ install(TARGETS BundleTest DESTINATION Applications)
# installed into a location that uses this output name this will fail if the
# bundle does not respect the name. Also the executable will not be found by
# the test driver if this does not work.
-set_target_properties(BundleTest PROPERTIES
- OUTPUT_NAME BundleTestExe
- XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
- XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO"
- )
+set_target_properties(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe)
# Test executable versioning if it is supported.
if(NOT XCODE)
diff --git a/Tests/BundleUtilities/CMakeLists.txt b/Tests/BundleUtilities/CMakeLists.txt
index 69ef535..4a95e2f 100644
--- a/Tests/BundleUtilities/CMakeLists.txt
+++ b/Tests/BundleUtilities/CMakeLists.txt
@@ -1,6 +1,15 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(BundleUtilities)
+if(CMAKE_GENERATOR STREQUAL "Xcode" AND
+ "${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64")
+ # Tell Xcode to pretend the linker signed binaries so that
+ # editing with install_name_tool preserves ad-hoc signatures.
+ # See CMake Issue 21854.
+ # This option is supported by codesign on macOS 11 or higher.
+ set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "-o linker-signed")
+endif()
+
###### the various types of dependencies we can have
# a shared library
diff --git a/Tests/CFBundleTest/CMakeLists.txt b/Tests/CFBundleTest/CMakeLists.txt
index b2b1b73..5f2e8ec 100644
--- a/Tests/CFBundleTest/CMakeLists.txt
+++ b/Tests/CFBundleTest/CMakeLists.txt
@@ -1,6 +1,6 @@
#this is adapted from FireBreath (http://www.firebreath.org)
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CFBundleTest)
diff --git a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
index 995b32c..b28d0be 100644
--- a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
+++ b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(add_compile_options)
diff --git a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
index a5bc1e1..72b3502 100644
--- a/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_definitions/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(target_compile_definitions)
diff --git a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt
index a7055b1..268c7eb 100644
--- a/Tests/CMakeCommands/target_compile_options/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_options/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(target_compile_options)
diff --git a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
index 8713d99..0702ab5 100644
--- a/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_include_directories/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(target_include_directories)
diff --git a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
index 5c704ac..aa8e21a 100644
--- a/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Using 2.8 will trigger a deprecation warning. In this case it's explicitly
+# intentional since the tests checks various policy implementations prior to
+# 2.8.12
cmake_minimum_required(VERSION 2.8)
project(target_link_libraries)
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index 2c77acc..0ebe00e 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -36,8 +36,8 @@ public:
void Parse()
{
- NextNonWhitespace();
- ParseTranslationUnits();
+ this->NextNonWhitespace();
+ this->ParseTranslationUnits();
}
const TranslationUnitsType& GetTranslationUnits()
@@ -49,51 +49,51 @@ private:
void ParseTranslationUnits()
{
this->TranslationUnits = TranslationUnitsType();
- ExpectOrDie('[', "at start of compile command file\n");
+ this->ExpectOrDie('[', "at start of compile command file\n");
do {
- ParseTranslationUnit();
+ this->ParseTranslationUnit();
this->TranslationUnits.push_back(this->Command);
- } while (Expect(','));
- ExpectOrDie(']', "at end of array");
+ } while (this->Expect(','));
+ this->ExpectOrDie(']', "at end of array");
}
void ParseTranslationUnit()
{
this->Command = CommandType();
- if (!Expect('{')) {
+ if (!this->Expect('{')) {
return;
}
- if (Expect('}')) {
+ if (this->Expect('}')) {
return;
}
do {
- ParseString();
+ this->ParseString();
std::string name = this->String;
- ExpectOrDie(':', "between name and value");
- ParseString();
+ this->ExpectOrDie(':', "between name and value");
+ this->ParseString();
std::string value = this->String;
this->Command[name] = value;
- } while (Expect(','));
- ExpectOrDie('}', "at end of object");
+ } while (this->Expect(','));
+ this->ExpectOrDie('}', "at end of object");
}
void ParseString()
{
this->String = "";
- if (!Expect('"')) {
+ if (!this->Expect('"')) {
return;
}
- while (!Expect('"')) {
- Expect('\\');
- this->String.append(1, C);
- Next();
+ while (!this->Expect('"')) {
+ this->Expect('\\');
+ this->String.append(1, this->C);
+ this->Next();
}
}
bool Expect(char c)
{
if (this->C == c) {
- NextNonWhitespace();
+ this->NextNonWhitespace();
return true;
}
return false;
@@ -101,23 +101,23 @@ private:
void ExpectOrDie(char c, const std::string& message)
{
- if (!Expect(c)) {
- ErrorExit(std::string("'") + c + "' expected " + message + ".");
+ if (!this->Expect(c)) {
+ this->ErrorExit(std::string("'") + c + "' expected " + message + ".");
}
}
void NextNonWhitespace()
{
do {
- Next();
- } while (IsWhitespace());
+ this->Next();
+ } while (this->IsWhitespace());
}
void Next()
{
- this->C = char(Input.get());
+ this->C = char(this->Input.get());
if (this->Input.bad()) {
- ErrorExit("Unexpected end of file.");
+ this->ErrorExit("Unexpected end of file.");
}
}
@@ -127,7 +127,7 @@ private:
exit(1);
}
- bool IsWhitespace()
+ bool IsWhitespace() const
{
return (this->C == ' ' || this->C == '\t' || this->C == '\n' ||
this->C == '\r');
diff --git a/Tests/CMakeLib/testCMExtMemory.cxx b/Tests/CMakeLib/testCMExtMemory.cxx
index 2aeaf7f..d8932ce 100644
--- a/Tests/CMakeLib/testCMExtMemory.cxx
+++ b/Tests/CMakeLib/testCMExtMemory.cxx
@@ -26,9 +26,9 @@ public:
: value(v)
{
}
- ~Wrapper() { delete value; }
+ ~Wrapper() { delete this->value; }
- T* get() const { return value; }
+ T* get() const { return this->value; }
private:
T* value;
diff --git a/Tests/CMakeLib/testGccDepfileReader.cxx b/Tests/CMakeLib/testGccDepfileReader.cxx
index e79f047..d46e8f3 100644
--- a/Tests/CMakeLib/testGccDepfileReader.cxx
+++ b/Tests/CMakeLib/testGccDepfileReader.cxx
@@ -5,6 +5,8 @@
#include <utility>
#include <vector>
+#include <cm/optional>
+
#include "cmsys/FStream.hxx"
#include "cmGccDepfileReader.h"
@@ -112,17 +114,26 @@ int testGccDepfileReader(int argc, char* argv[])
std::string dataDirPath = argv[1];
dataDirPath += "/testGccDepfileReader_data";
- const int numberOfTestFiles = 3;
+ const int numberOfTestFiles = 7; // 6th file doesn't exist
for (int i = 1; i <= numberOfTestFiles; ++i) {
const std::string base = dataDirPath + "/deps" + std::to_string(i);
const std::string depfile = base + ".d";
const std::string plainDepfile = base + ".txt";
std::cout << "Comparing " << base << " with " << plainDepfile << std::endl;
const auto actual = cmReadGccDepfile(depfile.c_str());
- const auto expected = readPlainDepfile(plainDepfile.c_str());
- if (!compare(actual, expected)) {
- dump("actual", actual);
- dump("expected", expected);
+ if (cmSystemTools::FileExists(plainDepfile)) {
+ if (!actual) {
+ std::cerr << "Reading " << depfile << " should have succeeded\n";
+ return 1;
+ }
+ const auto expected = readPlainDepfile(plainDepfile.c_str());
+ if (!compare(*actual, expected)) {
+ dump("actual", *actual);
+ dump("expected", expected);
+ return 1;
+ }
+ } else if (actual) {
+ std::cerr << "Reading " << depfile << " should have failed\n";
return 1;
}
}
diff --git a/Tests/CMakeLib/testGccDepfileReader_data/deps4.d b/Tests/CMakeLib/testGccDepfileReader_data/deps4.d
new file mode 100644
index 0000000..9977a28
--- /dev/null
+++ b/Tests/CMakeLib/testGccDepfileReader_data/deps4.d
@@ -0,0 +1 @@
+invalid
diff --git a/Tests/CMakeLib/testGccDepfileReader_data/deps5.d b/Tests/CMakeLib/testGccDepfileReader_data/deps5.d
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/CMakeLib/testGccDepfileReader_data/deps5.d
diff --git a/Tests/CMakeLib/testGccDepfileReader_data/deps5.txt b/Tests/CMakeLib/testGccDepfileReader_data/deps5.txt
new file mode 100644
index 0000000..6c4a75b
--- /dev/null
+++ b/Tests/CMakeLib/testGccDepfileReader_data/deps5.txt
@@ -0,0 +1,2 @@
+--RULES--
+--DEPENDENCIES--
diff --git a/Tests/CMakeLib/testGccDepfileReader_data/deps7.d b/Tests/CMakeLib/testGccDepfileReader_data/deps7.d
new file mode 100644
index 0000000..92280cf
--- /dev/null
+++ b/Tests/CMakeLib/testGccDepfileReader_data/deps7.d
@@ -0,0 +1,6 @@
+out1 \
+ out2: \
+ in1 \
+ in2
+
+out3: in3
diff --git a/Tests/CMakeLib/testGccDepfileReader_data/deps7.txt b/Tests/CMakeLib/testGccDepfileReader_data/deps7.txt
new file mode 100644
index 0000000..86b6600
--- /dev/null
+++ b/Tests/CMakeLib/testGccDepfileReader_data/deps7.txt
@@ -0,0 +1,10 @@
+--RULES--
+out1
+out2
+--DEPENDENCIES--
+in1
+in2
+--RULES--
+out3
+--DEPENDENCIES--
+in3
diff --git a/Tests/CMakeLib/testOptional.cxx b/Tests/CMakeLib/testOptional.cxx
index de09c0f..2d7dd7c 100644
--- a/Tests/CMakeLib/testOptional.cxx
+++ b/Tests/CMakeLib/testOptional.cxx
@@ -82,6 +82,18 @@ public:
int Value = 0;
};
+class NoMoveAssignEventLogger : public EventLogger
+{
+public:
+ using EventLogger::EventLogger;
+
+ NoMoveAssignEventLogger(const NoMoveAssignEventLogger&) = default;
+ NoMoveAssignEventLogger(NoMoveAssignEventLogger&&) = default;
+
+ NoMoveAssignEventLogger& operator=(const NoMoveAssignEventLogger&) = default;
+ NoMoveAssignEventLogger& operator=(NoMoveAssignEventLogger&&) = delete;
+};
+
#define ASSERT_TRUE(x) \
do { \
if (!(x)) { \
@@ -328,12 +340,28 @@ static bool testCopyAssign(std::vector<Event>& expected)
o1 = o4; // Intentionally duplicated to test assigning an empty optional to
// an empty optional
+ cm::optional<NoMoveAssignEventLogger> o5{ 1 };
+ auto const* v5 = &*o5;
+ const cm::optional<NoMoveAssignEventLogger> o6{ 2 };
+ auto const* v6 = &*o6;
+ o5 = std::move(o6);
+ const NoMoveAssignEventLogger e7{ 3 };
+ o5 = std::move(e7);
+
expected = {
{ Event::VALUE_CONSTRUCT, v2, nullptr, 4 },
{ Event::COPY_CONSTRUCT, v1, v2, 4 },
{ Event::VALUE_CONSTRUCT, v3, nullptr, 5 },
{ Event::COPY_ASSIGN, v1, v3, 5 },
{ Event::DESTRUCT, v1, nullptr, 5 },
+ { Event::VALUE_CONSTRUCT, v5, nullptr, 1 },
+ { Event::VALUE_CONSTRUCT, v6, nullptr, 2 },
+ { Event::COPY_ASSIGN, v5, v6, 2 },
+ { Event::VALUE_CONSTRUCT, &e7, nullptr, 3 },
+ { Event::COPY_ASSIGN, v5, &e7, 3 },
+ { Event::DESTRUCT, &e7, nullptr, 3 },
+ { Event::DESTRUCT, v6, nullptr, 2 },
+ { Event::DESTRUCT, v5, nullptr, 3 },
{ Event::DESTRUCT, v3, nullptr, 5 },
{ Event::DESTRUCT, v2, nullptr, 4 },
};
diff --git a/Tests/CMakeLib/testRST.expect b/Tests/CMakeLib/testRST.expect
index 970adaa..4870f65 100644
--- a/Tests/CMakeLib/testRST.expect
+++ b/Tests/CMakeLib/testRST.expect
@@ -20,6 +20,12 @@ Environment variable ``SOME_ENV_VAR``.
Environment variable ``some env var`` with space and target.
Generator ``Some Generator`` with space.
Generator ``Some Generator`` with space.
+Generator expression ``SOME_GENEX``.
+Generator expression ``$<SOME_GENEX>`` with brackets.
+Generator expression ``$<SOME_GENEX:...>`` with brackets and parameter.
+Generator expression ``some genex`` with space and target.
+Generator expression ``$<SOME_GENEX>`` with brackets, space, and target.
+Generator expression ``$<SOME_GENEX:...>`` with brackets, parameter, space, and target.
Inline literal ``~!@#$%^&*( )_+-=\\[]{}'":;,<>.?/``.
Inline link Link Text.
Inline link Link Text <With \-escaped Brackets>.
@@ -48,6 +54,22 @@ Bracket Comment Content
Command other_cmd description.
+.. cmake:envvar:: some_var
+
+ Environment variable some_var description.
+
+.. envvar:: other_var
+
+ Environment variable other_var description.
+
+.. cmake:genex:: SOME_GENEX
+
+ Generator expression SOME_GENEX description.
+
+.. genex:: $<OTHER_GENEX>
+
+ Generator expression $<OTHER_GENEX> description.
+
.. cmake:variable:: some_var
Variable some_var description.
diff --git a/Tests/CMakeLib/testRST.rst b/Tests/CMakeLib/testRST.rst
index 6462f1b..44931a7 100644
--- a/Tests/CMakeLib/testRST.rst
+++ b/Tests/CMakeLib/testRST.rst
@@ -27,6 +27,12 @@ Environment variable :envvar:`SOME_ENV_VAR`.
Environment variable :envvar:`some env var <SOME_ENV_VAR>` with space and target.
Generator :generator:`Some Generator` with space.
Generator :cpack_gen:`Some Generator` with space.
+Generator expression :genex:`SOME_GENEX`.
+Generator expression :genex:`$<SOME_GENEX>` with brackets.
+Generator expression :genex:`$<SOME_GENEX:...>` with brackets and parameter.
+Generator expression :genex:`some genex <SOME_GENEX>` with space and target.
+Generator expression :genex:`$<SOME_GENEX> <SOME_GENEX>` with brackets, space, and target.
+Generator expression :genex:`$<SOME_GENEX:...> <SOME_GENEX>` with brackets, parameter, space, and target.
Inline literal ``~!@#$%^&*( )_+-=\\[]{}'":;,<>.?/``.
Inline link `Link Text <ExternalDest>`_.
Inline link `Link Text \<With \\-escaped Brackets\> <ExternalDest>`_.
@@ -51,6 +57,22 @@ Inline literal ``__`` followed by inline link `Link Text <InternalDest_>`_.
Command other_cmd description.
+.. cmake:envvar:: some_var
+
+ Environment variable some_var description.
+
+.. envvar:: other_var
+
+ Environment variable other_var description.
+
+.. cmake:genex:: SOME_GENEX
+
+ Generator expression SOME_GENEX description.
+
+.. genex:: $<OTHER_GENEX>
+
+ Generator expression $<OTHER_GENEX> description.
+
.. cmake:variable:: some_var
Variable some_var description.
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index 61a77cf..a003205 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -181,6 +181,10 @@ bool checkOutput(std::istream& outputStream, std::istream& errorStream)
}
std::string error = getInput(errorStream);
+ auto qemu_error_pos = error.find("qemu:");
+ if (qemu_error_pos != std::string::npos) {
+ error.resize(qemu_error_pos);
+ }
if (error.length() != 3 || error.find('1') == std::string::npos ||
error.find('2') == std::string::npos ||
error.find('3') == std::string::npos) {
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 1fb47cb..8e7c04f 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -256,8 +256,6 @@ if(BUILD_TESTING)
if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_subdirectory(CMakeLib)
-
- add_subdirectory(CMakeServerLib)
endif()
add_subdirectory(CMakeOnly)
add_subdirectory(RunCMake)
@@ -431,6 +429,10 @@ if(BUILD_TESTING)
set(CMAKE_SKIP_VSGNUFortran TRUE)
endif()
endif()
+ if(CMAKE_Fortran_COMPILER_ID STREQUAL IntelLLVM)
+ message(STATUS "Skip VSGNUFortran for ifx until DLLEXPORT support is implemented")
+ set(CMAKE_SKIP_VSGNUFortran TRUE)
+ endif()
if((CMAKE_C_COMPILER MATCHES lsb)
AND (CMAKE_Fortran_COMPILER MATCHES ifort))
message(STATUS "Skip VSGNUFortran for ifort and lsb compilers")
@@ -1155,6 +1157,26 @@ if(BUILD_TESTING)
"components-depend1"
"components-depend2"
"compression")
+ # Run additional tests if dpkg-shlibdeps is available (and is new enough version)
+ find_program(SHLIBDEPS_EXECUTABLE NAMES dpkg-shlibdeps)
+ if(SHLIBDEPS_EXECUTABLE)
+ # Check version of the dpkg-shlibdeps tool
+ execute_process(COMMAND ${CMAKE_COMMAND} -E env LC_ALL=C ${SHLIBDEPS_EXECUTABLE} --version
+ OUTPUT_VARIABLE _TMP_VERSION
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(_TMP_VERSION MATCHES "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)")
+ set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
+ else()
+ unset(SHLIBDEPS_EXECUTABLE_VERSION)
+ endif()
+ if(NOT SHLIBDEPS_EXECUTABLE_VERSION VERSION_LESS 1.19 OR
+ (NOT SHLIBDEPS_EXECUTABLE_VERSION VERSION_LESS 1.17 AND NOT CMAKE_BINARY_DIR MATCHES ".*[ ].*"))
+ list(APPEND DEB_CONFIGURATIONS_TO_TEST "shlibdeps-with-private-lib-failure"
+ "shlibdeps-with-private-lib-success")
+ endif()
+ endif()
+
set(CPackGen "DEB")
set(CPackRun_CPackGen "-DCPackGen=${CPackGen}")
@@ -1281,21 +1303,6 @@ if(BUILD_TESTING)
set_property(TEST CMakeTestAllGenerators PROPERTY RUN_SERIAL 1)
endif()
- if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures)
- set(CTEST_RUN_CMakeTestMultipleConfigures ON)
- endif()
-
- if(CTEST_RUN_CMakeTestMultipleConfigures)
- add_test(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND}
- -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures
- -D gen=${CMAKE_GENERATOR}
- -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR}
- -P ${CMake_SOURCE_DIR}/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
- )
- list(APPEND TEST_BUILD_DIRS
- "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures")
- endif()
-
if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -1427,6 +1434,7 @@ if(BUILD_TESTING)
GTK2
Iconv
ICU
+ Intl
JPEG
JsonCpp
LAPACK
@@ -1944,7 +1952,7 @@ if(BUILD_TESTING)
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR NOT "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
ADD_TEST_MACRO(ForceInclude foo)
endif()
- if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" AND NOT CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
ADD_TEST_MACRO(PrecompiledHeader foo)
endif()
set(MSVCRuntimeLibrary_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
@@ -2010,12 +2018,19 @@ if(BUILD_TESTING)
endif()
endif()
- # For the Watcom WMake generator, avoid the MFC test by default.
if(CTEST_RUN_MFC)
+ # For the Watcom WMake generator, avoid the MFC test by default.
if("${CMAKE_GENERATOR}" MATCHES "WMake")
message(STATUS
"using the Watcom WMake generator, avoiding MFC test")
set(CTEST_RUN_MFC OFF)
+ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "IntelLLVM")
+ # clang-cl cannot deal with implicit dependencies in UTF16 files
+ # (see #18311). IntelLLVM inherits this behavior from Clang.
+ # TODO: maybe clang should also skip the MFC test
+ message(STATUS
+ "using generator other than Visual Studio with clang-cl, avoiding MFC test")
+ set(CTEST_RUN_MFC OFF)
endif()
endif()
@@ -2926,13 +2941,6 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(CMakeCommands.link_directories)
ADD_TEST_MACRO(CMakeCommands.target_link_directories)
- # The cmake server-mode test requires python for a simple client.
- find_package(PythonInterp QUIET)
- if(PYTHON_EXECUTABLE)
- set(Server_BUILD_OPTIONS -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE})
- ADD_TEST_MACRO(Server Server)
- endif()
-
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestTestCrash/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake"
@@ -2947,7 +2955,7 @@ if(BUILD_TESTING)
PASS_REGULAR_EXPRESSION "Failed")
else()
set_tests_properties(CTestTestCrash PROPERTIES
- PASS_REGULAR_EXPRESSION "(Illegal|SegFault|Subprocess aborted)")
+ PASS_REGULAR_EXPRESSION "(Illegal|SegFault|Subprocess aborted|SIGTRAP)")
endif()
configure_file(
@@ -3402,6 +3410,9 @@ if(BUILD_TESTING)
${build_generator_args}
--build-project helloJavaNativeHeaders
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders/"
+ --build-target install
+ --build-options
+ "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/JavaNativeHeaders/Install"
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIG>)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders")
endif()
diff --git a/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt
index 1f9d3ac..7ca68ec 100644
--- a/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckCXXCompilerFlag/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CheckCXXCompilerFlag)
message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
diff --git a/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt b/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt
index 859ec41..4cbccd3 100644
--- a/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckStructHasMember/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CheckStructHasMember)
diff --git a/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt
index 2511064..9f30c7d 100644
--- a/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt
+++ b/Tests/CMakeOnly/MajorVersionSelection/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
if (NOT MAJOR_TEST_MODULE OR NOT MAJOR_TEST_VERSION)
message(FATAL_ERROR "test selection variables not set up")
diff --git a/Tests/CMakeOnly/find_library/CMakeLists.txt b/Tests/CMakeOnly/find_library/CMakeLists.txt
index fe3815e..b23d5e2 100644
--- a/Tests/CMakeOnly/find_library/CMakeLists.txt
+++ b/Tests/CMakeOnly/find_library/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(FindLibraryTest NONE)
set(CMAKE_FIND_DEBUG_MODE 1)
diff --git a/Tests/CMakeOnly/find_path/CMakeLists.txt b/Tests/CMakeOnly/find_path/CMakeLists.txt
index 0e64ed4..bf4e350 100644
--- a/Tests/CMakeOnly/find_path/CMakeLists.txt
+++ b/Tests/CMakeOnly/find_path/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(FindPathTest NONE)
set(CMAKE_FIND_DEBUG_MODE 1)
diff --git a/Tests/CMakeServerLib/CMakeLists.txt b/Tests/CMakeServerLib/CMakeLists.txt
deleted file mode 100644
index 2c23c2d..0000000
--- a/Tests/CMakeServerLib/CMakeLists.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${CMake_BINARY_DIR}/Source
- ${CMake_SOURCE_DIR}/Source
- )
-
-set(CMakeServerLib_TESTS
- testServerBuffering.cpp
- )
-
-create_test_sourcelist(CMakeLib_TEST_SRCS CMakeServerLibTests.cxx ${CMakeServerLib_TESTS})
-add_executable(CMakeServerLibTests ${CMakeLib_TEST_SRCS})
-target_link_libraries(CMakeServerLibTests CMakeLib CMakeServerLib)
-
-SET_PROPERTY(TARGET CMakeServerLibTests PROPERTY C_CLANG_TIDY "")
-SET_PROPERTY(TARGET CMakeServerLibTests PROPERTY CXX_CLANG_TIDY "")
-
-foreach(testfile ${CMakeServerLib_TESTS})
- get_filename_component(test "${testfile}" NAME_WE)
- add_test(CMakeServerLib.${test} CMakeServerLibTests ${test} ${${test}_ARGS})
-endforeach()
diff --git a/Tests/CMakeServerLib/testServerBuffering.cpp b/Tests/CMakeServerLib/testServerBuffering.cpp
deleted file mode 100644
index 6f22940..0000000
--- a/Tests/CMakeServerLib/testServerBuffering.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-#include <iostream>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "cmConnection.h"
-#include "cmServerConnection.h"
-
-void print_error(const std::vector<std::string>& input,
- const std::vector<std::string>& output)
-{
- std::cerr << "Responses don't equal input messages input." << std::endl;
- std::cerr << "Responses: " << std::endl;
-
- for (auto& msg : output) {
- std::cerr << "'" << msg << "'" << std::endl;
- }
-
- std::cerr << "Input messages" << std::endl;
- for (auto& msg : input) {
- std::cerr << "'" << msg << "'" << std::endl;
- }
-}
-
-std::string trim_newline(const std::string& _buffer)
-{
- auto buffer = _buffer;
- while (!buffer.empty() && (buffer.back() == '\n' || buffer.back() == '\r')) {
- buffer.pop_back();
- }
- return buffer;
-}
-
-int testServerBuffering(int, char** const)
-{
- std::vector<std::string> messages = {
- "{ \"test\": 10}", "{ \"test\": { \"test2\": false} }",
- "{ \"test\": [1, 2, 3] }",
- "{ \"a\": { \"1\": {}, \n\n\n \"2\":[] \t\t\t\t}}"
- };
-
- std::string fullMessage;
- for (auto& msg : messages) {
- fullMessage += "[== \"CMake Server\" ==[\n";
- fullMessage += msg;
- fullMessage += "\n]== \"CMake Server\" ==]\n";
- }
-
- // The buffering strategy should cope with any fragmentation, including
- // just getting the characters one at a time.
- auto bufferingStrategy =
- std::unique_ptr<cmConnectionBufferStrategy>(new cmServerBufferStrategy);
- std::vector<std::string> response;
- std::string rawBuffer;
- for (auto& messageChar : fullMessage) {
- rawBuffer += messageChar;
- std::string packet = bufferingStrategy->BufferMessage(rawBuffer);
- do {
- if (!packet.empty() && packet != "\r\n") {
- response.push_back(trim_newline(packet));
- }
- packet = bufferingStrategy->BufferMessage(rawBuffer);
- } while (!packet.empty());
- }
-
- if (response != messages) {
- print_error(messages, response);
- return 1;
- }
-
- // We should also be able to deal with getting a bunch at once
- response.clear();
- std::string packet = bufferingStrategy->BufferMessage(fullMessage);
- do {
- if (!packet.empty() && packet != "\r\n") {
- response.push_back(trim_newline(packet));
- }
- packet = bufferingStrategy->BufferMessage(fullMessage);
- } while (!packet.empty());
-
- if (response != messages) {
- print_error(messages, response);
- return 1;
- }
-
- return 0;
-}
diff --git a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
deleted file mode 100644
index a79bfcb..0000000
--- a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
+++ /dev/null
@@ -1,165 +0,0 @@
-if(NOT DEFINED CMake_SOURCE_DIR)
- message(FATAL_ERROR "CMake_SOURCE_DIR not defined")
-endif()
-
-if(NOT DEFINED dir)
- message(FATAL_ERROR "dir not defined")
-endif()
-
-if(NOT DEFINED gen)
- message(FATAL_ERROR "gen not defined")
-endif()
-
-# Call cmake once to get a baseline/reference output build tree: "Build".
-# Then call cmake N more times, each time making a copy of the entire
-# build tree after cmake is done configuring/generating. At the end,
-# analyze the diffs in the generated build trees. Expect no diffs.
-#
-message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
-
-set(N 7)
-
-# First setup source and binary trees:
-#
-execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
- ${dir}/Source
-)
-
-execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
- ${dir}/Build
-)
-
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${CMake_SOURCE_DIR}/Tests/CTestTest/SmallAndFast
- ${dir}/Source
-)
-
-execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
- ${dir}/Build
-)
-
-# Patch SmallAndFast to build a .cxx executable too:
-#
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy
- ${dir}/Source/echoargs.c
- ${dir}/Source/echoargs.cxx
-)
-file(APPEND "${dir}/Source/CMakeLists.txt" "\nadd_executable(echoargsCXX echoargs.cxx)\n")
-
-# Loop N times, saving a copy of the configured/generated build tree each time:
-#
-foreach(i RANGE 1 ${N})
- # Equivalent sequence of shell commands:
- #
- message(STATUS "${i}: cd Build && cmake -G \"${gen}\" ../Source && cd .. && cp -r Build b${i}")
-
- # Run cmake:
- #
- execute_process(COMMAND ${CMAKE_COMMAND} -G ${gen} ../Source
- RESULT_VARIABLE result
- OUTPUT_VARIABLE stdout
- ERROR_VARIABLE stderr
- WORKING_DIRECTORY ${dir}/Build
- )
-
- message(STATUS "result='${result}'")
- message(STATUS "stdout='${stdout}'")
- message(STATUS "stderr='${stderr}'")
- message(STATUS "")
-
- # Save this iteration of the Build directory:
- #
- execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
- ${dir}/b${i}
- )
- execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
- ${dir}/Build
- ${dir}/b${i}
- RESULT_VARIABLE result
- OUTPUT_VARIABLE stdout
- ERROR_VARIABLE stderr
- )
-
- message(STATUS "result='${result}'")
- message(STATUS "stdout='${stdout}'")
- message(STATUS "stderr='${stderr}'")
- message(STATUS "")
-endforeach()
-
-
-# Function to analyze diffs between two directories.
-# Set DIFF_EXECUTABLE before calling if 'diff' is available.
-#
-function(analyze_directory_diffs d1 d2 diff_count_var)
- set(diffs 0)
-
- message(STATUS "Analyzing directory diffs between:")
- message(STATUS " d1='${d1}'")
- message(STATUS " d2='${d2}'")
-
- if(NOT "${d1}" STREQUAL "" AND NOT "${d2}" STREQUAL "")
- message(STATUS "info: analyzing directories")
-
- file(GLOB_RECURSE files1 RELATIVE "${d1}" "${d1}/*")
- file(GLOB_RECURSE files2 RELATIVE "${d2}" "${d2}/*")
-
- if("${files1}" STREQUAL "${files2}")
- message(STATUS "info: file lists the same")
- #message(STATUS " files='${files1}'")
-
- foreach(f ${files1})
- execute_process(COMMAND ${CMAKE_COMMAND} -E compare_files
- ${d1}/${f}
- ${d2}/${f}
- RESULT_VARIABLE result
- OUTPUT_VARIABLE stdout
- ERROR_VARIABLE stderr
- )
- if(result STREQUAL 0)
- #message(STATUS "info: file '${f}' the same")
- else()
- math(EXPR diffs "${diffs} + 1")
- message(STATUS "warning: file '${f}' differs from d1 to d2")
- file(READ "${d1}/${f}" f1contents)
- message(STATUS "contents of file '${d1}/${f}'
-[===[${f1contents}]===]")
- file(READ "${d2}/${f}" f2contents)
- message(STATUS "contents of file '${d2}/${f}'
-[===[${f2contents}]===]")
- if(DIFF_EXECUTABLE)
- message(STATUS "diff of files '${d1}/${f}' '${d2}/${f}'")
- message(STATUS "[====[")
- execute_process(COMMAND ${DIFF_EXECUTABLE} "${d1}/${f}" "${d2}/${f}")
- message(STATUS "]====]")
- endif()
- endif()
- endforeach()
- else()
- math(EXPR diffs "${diffs} + 1")
- message(STATUS "warning: file *lists* differ - some files exist in d1/not-d2 or not-d1/d2...")
- message(STATUS " files1='${files1}'")
- message(STATUS " files2='${files2}'")
- endif()
- endif()
-
- set(${diff_count_var} ${diffs} PARENT_SCOPE)
-endfunction()
-
-
-# Analyze diffs between b1:b2, b2:b3, b3:b4, b4:b5 ... bN-1:bN.
-# Expect no diffs.
-#
-find_program(DIFF_EXECUTABLE diff)
-set(total_diffs 0)
-
-foreach(i RANGE 2 ${N})
- math(EXPR prev "${i} - 1")
- set(count 0)
- analyze_directory_diffs(${dir}/b${prev} ${dir}/b${i} count)
- message(STATUS "diff count='${count}'")
- message(STATUS "")
- math(EXPR total_diffs "${total_diffs} + ${count}")
-endforeach()
-
-message(STATUS "CMAKE_COMMAND='${CMAKE_COMMAND}'")
-message(STATUS "total_diffs='${total_diffs}'")
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index 348e6d0..6bbbe7d 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -44,10 +44,6 @@ set_property(TEST CMake.FileDownloadBadHash PROPERTY
AddCMakeTest(FileUpload "")
-if(HAVE_ELF_H)
- AddCMakeTest(ELF "")
-endif()
-
set(EndStuff_PreArgs
"-Ddir:STRING=${CMAKE_CURRENT_BINARY_DIR}/EndStuffTest"
)
diff --git a/Tests/CMakeTests/EndStuffTestScript.cmake b/Tests/CMakeTests/EndStuffTestScript.cmake
index 9f40818..e0d826d 100644
--- a/Tests/CMakeTests/EndStuffTestScript.cmake
+++ b/Tests/CMakeTests/EndStuffTestScript.cmake
@@ -1,68 +1,40 @@
message(STATUS "testname='${testname}'")
-if(testname STREQUAL bad_else) # fail
- file(WRITE "${dir}/${testname}.cmake"
-"else()
-")
+function(do_end content)
+ file(WRITE "${dir}/${testname}.cmake" "${content}")
execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
RESULT_VARIABLE rv)
if(NOT rv EQUAL 0)
message(FATAL_ERROR "${testname} failed")
endif()
+endfunction()
+
+if(testname STREQUAL bad_else) # fail
+ do_end("else()\n")
elseif(testname STREQUAL bad_elseif) # fail
- file(WRITE "${dir}/${testname}.cmake"
-"elseif()
-")
- execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
- RESULT_VARIABLE rv)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "${testname} failed")
- endif()
+ do_end("elseif()\n")
elseif(testname STREQUAL bad_endforeach) # fail
- endforeach()
+ do_end("endforeach()\n")
elseif(testname STREQUAL bad_endfunction) # fail
- endfunction()
+ do_end("endfunction()\n")
elseif(testname STREQUAL bad_endif) # fail
- file(WRITE "${dir}/${testname}.cmake"
-"cmake_minimum_required(VERSION 2.8)
-endif()
-")
- execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
- RESULT_VARIABLE rv)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "${testname} failed")
- endif()
+ do_end("cmake_minimum_required(VERSION 2.8.12)\nendif()\n")
-elseif(testname STREQUAL endif_low_min_version) # pass
- file(WRITE "${dir}/${testname}.cmake"
-"cmake_minimum_required(VERSION 1.2)
-endif()
-")
- execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
- RESULT_VARIABLE rv)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "${testname} failed")
- endif()
+elseif(testname STREQUAL endif_low_min_version) # fail
+ do_end("cmake_minimum_required(VERSION 1.2)\nendif()\n")
-elseif(testname STREQUAL endif_no_min_version) # pass
- file(WRITE "${dir}/${testname}.cmake"
-"endif()
-")
- execute_process(COMMAND ${CMAKE_COMMAND} -P "${dir}/${testname}.cmake"
- RESULT_VARIABLE rv)
- if(NOT rv EQUAL 0)
- message(FATAL_ERROR "${testname} failed")
- endif()
+elseif(testname STREQUAL endif_no_min_version) # fail
+ do_end("endif()\n")
elseif(testname STREQUAL bad_endmacro) # fail
- endmacro()
+ do_end("endmacro()\n")
elseif(testname STREQUAL bad_endwhile) # fail
- endwhile()
+ do_end("endwhile()\n")
else() # fail
message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'")
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in
index 69d9a14..e0ce99a 100644
--- a/Tests/CMakeTests/FileDownloadTest.cmake.in
+++ b/Tests/CMakeTests/FileDownloadTest.cmake.in
@@ -136,6 +136,9 @@ __reportIfWrongStatus("${status}" 0)
# Print status because we check its message too
message(STATUS "${status}")
+# do not use proxy for lookup of invalid site (DNS failure by proxy looks
+# different than DNS failure without proxy)
+set(ENV{no_proxy} "$ENV{no_proxy},badhostname.invalid")
message(STATUS "FileDownload:11")
file(DOWNLOAD
badhostname.invalid
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in
index 785f41d..76737e5 100644
--- a/Tests/CMakeTests/ListTest.cmake.in
+++ b/Tests/CMakeTests/ListTest.cmake.in
@@ -142,9 +142,8 @@ set(Find-List-Only-STDERR "three")
set(Insert-List-Only-STDERR "at least three")
set(Length-List-Only-STDERR "two")
set(Remove_At-List-Only-STDERR "at least two")
-set(Remove_Item-List-Only-STDERR "two or more")
-foreach(cmd IN ITEMS Find Get Insert Length Remove_At Remove_Item)
+foreach(cmd IN ITEMS Find Get Insert Length Remove_At)
string(TOUPPER ${cmd} cmd_upper)
set(${cmd}-List-Only-RESULT 1)
set(${cmd}-List-Only-STDERR ".*CMake Error at List-${cmd}-List-Only.cmake:1 \\(list\\):.*list sub-command ${cmd_upper} requires ${${cmd}-List-Only-STDERR} arguments.*")
diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt
index 4363f1b..b2e2106 100644
--- a/Tests/CPackComponentsDEB/CMakeLists.txt
+++ b/Tests/CPackComponentsDEB/CMakeLists.txt
@@ -22,6 +22,13 @@ target_link_libraries(mylibapp mylib)
add_executable(mylibapp2 mylibapp.cpp)
target_link_libraries(mylibapp2 mylib)
+if (CPackDEBConfiguration MATCHES "shlibdeps-with-private-lib")
+ add_subdirectory("shlibdeps-with-private-lib")
+ add_executable(mylibapp3 mylibapp.cpp)
+ target_compile_definitions(mylibapp3 PRIVATE -DSHLIBDEPS_PRIVATE)
+ target_link_libraries(mylibapp3 myprivatelib)
+endif()
+
# Create installation targets. Note that we put each kind of file
# into a different component via COMPONENT. These components will
# be used to create the installation components.
@@ -39,6 +46,13 @@ install(FILES mylib.h
DESTINATION include
COMPONENT headers)
+if (CPackDEBConfiguration MATCHES "shlibdeps-with-private-lib")
+ install(TARGETS mylibapp3
+ RUNTIME
+ DESTINATION bin
+ COMPONENT applications)
+endif()
+
# CPack boilerplate for this project
set(CPACK_PACKAGE_NAME "MyLib")
set(CPACK_PACKAGE_CONTACT "None")
diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-shlibdeps-with-private-lib-failure.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-shlibdeps-with-private-lib-failure.cmake.in
new file mode 100644
index 0000000..cfe6df5
--- /dev/null
+++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-shlibdeps-with-private-lib-failure.cmake.in
@@ -0,0 +1,24 @@
+#
+# Activate component packaging
+#
+
+if(CPACK_GENERATOR MATCHES "DEB")
+ set(CPACK_DEB_COMPONENT_INSTALL "ON")
+endif()
+
+#
+# Choose grouping way
+#
+#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE)
+#set(CPACK_COMPONENTS_GROUPING)
+set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
+#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
+
+# we set shlibdeps to on
+set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+# except for the component "headers" that do not contain any binary.
+# the packaging will just fail if this does not work
+set(CPACK_DEBIAN_HEADERS_PACKAGE_SHLIBDEPS OFF)
+
+# Also libraries contains only a static library.
+set(CPACK_DEBIAN_LIBRARIES_PACKAGE_SHLIBDEPS OFF)
diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-shlibdeps-with-private-lib-success.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-shlibdeps-with-private-lib-success.cmake.in
new file mode 100644
index 0000000..76aadc9
--- /dev/null
+++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-shlibdeps-with-private-lib-success.cmake.in
@@ -0,0 +1,33 @@
+#
+# Activate component packaging
+#
+
+if(CPACK_GENERATOR MATCHES "DEB")
+ set(CPACK_DEB_COMPONENT_INSTALL "ON")
+endif()
+
+#
+# Choose grouping way
+#
+#set(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE)
+#set(CPACK_COMPONENTS_GROUPING)
+set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
+#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
+
+# we set shlibdeps to on
+set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
+# except for the component "headers" that do not contain any binary.
+# the packaging will just fail if this does not work
+set(CPACK_DEBIAN_HEADERS_PACKAGE_SHLIBDEPS OFF)
+
+# Also libraries contains only a static library.
+set(CPACK_DEBIAN_LIBRARIES_PACKAGE_SHLIBDEPS OFF)
+
+# Most importantly, we also give a list of additional search directories
+# to allow `dpkg-shlibdeps` to find the private dependency.
+set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS
+ "${CPACK_PACKAGE_DIRECTORY}/shlibdeps-with-private-lib"
+ "${CPACK_PACKAGE_DIRECTORY}/shlibdeps-with-private-lib/Debug"
+ "${CPACK_PACKAGE_DIRECTORY}/shlibdeps-with-private-lib/Release"
+ "${CPACK_PACKAGE_DIRECTORY}/shlibdeps-with-private-lib/RelWithDebInfo"
+ "${CPACK_PACKAGE_DIRECTORY}/shlibdeps-with-private-lib/MinSizeRel")
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-shlibdeps-with-private-lib-failure.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-shlibdeps-with-private-lib-failure.cmake
new file mode 100644
index 0000000..962a1fb
--- /dev/null
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-shlibdeps-with-private-lib-failure.cmake
@@ -0,0 +1,19 @@
+if(NOT CPackComponentsDEB_SOURCE_DIR)
+ message(FATAL_ERROR "CPackComponentsDEB_SOURCE_DIR not set")
+endif()
+
+include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
+
+
+set(actual_output)
+run_cpack(actual_output
+ CPack_output
+ CPack_error
+ EXPECT_FAILURE
+ CONFIG_ARGS ${config_args}
+ CONFIG_VERBOSE ${config_verbose})
+
+string(REGEX MATCH "dpkg-shlibdeps: error: (cannot|couldn't) find[ \n\t]+library[ \n\t]+libmyprivatelib.so.1[ \n\t]+needed[ \n\t]+by[ \n\t]+./usr/bin/mylibapp3" expected_error ${CPack_error})
+if(NOT expected_error)
+ message(FATAL_ERROR "Did not get the expected error-message!")
+endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-shlibdeps-with-private-lib-success.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-shlibdeps-with-private-lib-success.cmake
new file mode 100644
index 0000000..6eff3db
--- /dev/null
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-shlibdeps-with-private-lib-success.cmake
@@ -0,0 +1,75 @@
+if(NOT CPackComponentsDEB_SOURCE_DIR)
+ message(FATAL_ERROR "CPackComponentsDEB_SOURCE_DIR not set")
+endif()
+
+include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
+
+
+
+# requirements
+
+# debian now produces lower case names
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
+set(expected_count 3)
+
+
+set(actual_output)
+run_cpack(actual_output
+ CPack_output
+ CPack_error
+ EXPECTED_FILE_MASK "${expected_file_mask}"
+ CONFIG_ARGS ${config_args}
+ CONFIG_VERBOSE ${config_verbose})
+
+message(STATUS "expected_count='${expected_count}'")
+message(STATUS "expected_file_mask='${expected_file_mask}'")
+message(STATUS "actual_output_files='${actual_output}'")
+
+if(NOT actual_output)
+ message(FATAL_ERROR "error: expected_files do not exist: CPackComponentsDEB test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+endif()
+
+list(LENGTH actual_output actual_count)
+message(STATUS "actual_count='${actual_count}'")
+if(NOT actual_count EQUAL expected_count)
+ message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})")
+endif()
+
+
+# dpkg-deb checks for the summary of the packages
+find_program(DPKGDEB_EXECUTABLE dpkg-deb)
+if(DPKGDEB_EXECUTABLE)
+ set(dpkgdeb_output_errors_all "")
+ foreach(_f IN LISTS actual_output)
+
+ # extracts the metadata from the package
+ run_dpkgdeb(dpkg_output
+ FILENAME ${_f}
+ )
+
+ dpkgdeb_return_specific_metaentry(dpkg_package_name
+ DPKGDEB_OUTPUT "${dpkg_output}"
+ METAENTRY "Package:")
+
+ message(STATUS "package='${dpkg_package_name}'")
+
+ if(dpkg_package_name STREQUAL "mylib-applications")
+ # pass
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ # pass
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ # pass
+ else()
+ set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
+ "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
+ endif()
+
+ endforeach()
+
+
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
+ message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
+ endif()
+else()
+ message("dpkg-deb executable not found - skipping dpkg-deb test")
+endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
index 3bc8d2a..8f7c198 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
@@ -29,7 +29,7 @@ endif()
# run cpack with some options and returns the list of files generated
# -output_expected_file: list of files that match the pattern
function(run_cpack output_expected_file CPack_output_parent CPack_error_parent)
- set(options )
+ set(options "EXPECT_FAILURE")
set(oneValueArgs "EXPECTED_FILE_MASK" "CONFIG_VERBOSE")
set(multiValueArgs "CONFIG_ARGS")
cmake_parse_arguments(run_cpack_deb "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
@@ -45,17 +45,26 @@ function(run_cpack output_expected_file CPack_output_parent CPack_error_parent)
message("config_args = ${run_cpack_deb_CONFIG_ARGS}")
message("config_verbose = ${run_cpack_deb_CONFIG_VERBOSE}")
+
+ set(_backup_lang "$ENV{LANG}")
+ set(_backup_lc_all "$ENV{LC_ALL}")
+ set(ENV{LANG} "C")
+ set(ENV{LC_ALL} "C")
execute_process(COMMAND ${CMAKE_CPACK_COMMAND} ${run_cpack_deb_CONFIG_VERBOSE} -G ${CPackGen} -C "${CONFIG}" ${run_cpack_deb_CONFIG_ARGS}
RESULT_VARIABLE CPack_result
OUTPUT_VARIABLE CPack_output
ERROR_VARIABLE CPack_error
WORKING_DIRECTORY ${CPackComponentsDEB_BINARY_DIR})
+ set(ENV{LANG} "${_backup_lang}")
+ set(ENV{LC_ALL} "${_backup_lc_all}")
set(${CPack_output_parent} ${CPack_output} PARENT_SCOPE)
set(${CPack_error_parent} ${CPack_error} PARENT_SCOPE)
- if (CPack_result)
+ if (CPack_result AND NOT run_cpack_deb_EXPECT_FAILURE)
message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+ elseif (NOT CPack_result AND run_cpack_deb_EXPECT_FAILURE)
+ message(FATAL_ERROR "error: CPack execution succeeded although failure was expected!, CPack_output=${CPack_output}, CPack_error=${CPack_error}")
else ()
message(STATUS "CPack_output=${CPack_output}")
message(STATUS "CPack_error=${CPack_error}")
diff --git a/Tests/CPackComponentsDEB/mylibapp.cpp b/Tests/CPackComponentsDEB/mylibapp.cpp
index a438ac7..bb45831 100644
--- a/Tests/CPackComponentsDEB/mylibapp.cpp
+++ b/Tests/CPackComponentsDEB/mylibapp.cpp
@@ -1,6 +1,19 @@
-#include "mylib.h"
+#ifndef SHLIBDEPS_PRIVATE
+
+# include "mylib.h"
int main()
{
mylib_function();
}
+
+#else
+
+# include "shlibdeps-with-private-lib/myprivatelib.h"
+
+int main()
+{
+ myprivatelib_function();
+}
+
+#endif
diff --git a/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/CMakeLists.txt b/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/CMakeLists.txt
new file mode 100644
index 0000000..c7ef386
--- /dev/null
+++ b/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_library(myprivatelib SHARED myprivatelib.cpp)
+set_target_properties( myprivatelib PROPERTIES
+ VERSION 1.2.3
+ SOVERSION 1
+)
diff --git a/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/myprivatelib.cpp b/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/myprivatelib.cpp
new file mode 100644
index 0000000..67110e6
--- /dev/null
+++ b/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/myprivatelib.cpp
@@ -0,0 +1,8 @@
+#include "myprivatelib.h"
+
+#include "stdio.h"
+
+void myprivatelib_function()
+{
+ printf("This is myprivatelib");
+}
diff --git a/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/myprivatelib.h b/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/myprivatelib.h
new file mode 100644
index 0000000..7e4a42d
--- /dev/null
+++ b/Tests/CPackComponentsDEB/shlibdeps-with-private-lib/myprivatelib.h
@@ -0,0 +1 @@
+void myprivatelib_function();
diff --git a/Tests/CPackNSISGenerator/CMakeLists.txt b/Tests/CPackNSISGenerator/CMakeLists.txt
index 8ed4d59..64a8ef6 100644
--- a/Tests/CPackNSISGenerator/CMakeLists.txt
+++ b/Tests/CPackNSISGenerator/CMakeLists.txt
@@ -17,5 +17,7 @@ set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}\\\\uninstall.ico")
set(CPACK_GENERATOR "NSIS")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_NSIS_MANIFEST_DPI_AWARE ON)
+set(CPACK_NSIS_BRANDING_TEXT "CMake branding text")
+set(CPACK_NSIS_BRANDING_TEXT_TRIM_POSITION "RIGHT")
include(CPack)
diff --git a/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake b/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake
index bfbcf9c..8bfcf26 100644
--- a/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake
+++ b/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake
@@ -52,3 +52,11 @@ if("${output_index}" EQUAL "-1")
else()
message(STATUS "Found DPI-aware")
endif()
+
+file(STRINGS "${project_file}" line REGEX "^BrandingText /TRIMRIGHT \"CMake branding text\"")
+string(FIND "${line}" "TRIMRIGHT" output_index)
+if("${output_index}" EQUAL "-1")
+ message(FATAL_ERROR "BrandingText not found in the project")
+else()
+ message(STATUS "Found BrandingText")
+endif()
diff --git a/Tests/CPackTestAllGenerators/CMakeLists.txt b/Tests/CPackTestAllGenerators/CMakeLists.txt
index 5eeb7e9..95daabf 100644
--- a/Tests/CPackTestAllGenerators/CMakeLists.txt
+++ b/Tests/CPackTestAllGenerators/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CPackTestAllGenerators)
add_subdirectory(../CTestTest/SmallAndFast SmallAndFast)
install(FILES RunCPack.cmake DESTINATION .)
diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt
index 940e849..2249d70 100644
--- a/Tests/CPackWiXGenerator/CMakeLists.txt
+++ b/Tests/CPackWiXGenerator/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CPackWiXGenerator)
diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in
index 1818888..a36f374 100644
--- a/Tests/CTestCoverageCollectGCOV/test.cmake.in
+++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in
@@ -29,6 +29,20 @@ set(expected_out
uncovered/uncovered2.cpp
)
+# A symbolic link in the path can cause tar to put an equivalent, but not
+# minimal file name to some files in the tar file. Convert paths to absolute
+# then back to relative to get them in canonical form (or maybe this is a bug
+# in how the tarball is generated?)
+function(to_relative_paths real_paths paths)
+ foreach(file ${paths})
+ file(REAL_PATH "${file}" real_path BASE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+ file(RELATIVE_PATH relative_path "${CTEST_BINARY_DIRECTORY}" "${real_path}")
+ list(APPEND local_real_paths "${relative_path}")
+ message(DEBUG "${file} -> ${real_path} -> ${relative_path}")
+ endforeach()
+ set("${real_paths}" "${local_real_paths}" PARENT_SCOPE)
+endfunction()
+
#------------------------------------------------------------------------------#
# Test 1: with standard arguments
#------------------------------------------------------------------------------#
@@ -50,6 +64,7 @@ execute_process(COMMAND
)
string(REPLACE "\n" ";" out "${out}")
+to_relative_paths(out "${out}")
list(SORT out)
if("${out}" STREQUAL "${expected_out}")
@@ -80,6 +95,7 @@ execute_process(COMMAND
)
string(REPLACE "\n" ";" out "${out}")
+to_relative_paths(out "${out}")
list(SORT out)
if("${out}" STREQUAL "${expected_out}")
@@ -110,6 +126,7 @@ execute_process(COMMAND
)
string(REPLACE "\n" ";" out "${out}")
+to_relative_paths(out "${out}")
list(SORT out)
if("${out}" STREQUAL "${expected_out}")
@@ -140,6 +157,7 @@ execute_process(COMMAND
)
string(REPLACE "\n" ";" out "${out}")
+to_relative_paths(out "${out}")
list(SORT out)
if("${out}" STREQUAL "${expected_out}")
@@ -170,6 +188,7 @@ execute_process(COMMAND
)
string(REPLACE "\n" ";" out "${out}")
+to_relative_paths(out "${out}")
list(SORT out)
if("${out}" STREQUAL "${expected_out}")
diff --git a/Tests/CTestLimitDashJ/CMakeLists.txt b/Tests/CTestLimitDashJ/CMakeLists.txt
index 5208d2d..d04b3ad 100644
--- a/Tests/CTestLimitDashJ/CMakeLists.txt
+++ b/Tests/CTestLimitDashJ/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CTestLimitDashJ NONE)
# This file demonstrates https://gitlab.kitware.com/cmake/cmake/-/issues/12904
diff --git a/Tests/CTestTest/SmallAndFast/CMakeLists.txt b/Tests/CTestTest/SmallAndFast/CMakeLists.txt
index 85cb30c..06cbafd 100644
--- a/Tests/CTestTest/SmallAndFast/CMakeLists.txt
+++ b/Tests/CTestTest/SmallAndFast/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(SmallAndFast)
include(CTest)
diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in
index 5389bdf..8e0b611 100644
--- a/Tests/CTestUpdateCVS.cmake.in
+++ b/Tests/CTestUpdateCVS.cmake.in
@@ -17,21 +17,11 @@ message("Using CVS tools:")
set(CVS "@CVS_EXECUTABLE@")
message(" cvs = ${CVS}")
-set(REPO ${TOP}/repo)
-
-# The MSYS cvs tool interprets "c:/" as a "machine:" name for SSH.
-# Detect the MSYS cvs and convert the repo path to an MSYS path.
-if(WIN32)
- if(EXISTS "${CVS}")
- file(STRINGS "${CVS}" cvs_is_msys LIMIT_COUNT 1 REGEX "[Mm][Ss][Yy][Ss]")
- if(cvs_is_msys)
- message(" '${CVS}' is from MSYS (contains '${cvs_is_msys}')")
- string(REGEX REPLACE "^([A-Za-z]):" "/\\1" REPO "${REPO}")
- endif()
- endif()
-endif()
+# Pre-pending :local: prevents cvs from trying to interpret Windows drive
+# letters, like "C:", as host names.
+set(REPO ":local:${TOP}/repo")
-set(CVSCMD ${CVS} -d${REPO})
+set(CVSCMD ${CVS} -d "${REPO}")
# CVSNT requires an extra option to 'cvs init'.
set(CVS_INIT_OPT)
diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in
index 7d0fa0f..a3ef4eb 100644
--- a/Tests/CTestUpdateGIT.cmake.in
+++ b/Tests/CTestUpdateGIT.cmake.in
@@ -32,6 +32,20 @@ if(UNIX)
set(GIT ${TOP}/git.sh)
endif()
+# Adapt to the system default branch name.
+execute_process(
+ COMMAND ${GIT} config --get init.defaultBranch
+ RESULT_VARIABLE defaultBranchFailed
+ OUTPUT_VARIABLE defaultBranch
+ ERROR_VARIABLE defaultBranchError
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_STRIP_TRAILING_WHITESPACE
+ )
+if(defaultBranch STREQUAL "")
+ set(defaultBranch master)
+endif()
+message("Detected default branch name '${defaultBranch}'")
+
#-----------------------------------------------------------------------------
# Create the repository.
message("Creating repository...")
@@ -64,7 +78,7 @@ run_child(WORKING_DIRECTORY ${TOP}/module
COMMAND ${GIT} commit -m "Initial content"
)
run_child(WORKING_DIRECTORY ${TOP}/module
- COMMAND ${GIT} push origin master:refs/heads/master
+ COMMAND ${GIT} push origin ${defaultBranch}:refs/heads/${defaultBranch}
)
#-----------------------------------------------------------------------------
@@ -80,7 +94,7 @@ file(APPEND ${TOP}/import/.git/config "
${AUTHOR_CONFIG}")
create_content(import)
file(WRITE ${TOP}/import/HEAD "HEAD\n")
-file(WRITE ${TOP}/import/master "master\n")
+file(WRITE ${TOP}/import/${defaultBranch} "${defaultBranch}\n")
run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${GIT} add .
)
@@ -94,7 +108,7 @@ run_child(WORKING_DIRECTORY ${TOP}/import
COMMAND ${GIT} commit -m "Initial content"
)
run_child(WORKING_DIRECTORY ${TOP}/import
- COMMAND ${GIT} push origin master:refs/heads/master
+ COMMAND ${GIT} push origin ${defaultBranch}:refs/heads/${defaultBranch}
)
#-----------------------------------------------------------------------------
@@ -107,7 +121,7 @@ run_child(WORKING_DIRECTORY ${TOP}/module
COMMAND ${GIT} commit -m "Changed content"
)
run_child(WORKING_DIRECTORY ${TOP}/module
- COMMAND ${GIT} push origin master:refs/heads/master
+ COMMAND ${GIT} push origin ${defaultBranch}:refs/heads/${defaultBranch}
)
#-----------------------------------------------------------------------------
@@ -163,7 +177,7 @@ run_child(
COMMAND ${GIT} rm -- ${files_removed}
)
run_child(WORKING_DIRECTORY ${TOP}/user-source/module
- COMMAND ${GIT} checkout master --
+ COMMAND ${GIT} checkout ${defaultBranch} --
)
run_child(
WORKING_DIRECTORY ${TOP}/user-source
@@ -222,7 +236,7 @@ rewind_source(user-source)
# modified files) even if ~/.gitconfig sets "branch.master.rebase".
run_child(
WORKING_DIRECTORY ${TOP}/user-source
- COMMAND ${GIT} config branch.master.rebase false
+ COMMAND ${GIT} config branch.${defaultBranch}.rebase false
)
# Create a modified file.
@@ -254,7 +268,7 @@ create_build_tree(user-source user-binary-custom)
file(APPEND ${TOP}/user-binary-custom/CTestConfiguration.ini
"# GIT command configuration
UpdateCommand: ${GIT}
-GITUpdateCustom: ${GIT};pull;origin;master
+GITUpdateCustom: ${GIT};pull;origin;${defaultBranch}
")
# Run the dashboard command line interface.
@@ -304,7 +318,7 @@ create_dashboard_script(dash-binary-custom
"# git command configuration
set(CTEST_GIT_COMMAND \"${GIT}\")
set(CTEST_GIT_UPDATE_OPTIONS)
-set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
+set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin ${defaultBranch})
")
# Run the dashboard script with CTest.
@@ -339,7 +353,7 @@ create_dashboard_script(dash-binary-quiet
"# git command configuration
set(CTEST_GIT_COMMAND \"${GIT}\")
set(CTEST_GIT_UPDATE_OPTIONS)
-set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin master)
+set(CTEST_GIT_UPDATE_CUSTOM \${CTEST_GIT_COMMAND} pull origin ${defaultBranch})
")
unset(ctest_update_args)
diff --git a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
index 87b7f1a..69fa4b6 100644
--- a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
+++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CheckCompilerRelatedVariables)
diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt
index 1d8afbf..8347d5a 100644
--- a/Tests/CompileDefinitions/CMakeLists.txt
+++ b/Tests/CompileDefinitions/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CompileDefinitions)
# Use compile flags to tell executables which config is built
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index ef9198d..cff98e3 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -4,9 +4,12 @@ cmake_policy(SET CMP0057 NEW)
project(CompileFeatures)
+set(ext_C c)
+set(ext_CXX cpp)
+
macro(run_test feature lang)
if (${feature} IN_LIST CMAKE_${lang}_COMPILE_FEATURES)
- add_library(test_${feature} OBJECT ${feature})
+ add_library(test_${feature} OBJECT ${feature}.${ext_${lang}})
set_property(TARGET test_${feature}
PROPERTY COMPILE_FEATURES "${feature}"
)
@@ -15,7 +18,7 @@ macro(run_test feature lang)
endif()
endmacro()
-if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$")
+if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$")
get_property(c_features GLOBAL PROPERTY CMAKE_C_KNOWN_FEATURES)
list(FILTER c_features EXCLUDE REGEX "^c_std_[0-9][0-9]")
foreach(feature ${c_features})
@@ -23,7 +26,7 @@ if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$")
endforeach()
endif()
-if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$")
+if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$")
get_property(cxx_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
list(FILTER cxx_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]")
foreach(feature ${cxx_features})
@@ -268,6 +271,7 @@ if (CMAKE_CXX_COMPILE_FEATURES)
if (std_flag_idx EQUAL -1)
add_executable(default_dialect default_dialect.cpp)
target_compile_definitions(default_dialect PRIVATE
+ DEFAULT_CXX23=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},23>
DEFAULT_CXX20=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},20>
DEFAULT_CXX17=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},17>
DEFAULT_CXX14=$<EQUAL:${CMAKE_CXX_STANDARD_DEFAULT},14>
@@ -349,6 +353,7 @@ else()
HAVE_CXX_STD_14=$<COMPILE_FEATURES:cxx_std_14>
HAVE_CXX_STD_17=$<COMPILE_FEATURES:cxx_std_17>
HAVE_CXX_STD_20=$<COMPILE_FEATURES:cxx_std_20>
+ HAVE_CXX_STD_23=$<COMPILE_FEATURES:cxx_std_23>
)
endif()
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index e6b3ff6..bd504ff 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -18,7 +18,11 @@ struct Outputter;
# define CXX_STD __cplusplus
#endif
-#if DEFAULT_CXX20
+#if DEFAULT_CXX23
+# if CXX_STD <= 202002L
+Outputter<CXX_STD> o;
+# endif
+#elif DEFAULT_CXX20
# if CXX_STD <= 201703L
Outputter<CXX_STD> o;
# endif
diff --git a/Tests/CompileFeatures/genex_test.cpp b/Tests/CompileFeatures/genex_test.cpp
index 53dce62..9c3910e 100644
--- a/Tests/CompileFeatures/genex_test.cpp
+++ b/Tests/CompileFeatures/genex_test.cpp
@@ -21,6 +21,12 @@
# if HAVE_CXX_STD_17 && !defined(ALLOW_LATER_STANDARDS)
# error HAVE_CXX_STD_17 is true with CXX_STANDARD == 11
# endif
+# if HAVE_CXX_STD_20 && !defined(ALLOW_LATER_STANDARDS)
+# error HAVE_CXX_STD_20 is true with CXX_STANDARD == 11
+# endif
+# if HAVE_CXX_STD_23 && !defined(ALLOW_LATER_STANDARDS)
+# error HAVE_CXX_STD_23 is true with CXX_STANDARD == 11
+# endif
#endif
#if !HAVE_OVERRIDE_CONTROL
diff --git a/Tests/CompileOptions/CMakeLists.txt b/Tests/CompileOptions/CMakeLists.txt
index 1433462..cd6cacd 100644
--- a/Tests/CompileOptions/CMakeLists.txt
+++ b/Tests/CompileOptions/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(CompileOptions)
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index 9eed1c0..a3d98f6 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -5,6 +5,11 @@ if(NOT _isMultiConfig AND NOT CMAKE_BUILD_TYPE)
endif()
project(ConfigSources CXX)
+if("${CMAKE_CXX_COMPILER_ID};${CMAKE_CXX_SIMULATE_ID}" STREQUAL "Intel;MSVC")
+ string(APPEND CMAKE_CXX_FLAGS_DEBUG " -Z7")
+ string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -Z7")
+endif()
+
# Source file(s) named with the configuration(s).
file(GENERATE
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp"
@@ -16,6 +21,72 @@ void config_$<CONFIG>() {}
]]
)
+# Custom command outputs named with the configuration(s).
+add_custom_command(
+ OUTPUT "custom1_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/custom1.cpp.in" "custom1_$<CONFIG>.cpp"
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/custom1.cpp.in
+ VERBATIM
+ )
+# Output path starts in a generator expression.
+add_custom_command(
+ OUTPUT "$<1:custom2_$<CONFIG>.cpp>"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/custom2.cpp.in" "custom2_$<CONFIG>.cpp"
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/custom2.cpp.in
+ VERBATIM
+ )
+# Source file generated as a custom command's byproduct.
+add_custom_command(
+ OUTPUT custom3.txt
+ BYPRODUCTS "$<1:custom3_$<CONFIG>.cpp>"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/custom3.cpp.in" "custom3_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E touch custom3.txt
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/custom3.cpp.in
+ VERBATIM
+ )
+# Source file generated as a custom target's byproduct.
+add_custom_target(custom4
+ BYPRODUCTS "custom4_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/custom4.cpp.in" "custom4_$<CONFIG>.cpp"
+ VERBATIM
+ )
+# Source file generated by appended custom command.
+add_custom_command(
+ OUTPUT "custom5_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E echo custom5_$<CONFIG>.cpp
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/custom5.cpp.in
+ VERBATIM
+ )
+add_custom_command(APPEND
+ OUTPUT "custom5_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/custom5.cpp.in" "custom5_$<CONFIG>.cpp.in"
+ VERBATIM
+ )
+# Appending through any configuration's output affects all configurations.
+if(CMAKE_CONFIGURATION_TYPES MATCHES ";([^;]+)$")
+ set(last_config "${CMAKE_MATCH_1}")
+else()
+ set(last_config ${CMAKE_BUILD_TYPE})
+endif()
+add_custom_command(APPEND
+ OUTPUT "custom5_${last_config}.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "custom5_$<CONFIG>.cpp.in" "custom5_$<CONFIG>.cpp"
+ VERBATIM
+ )
+foreach(n RANGE 1 5)
+ set_property(SOURCE custom${n}_Debug.cpp PROPERTY COMPILE_DEFINITIONS CUSTOM_CFG_DEBUG)
+ foreach(other Release RelWithDebInfo MinSizeRel)
+ set_property(SOURCE custom${n}_${other}.cpp PROPERTY COMPILE_DEFINITIONS CUSTOM_CFG_OTHER)
+ endforeach()
+endforeach()
+add_library(Custom STATIC
+ custom1_$<CONFIG>.cpp
+ custom2_$<CONFIG>.cpp
+ custom3_$<CONFIG>.cpp custom3.txt
+ custom4_$<CONFIG>.cpp
+ custom5_$<CONFIG>.cpp
+ )
+
# Per-config sources via INTERFACE_SOURCES.
add_library(iface INTERFACE)
target_sources(iface INTERFACE
@@ -34,7 +105,7 @@ add_executable(ConfigSources
$<$<CONFIG:NotAConfig>:does_not_exist.cpp>
${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp
)
-target_link_libraries(ConfigSources iface)
+target_link_libraries(ConfigSources Custom iface)
# Per-config sources via LINK_LIBRARIES.
add_library(iface_debug INTERFACE)
@@ -53,6 +124,7 @@ target_compile_definitions(ConfigSourcesLink PRIVATE
"$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
)
target_link_libraries(ConfigSourcesLink PRIVATE
+ Custom
"$<$<CONFIG:Debug>:iface_debug>"
"$<$<NOT:$<CONFIG:Debug>>:iface_other>"
"$<$<CONFIG:NotAConfig>:iface_does_not_exist>"
@@ -70,7 +142,7 @@ target_compile_definitions(ConfigSourcesLinkIface PRIVATE
"$<$<CONFIG:Debug>:CFG_DEBUG>"
"$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
)
-target_link_libraries(ConfigSourcesLinkIface ConfigSourcesIface)
+target_link_libraries(ConfigSourcesLinkIface Custom ConfigSourcesIface)
# A target with sources in only one configuration that is not the
# first in CMAKE_CONFIGURATION_TYPES.
diff --git a/Tests/ConfigSources/custom1.cpp.in b/Tests/ConfigSources/custom1.cpp.in
new file mode 100644
index 0000000..e5f21c7
--- /dev/null
+++ b/Tests/ConfigSources/custom1.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom1_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom1_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/custom2.cpp.in b/Tests/ConfigSources/custom2.cpp.in
new file mode 100644
index 0000000..438c1fd
--- /dev/null
+++ b/Tests/ConfigSources/custom2.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom2_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom2_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/custom3.cpp.in b/Tests/ConfigSources/custom3.cpp.in
new file mode 100644
index 0000000..4545b69
--- /dev/null
+++ b/Tests/ConfigSources/custom3.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom3_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom3_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/custom4.cpp.in b/Tests/ConfigSources/custom4.cpp.in
new file mode 100644
index 0000000..8a8b2a8
--- /dev/null
+++ b/Tests/ConfigSources/custom4.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom4_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom4_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/custom5.cpp.in b/Tests/ConfigSources/custom5.cpp.in
new file mode 100644
index 0000000..51f40ae
--- /dev/null
+++ b/Tests/ConfigSources/custom5.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom5_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom5_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/main_debug.cpp b/Tests/ConfigSources/main_debug.cpp
index 9b1e68a..ef776f8 100644
--- a/Tests/ConfigSources/main_debug.cpp
+++ b/Tests/ConfigSources/main_debug.cpp
@@ -7,7 +7,14 @@
#include "iface.h"
+extern int custom1_debug();
+extern int custom2_debug();
+extern int custom3_debug();
+extern int custom4_debug();
+extern int custom5_debug();
+
int main(int argc, char** argv)
{
- return iface_src() + iface_debug();
+ return iface_src() + iface_debug() + custom1_debug() + custom2_debug() +
+ custom3_debug() + custom4_debug() + custom5_debug();
}
diff --git a/Tests/ConfigSources/main_other.cpp b/Tests/ConfigSources/main_other.cpp
index 3184a19..74f2156 100644
--- a/Tests/ConfigSources/main_other.cpp
+++ b/Tests/ConfigSources/main_other.cpp
@@ -7,7 +7,14 @@
#include "iface.h"
+extern int custom1_other();
+extern int custom2_other();
+extern int custom3_other();
+extern int custom4_other();
+extern int custom5_other();
+
int main(int argc, char** argv)
{
- return iface_src() + iface_other();
+ return iface_src() + iface_other() + custom1_other() + custom2_other() +
+ custom3_other() + custom4_other() + custom5_other();
}
diff --git a/Tests/Contracts/Trilinos/CMakeLists.txt b/Tests/Contracts/Trilinos/CMakeLists.txt
index 4d7062b..6cc2d09 100644
--- a/Tests/Contracts/Trilinos/CMakeLists.txt
+++ b/Tests/Contracts/Trilinos/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(Trilinos)
include(ExternalProject)
diff --git a/Tests/Contracts/VTK/CMakeLists.txt b/Tests/Contracts/VTK/CMakeLists.txt
index 6ae2732..0d36323 100644
--- a/Tests/Contracts/VTK/CMakeLists.txt
+++ b/Tests/Contracts/VTK/CMakeLists.txt
@@ -1,6 +1,6 @@
# The VTK external project for CMake
# ---------------------------------------------------------------------------
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(VTK)
include(ExternalProject)
diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt
index 00125e3..8b42296 100644
--- a/Tests/Cuda/Toolkit/CMakeLists.txt
+++ b/Tests/Cuda/Toolkit/CMakeLists.txt
@@ -5,6 +5,10 @@ project(Toolkit CXX)
# Validate that we can use CUDAToolkit to find cuda include paths
find_package(CUDAToolkit REQUIRED)
+if(NOT DEFINED CUDAToolkit_VERSION)
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDAToolkit_VERSION not found")
+endif()
+
message(STATUS "CUDAToolkit_VERSION: ${CUDAToolkit_VERSION}")
message(STATUS "CUDAToolkit_VERSION_MAJOR: ${CUDAToolkit_VERSION_MAJOR}")
message(STATUS "CUDAToolkit_VERSION_MINOR: ${CUDAToolkit_VERSION_MINOR}")
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 033f197..fdb7a6e 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -11,6 +11,7 @@ add_cuda_test_macro(CudaOnly.ExportPTX CudaOnlyExportPTX)
add_cuda_test_macro(CudaOnly.SharedRuntimePlusToolkit CudaOnlySharedRuntimePlusToolkit)
add_cuda_test_macro(CudaOnly.Standard98 CudaOnlyStandard98)
add_cuda_test_macro(CudaOnly.Toolkit CudaOnlyToolkit)
+add_cuda_test_macro(CudaOnly.ToolkitBeforeLang CudaOnlyToolkitBeforeLang)
add_cuda_test_macro(CudaOnly.WithDefs CudaOnlyWithDefs)
add_cuda_test_macro(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine)
add_cuda_test_macro(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
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/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt
index bb06ba8..1486c1a 100644
--- a/Tests/CudaOnly/Toolkit/CMakeLists.txt
+++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt
@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.15)
project(CudaOnlyToolkit CUDA)
find_package(CUDAToolkit REQUIRED)
+if(NOT DEFINED CUDAToolkit_VERSION)
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDAToolkit_VERSION not found")
+endif()
+
message(STATUS "CUDAToolkit_VERSION: ${CUDAToolkit_VERSION}")
message(STATUS "CUDAToolkit_VERSION_MAJOR: ${CUDAToolkit_VERSION_MAJOR}")
message(STATUS "CUDAToolkit_VERSION_MINOR: ${CUDAToolkit_VERSION_MINOR}")
diff --git a/Tests/CudaOnly/ToolkitBeforeLang/CMakeLists.txt b/Tests/CudaOnly/ToolkitBeforeLang/CMakeLists.txt
new file mode 100644
index 0000000..8dff6cc
--- /dev/null
+++ b/Tests/CudaOnly/ToolkitBeforeLang/CMakeLists.txt
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 3.15)
+project(CudaOnlyToolkitBeforeLang CXX)
+
+# Validate that CUDAToolkit gets the correct version
+# when called before CUDA the language is enabled
+find_package(CUDAToolkit REQUIRED)
+enable_language(CUDA)
+
+if(NOT DEFINED CUDAToolkit_VERSION)
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDAToolkit_VERSION not found")
+endif()
+
+set(cuda_libs cudart cuda_driver)
+
+# Verify that all the CUDA:: targets and variables exist
+foreach (cuda_lib IN LISTS cuda_libs)
+ if(NOT CUDA_${cuda_lib}_LIBRARY)
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
+ endif()
+ if(NOT TARGET CUDA::${cuda_lib})
+ message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found")
+ endif()
+endforeach()
+
+add_executable(CudaOnlyToolkitBeforeLang main.cu)
+target_link_libraries(CudaOnlyToolkitBeforeLang PRIVATE CUDA::toolkit)
diff --git a/Tests/CudaOnly/ToolkitBeforeLang/main.cu b/Tests/CudaOnly/ToolkitBeforeLang/main.cu
new file mode 100644
index 0000000..0f3ccdc
--- /dev/null
+++ b/Tests/CudaOnly/ToolkitBeforeLang/main.cu
@@ -0,0 +1,8 @@
+// Only thing we care about is that these headers are found
+#include <cuda.h>
+#include <cuda_runtime_api.h>
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index c1a7a57..80545c4 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -582,3 +582,7 @@ set_target_properties(mac_fw PROPERTIES
)
add_custom_command(OUTPUT mac_fw.txt COMMAND ${CMAKE_COMMAND} -E touch mac_fw.txt DEPENDS mac_fw)
add_custom_target(drive_mac_fw ALL DEPENDS mac_fw.txt)
+
+# Test empty COMMANDs are ommited
+add_executable(empty_command empty_command.cxx)
+add_custom_command(TARGET empty_command POST_BUILD COMMAND $<0:date>)
diff --git a/Tests/Server/empty.cpp b/Tests/CustomCommand/empty_command.cxx
index 766b775..f8b643a 100644
--- a/Tests/Server/empty.cpp
+++ b/Tests/CustomCommand/empty_command.cxx
@@ -1,4 +1,3 @@
-
int main()
{
return 0;
diff --git a/Tests/EmptyDepends/CMakeLists.txt b/Tests/EmptyDepends/CMakeLists.txt
index 832d9dc..272eff7 100644
--- a/Tests/EmptyDepends/CMakeLists.txt
+++ b/Tests/EmptyDepends/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(EmptyDepends)
include(CTest)
diff --git a/Tests/ExportImport/Import/try_compile/CMakeLists.txt b/Tests/ExportImport/Import/try_compile/CMakeLists.txt
index 1088461..813cf06 100644
--- a/Tests/ExportImport/Import/try_compile/CMakeLists.txt
+++ b/Tests/ExportImport/Import/try_compile/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
find_package(testLibRequired 2.5 REQUIRED)
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 29cdcc9..59e3bcc 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(ExternalProjectTest NONE)
if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12)
cmake_policy(SET CMP0114 NEW)
@@ -161,7 +161,7 @@ if(do_cvs_tests)
#
set(proj TutorialStep1-CVS-20090626)
ExternalProject_Add(${proj}
- CVS_REPOSITORY "${local_cvs_repo}"
+ CVS_REPOSITORY ":local:${local_cvs_repo}"
CVS_MODULE "TutorialStep1"
CVS_TAG "-D2009-06-26 16:50:00 UTC"
UPDATE_COMMAND ""
@@ -176,7 +176,7 @@ if(do_cvs_tests)
#
set(proj TutorialStep1-CVS-testtag1)
ExternalProject_Add(${proj}
- CVS_REPOSITORY "${local_cvs_repo}"
+ CVS_REPOSITORY ":local:${local_cvs_repo}"
CVS_MODULE "TutorialStep1"
CVS_TAG -rtesttag1
UPDATE_COMMAND ""
@@ -191,7 +191,7 @@ if(do_cvs_tests)
#
set(proj TutorialStep1-CVS-HEAD)
ExternalProject_Add(${proj}
- CVS_REPOSITORY "${local_cvs_repo}"
+ CVS_REPOSITORY ":local:${local_cvs_repo}"
CVS_MODULE "TutorialStep1"
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
@@ -298,15 +298,9 @@ set(do_git_tests 0)
if(GIT_EXECUTABLE)
set(do_git_tests 1)
- execute_process(
- COMMAND "${GIT_EXECUTABLE}" --version
- OUTPUT_VARIABLE ov
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}")
- message(STATUS "git_version='${git_version}'")
+ message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'")
- if(git_version VERSION_LESS 1.6.5)
+ if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5)
message(STATUS "No ExternalProject git tests with git client less than version 1.6.5")
set(do_git_tests 0)
endif()
@@ -335,7 +329,7 @@ if(do_git_tests)
set(proj TutorialStep1-GIT-byhash)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
- GIT_TAG d1970730310fe8bc07e73f15dc570071f9f9654a
+ GIT_TAG 57418671a0a0e371e7bac532337152595fbe0df5 # generated by gitrepo.bash
UPDATE_COMMAND ""
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
@@ -670,23 +664,23 @@ endif()
if(do_git_tests)
add_test(TutorialStep1-GIT-byhash
- "${binary_base}/TutorialStep1-GIT-byhash/Tutorial" 100)
+ ${CMAKE_COMMAND} -P "${binary_base}/TutorialStep1-GIT-byhash/example.cmake")
add_test(TutorialStep1-GIT-bytag
- "${binary_base}/TutorialStep1-GIT-bytag/Tutorial" 99)
+ ${CMAKE_COMMAND} -P "${binary_base}/TutorialStep1-GIT-bytag/example.cmake")
add_test(TutorialStep1-GIT-bytag-withsubmodules
- "${binary_base}/TutorialStep1-GIT-bytag-withsubmodules/Tutorial" 99)
+ ${CMAKE_COMMAND} -P "${binary_base}/TutorialStep1-GIT-bytag-withsubmodules/example.cmake")
add_test(TutorialStep1-GIT-shallow-master
- "${binary_base}/TutorialStep1-GIT-shallow-master/Tutorial" 98)
+ ${CMAKE_COMMAND} -P "${binary_base}/TutorialStep1-GIT-shallow-master/example.cmake")
add_test(TutorialStep1-GIT-master
- "${binary_base}/TutorialStep1-GIT-master/Tutorial" 98)
+ ${CMAKE_COMMAND} -P "${binary_base}/TutorialStep1-GIT-master/example.cmake")
if(NOT git_version VERSION_LESS 1.7.7)
add_test(TutorialStep1-GIT-config
- "${binary_base}/TutorialStep1-GIT-config/Tutorial" 98)
+ ${CMAKE_COMMAND} -P "${binary_base}/TutorialStep1-GIT-config/example.cmake")
endif()
endif()
diff --git a/Tests/ExternalProject/Example/CMakeLists.txt b/Tests/ExternalProject/Example/CMakeLists.txt
index 4c12895..c3f2614 100644
--- a/Tests/ExternalProject/Example/CMakeLists.txt
+++ b/Tests/ExternalProject/Example/CMakeLists.txt
@@ -1,5 +1,5 @@
# This is the canonical simplest ExternalProject example CMakeLists.txt file:
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(ExternalProjectExample NONE)
include(ExternalProject)
diff --git a/Tests/ExternalProject/gitrepo-sub-rec.tgz b/Tests/ExternalProject/gitrepo-sub-rec.tgz
index b0f3f18..0e63651 100644
--- a/Tests/ExternalProject/gitrepo-sub-rec.tgz
+++ b/Tests/ExternalProject/gitrepo-sub-rec.tgz
Binary files differ
diff --git a/Tests/ExternalProject/gitrepo-sub.tgz b/Tests/ExternalProject/gitrepo-sub.tgz
index c0b5360..ab34fff 100644
--- a/Tests/ExternalProject/gitrepo-sub.tgz
+++ b/Tests/ExternalProject/gitrepo-sub.tgz
Binary files differ
diff --git a/Tests/ExternalProject/gitrepo.bash b/Tests/ExternalProject/gitrepo.bash
new file mode 100755
index 0000000..c341f28
--- /dev/null
+++ b/Tests/ExternalProject/gitrepo.bash
@@ -0,0 +1,129 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+
+readonly tmpdir="$(mktemp -d)"
+trap "rm -rf '$tmpdir'" EXIT
+
+readonly outdir="${BASH_SOURCE%/*}"
+readonly defaultBranch='master'
+
+export GIT_AUTHOR_NAME='testauthor'
+export GIT_AUTHOR_EMAIL='testauthor@cmake.org'
+export GIT_COMMITTER_NAME='testauthor'
+export GIT_COMMITTER_EMAIL='testauthor@cmake.org'
+
+(
+cd "$tmpdir"
+
+git --bare init -b "$defaultBranch" gitrepo.git
+rm -f gitrepo.git/hooks/*.sample
+
+mkdir gitrepo
+cd gitrepo
+git init -b "$defaultBranch"
+echo 'cmake_minimum_required(VERSION 3.19)
+project(Example NONE)
+add_custom_target(example ALL
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/example.cmake.in example.cmake
+)' >CMakeLists.txt
+echo 'message(STATUS example)' >example.cmake.in
+git add CMakeLists.txt example.cmake.in
+git commit -m "Initial import into repo."
+git push ../gitrepo.git "$defaultBranch"
+cd ../gitrepo.git
+git gc --prune
+cd ..
+ln -s gitrepo.git GIT
+
+git --bare init -b "$defaultBranch" gitrepo-sub.git
+rm -f gitrepo-sub.git/hooks/*.sample
+
+mkdir gitrepo-sub
+cd gitrepo-sub
+git init -b "$defaultBranch"
+echo 'cmake_minimum_required(VERSION 3.19)
+project(ExampleWithSub NONE)
+file(STRINGS "${CMAKE_SOURCE_DIR}/.git/config" git_config_strings
+ REGEX "^\\[submodule")
+foreach(submodule m1 m2)
+ option(WITH_${submodule} "Enable ${submodule}" OFF)
+ set(${submodule}_INITED FALSE)
+ set(${submodule}_UPDATED FALSE)
+ foreach(s ${git_config_strings})
+ if("${s}" MATCHES "${submodule}")
+ set(${submodule}_INITED TRUE)
+ endif()
+ endforeach()
+ if(EXISTS "${CMAKE_SOURCE_DIR}/m/${submodule}/CMakeLists.txt")
+ set(${submodule}_UPDATED TRUE)
+ endif()
+ if(WITH_${submodule})
+ if(NOT ${submodule}_INITED)
+ message(FATAL_ERROR "${submodule} not inited")
+ elseif(NOT ${submodule}_UPDATED)
+ message(FATAL_ERROR "${submodule} not updated")
+ endif()
+ else()
+ if(${submodule}_INITED)
+ message(FATAL_ERROR "${submodule} inited")
+ elseif(${submodule}_UPDATED)
+ message(FATAL_ERROR "${submodule} updated")
+ endif()
+ endif()
+endforeach()' >CMakeLists.txt
+git add CMakeLists.txt
+git submodule add -- ../GIT m/m1
+git submodule add -- ../GIT m/m2
+git submodule add -- ../GIT m/m3
+git commit -m "Initial import into repo."
+git push ../gitrepo-sub.git "$defaultBranch"
+cd ../gitrepo-sub.git
+git gc --prune
+cd ..
+ln -s gitrepo-sub.git GIT-with-submodules
+
+git --bare init -b "$defaultBranch" gitrepo-sub-rec.git
+rm -f gitrepo-sub-rec.git/hooks/*.sample
+
+mkdir gitrepo-sub-rec
+cd gitrepo-sub-rec
+git init -b "$defaultBranch"
+echo 'cmake_minimum_required(VERSION 3.19)
+project(ExampleWithRecSub NONE)
+set(top_submodule_dir "${CMAKE_SOURCE_DIR}/submodule")
+if(NOT EXISTS "${top_submodule_dir}/CMakeLists.txt")
+ message(FATAL_ERROR "Top submodule not updated")
+endif()
+option(WITH_RECURSIVE "Submodules are updated recursively" ON)
+foreach(submodule m1 m2 m3)
+ set(${submodule}_UPDATED FALSE)
+ if(EXISTS "${top_submodule_dir}/m/${submodule}/CMakeLists.txt")
+ set(${submodule}_UPDATED TRUE)
+ endif()
+ if(WITH_RECURSIVE)
+ if(NOT ${submodule}_UPDATED)
+ message(FATAL_ERROR "${submodule} not updated")
+ endif()
+ else()
+ if(${submodule}_UPDATED)
+ message(FATAL_ERROR "${submodule} updated")
+ endif()
+ endif()
+endforeach()' >CMakeLists.txt
+git add CMakeLists.txt
+git submodule add -- ../GIT-with-submodules submodule
+git commit -m "Initial import into repo."
+git push ../gitrepo-sub-rec.git "$defaultBranch"
+cd ../gitrepo-sub-rec.git
+git gc --prune
+cd ..
+)
+
+tar cvzf "$outdir/gitrepo.tgz" -C "$tmpdir" gitrepo.git
+tar cvzf "$outdir/gitrepo-sub.tgz" -C "$tmpdir" gitrepo-sub.git
+tar cvzf "$outdir/gitrepo-sub-rec.tgz" -C "$tmpdir" gitrepo-sub-rec.git
+
+git_tag=$(cd "$tmpdir/gitrepo.git" ; git rev-parse HEAD)
+sed -i "/generated by gitrepo.bash/ s/ [0-9a-f]\\+ / $git_tag /" "$outdir/CMakeLists.txt"
diff --git a/Tests/ExternalProject/gitrepo.tgz b/Tests/ExternalProject/gitrepo.tgz
index 0a84bda..8d2d144 100644
--- a/Tests/ExternalProject/gitrepo.tgz
+++ b/Tests/ExternalProject/gitrepo.tgz
Binary files differ
diff --git a/Tests/ExternalProjectLocal/CMakeLists.txt b/Tests/ExternalProjectLocal/CMakeLists.txt
index 789e4fb..9a0241c 100644
--- a/Tests/ExternalProjectLocal/CMakeLists.txt
+++ b/Tests/ExternalProjectLocal/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(ExternalProjectLocalTest NONE)
if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12)
cmake_policy(SET CMP0114 NEW)
diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt
index 563a6cf..6f8a7b1 100644
--- a/Tests/ExternalProjectUpdate/CMakeLists.txt
+++ b/Tests/ExternalProjectUpdate/CMakeLists.txt
@@ -1,7 +1,12 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(ExternalProjectUpdateTest NONE)
if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12)
cmake_policy(SET CMP0114 NEW)
+else()
+ # This test is very noisy with warnings about this policy if we don't
+ # explicitly set it. Projects shouldn't do this, but for test code this
+ # is reasonable.
+ cmake_policy(SET CMP0114 OLD)
endif()
cmake_policy(GET CMP0114 cmp0114)
@@ -51,15 +56,9 @@ set(do_git_tests 0)
if(GIT_EXECUTABLE)
set(do_git_tests 1)
- execute_process(
- COMMAND "${GIT_EXECUTABLE}" --version
- OUTPUT_VARIABLE ov
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}")
- message(STATUS "git_version='${git_version}'")
+ message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'")
- if(git_version VERSION_LESS 1.6.5)
+ if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5)
message(STATUS "No ExternalProject git tests with git client less than version 1.6.5")
set(do_git_tests 0)
endif()
diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
index ddc513f..394df87 100644
--- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -167,15 +167,9 @@ set(do_git_tests 0)
if(GIT_EXECUTABLE)
set(do_git_tests 1)
- execute_process(
- COMMAND "${GIT_EXECUTABLE}" --version
- OUTPUT_VARIABLE ov
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- string(REGEX REPLACE "^git version (.+)$" "\\1" git_version "${ov}")
- message(STATUS "git_version='${git_version}'")
+ message(STATUS "GIT_VERSION_STRING='${GIT_VERSION_STRING}'")
- if(git_version VERSION_LESS 1.6.5)
+ if("${GIT_VERSION_STRING}" VERSION_LESS 1.6.5)
message(STATUS "No ExternalProject git tests with git client less than version 1.6.5")
set(do_git_tests 0)
endif()
@@ -185,17 +179,16 @@ endif()
file(REMOVE_RECURSE ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals)
if(do_git_tests)
- check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 REBASE)
+ check_a_tag(origin/master b5752a26ae448410926b35c275af3c192a53722e 1 REBASE)
check_a_tag(tag1 d1970730310fe8bc07e73f15dc570071f9f9654a 1 REBASE)
- # With the Git UPDATE_COMMAND performance patch, this will not required a
+ # With the Git UPDATE_COMMAND performance patch, this will not require a
# 'git fetch'
check_a_tag(tag1 d1970730310fe8bc07e73f15dc570071f9f9654a 0 REBASE)
check_a_tag(tag2 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 REBASE)
- check_a_tag(d19707303 d1970730310fe8bc07e73f15dc570071f9f9654a 1 REBASE)
check_a_tag(d19707303 d1970730310fe8bc07e73f15dc570071f9f9654a 0 REBASE)
- check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 REBASE)
+ check_a_tag(origin/master b5752a26ae448410926b35c275af3c192a53722e 1 REBASE)
# This is a remote symbolic ref, so it will always trigger a 'git fetch'
- check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 REBASE)
+ check_a_tag(origin/master b5752a26ae448410926b35c275af3c192a53722e 1 REBASE)
foreach(strategy IN ITEMS CHECKOUT REBASE_CHECKOUT)
# Move local master back, then apply a change that will cause a conflict
@@ -229,7 +222,19 @@ if(do_git_tests)
message(FATAL_ERROR "Could not commit conflicting change.")
endif()
# This should discard our commit but leave behind an annotated tag
- check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 ${strategy})
+ check_a_tag(origin/master b5752a26ae448410926b35c275af3c192a53722e 1 ${strategy})
endforeach()
+ # This file matches a .gitignore rule that the last commit defines. We can't
+ # directly check that updates don't stash ignored contents because the stash
+ # and pop are both done within the update step. We don't have an opportunity
+ # to check things in between, but we can at least check that the update step
+ # doesn't choke on it.
+ set(ignoredFile ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT/ignored_item)
+ file(TOUCH ${ignoredFile})
+ check_a_tag(origin/master b5752a26ae448410926b35c275af3c192a53722e 1 REBASE)
+ if(NOT EXISTS ${ignoredFile})
+ message(FATAL_ERROR "Ignored file is missing")
+ endif()
+
endif()
diff --git a/Tests/ExternalProjectUpdate/gitrepo.tgz b/Tests/ExternalProjectUpdate/gitrepo.tgz
index 87090ab..4dab56b 100644
--- a/Tests/ExternalProjectUpdate/gitrepo.tgz
+++ b/Tests/ExternalProjectUpdate/gitrepo.tgz
Binary files differ
diff --git a/Tests/FindGTK2/atk/CMakeLists.txt b/Tests/FindGTK2/atk/CMakeLists.txt
index be37957..0392d88 100644
--- a/Tests/FindGTK2/atk/CMakeLists.txt
+++ b/Tests/FindGTK2/atk/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(atk C)
diff --git a/Tests/FindGTK2/atkmm/CMakeLists.txt b/Tests/FindGTK2/atkmm/CMakeLists.txt
index e8320b5..ec838de 100644
--- a/Tests/FindGTK2/atkmm/CMakeLists.txt
+++ b/Tests/FindGTK2/atkmm/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(atkmm CXX)
diff --git a/Tests/FindGTK2/cairo/CMakeLists.txt b/Tests/FindGTK2/cairo/CMakeLists.txt
index 97a7369..3652ad6 100644
--- a/Tests/FindGTK2/cairo/CMakeLists.txt
+++ b/Tests/FindGTK2/cairo/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(cairo C)
diff --git a/Tests/FindGTK2/cairomm/CMakeLists.txt b/Tests/FindGTK2/cairomm/CMakeLists.txt
index 47a156e..cde0f42 100644
--- a/Tests/FindGTK2/cairomm/CMakeLists.txt
+++ b/Tests/FindGTK2/cairomm/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(cairomm CXX)
diff --git a/Tests/FindGTK2/gdk/CMakeLists.txt b/Tests/FindGTK2/gdk/CMakeLists.txt
index f485236..35ef337 100644
--- a/Tests/FindGTK2/gdk/CMakeLists.txt
+++ b/Tests/FindGTK2/gdk/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gdk C)
diff --git a/Tests/FindGTK2/gdk_pixbuf/CMakeLists.txt b/Tests/FindGTK2/gdk_pixbuf/CMakeLists.txt
index 004e82e..ea1b05d 100644
--- a/Tests/FindGTK2/gdk_pixbuf/CMakeLists.txt
+++ b/Tests/FindGTK2/gdk_pixbuf/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gdk_pixbuf C)
diff --git a/Tests/FindGTK2/gdkmm/CMakeLists.txt b/Tests/FindGTK2/gdkmm/CMakeLists.txt
index a54fc4f..72fc6f4 100644
--- a/Tests/FindGTK2/gdkmm/CMakeLists.txt
+++ b/Tests/FindGTK2/gdkmm/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gdkmm CXX)
diff --git a/Tests/FindGTK2/gio/CMakeLists.txt b/Tests/FindGTK2/gio/CMakeLists.txt
index db9cdd0..4835afa 100644
--- a/Tests/FindGTK2/gio/CMakeLists.txt
+++ b/Tests/FindGTK2/gio/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gio C)
diff --git a/Tests/FindGTK2/giomm/CMakeLists.txt b/Tests/FindGTK2/giomm/CMakeLists.txt
index 46cfef5..b639979 100644
--- a/Tests/FindGTK2/giomm/CMakeLists.txt
+++ b/Tests/FindGTK2/giomm/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(giomm CXX)
diff --git a/Tests/FindGTK2/glib/CMakeLists.txt b/Tests/FindGTK2/glib/CMakeLists.txt
index 1aa73ff..536fc67 100644
--- a/Tests/FindGTK2/glib/CMakeLists.txt
+++ b/Tests/FindGTK2/glib/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(glib C)
diff --git a/Tests/FindGTK2/glibmm/CMakeLists.txt b/Tests/FindGTK2/glibmm/CMakeLists.txt
index af8ddcf..25d5518 100644
--- a/Tests/FindGTK2/glibmm/CMakeLists.txt
+++ b/Tests/FindGTK2/glibmm/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(glibmm CXX)
diff --git a/Tests/FindGTK2/gmodule/CMakeLists.txt b/Tests/FindGTK2/gmodule/CMakeLists.txt
index 9717da8..2bfb81e 100644
--- a/Tests/FindGTK2/gmodule/CMakeLists.txt
+++ b/Tests/FindGTK2/gmodule/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gmodule C)
diff --git a/Tests/FindGTK2/gobject/CMakeLists.txt b/Tests/FindGTK2/gobject/CMakeLists.txt
index c51fd4d..11520f8 100644
--- a/Tests/FindGTK2/gobject/CMakeLists.txt
+++ b/Tests/FindGTK2/gobject/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gobject C)
diff --git a/Tests/FindGTK2/gthread/CMakeLists.txt b/Tests/FindGTK2/gthread/CMakeLists.txt
index a90294d0..5ecfd9b 100644
--- a/Tests/FindGTK2/gthread/CMakeLists.txt
+++ b/Tests/FindGTK2/gthread/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gthread C)
diff --git a/Tests/FindGTK2/gtk/CMakeLists.txt b/Tests/FindGTK2/gtk/CMakeLists.txt
index 11603ae..2c67619 100644
--- a/Tests/FindGTK2/gtk/CMakeLists.txt
+++ b/Tests/FindGTK2/gtk/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gtk C)
diff --git a/Tests/FindGTK2/gtkmm/CMakeLists.txt b/Tests/FindGTK2/gtkmm/CMakeLists.txt
index eb0b7aa..3375a55 100644
--- a/Tests/FindGTK2/gtkmm/CMakeLists.txt
+++ b/Tests/FindGTK2/gtkmm/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(gtkmm CXX)
diff --git a/Tests/FindGTK2/pango/CMakeLists.txt b/Tests/FindGTK2/pango/CMakeLists.txt
index af382a4..bd6b13a 100644
--- a/Tests/FindGTK2/pango/CMakeLists.txt
+++ b/Tests/FindGTK2/pango/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(pango C)
diff --git a/Tests/FindGTK2/pangocairo/CMakeLists.txt b/Tests/FindGTK2/pangocairo/CMakeLists.txt
index 8f61379..157b9c2 100644
--- a/Tests/FindGTK2/pangocairo/CMakeLists.txt
+++ b/Tests/FindGTK2/pangocairo/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(pangocairo C)
diff --git a/Tests/FindGTK2/pangoft2/CMakeLists.txt b/Tests/FindGTK2/pangoft2/CMakeLists.txt
index 0f84c7f..76966e7 100644
--- a/Tests/FindGTK2/pangoft2/CMakeLists.txt
+++ b/Tests/FindGTK2/pangoft2/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(pangoft2 C)
diff --git a/Tests/FindGTK2/pangomm/CMakeLists.txt b/Tests/FindGTK2/pangomm/CMakeLists.txt
index 3650c50..0bb49e2 100644
--- a/Tests/FindGTK2/pangomm/CMakeLists.txt
+++ b/Tests/FindGTK2/pangomm/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(pangomm CXX)
diff --git a/Tests/FindGTK2/pangoxft/CMakeLists.txt b/Tests/FindGTK2/pangoxft/CMakeLists.txt
index 0db16b1..7051d35 100644
--- a/Tests/FindGTK2/pangoxft/CMakeLists.txt
+++ b/Tests/FindGTK2/pangoxft/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(pangoxft C)
diff --git a/Tests/FindGTK2/sigc++/CMakeLists.txt b/Tests/FindGTK2/sigc++/CMakeLists.txt
index f830b81..9c1fff7 100644
--- a/Tests/FindGTK2/sigc++/CMakeLists.txt
+++ b/Tests/FindGTK2/sigc++/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(sigc++ CXX)
diff --git a/Tests/FindIntl/CMakeLists.txt b/Tests/FindIntl/CMakeLists.txt
new file mode 100644
index 0000000..0906ede
--- /dev/null
+++ b/Tests/FindIntl/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindIntl.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindIntl/Test"
+ "${CMake_BINARY_DIR}/Tests/FindIntl/Test"
+ ${build_generator_args}
+ --build-project TestFindIntl
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindIntl/Test/CMakeLists.txt b/Tests/FindIntl/Test/CMakeLists.txt
new file mode 100644
index 0000000..5140406
--- /dev/null
+++ b/Tests/FindIntl/Test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.10)
+project(TestFindIntl CXX)
+include(CTest)
+
+find_package(Intl REQUIRED)
+
+add_executable(test_intl_tgt main.cxx)
+target_link_libraries(test_intl_tgt Intl::Intl)
+add_test(NAME test_intl_tgt COMMAND test_intl_tgt)
+
+add_executable(test_intl_var main.cxx)
+target_include_directories(test_intl_var PRIVATE ${Intl_INCLUDE_DIRS})
+target_link_libraries(test_intl_var PRIVATE ${Intl_LIBRARIES})
+add_test(NAME test_intl_var COMMAND test_intl_var)
diff --git a/Tests/FindIntl/Test/main.cxx b/Tests/FindIntl/Test/main.cxx
new file mode 100644
index 0000000..d90c095
--- /dev/null
+++ b/Tests/FindIntl/Test/main.cxx
@@ -0,0 +1,11 @@
+extern "C" {
+#include <libintl.h>
+}
+
+int main()
+{
+ // Check if we include the directory correctly and have no link errors
+ bindtextdomain("", "");
+ gettext("");
+ return 0;
+}
diff --git a/Tests/FindPostgreSQL/Test/CMakeLists.txt b/Tests/FindPostgreSQL/Test/CMakeLists.txt
index 374e147..1bc5c56 100644
--- a/Tests/FindPostgreSQL/Test/CMakeLists.txt
+++ b/Tests/FindPostgreSQL/Test/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
project(TestFindPostgreSQL C)
include(CTest)
-find_package(PostgreSQL REQUIRED)
+find_package(PostgreSQL REQUIRED COMPONENTS Server)
add_definitions(-DCMAKE_EXPECTED_POSTGRESQL_VERSION="${PostgreSQL_VERSION_STRING}")
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 44484c3..520ba9e 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -451,6 +451,18 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
endif()
+
+ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ add_test(NAME FindPython.UnversionedNames COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/UnversionedNames"
+ "${CMake_BINARY_DIR}/Tests/FindPython/UnversionedNames"
+ ${build_generator_args}
+ --build-project UnversionedNames
+ --build-options ${build_options}
+ )
+ endif()
endif()
if(CMake_TEST_FindPython_NumPy)
diff --git a/Tests/FindPython/UnversionedNames/CMakeLists.txt b/Tests/FindPython/UnversionedNames/CMakeLists.txt
new file mode 100644
index 0000000..597bd4e
--- /dev/null
+++ b/Tests/FindPython/UnversionedNames/CMakeLists.txt
@@ -0,0 +1,66 @@
+cmake_minimum_required(VERSION 3.19...3.20)
+
+project(UnversionedNames LANGUAGES NONE)
+
+# check if it is possible to find python with a generic name
+find_program(UNVERSIONED_Python3 NAMES python3)
+
+if (NOT UNVERSIONED_Python3)
+ # no generic name available
+ # test cannot be done
+ return()
+endif()
+
+# search with default configuration
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (Python3_EXECUTABLE STREQUAL UNVERSIONED_Python3)
+ # default configuration pick-up the generic name
+ # test cannot be completed
+ return()
+endif()
+
+unset(Python3_EXECUTABLE)
+# Force now to search first for generic name
+set(Python3_FIND_UNVERSIONED_NAMES FIRST)
+
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (NOT Python3_EXECUTABLE STREQUAL UNVERSIONED_Python3)
+ message(SEND_ERROR "Found unexpected interpreter ${Python3_EXECUTABLE} instead of ${UNVERSIONED_Python3}")
+endif()
+
+# To check value 'NEVER", creates directory holding a symlink to the generic name
+file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/bin")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
+file(CREATE_LINK "${UNVERSIONED_Python3}" "${CMAKE_CURRENT_BINARY_DIR}/bin/python3" SYMBOLIC)
+
+unset(Python3_EXECUTABLE)
+set(Python3_FIND_UNVERSIONED_NAMES FIRST)
+set(Python3_ROOT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+# First search: generic name must be found
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (NOT Python3_EXECUTABLE STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+ message(FATAL_ERROR "Found unexpected interpreter ${Python3_EXECUTABLE} instead of ${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+endif()
+
+unset(Python3_EXECUTABLE)
+set(Python3_FIND_UNVERSIONED_NAMES LAST)
+
+# Second search: generic name must be found
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (NOT Python3_EXECUTABLE STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+ message(FATAL_ERROR "Found unexpected interpreter ${Python3_EXECUTABLE} instead of ${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+endif()
+
+unset(Python3_EXECUTABLE)
+set(Python3_FIND_UNVERSIONED_NAMES NEVER)
+
+# Third search: generic name must NOT be found
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
+if (Python3_EXECUTABLE STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/bin/python3")
+ message(FATAL_ERROR "Found unexpected interpreter ${Python3_EXECUTABLE}")
+endif()
diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt
index 929fa4d..1868892 100644
--- a/Tests/Fortran/CMakeLists.txt
+++ b/Tests/Fortran/CMakeLists.txt
@@ -120,7 +120,7 @@ endfunction()
# if the id's match or the compilers are compatible, then
# call the test_fortran_c_interface_module function
if("${CMAKE_Fortran_COMPILER_ID}:${CMAKE_C_COMPILER_ID}" MATCHES
- "(Intel:MSVC|Absoft:GNU)"
+ "(Intel(LLVM)?:MSVC|Absoft:GNU)"
OR ("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "${CMAKE_C_COMPILER_ID}" ))
test_fortran_c_interface_module()
else()
diff --git a/Tests/Fortran/myc.c b/Tests/Fortran/myc.c
index efd9b68..1a4d5a4 100644
--- a/Tests/Fortran/myc.c
+++ b/Tests/Fortran/myc.c
@@ -1,6 +1,6 @@
#include "foo.h"
-extern F_test_mod_sub(void);
-extern F_mysub(void);
+extern void F_test_mod_sub(void);
+extern void F_mysub(void);
int myc(void)
{
F_mysub();
diff --git a/Tests/FortranC/CMakeLists.txt b/Tests/FortranC/CMakeLists.txt
index 79c670d..83c2729 100644
--- a/Tests/FortranC/CMakeLists.txt
+++ b/Tests/FortranC/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(FortranC C Fortran)
# Skip this test for compilers not known to be compatible.
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index 637f581..b5b5e56 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -111,7 +111,7 @@ endif()
# Test that with Intel Fortran we always compile with preprocessor
# defines even if splitting the preprocessing and compilation steps.
-if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
add_executable(IntelIfDef IntelIfDef.f)
set_property(TARGET IntelIfDef PROPERTY Fortran_FORMAT FIXED)
target_compile_definitions(IntelIfDef PRIVATE SOME_DEF)
@@ -146,13 +146,13 @@ set_property(SOURCE no_preprocess_source_lower.f PROPERTY Fortran_PREPROCESS OFF
# Test that we can explicitly not preprocess a target or source.
# This will not work on certain compilers due to either missing a
# "don't preprocess" flag, or due to choice of file extension.
-if(test_pp_flags AND NOT CMAKE_Fortran_COMPILER_ID MATCHES "(Flang|NAG|PGI|SunPro|XL)")
+if(test_pp_flags AND NOT CMAKE_Fortran_COMPILER_ID MATCHES "(Flang|NAG|PGI|NVHPC|SunPro|XL)")
add_library(no_preprocess_target STATIC no_preprocess_target_upper.F)
target_compile_options(no_preprocess_target PRIVATE -DINTEGER=nonsense)
add_library(no_preprocess_source STATIC no_preprocess_source_upper.F)
target_compile_options(no_preprocess_source PRIVATE -DINTEGER=nonsense)
if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL "Cray"
- AND NOT "${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" STREQUAL "Intel;MSVC")
+ AND NOT "${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" MATCHES "Intel(LLVM)?;MSVC")
target_sources(no_preprocess_target PRIVATE no_preprocess_target_fpp.fpp)
target_sources(no_preprocess_source PRIVATE no_preprocess_source_fpp.fpp)
endif()
diff --git a/Tests/Fuzzing/README.rst b/Tests/Fuzzing/README.rst
new file mode 100644
index 0000000..a869f9c
--- /dev/null
+++ b/Tests/Fuzzing/README.rst
@@ -0,0 +1,8 @@
+The fuzzers in this directory are run continuously through OSS-fuzz.
+All fuzzers are implemented by way of the `libFuzzer engine`_.
+
+The link to the OSS-fuzz integration can be found here: (pending)
+All email addresses in the `project.yaml` file on OSS-fuzz will have access
+to detailed bug reports and will be notified via email if/when bugs are found.
+
+.. _`libFuzzer Engine`: https://llvm.org/docs/LibFuzzer.html
diff --git a/Tests/Fuzzing/xml_parser_fuzzer.cc b/Tests/Fuzzing/xml_parser_fuzzer.cc
new file mode 100644
index 0000000..1faa918
--- /dev/null
+++ b/Tests/Fuzzing/xml_parser_fuzzer.cc
@@ -0,0 +1,27 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "cmXMLParser.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size)
+{
+ char test_file[] = "libfuzzer.xml";
+
+ FILE* fp = fopen(test_file, "wb");
+ if (!fp)
+ return 0;
+ fwrite(data, size, 1, fp);
+ fclose(fp);
+
+ cmXMLParser parser;
+ if (!parser.ParseFile(test_file)) {
+ return 1;
+ }
+
+ remove(test_file);
+ return 0;
+}
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/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
index 20bd601..dee39c8 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(SystemIncludeDirectories)
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index a9edf9a..3b994a2 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(TargetIncludeDirectories)
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index ec0a604..a302c7c 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(InterfaceLibrary)
diff --git a/Tests/JavaNativeHeaders/CMakeLists.txt b/Tests/JavaNativeHeaders/CMakeLists.txt
index 2023d25..f3cc89d 100644
--- a/Tests/JavaNativeHeaders/CMakeLists.txt
+++ b/Tests/JavaNativeHeaders/CMakeLists.txt
@@ -11,7 +11,7 @@ include (UseJava)
# JNI support
find_package(JNI)
-add_jar(B1 D.java GENERATE_NATIVE_HEADERS D1-native)
+add_jar(B1 D.java GENERATE_NATIVE_HEADERS D1-native DESTINATION INSTALL include)
add_jar(E1 E.java GENERATE_NATIVE_HEADERS E1-native)
add_jar(hello4 HelloWorld3.java)
@@ -19,6 +19,13 @@ add_jar(hello4 HelloWorld3.java)
add_library(D SHARED D.cpp E.cpp)
target_link_libraries (D PRIVATE D1-native E1-native)
+install(TARGETS D1-native EXPORT native)
+install(DIRECTORY "$<TARGET_PROPERTY:D1-native,NATIVE_HEADERS_DIRECTORY>/" DESTINATION include)
+install(EXPORT native DESTINATION "${CMAKE_INSTALL_PREFIX}" NAMESPACE D1::)
+
add_test (NAME Java.NativeHeaders
COMMAND "${Java_JAVA_EXECUTABLE}" -Djava.library.path=$<TARGET_FILE_DIR:D> -classpath hello4.jar HelloWorld3)
+
+add_test (NAME Java.ImportNativeHeaders
+ COMMAND "${CMAKE_COMMAND}" "-DNATIVE_HEADERS_IMPORT_DIR=${CMAKE_INSTALL_PREFIX}" -S "${CMAKE_CURRENT_SOURCE_DIR}/Import" -B "${CMAKE_CURRENT_BINARY_DIR}/Import")
diff --git a/Tests/JavaNativeHeaders/Import/CMakeLists.txt b/Tests/JavaNativeHeaders/Import/CMakeLists.txt
new file mode 100644
index 0000000..5486da9
--- /dev/null
+++ b/Tests/JavaNativeHeaders/Import/CMakeLists.txt
@@ -0,0 +1,19 @@
+project(ImportJavaNativeHeaders LANGUAGES NONE)
+
+cmake_minimum_required (VERSION 3.19...3.20)
+set(CMAKE_VERBOSE_MAKEFILE 1)
+
+include(${NATIVE_HEADERS_IMPORT_DIR}/native.cmake)
+
+if(NOT TARGET D1::D1-native)
+ message(FATAL_ERROR "Target 'D1::D1-native' not found.")
+endif()
+
+get_property(incs TARGET D1::D1-native PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+if (NOT incs MATCHES "${NATIVE_HEADERS_IMPORT_DIR}/include")
+ message(FATAL_ERROR "Target 'D1::D1-native', property 'INTERFACE_INCLUDE_DIRECTORIES' badly defined: ${incs}.")
+endif()
+
+if (NOT EXISTS "${NATIVE_HEADERS_IMPORT_DIR}/include/D.h")
+ message(FATAL_ERROR "file '${NATIVE_HEADERS_IMPORT_DIR}/include/D.h' not found.")
+endif()
diff --git a/Tests/LinkDirectory/CMakeLists.txt b/Tests/LinkDirectory/CMakeLists.txt
index c7a2700..d9a8ac8 100644
--- a/Tests/LinkDirectory/CMakeLists.txt
+++ b/Tests/LinkDirectory/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(LinkDirectory C)
# Put the subproject source tree in our build tree so it can refer to
diff --git a/Tests/LinkDirectory/External/CMakeLists.txt b/Tests/LinkDirectory/External/CMakeLists.txt
index c877913..e222929 100644
--- a/Tests/LinkDirectory/External/CMakeLists.txt
+++ b/Tests/LinkDirectory/External/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(LinkDirectoryExternal C)
diff --git a/Tests/LinkFlags/CMakeLists.txt b/Tests/LinkFlags/CMakeLists.txt
index 4607035..31ff9b5 100644
--- a/Tests/LinkFlags/CMakeLists.txt
+++ b/Tests/LinkFlags/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(LinkFlags C)
string(TOUPPER "${TEST_CONFIG}" TEST_CONFIG_UPPER)
diff --git a/Tests/MFC/CMakeLists.txt b/Tests/MFC/CMakeLists.txt
index 62ff749..d17b955 100644
--- a/Tests/MFC/CMakeLists.txt
+++ b/Tests/MFC/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(mfc_driver)
include(CTest)
diff --git a/Tests/MFC/CMakeLists.txt.in b/Tests/MFC/CMakeLists.txt.in
index 3632e03..a600c63 100644
--- a/Tests/MFC/CMakeLists.txt.in
+++ b/Tests/MFC/CMakeLists.txt.in
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(mfc1)
macro(replace_flags var these those)
diff --git a/Tests/MFC/try_compile/CMakeLists.txt b/Tests/MFC/try_compile/CMakeLists.txt
index 8e5d746..768d2a6 100644
--- a/Tests/MFC/try_compile/CMakeLists.txt
+++ b/Tests/MFC/try_compile/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(try_compile_mfc)
set(files
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 27838a4..41bd6f5 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -6,8 +6,9 @@ foreach(t MultiThreaded SingleThreaded)
foreach(dbg "" Debug)
foreach(dll "" DLL)
set(var "CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_${t}${dbg}${dll}")
- if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
- # ifort does not actually define these, so inject them
+ if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel"
+ OR CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
+ # ifort and ifx do not actually define these, so inject them
string(REPLACE "-threads" "-threads;-D_MT" "${var}" "${${var}}")
string(REPLACE "-dbglibs" "-dbglibs;-D_DEBUG" "${var}" "${${var}}")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Flang")
diff --git a/Tests/MacRuntimePath/A/CMakeLists.txt b/Tests/MacRuntimePath/A/CMakeLists.txt
index bf937e6..c9d3f2c 100644
--- a/Tests/MacRuntimePath/A/CMakeLists.txt
+++ b/Tests/MacRuntimePath/A/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(MacRuntimePath_A)
# a shared library
diff --git a/Tests/MacRuntimePath/B/CMakeLists.txt b/Tests/MacRuntimePath/B/CMakeLists.txt
index 4317af6..85598c4 100644
--- a/Tests/MacRuntimePath/B/CMakeLists.txt
+++ b/Tests/MacRuntimePath/B/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(MacRuntimePath_B)
include(${MacRuntimePath_B_BINARY_DIR}/../Root/lib/exp.cmake)
diff --git a/Tests/MissingSourceFile/CMakeLists.txt b/Tests/MissingSourceFile/CMakeLists.txt
index a7206c8..b4f0033 100644
--- a/Tests/MissingSourceFile/CMakeLists.txt
+++ b/Tests/MissingSourceFile/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(MissingSourceFile C)
add_executable(MissingSourceFile DoesNotExist/MissingSourceFile.c)
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index cffef5a..0cf74bf 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -52,7 +52,7 @@ endmacro()
# detailed features tables, not just meta-features
if (CMAKE_C_COMPILE_FEATURES)
- if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$")
+ if(NOT CMAKE_C_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$")
set(C_expected_features ${CMAKE_C_COMPILE_FEATURES})
list(FILTER C_expected_features EXCLUDE REGEX "^c_std_[0-9][0-9]")
endif()
@@ -95,7 +95,7 @@ if (C_expected_features)
endif()
if (CMAKE_CXX_COMPILE_FEATURES)
- if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$")
+ if(NOT CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang|IntelLLVM)$")
set(CXX_expected_features ${CMAKE_CXX_COMPILE_FEATURES})
list(FILTER CXX_expected_features EXCLUDE REGEX "^cxx_std_[0-9][0-9]")
endif()
diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt
index fca5f41..74f34e4 100644
--- a/Tests/ObjectLibrary/CMakeLists.txt
+++ b/Tests/ObjectLibrary/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(ObjectLibrary C)
add_subdirectory(A)
diff --git a/Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt b/Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt
index 22c92a7..fb0ebc0 100644
--- a/Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt
+++ b/Tests/ObjectLibrary/ExportLanguages/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(ExportLanguages CXX)
add_library(ExportLanguagesA OBJECT a.cxx)
add_library(ExportLanguagesB STATIC a.c $<TARGET_OBJECTS:ExportLanguagesA>)
diff --git a/Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt b/Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt
index fc8dd2b..8544798 100644
--- a/Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt
+++ b/Tests/ObjectLibrary/ExportLanguages/ExportLanguagesTest/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(ExportLanguagesTest)
diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt
index 44194ca..5aa2459 100644
--- a/Tests/PDBDirectoryAndName/CMakeLists.txt
+++ b/Tests/PDBDirectoryAndName/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
cmake_policy(SET CMP0054 NEW)
project(PDBDirectoryAndName C)
@@ -9,8 +9,9 @@ endif()
# Intel 11.1 does not support /Fd but Intel 14.0 does.
# TODO: Did a version in between these add it?
-if(CMAKE_C_COMPILER_ID STREQUAL Intel AND
- CMAKE_C_COMPILER_VERSION VERSION_LESS 14.0)
+if((CMAKE_C_COMPILER_ID STREQUAL Intel AND
+ CMAKE_C_COMPILER_VERSION VERSION_LESS 14.0) OR
+ CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
set(NO_COMPILE_PDB 1)
endif()
diff --git a/Tests/Plugin/PluginTest/CMakeLists.txt b/Tests/Plugin/PluginTest/CMakeLists.txt
index 5626dbc..f00122d 100644
--- a/Tests/Plugin/PluginTest/CMakeLists.txt
+++ b/Tests/Plugin/PluginTest/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(PluginTest)
diff --git a/Tests/PositionIndependentTargets/CMakeLists.txt b/Tests/PositionIndependentTargets/CMakeLists.txt
index e79f3b7..ff779d3 100644
--- a/Tests/PositionIndependentTargets/CMakeLists.txt
+++ b/Tests/PositionIndependentTargets/CMakeLists.txt
@@ -1,5 +1,5 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(PositionIndependentTargets)
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index bce1b3f..bf2af64 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -147,8 +147,13 @@ endif()
# - NMake is okay with just \\\"
# - The XL compiler does not re-escape \\\" when launching an
# internal tool to do preprocessing .
+# - The IntelLLVM C and C++ compiler drivers do not re-escape the \\\" when
+# launching the underlying compiler. FIXME: this bug is expected to be fixed
+# in a future release.
if((PP_NMAKE OR PP_UMAKE) AND
- NOT CMAKE_C_COMPILER_ID STREQUAL "XL")
+ NOT CMAKE_C_COMPILER_ID STREQUAL "XL" AND
+ NOT CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM" AND
+ NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
string(APPEND STRING_EXTRA "\\\"")
endif()
diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt
index 2ca11e4..3ddc345 100644
--- a/Tests/Qt4Targets/CMakeLists.txt
+++ b/Tests/Qt4Targets/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(Qt4Targets)
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
index d9fc2b0..17855ff 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/CMakeLists.txt
@@ -2,6 +2,15 @@ cmake_minimum_required(VERSION 3.11)
project(AutogenOriginDependsOff)
include("../AutogenCoreTest.cmake")
+get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+# XXX(xcode-per-cfg-src): Enable multi-config code path for Xcode
+# when the Xcode generator supports per-config sources.
+if(_isMultiConfig AND NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ set(mocs_compilation_cpp "mocs_compilation_$<CONFIG>.cpp")
+else()
+ set(mocs_compilation_cpp "mocs_compilation.cpp")
+endif()
+
set(CSD ${CMAKE_CURRENT_SOURCE_DIR})
set(CBD ${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CSD})
@@ -19,7 +28,7 @@ add_custom_command (
add_custom_target ( a_mc
COMMAND ${CMAKE_COMMAND} -E sleep 2
COMMAND ${CMAKE_COMMAND}
- "-DMCF=${CBD}/a_qt_autogen/mocs_compilation.cpp"
+ "-DMCF=${CBD}/a_qt_autogen/${mocs_compilation_cpp}"
"-DCF_IN=${CSD}/a_mc.hpp.in"
"-DCF_OUT=${CBD}/a_mc.hpp"
-P ${CSD}/configure_content.cmake
@@ -51,7 +60,7 @@ add_custom_command (
DEPENDS b_qt_autogen
COMMAND ${CMAKE_COMMAND} -E sleep 2
COMMAND ${CMAKE_COMMAND}
- "-DMCF=${CBD}/b_qt_autogen/mocs_compilation.cpp"
+ "-DMCF=${CBD}/b_qt_autogen/${mocs_compilation_cpp}"
"-DCF_IN=${CSD}/b_mc.cpp.in"
"-DCF_OUT=${CBD}/b_mc.cpp"
-P ${CSD}/configure_content.cmake
diff --git a/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
index 81fd8db..e95c626 100644
--- a/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
+++ b/Tests/QtAutogen/GlobalAutogenTarget/CMakeLists.txt
@@ -13,10 +13,10 @@ include("../AutogenCoreTest.cmake")
set(GAT_SDIR "${CMAKE_CURRENT_SOURCE_DIR}/GAT")
set(GAT_BDIR "${CMAKE_CURRENT_BINARY_DIR}/GAT")
# Files
-set(MCA "sda/sda_autogen/mocs_compilation.cpp")
-set(MCB "sdb/sdb_autogen/mocs_compilation.cpp")
-set(MCC "sdc/sdc_autogen/mocs_compilation.cpp")
-set(MCG "gat_autogen/mocs_compilation.cpp")
+set(MCA "sda/sda_autogen/mocs_compilation*.cpp")
+set(MCB "sdb/sdb_autogen/mocs_compilation*.cpp")
+set(MCC "sdc/sdc_autogen/mocs_compilation*.cpp")
+set(MCG "gat_autogen/mocs_compilation*.cpp")
set(DRA "sda/sda_autogen/*qrc_data.cpp")
set(DRB "sdb/sdb_autogen/*qrc_data.cpp")
diff --git a/Tests/QtAutogen/MocOnly/CMakeLists.txt b/Tests/QtAutogen/MocOnly/CMakeLists.txt
index e109154..f4fde58 100644
--- a/Tests/QtAutogen/MocOnly/CMakeLists.txt
+++ b/Tests/QtAutogen/MocOnly/CMakeLists.txt
@@ -11,6 +11,18 @@ add_executable(mocOnly
IncA.cpp
IncB.cpp
)
+# XXX(xcode-per-cfg-src): Drop the NO_PER_CONFIG_SOURCES exclusion
+# when the Xcode generator supports per-config sources.
+if(NOT NO_PER_CONFIG_SOURCES)
+ target_sources(mocOnly PRIVATE
+ "$<$<CONFIG:Debug>:${CMAKE_CURRENT_SOURCE_DIR}/CfgDebug.cpp>"
+ "$<$<NOT:$<CONFIG:Debug>>:${CMAKE_CURRENT_SOURCE_DIR}/CfgOther.cpp>"
+ )
+ target_compile_definitions(mocOnly PRIVATE
+ "$<$<CONFIG:Debug>:HAVE_CFG_DEBUG>"
+ "$<$<NOT:$<CONFIG:Debug>>:HAVE_CFG_OTHER>"
+ )
+endif()
set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
target_link_libraries(mocOnly ${QT_LIBRARIES})
# Add compile definitions with unusual characters
diff --git a/Tests/QtAutogen/MocOnly/CfgDebug.cpp b/Tests/QtAutogen/MocOnly/CfgDebug.cpp
new file mode 100644
index 0000000..07ca3fb
--- /dev/null
+++ b/Tests/QtAutogen/MocOnly/CfgDebug.cpp
@@ -0,0 +1,5 @@
+#include "CfgDebug.hpp"
+
+CfgDebug::CfgDebug()
+{
+}
diff --git a/Tests/QtAutogen/MocOnly/CfgDebug.hpp b/Tests/QtAutogen/MocOnly/CfgDebug.hpp
new file mode 100644
index 0000000..3cd90a4
--- /dev/null
+++ b/Tests/QtAutogen/MocOnly/CfgDebug.hpp
@@ -0,0 +1,15 @@
+#ifndef CFGDEBUG_HPP
+#define CFGDEBUG_HPP
+
+#include <QObject>
+
+/* clang-format off */
+class CfgDebug : public QObject
+{
+ Q_OBJECT
+public:
+ CfgDebug();
+};
+/* clang-format on */
+
+#endif
diff --git a/Tests/QtAutogen/MocOnly/CfgOther.cpp b/Tests/QtAutogen/MocOnly/CfgOther.cpp
new file mode 100644
index 0000000..0ccd433
--- /dev/null
+++ b/Tests/QtAutogen/MocOnly/CfgOther.cpp
@@ -0,0 +1,5 @@
+#include "CfgOther.hpp"
+
+CfgOther::CfgOther()
+{
+}
diff --git a/Tests/QtAutogen/MocOnly/CfgOther.hpp b/Tests/QtAutogen/MocOnly/CfgOther.hpp
new file mode 100644
index 0000000..7cacd52
--- /dev/null
+++ b/Tests/QtAutogen/MocOnly/CfgOther.hpp
@@ -0,0 +1,15 @@
+#ifndef CFGOTHER_HPP
+#define CFGOTHER_HPP
+
+#include <QObject>
+
+/* clang-format off */
+class CfgOther : public QObject
+{
+ Q_OBJECT
+public:
+ CfgOther();
+};
+/* clang-format on */
+
+#endif
diff --git a/Tests/QtAutogen/MocOnly/main.cpp b/Tests/QtAutogen/MocOnly/main.cpp
index ec8da21..6c0f6f2 100644
--- a/Tests/QtAutogen/MocOnly/main.cpp
+++ b/Tests/QtAutogen/MocOnly/main.cpp
@@ -5,6 +5,14 @@
#include "StyleA.hpp"
#include "StyleB.hpp"
+#ifdef HAVE_CFG_DEBUG
+# include "CfgDebug.hpp"
+#endif
+
+#ifdef HAVE_CFG_OTHER
+# include "CfgOther.hpp"
+#endif
+
int main(int argv, char** args)
{
StyleA styleA;
diff --git a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
index 9b32e59..c53e857 100644
--- a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt
@@ -47,19 +47,38 @@ macro(require_change_not)
endmacro()
-# Initial build
+# Configure the test project
configure_file("${mocBasicSrcDir}/test1a.h.in" "${mocBasicBinDir}/test1.h" COPYONLY)
-try_compile(MOC_RERUN
- "${mocBasicBinDir}"
- "${mocBasicSrcDir}"
- MocBasic
- CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
- "-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
- "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+configure_file("${mocBasicSrcDir}/myobject3a.h.in" "${mocBasicBinDir}/myobject3.h" @ONLY)
+if(CMAKE_GENERATOR_INSTANCE)
+ set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE=${CMAKE_GENERATOR_INSTANCE}")
+else()
+ set(_D_CMAKE_GENERATOR_INSTANCE "")
+endif()
+execute_process(
+ COMMAND "${CMAKE_COMMAND}" -B "${mocBasicBinDir}" -S "${mocBasicSrcDir}"
+ -G "${CMAKE_GENERATOR}"
+ -A "${CMAKE_GENERATOR_PLATFORM}"
+ -T "${CMAKE_GENERATOR_TOOLSET}"
+ ${_D_CMAKE_GENERATOR_INSTANCE}
+ "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+ "-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+ RESULT_VARIABLE exit_code
OUTPUT_VARIABLE output
)
-if (NOT MOC_RERUN)
- message(FATAL_ERROR "Initial build of mocBasic failed. Output: ${output}")
+if(NOT exit_code EQUAL 0)
+ message(FATAL_ERROR "Initial configuration of mocBasic failed. Output: ${output}")
+endif()
+
+# Initial build
+execute_process(
+ COMMAND "${CMAKE_COMMAND}" --build "${mocBasicBinDir}"
+ RESULT_VARIABLE exit_code
+ OUTPUT_VARIABLE output
+)
+if(NOT exit_code EQUAL 0)
+ message(FATAL_ERROR "Initial build of mocBasic failed. Output: ${output}")
endif()
# Get name of the output binary
@@ -100,3 +119,43 @@ message(STATUS "Changing nothing for no MOC re-run")
rebuild(3)
acquire_timestamp(After)
require_change_not()
+
+
+# - Ensure that the timestamp will change
+# - Remove Q_OBJECT from header
+# - Rebuild
+acquire_timestamp(Before)
+sleep()
+message(STATUS "Remove Q_OBJECT from header file for a MOC re-run")
+configure_file("${mocBasicSrcDir}/test1c.h.in" "${mocBasicBinDir}/test1.h" COPYONLY)
+sleep()
+rebuild(4)
+acquire_timestamp(After)
+require_change()
+
+
+# - Ensure that the timestamp will change
+# - Add Q_OBJECT to header again
+# - Rebuild
+acquire_timestamp(Before)
+sleep()
+message(STATUS "Add Q_OBJECT to test1.h for a MOC re-run")
+configure_file("${mocBasicSrcDir}/test1a.h.in" "${mocBasicBinDir}/test1.h" COPYONLY)
+sleep()
+rebuild(5)
+acquire_timestamp(After)
+require_change()
+
+
+# - Ensure that the timestamp will change
+# - Add Q_OBJECT to MyObject3
+# - Rebuild
+acquire_timestamp(Before)
+sleep()
+message(STATUS "Add Q_OBJECT to myobject3.h file for a MOC re-run")
+set(CLASS_CONTENT "Q_OBJECT")
+configure_file("${mocBasicSrcDir}/myobject3a.h.in" "${mocBasicBinDir}/myobject3.h" @ONLY)
+sleep()
+rebuild(6)
+acquire_timestamp(After)
+require_change()
diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
index 6a9f550..42f2f57 100644
--- a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt
@@ -13,10 +13,15 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
add_executable(mocBasic
${CMAKE_CURRENT_BINARY_DIR}/test1.h
+ ${CMAKE_CURRENT_BINARY_DIR}/myobject3.h
${CMAKE_CURRENT_BINARY_DIR}/main.cpp
+ plainobject.cpp
res1.qrc
)
-target_include_directories(mocBasic PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+target_include_directories(mocBasic PRIVATE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
target_link_libraries(mocBasic ${QT_QTCORE_TARGET})
# Write target name to text file
add_custom_command(TARGET mocBasic POST_BUILD COMMAND
diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/main.cpp.in b/Tests/QtAutogen/RerunMocBasic/MocBasic/main.cpp.in
index 9d7ea37..5accfd6 100644
--- a/Tests/QtAutogen/RerunMocBasic/MocBasic/main.cpp.in
+++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/main.cpp.in
@@ -1,4 +1,5 @@
#include "test1.h"
+#include "plainobject.h"
extern int qInitResources_res1();
@@ -16,6 +17,7 @@ int main()
Test1 test1;
Test2 test2;
+ PlainObject plainObject;
return 0;
}
diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/myobject3a.h.in b/Tests/QtAutogen/RerunMocBasic/MocBasic/myobject3a.h.in
new file mode 100644
index 0000000..d62c314
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/myobject3a.h.in
@@ -0,0 +1,13 @@
+#ifndef MYOBJECT3_H
+#define MYOBJECT3_H
+
+#include <qobject.h>
+
+class MyObject3 : public QObject
+{
+ @CLASS_CONTENT@
+public:
+ MyObject3() {}
+};
+
+#endif
diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/plainobject.cpp b/Tests/QtAutogen/RerunMocBasic/MocBasic/plainobject.cpp
new file mode 100644
index 0000000..0ca785e
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/plainobject.cpp
@@ -0,0 +1,12 @@
+#include "plainobject.h"
+
+#include "myobject3.h"
+
+PlainObject::PlainObject()
+{
+}
+
+void PlainObject::doSomething()
+{
+ MyObject3 obj3;
+}
diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/plainobject.h b/Tests/QtAutogen/RerunMocBasic/MocBasic/plainobject.h
new file mode 100644
index 0000000..8037858
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/plainobject.h
@@ -0,0 +1,12 @@
+#ifndef PLAINOBJECT_H
+#define PLAINOBJECT_H
+
+// Class that is plain C++, no Qt involved.
+class PlainObject
+{
+public:
+ PlainObject();
+ void doSomething();
+};
+
+#endif
diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/test1c.h.in b/Tests/QtAutogen/RerunMocBasic/MocBasic/test1c.h.in
new file mode 100644
index 0000000..d0b9868
--- /dev/null
+++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/test1c.h.in
@@ -0,0 +1,6 @@
+#include <QObject>
+class Test1
+{
+public:
+ void onTst1() {}
+};
diff --git a/Tests/QtAutogen/TestMacros.cmake b/Tests/QtAutogen/TestMacros.cmake
index 0e27188..1024996 100644
--- a/Tests/QtAutogen/TestMacros.cmake
+++ b/Tests/QtAutogen/TestMacros.cmake
@@ -1,12 +1,19 @@
# Autogen build options
set(Autogen_BUILD_OPTIONS "-DQT_TEST_VERSION=${QT_TEST_VERSION}")
-if(NOT _isMultiConfig) # Set in Tests/CMakeLists.txt
+if(_isMultiConfig) # Set in Tests/CMakeLists.txt
+ list(APPEND Autogen_CTEST_OPTIONS --build-config $<CONFIGURATION>)
+else()
list(APPEND Autogen_BUILD_OPTIONS "-DCMAKE_BUILD_TYPE=$<CONFIGURATION>")
endif()
list(APPEND Autogen_BUILD_OPTIONS
"-DCMAKE_AUTOGEN_VERBOSE=1"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
)
+# XXX(xcode-per-cfg-src): Drop the NO_PER_CONFIG_SOURCES exclusion
+# when the Xcode generator supports per-config sources.
+if(CMAKE_GENERATOR STREQUAL "Xcode")
+ list(APPEND Autogen_BUILD_OPTIONS -DNO_PER_CONFIG_SOURCES=1)
+endif()
# A macro to add a QtAutogen test
macro(ADD_AUTOGEN_TEST NAME)
@@ -30,6 +37,7 @@ macro(ADD_AUTOGEN_TEST NAME)
"${_BuildDir}"
${build_generator_args}
--build-project ${NAME}
+ ${Autogen_CTEST_OPTIONS}
--build-exe-dir "${_BuildDir}"
--force-new-ctest-process
--build-options ${build_options} ${Autogen_BUILD_OPTIONS}
diff --git a/Tests/QtAutomocNoQt/CMakeLists.txt b/Tests/QtAutomocNoQt/CMakeLists.txt
index b26e471..655f12b 100644
--- a/Tests/QtAutomocNoQt/CMakeLists.txt
+++ b/Tests/QtAutomocNoQt/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(QtAutomocNoQt)
diff --git a/Tests/RunCMake/ABI/C-stdout.txt b/Tests/RunCMake/ABI/C-stdout.txt
new file mode 100644
index 0000000..5b67b84
--- /dev/null
+++ b/Tests/RunCMake/ABI/C-stdout.txt
@@ -0,0 +1 @@
+-- Check if the system is big endian
diff --git a/Tests/RunCMake/ABI/C.cmake b/Tests/RunCMake/ABI/C.cmake
new file mode 100644
index 0000000..92f5da4
--- /dev/null
+++ b/Tests/RunCMake/ABI/C.cmake
@@ -0,0 +1,22 @@
+enable_language(C)
+if(NOT CMAKE_C_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$")
+ if(CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ return()
+ endif()
+ message(FATAL_ERROR "CMAKE_C_BYTE_ORDER has unexpected value '${CMAKE_C_BYTE_ORDER}'")
+endif()
+
+include(TestBigEndian)
+test_big_endian(IS_BIG_ENDIAN)
+if(IS_BIG_ENDIAN AND NOT CMAKE_C_BYTE_ORDER STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()
+
+# Test legacy check.
+set(byte_order "${CMAKE_C_BYTE_ORDER}")
+unset(CMAKE_C_BYTE_ORDER)
+include(TestBigEndian)
+test_big_endian(IS_BIG)
+if(IS_BIG AND NOT byte_order STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()
diff --git a/Tests/RunCMake/ABI/CMakeLists.txt b/Tests/RunCMake/ABI/CMakeLists.txt
new file mode 100644
index 0000000..ab1a20c
--- /dev/null
+++ b/Tests/RunCMake/ABI/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.19)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ABI/CUDA.cmake b/Tests/RunCMake/ABI/CUDA.cmake
new file mode 100644
index 0000000..8ede3a9
--- /dev/null
+++ b/Tests/RunCMake/ABI/CUDA.cmake
@@ -0,0 +1,13 @@
+enable_language(CUDA)
+if(NOT CMAKE_CUDA_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$")
+ if(CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ return()
+ endif()
+ message(FATAL_ERROR "CMAKE_CUDA_BYTE_ORDER has unexpected value '${CMAKE_CUDA_BYTE_ORDER}'")
+endif()
+
+include(TestBigEndian)
+test_big_endian(IS_BIG_ENDIAN)
+if(IS_BIG_ENDIAN AND NOT CMAKE_CUDA_BYTE_ORDER STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()
diff --git a/Tests/RunCMake/ABI/CXX-stdout.txt b/Tests/RunCMake/ABI/CXX-stdout.txt
new file mode 100644
index 0000000..5b67b84
--- /dev/null
+++ b/Tests/RunCMake/ABI/CXX-stdout.txt
@@ -0,0 +1 @@
+-- Check if the system is big endian
diff --git a/Tests/RunCMake/ABI/CXX.cmake b/Tests/RunCMake/ABI/CXX.cmake
new file mode 100644
index 0000000..2310002
--- /dev/null
+++ b/Tests/RunCMake/ABI/CXX.cmake
@@ -0,0 +1,22 @@
+enable_language(CXX)
+if(NOT CMAKE_CXX_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$")
+ if(CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ return()
+ endif()
+ message(FATAL_ERROR "CMAKE_CXX_BYTE_ORDER has unexpected value '${CMAKE_CXX_BYTE_ORDER}'")
+endif()
+
+include(TestBigEndian)
+test_big_endian(IS_BIG_ENDIAN)
+if(IS_BIG_ENDIAN AND NOT CMAKE_CXX_BYTE_ORDER STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()
+
+# Test legacy check.
+set(byte_order "${CMAKE_CXX_BYTE_ORDER}")
+unset(CMAKE_CXX_BYTE_ORDER)
+include(TestBigEndian)
+test_big_endian(IS_BIG)
+if(IS_BIG AND NOT byte_order STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()
diff --git a/Tests/RunCMake/ABI/OBJC.cmake b/Tests/RunCMake/ABI/OBJC.cmake
new file mode 100644
index 0000000..ab67459
--- /dev/null
+++ b/Tests/RunCMake/ABI/OBJC.cmake
@@ -0,0 +1,13 @@
+enable_language(OBJC)
+if(NOT CMAKE_OBJC_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$")
+ if(CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ return()
+ endif()
+ message(FATAL_ERROR "CMAKE_OBJC_BYTE_ORDER has unexpected value '${CMAKE_OBJC_BYTE_ORDER}'")
+endif()
+
+include(TestBigEndian)
+test_big_endian(IS_BIG_ENDIAN)
+if(IS_BIG_ENDIAN AND NOT CMAKE_OBJC_BYTE_ORDER STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()
diff --git a/Tests/RunCMake/ABI/OBJCXX.cmake b/Tests/RunCMake/ABI/OBJCXX.cmake
new file mode 100644
index 0000000..41a719e
--- /dev/null
+++ b/Tests/RunCMake/ABI/OBJCXX.cmake
@@ -0,0 +1,13 @@
+enable_language(OBJCXX)
+if(NOT CMAKE_OBJCXX_BYTE_ORDER MATCHES "^(BIG_ENDIAN|LITTLE_ENDIAN)$")
+ if(CMAKE_OSX_ARCHITECTURES MATCHES ";ppc|ppc;")
+ return()
+ endif()
+ message(FATAL_ERROR "CMAKE_OBJCXX_BYTE_ORDER has unexpected value '${CMAKE_OBJCXX_BYTE_ORDER}'")
+endif()
+
+include(TestBigEndian)
+test_big_endian(IS_BIG_ENDIAN)
+if(IS_BIG_ENDIAN AND NOT CMAKE_OBJCXX_BYTE_ORDER STREQUAL "BIG_ENDIAN")
+ message(FATAL_ERROR "test_big_endian result does not match ABI result")
+endif()
diff --git a/Tests/RunCMake/ABI/RunCMakeTest.cmake b/Tests/RunCMake/ABI/RunCMakeTest.cmake
new file mode 100644
index 0000000..d9eabb7
--- /dev/null
+++ b/Tests/RunCMake/ABI/RunCMakeTest.cmake
@@ -0,0 +1,15 @@
+include(RunCMake)
+
+run_cmake(C)
+run_cmake(CXX)
+
+if(APPLE)
+ run_cmake(OBJC)
+ run_cmake(OBJCXX)
+endif()
+
+if(CMake_TEST_CUDA)
+ run_cmake(CUDA)
+endif()
+
+run_cmake(TestBigEndian-NoLang)
diff --git a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-wrong-path-result.txt b/Tests/RunCMake/ABI/TestBigEndian-NoLang-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-wrong-path-result.txt
+++ b/Tests/RunCMake/ABI/TestBigEndian-NoLang-result.txt
diff --git a/Tests/RunCMake/ABI/TestBigEndian-NoLang-stderr.txt b/Tests/RunCMake/ABI/TestBigEndian-NoLang-stderr.txt
new file mode 100644
index 0000000..d0aa899
--- /dev/null
+++ b/Tests/RunCMake/ABI/TestBigEndian-NoLang-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Error at [^
+]*/Modules/TestBigEndian.cmake:[0-9]+ \(message\):
+ TEST_BIG_ENDIAN needs either C or CXX language enabled
+Call Stack \(most recent call first\):
+ [^
+]*/Modules/TestBigEndian.cmake:[0-9]+ \(__TEST_BIG_ENDIAN_LEGACY_IMPL\)
+ TestBigEndian-NoLang.cmake:[0-9]+ \(test_big_endian\)
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/ABI/TestBigEndian-NoLang.cmake b/Tests/RunCMake/ABI/TestBigEndian-NoLang.cmake
new file mode 100644
index 0000000..8c10201
--- /dev/null
+++ b/Tests/RunCMake/ABI/TestBigEndian-NoLang.cmake
@@ -0,0 +1,2 @@
+include(TestBigEndian)
+test_big_endian(var)
diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake
index c4b1a00..aa0cf4d 100644
--- a/Tests/RunCMake/Android/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Android/RunCMakeTest.cmake
@@ -103,6 +103,13 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
set(ndk_arg)
endif()
+ set(RunCMake_TEST_OPTIONS
+ -DCMAKE_SYSTEM_NAME=Android
+ -DCMAKE_FIND_ROOT_PATH=/tmp
+ ${ndk_arg}
+ )
+ run_cmake(ndk-search-order)
+
# Test failure cases.
message(STATUS "ndk='${ndk}'")
if(RunCMake_GENERATOR MATCHES "Visual Studio")
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake
index 32412aa..7c80a04 100644
--- a/Tests/RunCMake/Android/common.cmake
+++ b/Tests/RunCMake/Android/common.cmake
@@ -5,10 +5,21 @@ if(NOT ANDROID)
message(SEND_ERROR "CMake variable 'ANDROID' is not set to a true value.")
endif()
-foreach(f
- "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ar${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
+set(files
+ "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ar${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
+ )
+if(NOT CMAKE_ANDROID_NDK_VERSION VERSION_GREATER_EQUAL 22)
+ list(APPEND files
"${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ld${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
)
+endif()
+if(NOT CMAKE_ANDROID_NDK_VERSION VERSION_GREATER_EQUAL 19)
+ list(APPEND files
+ "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}"
+ "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}g++${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
+ )
+endif()
+foreach(f IN LISTS files)
if(NOT EXISTS "${f}")
message(SEND_ERROR "Expected file does not exist:\n \"${f}\"")
endif()
diff --git a/Tests/RunCMake/Android/ndk-search-order.cmake b/Tests/RunCMake/Android/ndk-search-order.cmake
new file mode 100644
index 0000000..498d775
--- /dev/null
+++ b/Tests/RunCMake/Android/ndk-search-order.cmake
@@ -0,0 +1,17 @@
+if(NOT CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED)
+ return()
+endif()
+
+find_library(LIBDL dl)
+if(NOT LIBDL)
+ message(FATAL_ERROR "libdl not found.")
+endif()
+
+if(LIBDL MATCHES ".a$")
+ message(FATAL_ERROR "found libdl.a")
+endif()
+
+find_program(CLANG clang)
+if(NOT CLANG)
+ message(FATAL_ERROR "clang not found")
+endif()
diff --git a/Tests/RunCMake/ArtifactOutputDirs/ArtifactOutputDirs.cmake b/Tests/RunCMake/ArtifactOutputDirs/ArtifactOutputDirs.cmake
new file mode 100644
index 0000000..d0accd7
--- /dev/null
+++ b/Tests/RunCMake/ArtifactOutputDirs/ArtifactOutputDirs.cmake
@@ -0,0 +1,27 @@
+enable_language(C)
+
+if(CMAKE_IMPORT_LIBRARY_SUFFIX)
+ set(expect_dll 1)
+else()
+ set(expect_dll 0)
+endif()
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/$<IF:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>,rtlib,rtbin>")
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/$<IF:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>,sharedlib,others>")
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/$<IF:$<STREQUAL:$<TARGET_PROPERTY:TYPE>,STATIC_LIBRARY>,staticlib,others>")
+
+add_executable(exe_tgt main.c)
+add_library(shared_tgt SHARED lib.c)
+add_library(static_tgt STATIC lib.c)
+
+add_custom_target(checkDirs ALL
+ COMMAND ${CMAKE_COMMAND}
+ -Dartifact_path=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>
+ -Dexe_name=$<TARGET_FILE_NAME:exe_tgt>
+ -Dshared_name=$<TARGET_FILE_NAME:shared_tgt>
+ -Dstatic_name=$<TARGET_FILE_NAME:static_tgt>
+ -Dexpect_dll=${expect_dll}
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
+ )
+
+add_dependencies(checkDirs exe_tgt shared_tgt static_tgt)
diff --git a/Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt b/Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt
new file mode 100644
index 0000000..ab1a20c
--- /dev/null
+++ b/Tests/RunCMake/ArtifactOutputDirs/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.19)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake b/Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake
new file mode 100644
index 0000000..1bf8438
--- /dev/null
+++ b/Tests/RunCMake/ArtifactOutputDirs/RunCMakeTest.cmake
@@ -0,0 +1,19 @@
+include(RunCMake)
+
+function(run_cmake_and_verify_after_build case)
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${case}-build")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug)
+ else()
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ run_cmake(${case})
+ run_cmake_command("${case}-build" ${CMAKE_COMMAND} --build .)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(RunCMake_TEST_BINARY_DIR)
+endfunction()
+
+run_cmake_and_verify_after_build(ArtifactOutputDirs)
diff --git a/Tests/RunCMake/ArtifactOutputDirs/check.cmake b/Tests/RunCMake/ArtifactOutputDirs/check.cmake
new file mode 100644
index 0000000..ca37eba
--- /dev/null
+++ b/Tests/RunCMake/ArtifactOutputDirs/check.cmake
@@ -0,0 +1,21 @@
+set(expected ${artifact_path}/rtbin/${exe_name})
+if(NOT EXISTS "${expected}")
+ message(SEND_ERROR "executable artifact not created in the expected path:\n ${expected}")
+endif()
+
+set(expected ${artifact_path}/staticlib/${static_name})
+if(NOT EXISTS "${expected}")
+ message(SEND_ERROR "static artifact not created in the expected path:\n ${expected}")
+endif()
+
+if(expect_dll)
+ set(expected ${artifact_path}/rtlib/${shared_name})
+ if(NOT EXISTS "${expected}")
+ message(SEND_ERROR "dll artifact not created in the expected path:\n ${expected}")
+ endif()
+else()
+ set(expected ${artifact_path}/sharedlib/${shared_name})
+ if(NOT EXISTS "${expected}")
+ message(SEND_ERROR "shared artifact not created in the expected path:\n ${expected}")
+ endif()
+endif()
diff --git a/Tests/RunCMake/TargetObjects/empty.cpp b/Tests/RunCMake/ArtifactOutputDirs/lib.c
index 4086dcc..22373f1 100644
--- a/Tests/RunCMake/TargetObjects/empty.cpp
+++ b/Tests/RunCMake/ArtifactOutputDirs/lib.c
@@ -1,4 +1,4 @@
-int empty()
+int func(void)
{
return 0;
}
diff --git a/Tests/Server/buildsystem1/foo.cpp b/Tests/RunCMake/ArtifactOutputDirs/main.c
index 7f39d71..8488f4e 100644
--- a/Tests/Server/buildsystem1/foo.cpp
+++ b/Tests/RunCMake/ArtifactOutputDirs/main.c
@@ -1,5 +1,4 @@
-
-int foo()
+int main(void)
{
return 0;
}
diff --git a/Tests/RunCMake/BuildDepends/CMakeLists.txt b/Tests/RunCMake/BuildDepends/CMakeLists.txt
index 74b3ff8..99f238b 100644
--- a/Tests/RunCMake/BuildDepends/CMakeLists.txt
+++ b/Tests/RunCMake/BuildDepends/CMakeLists.txt
@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
-include(${RunCMake_TEST}.cmake)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
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/cmake_path/HAS_RELATIVE_PATH-unexpected-arg-result.txt b/Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-unexpected-arg-result.txt
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs-result.txt
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs-stderr.txt b/Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs-stderr.txt
new file mode 100644
index 0000000..cddea3c
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at CustomCommandDependencies-BadArgs.cmake:[0-9]+ \(add_custom_command\):
+ add_custom_command IMPLICIT_DEPENDS and DEPFILE can not both be specified.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs.cmake
new file mode 100644
index 0000000..91ee338
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDependencies-BadArgs.cmake
@@ -0,0 +1,10 @@
+enable_language(C)
+
+add_custom_command(OUTPUT main.c
+ DEPFILE main.c.d
+ IMPLICIT_DEPENDS C main.c.in
+ COMMAND "${CMAKE_COMMAND}" -DINFILE=main.c.in -DOUTFILE=main.c -DDEPFILE=main.c.d
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/GenerateDepFile.cmake"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_custom_target(mainc ALL DEPENDS main.c)
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDependencies.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDependencies.cmake
new file mode 100644
index 0000000..28bbf11
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDependencies.cmake
@@ -0,0 +1,73 @@
+enable_language(C)
+
+add_custom_command(OUTPUT main.c
+ DEPFILE main.c.d
+ COMMAND "${CMAKE_COMMAND}" -DINFILE=main.c.in -DOUTFILE=main.c -DDEPFILE=main.c.d
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/GenerateDepFile.cmake"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
+
+add_custom_target(mainc ALL DEPENDS main.c)
+
+add_executable(main ${CMAKE_CURRENT_BINARY_DIR}/main.c)
+
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+cmake_minimum_required(VERSION 3.19)
+set(check_pairs
+ \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.c.in\"
+ \"$<TARGET_FILE:main>|${CMAKE_CURRENT_BINARY_DIR}/main.c\"
+ )
+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()
+ foreach(DEPEND_INFO_FILE IN LISTS CMAKE_DEPEND_INFO_FILES)
+ include(\"${CMAKE_CURRENT_BINARY_DIR}/\${DEPEND_INFO_FILE}\")
+ if (NOT CMAKE_DEPENDS_DEPENDENCY_FILES)
+ set(RunCMake_TEST_FAILED \"Variable CMAKE_DEPENDS_DEPENDENCY_FILES not found.\")
+ else()
+ list(LENGTH CMAKE_DEPENDS_DEPENDENCY_FILES DEPENDENCY_FILES_SIZE)
+ math(EXPR STOP_INDEX \"\${DEPENDENCY_FILES_SIZE} - 1\")
+ foreach(INDEX RANGE 0 \${STOP_INDEX} 4)
+ math(EXPR OBJECT_INDEX \"\${INDEX} + 1\")
+ math(EXPR FORMAT_INDEX \"\${INDEX} + 2\")
+ math(EXPR DEP_INDEX \"\${INDEX} + 3\")
+ list(GET CMAKE_DEPENDS_DEPENDENCY_FILES \${OBJECT_INDEX} OBJECT_FILE)
+ list(GET CMAKE_DEPENDS_DEPENDENCY_FILES \${FORMAT_INDEX} DEP_FORMAT)
+ list(GET CMAKE_DEPENDS_DEPENDENCY_FILES \${DEP_INDEX} DEP_FILE)
+ if (NOT EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/\${DEP_FILE}\")
+ set(RunCMake_TEST_FAILED \"File \${DEP_FILE} not found.\")
+ else()
+ cmake_path(APPEND TARGET_DEP_FILE \"${CMAKE_CURRENT_BINARY_DIR}\" \"\${DEPEND_INFO_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(DEPEND_INFO_FILE MATCHES \"main\\\\.dir\")
+ if (DEP_FORMAT STREQUAL \"gcc\" AND NOT DEPENDS_CONTENT MATCHES \"\${OBJECT_FILE} *:.+main.c\")
+ set(RunCMake_TEST_FAILED \"Dependency file '\${TARGET_DEP_FILE}' badly generated:\\n\${DEPENDS_CONTENT}\")
+ endif()
+ if (DEP_FORMAT STREQUAL \"custom\" AND NOT DEPENDS_CONTENT MATCHES \"\${OBJECT_FILE} *:.+main.c.in\")
+ set(RunCMake_TEST_FAILED \"Dependency file '\${TARGET_DEP_FILE}' badly generated:\\n\${DEPENDS_CONTENT}\")
+ endif()
+ else()
+ if (NOT DEPENDS_CONTENT MATCHES \"\${OBJECT_FILE} *:.+main.c.in\")
+ set(RunCMake_TEST_FAILED \"Dependency file '\${TARGET_DEP_FILE}' badly generated:\\n\${DEPENDS_CONTENT}\")
+ endif()
+ endif()
+ endif()
+ endforeach()
+ endif()
+ endforeach()
+ endif()
+endif()
+")
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDependencies.step1.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDependencies.step1.cmake
new file mode 100644
index 0000000..87576eb
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDependencies.step1.cmake
@@ -0,0 +1,3 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.c.in" [[
+int main(void) { return 1; }
+]])
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDependencies.step2.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDependencies.step2.cmake
new file mode 100644
index 0000000..69b21b8
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDependencies.step2.cmake
@@ -0,0 +1,3 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.c.in" [[
+int main(void) { return 2; }
+]])
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDepfile.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.cmake
new file mode 100644
index 0000000..01eac91
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.cmake
@@ -0,0 +1,61 @@
+cmake_policy(SET CMP0116 NEW)
+enable_language(C)
+
+add_custom_command(
+ OUTPUT topcc.c
+ DEPFILE topcc.c.d
+ COMMAND ${CMAKE_COMMAND} -DOUTFILE=${CMAKE_CURRENT_BINARY_DIR}/topcc.c -DINFILE=topccdep.txt -DDEPFILE=topcc.c.d -P "${CMAKE_CURRENT_LIST_DIR}/WriteDepfile.cmake"
+ )
+add_custom_target(topcc ALL DEPENDS topcc.c)
+
+add_custom_command(
+ OUTPUT topexe.c
+ DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/topexe.c.d
+ COMMAND ${CMAKE_COMMAND} -DOUTFILE=topexe.c "-DINFILE=${CMAKE_CURRENT_BINARY_DIR}/topexedep.txt" -DDEPFILE=topexe.c.d -P "${CMAKE_CURRENT_LIST_DIR}/WriteDepfile.cmake"
+ )
+add_executable(topexe "${CMAKE_CURRENT_BINARY_DIR}/topexe.c")
+
+add_custom_command(
+ OUTPUT toplib.c
+ DEPFILE toplib.c.d
+ COMMAND ${CMAKE_COMMAND} -DOUTFILE=toplib.c -DINFILE=toplibdep.txt -DDEPFILE=toplib.c.d -P "${CMAKE_CURRENT_LIST_DIR}/WriteDepfile.cmake"
+ )
+add_library(toplib STATIC toplib.c)
+
+add_subdirectory(DepfileSubdir)
+
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+function(check_exists file)
+ if(NOT EXISTS \"\${file}\")
+ string(APPEND RunCMake_TEST_FAILED \"\${file} does not exist\\n\")
+ endif()
+ set(RunCMake_TEST_FAILED \"\${RunCMake_TEST_FAILED}\" PARENT_SCOPE)
+endfunction()
+
+function(check_not_exists file)
+ if(EXISTS \"\${file}\")
+ string(APPEND RunCMake_TEST_FAILED \"\${file} exists\\n\")
+ endif()
+ set(RunCMake_TEST_FAILED \"\${RunCMake_TEST_FAILED}\" PARENT_SCOPE)
+endfunction()
+
+set(check_pairs
+ \"${CMAKE_BINARY_DIR}/topcc.c|${CMAKE_BINARY_DIR}/topccdep.txt\"
+ \"$<TARGET_FILE:topexe>|${CMAKE_BINARY_DIR}/topexedep.txt\"
+ \"$<TARGET_FILE:toplib>|${CMAKE_BINARY_DIR}/toplibdep.txt\"
+ \"${CMAKE_BINARY_DIR}/DepfileSubdir/subcc.c|${CMAKE_BINARY_DIR}/DepfileSubdir/subccdep.txt\"
+ \"$<TARGET_FILE:subexe>|${CMAKE_BINARY_DIR}/DepfileSubdir/subexedep.txt\"
+ \"$<TARGET_FILE:sublib>|${CMAKE_BINARY_DIR}/DepfileSubdir/sublibdep.txt\"
+ )
+
+if(check_step EQUAL 3)
+ list(APPEND check_pairs
+ \"${CMAKE_BINARY_DIR}/step3.timestamp|${CMAKE_BINARY_DIR}/topcc.c\"
+ \"${CMAKE_BINARY_DIR}/step3.timestamp|$<TARGET_FILE:topexe>\"
+ \"${CMAKE_BINARY_DIR}/step3.timestamp|$<TARGET_FILE:toplib>\"
+ \"${CMAKE_BINARY_DIR}/step3.timestamp|${CMAKE_BINARY_DIR}/DepfileSubdir/subcc.c\"
+ \"${CMAKE_BINARY_DIR}/step3.timestamp|$<TARGET_FILE:subexe>\"
+ \"${CMAKE_BINARY_DIR}/step3.timestamp|$<TARGET_FILE:sublib>\"
+ )
+endif()
+")
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step1.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step1.cmake
new file mode 100644
index 0000000..0dfe78e
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step1.cmake
@@ -0,0 +1,10 @@
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/DepfileSubdir")
+file(REMOVE "${RunCMake_TEST_BINARY_DIR}/../sublib.c")
+file(REMOVE "${RunCMake_TEST_BINARY_DIR}/step3.timestamp")
+
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/topccdep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/topexedep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/toplibdep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/DepfileSubdir/subccdep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/DepfileSubdir/subexedep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/DepfileSubdir/sublibdep.txt")
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step2.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step2.cmake
new file mode 100644
index 0000000..c711514
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step2.cmake
@@ -0,0 +1,6 @@
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/topccdep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/topexedep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/toplibdep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/DepfileSubdir/subccdep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/DepfileSubdir/subexedep.txt")
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/DepfileSubdir/sublibdep.txt")
diff --git a/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step3.cmake b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step3.cmake
new file mode 100644
index 0000000..c55ccc1
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/CustomCommandDepfile.step3.cmake
@@ -0,0 +1 @@
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/step3.timestamp")
diff --git a/Tests/RunCMake/BuildDepends/DepfileSubdir/CMakeLists.txt b/Tests/RunCMake/BuildDepends/DepfileSubdir/CMakeLists.txt
new file mode 100644
index 0000000..f131751
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/DepfileSubdir/CMakeLists.txt
@@ -0,0 +1,22 @@
+cmake_policy(SET CMP0116 NEW)
+
+add_custom_command(
+ OUTPUT subcc.c
+ DEPFILE subcc.c.d
+ COMMAND ${CMAKE_COMMAND} -DOUTFILE=${CMAKE_CURRENT_BINARY_DIR}/subcc.c -DINFILE=subccdep.txt -DDEPFILE=subcc.c.d -P "${CMAKE_CURRENT_LIST_DIR}/../WriteDepfile.cmake"
+ )
+add_custom_target(subcc ALL DEPENDS subcc.c)
+
+add_custom_command(
+ OUTPUT subexe.c
+ DEPFILE subexe.c.d
+ COMMAND ${CMAKE_COMMAND} -DOUTFILE=subexe.c -DINFILE=subexedep.txt -DDEPFILE=subexe.c.d -P "${CMAKE_CURRENT_LIST_DIR}/../WriteDepfile.cmake"
+ )
+add_executable(subexe subexe.c)
+
+add_custom_command(
+ OUTPUT ${CMAKE_BINARY_DIR}/../sublib.c
+ DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/sublib.c.d
+ COMMAND ${CMAKE_COMMAND} -DOUTFILE=${CMAKE_BINARY_DIR}/../sublib.c "-DINFILE=${CMAKE_CURRENT_BINARY_DIR}/sublibdep.txt" -DDEPFILE=sublib.c.d -P "${CMAKE_CURRENT_LIST_DIR}/../WriteDepfile.cmake"
+ )
+add_library(sublib STATIC "${CMAKE_BINARY_DIR}/../sublib.c")
diff --git a/Tests/RunCMake/BuildDepends/GenerateDepFile.cmake b/Tests/RunCMake/BuildDepends/GenerateDepFile.cmake
new file mode 100644
index 0000000..f7d0f13
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GenerateDepFile.cmake
@@ -0,0 +1,6 @@
+file(READ "${INFILE}" INCONTENT)
+file(WRITE "${OUTFILE}" "${INCONTENT}")
+
+string(REPLACE [[ ]] [[\ ]] OUTFILE "${OUTFILE}")
+string(REPLACE [[ ]] [[\ ]] INFILE "${INFILE}")
+file(WRITE "${DEPFILE}" "${OUTFILE}: ${INFILE}\n")
diff --git a/Tests/RunCMake/BuildDepends/MakeDependencies.cmake b/Tests/RunCMake/BuildDepends/MakeDependencies.cmake
new file mode 100644
index 0000000..33e8c7e
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/MakeDependencies.cmake
@@ -0,0 +1,13 @@
+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>\"
+ )
+")
diff --git a/Tests/RunCMake/BuildDepends/MakeDependencies.step1.cmake b/Tests/RunCMake/BuildDepends/MakeDependencies.step1.cmake
new file mode 100644
index 0000000..c74f033
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/MakeDependencies.step1.cmake
@@ -0,0 +1,18 @@
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/main.c")
+foreach(i RANGE 1 20000)
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/temp_header_file_${i}.h"
+ "#define HEADER_${i} ${i}\n"
+ )
+ file(APPEND "${RunCMake_TEST_BINARY_DIR}/main.c"
+ "#include \"temp_header_file_${i}.h\"\n"
+ )
+endforeach()
+file(APPEND "${RunCMake_TEST_BINARY_DIR}/main.c"
+ "#include \"main.h\"\n"
+ )
+file(APPEND "${RunCMake_TEST_BINARY_DIR}/main.c"
+ "int main(void) { return COUNT; }\n"
+ )
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.h"
+ "#define COUNT 1\n"
+ )
diff --git a/Tests/RunCMake/BuildDepends/MakeDependencies.step2.cmake b/Tests/RunCMake/BuildDepends/MakeDependencies.step2.cmake
new file mode 100644
index 0000000..c826d3c
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/MakeDependencies.step2.cmake
@@ -0,0 +1,3 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/main.h"
+ "#define COUNT 2\n"
+ )
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index 6c6d548..6232634 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -30,8 +30,17 @@ function(run_BuildDepends CASE)
include(${RunCMake_SOURCE_DIR}/${CASE}.step2.cmake OPTIONAL)
set(check_step 2)
run_cmake_command(${CASE}-build2 ${CMAKE_COMMAND} --build . --config Debug)
+ if(run_BuildDepends_skip_step_3)
+ return()
+ endif()
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep ${fs_delay}) # handle 1s resolution
+ include(${RunCMake_SOURCE_DIR}/${CASE}.step3.cmake OPTIONAL)
+ set(check_step 3)
+ run_cmake_command(${CASE}-build3 ${CMAKE_COMMAND} --build . --config Debug)
endfunction()
+set(run_BuildDepends_skip_step_3 1)
+
run_BuildDepends(C-Exe)
if(NOT RunCMake_GENERATOR STREQUAL "Xcode")
if(RunCMake_GENERATOR MATCHES "Visual Studio 10" OR
@@ -130,3 +139,28 @@ 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)
+ run_BuildDepends(CustomCommandDependencies)
+endif()
+
+if (RunCMake_GENERATOR MATCHES "Makefiles")
+ run_cmake(CustomCommandDependencies-BadArgs)
+endif()
+
+if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ unset(run_BuildDepends_skip_step_3)
+ run_BuildDepends(CustomCommandDepfile)
+ set(run_BuildDepends_skip_step_3 1)
+endif()
+
+if(RunCMake_GENERATOR MATCHES "Make")
+ run_BuildDepends(MakeDependencies)
+endif()
diff --git a/Tests/RunCMake/BuildDepends/WriteDepfile.cmake b/Tests/RunCMake/BuildDepends/WriteDepfile.cmake
new file mode 100644
index 0000000..c958cde
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/WriteDepfile.cmake
@@ -0,0 +1,8 @@
+file(WRITE "${OUTFILE}" [[int main(void)
+{
+ return 0;
+}
+]])
+string(REPLACE [[ ]] [[\ ]] OUTFILE "${OUTFILE}")
+string(REPLACE [[ ]] [[\ ]] INFILE "${INFILE}")
+file(WRITE "${DEPFILE}" "${OUTFILE}: ${INFILE}\n")
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/CMP0106/CMP0106-NEW-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt
index 7ad774e..8a4d7e4 100644
--- a/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at .*/Modules/Documentation.cmake:15 \(message\):
+CMake Error at .*/Modules/Documentation.cmake:[0-9]+ \(message\):
Documentation.cmake is VTK-specific code and should not be used in non-VTK
projects. This logic in this module is best shipped with the project using
it rather than with CMake. This is now an error according to policy
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt
index d0d48d0..af6bb05 100644
--- a/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt
@@ -8,7 +8,7 @@ Call Stack \(most recent call first\):
CMakeLists.txt:7 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
-CMake Warning \(dev\) at .*/Modules/Documentation.cmake:27 \(message\):
+CMake Warning \(dev\) at .*/Modules/Documentation.cmake:[0-9]+ \(message\):
Policy CMP0106 is not set: The Documentation module is removed. Run "cmake
--help-policy CMP0106" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
@@ -22,7 +22,7 @@ Call Stack \(most recent call first\):
CMakeLists.txt:7 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
-CMake Warning \(dev\) at .*/Modules/Documentation.cmake:27 \(message\):
+CMake Warning \(dev\) at .*/Modules/Documentation.cmake:[0-9]+ \(message\):
Policy CMP0106 is not set: The Documentation module is removed. Run "cmake
--help-policy CMP0106" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
diff --git a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-missing-output-result.txt b/Tests/RunCMake/CMP0115/CMP0115-NEW-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-missing-output-result.txt
+++ b/Tests/RunCMake/CMP0115/CMP0115-NEW-result.txt
diff --git a/Tests/RunCMake/CMP0115/CMP0115-NEW-stderr.txt b/Tests/RunCMake/CMP0115/CMP0115-NEW-stderr.txt
new file mode 100644
index 0000000..b63c53d
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/CMP0115-NEW-stderr.txt
@@ -0,0 +1,17 @@
+^CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+ main
+Call Stack \(most recent call first\):
+ CMP0115-NEW\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: exe
+Call Stack \(most recent call first\):
+ CMP0115-NEW\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0115/CMP0115-NEW.cmake b/Tests/RunCMake/CMP0115/CMP0115-NEW.cmake
new file mode 100644
index 0000000..ddf5071
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/CMP0115-NEW.cmake
@@ -0,0 +1 @@
+include(CMP0115.cmake)
diff --git a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-invalid-output-result.txt b/Tests/RunCMake/CMP0115/CMP0115-OLD-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PATH-invalid-output-result.txt
+++ b/Tests/RunCMake/CMP0115/CMP0115-OLD-result.txt
diff --git a/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt b/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt
new file mode 100644
index 0000000..8b90311
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/CMP0115-OLD-stderr.txt
@@ -0,0 +1,22 @@
+^CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+ noexist
+
+ Tried extensions [^
+]*
+ [^
+]*
+Call Stack \(most recent call first\):
+ CMP0115-OLD\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: exe
+Call Stack \(most recent call first\):
+ CMP0115-OLD\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0115/CMP0115-OLD.cmake b/Tests/RunCMake/CMP0115/CMP0115-OLD.cmake
new file mode 100644
index 0000000..ddf5071
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/CMP0115-OLD.cmake
@@ -0,0 +1 @@
+include(CMP0115.cmake)
diff --git a/Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-wrong-path-result.txt b/Tests/RunCMake/CMP0115/CMP0115-WARN-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-wrong-path-result.txt
+++ b/Tests/RunCMake/CMP0115/CMP0115-WARN-result.txt
diff --git a/Tests/RunCMake/CMP0115/CMP0115-WARN-stderr.txt b/Tests/RunCMake/CMP0115/CMP0115-WARN-stderr.txt
new file mode 100644
index 0000000..7b100b6
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/CMP0115-WARN-stderr.txt
@@ -0,0 +1,36 @@
+^CMake Warning \(dev\) at CMP0115\.cmake:[0-9]+ \(add_executable\):
+ Policy CMP0115 is not set: Source file extensions must be explicit\. Run
+ "cmake --help-policy CMP0115" for policy details\. Use the cmake_policy
+ command to set the policy and suppress this warning\.
+
+ File:
+
+ [^
+]*/Tests/RunCMake/CMP0115/main\.c
+Call Stack \(most recent call first\):
+ CMP0115-WARN\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
+
+CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\):
+ Cannot find source file:
+
+ noexist
+
+ Tried extensions [^
+]*
+ [^
+]*
+Call Stack \(most recent call first\):
+ CMP0115-WARN\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Error at CMP0115\.cmake:[0-9]+ \(add_executable\):
+ No SOURCES given to target: exe
+Call Stack \(most recent call first\):
+ CMP0115-WARN\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/CMP0115/CMP0115-WARN.cmake b/Tests/RunCMake/CMP0115/CMP0115-WARN.cmake
new file mode 100644
index 0000000..ddf5071
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/CMP0115-WARN.cmake
@@ -0,0 +1 @@
+include(CMP0115.cmake)
diff --git a/Tests/RunCMake/CMP0115/CMP0115.cmake b/Tests/RunCMake/CMP0115/CMP0115.cmake
new file mode 100644
index 0000000..be910a4
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/CMP0115.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_executable(exe main noexist)
diff --git a/Tests/RunCMake/CMP0115/CMakeLists.txt b/Tests/RunCMake/CMP0115/CMakeLists.txt
new file mode 100644
index 0000000..b646c4a
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.18)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0115/RunCMakeTest.cmake b/Tests/RunCMake/CMP0115/RunCMakeTest.cmake
new file mode 100644
index 0000000..58182ac
--- /dev/null
+++ b/Tests/RunCMake/CMP0115/RunCMakeTest.cmake
@@ -0,0 +1,12 @@
+include(RunCMake)
+
+function(run_cmp0115 status)
+ if(NOT status STREQUAL "WARN")
+ set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0115=${status})
+ endif()
+ run_cmake(CMP0115-${status})
+endfunction()
+
+run_cmp0115(OLD)
+run_cmp0115(WARN)
+run_cmp0115(NEW)
diff --git a/Tests/Server/buildsystem1/subdir/empty.cpp b/Tests/RunCMake/CMP0115/main.c
index 7f39d71..8488f4e 100644
--- a/Tests/Server/buildsystem1/subdir/empty.cpp
+++ b/Tests/RunCMake/CMP0115/main.c
@@ -1,5 +1,4 @@
-
-int foo()
+int main(void)
{
return 0;
}
diff --git a/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt
new file mode 100644
index 0000000..10e83a9
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-Mixed-stderr.txt
@@ -0,0 +1,17 @@
+^CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\):
+ Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
+ add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.(
+
+CMake Warning \(dev\) at CMP0116-Mixed\.cmake:1 \(add_custom_command\):
+ Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
+ add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.)*$
diff --git a/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake b/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake
new file mode 100644
index 0000000..6cbbc09
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-Mixed.cmake
@@ -0,0 +1,18 @@
+add_custom_command(
+ OUTPUT warn.txt
+ COMMAND ${CMAKE_COMMAND} -E touch warn.txt
+ DEPFILE warn.d
+ )
+cmake_policy(SET CMP0116 OLD)
+add_custom_command(
+ OUTPUT old.txt
+ COMMAND ${CMAKE_COMMAND} -E touch old.txt
+ DEPFILE old.d
+ )
+cmake_policy(SET CMP0116 NEW)
+add_custom_command(
+ OUTPUT new.txt
+ COMMAND ${CMAKE_COMMAND} -E touch new.txt
+ DEPFILE new.d
+ )
+add_custom_target(cc ALL DEPENDS warn.txt old.txt new.txt)
diff --git a/Tests/RunCMake/CMP0116/CMP0116-NEW-NOWARN.cmake b/Tests/RunCMake/CMP0116/CMP0116-NEW-NOWARN.cmake
new file mode 100644
index 0000000..f92fac6
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-NEW-NOWARN.cmake
@@ -0,0 +1,3 @@
+set(depdir)
+
+include(Common.cmake)
diff --git a/Tests/RunCMake/CMP0116/CMP0116-NEW-WARN.cmake b/Tests/RunCMake/CMP0116/CMP0116-NEW-WARN.cmake
new file mode 100644
index 0000000..f92fac6
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-NEW-WARN.cmake
@@ -0,0 +1,3 @@
+set(depdir)
+
+include(Common.cmake)
diff --git a/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN.cmake b/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN.cmake
new file mode 100644
index 0000000..665f485
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-OLD-NOWARN.cmake
@@ -0,0 +1,3 @@
+set(depdir Subdirectory/)
+
+include(Common.cmake)
diff --git a/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN.cmake b/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN.cmake
new file mode 100644
index 0000000..665f485
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-OLD-WARN.cmake
@@ -0,0 +1,3 @@
+set(depdir Subdirectory/)
+
+include(Common.cmake)
diff --git a/Tests/RunCMake/CMP0116/CMP0116-WARN-NOWARN-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-WARN-NOWARN-stderr.txt
new file mode 100644
index 0000000..843ff1c
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-WARN-NOWARN-stderr.txt
@@ -0,0 +1,7 @@
+^(CMake Warning \(dev\) at Subdirectory/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
+ add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+This warning is for project developers\. Use -Wno-dev to suppress it\.
+*)+$
diff --git a/Tests/RunCMake/CMP0116/CMP0116-WARN-NOWARN.cmake b/Tests/RunCMake/CMP0116/CMP0116-WARN-NOWARN.cmake
new file mode 100644
index 0000000..665f485
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-WARN-NOWARN.cmake
@@ -0,0 +1,3 @@
+set(depdir Subdirectory/)
+
+include(Common.cmake)
diff --git a/Tests/RunCMake/CMP0116/CMP0116-WARN-WARN-stderr.txt b/Tests/RunCMake/CMP0116/CMP0116-WARN-WARN-stderr.txt
new file mode 100644
index 0000000..e29af91
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-WARN-WARN-stderr.txt
@@ -0,0 +1,16 @@
+^(CMake Warning \(dev\) at Common\.cmake:[0-9]+ \(add_custom_command\):
+ Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
+ add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+Call Stack \(most recent call first\):
+ CMP0116-WARN-WARN\.cmake:[0-9]+ \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++)+(CMake Warning \(dev\) at Subdirectory/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ Policy CMP0116 is not set: Ninja generators transform DEPFILEs from
+ add_custom_command\(\)\. Run "cmake --help-policy CMP0116" for policy
+ details\. Use the cmake_policy command to set the policy and suppress this
+ warning\.
+This warning is for project developers\. Use -Wno-dev to suppress it\.
+*)+$
diff --git a/Tests/RunCMake/CMP0116/CMP0116-WARN-WARN.cmake b/Tests/RunCMake/CMP0116/CMP0116-WARN-WARN.cmake
new file mode 100644
index 0000000..665f485
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMP0116-WARN-WARN.cmake
@@ -0,0 +1,3 @@
+set(depdir Subdirectory/)
+
+include(Common.cmake)
diff --git a/Tests/RunCMake/CMP0116/CMakeLists.txt b/Tests/RunCMake/CMP0116/CMakeLists.txt
new file mode 100644
index 0000000..b646c4a
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.18)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0116/Common.cmake b/Tests/RunCMake/CMP0116/Common.cmake
new file mode 100644
index 0000000..472b162
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/Common.cmake
@@ -0,0 +1,8 @@
+add_custom_command(
+ OUTPUT top.txt
+ COMMAND ${CMAKE_COMMAND} -DOUTFILE=top.txt -DINFILE=topdep.txt -DDEPFILE=top.txt.d -DSTAMPFILE=topstamp.txt -DDEPDIR= -P ${CMAKE_SOURCE_DIR}/WriteDepfile.cmake
+ DEPFILE top.txt.d
+ )
+add_custom_target(top ALL DEPENDS top.txt)
+
+add_subdirectory(Subdirectory)
diff --git a/Tests/RunCMake/CMP0116/RunCMakeTest.cmake b/Tests/RunCMake/CMP0116/RunCMakeTest.cmake
new file mode 100644
index 0000000..ce3e86a
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/RunCMakeTest.cmake
@@ -0,0 +1,52 @@
+include(RunCMake)
+
+function(run_cmp0116 status warn)
+ if(warn)
+ set(name CMP0116-${status}-WARN)
+ else()
+ set(name CMP0116-${status}-NOWARN)
+ endif()
+ set(RunCMake_TEST_OPTIONS
+ -DCMAKE_POLICY_WARNING_CMP0116:BOOL=${warn}
+ )
+ if(NOT status STREQUAL "WARN")
+ list(APPEND RunCMake_TEST_OPTIONS
+ -DCMAKE_POLICY_DEFAULT_CMP0116:STRING=${status}
+ )
+ endif()
+
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
+ run_cmake(${name})
+ unset(RunCMake_TEST_OPTIONS)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake-check-file check.cmake)
+
+ file(TOUCH "${RunCMake_TEST_BINARY_DIR}/topdep.txt")
+ file(TOUCH "${RunCMake_TEST_BINARY_DIR}/Subdirectory/subdep.txt")
+ set(cmp0116_step 1)
+ run_cmake_command(${name}-build1 ${CMAKE_COMMAND} --build . --config Debug)
+ file(REMOVE "${RunCMake_TEST_BINARY_DIR}/topstamp.txt")
+ file(REMOVE "${RunCMake_TEST_BINARY_DIR}/Subdirectory/substamp.txt")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1.25)
+
+ file(TOUCH "${RunCMake_TEST_BINARY_DIR}/topdep.txt")
+ file(TOUCH "${RunCMake_TEST_BINARY_DIR}/Subdirectory/subdep.txt")
+ set(cmp0116_step 2)
+ run_cmake_command(${name}-build2 ${CMAKE_COMMAND} --build . --config Debug)
+ file(REMOVE "${RunCMake_TEST_BINARY_DIR}/topstamp.txt")
+ file(REMOVE "${RunCMake_TEST_BINARY_DIR}/Subdirectory/substamp.txt")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1.25)
+
+ set(cmp0116_step 3)
+ run_cmake_command(${name}-build3 ${CMAKE_COMMAND} --build . --config Debug)
+endfunction()
+
+run_cmp0116(WARN OFF)
+run_cmp0116(OLD OFF)
+run_cmp0116(NEW OFF)
+run_cmp0116(WARN ON)
+run_cmp0116(OLD ON)
+run_cmp0116(NEW ON)
+
+set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_WARNING_CMP0116:BOOL=TRUE)
+run_cmake(CMP0116-Mixed)
diff --git a/Tests/RunCMake/CMP0116/Subdirectory/CMakeLists.txt b/Tests/RunCMake/CMP0116/Subdirectory/CMakeLists.txt
new file mode 100644
index 0000000..f0f60b2
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/Subdirectory/CMakeLists.txt
@@ -0,0 +1,6 @@
+add_custom_command(
+ OUTPUT sub.txt
+ COMMAND ${CMAKE_COMMAND} -DOUTFILE=sub.txt -DINFILE=subdep.txt -DDEPFILE=sub.txt.d -DSTAMPFILE=substamp.txt -DDEPDIR=${depdir} -P ${CMAKE_SOURCE_DIR}/WriteDepfile.cmake
+ DEPFILE ${depdir}sub.txt.d
+ )
+add_custom_target(sub ALL DEPENDS sub.txt)
diff --git a/Tests/RunCMake/CMP0116/WriteDepfile.cmake b/Tests/RunCMake/CMP0116/WriteDepfile.cmake
new file mode 100644
index 0000000..1a74d2a
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/WriteDepfile.cmake
@@ -0,0 +1,3 @@
+file(TOUCH "${OUTFILE}")
+file(TOUCH "${STAMPFILE}")
+file(WRITE "${DEPFILE}" "${DEPDIR}${OUTFILE}: ${DEPDIR}${INFILE}\n")
diff --git a/Tests/RunCMake/CMP0116/check.cmake b/Tests/RunCMake/CMP0116/check.cmake
new file mode 100644
index 0000000..1b16748
--- /dev/null
+++ b/Tests/RunCMake/CMP0116/check.cmake
@@ -0,0 +1,18 @@
+function(check_exists file)
+ if(NOT EXISTS "${file}")
+ string(APPEND RunCMake_TEST_FAILED "${file} does not exist\n")
+ endif()
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(check_not_exists file)
+ if(EXISTS "${file}")
+ string(APPEND RunCMake_TEST_FAILED "${file} exists\n")
+ endif()
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+if(cmp0116_step EQUAL 3)
+ check_not_exists("${RunCMake_TEST_BINARY_DIR}/topstamp.txt")
+ check_not_exists("${RunCMake_TEST_BINARY_DIR}/Subdirectory/substamp.txt")
+endif()
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..2b66515
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test1.cmake
@@ -0,0 +1,9 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+get_property(prop SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ 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..d060207
--- /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 custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test10)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test11.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test11.cmake
new file mode 100644
index 0000000..00b204e
--- /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 custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test11)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test12.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test12.cmake
new file mode 100644
index 0000000..1182d17
--- /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 custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_command(TARGET custom0 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_command(TARGET custom1 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(TARGET custom2 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_command(TARGET custom3 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test12)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test13.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test13.cmake
new file mode 100644
index 0000000..12f4ac1
--- /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 custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_command(TARGET custom0 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_command(TARGET custom1 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_command(TARGET custom2 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_command(TARGET custom3 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test13)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test14.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test14.cmake
new file mode 100644
index 0000000..30e3edc
--- /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 custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_target(custom0_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_target(custom1_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test14)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test15.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test15.cmake
new file mode 100644
index 0000000..fb05248
--- /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 custom0 will not be modified by set_property!
+add_custom_target(custom0)
+target_sources(custom0 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+# The sources of custom[1-6] will (tried to) be modified by set_property!
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+add_custom_target(custom0_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source0.txt"
+)
+add_custom_target(custom1_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+
+add_subdirectory(subdir-Common-Test15)
+
+get_and_print_GENERATED_property("Generated_source0.txt")
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake
new file mode 100644
index 0000000..1180b6b
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test2.cmake
@@ -0,0 +1,12 @@
+add_custom_target(custom)
+target_sources(custom PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+)
+
+set_property(SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ PROPERTY GENERATED "1")
+get_property(prop SOURCE
+ "${CMAKE_CURRENT_BINARY_DIR}/GeneratedMain.txt"
+ 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..27516b7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "Generated_with_relative_path1.txt"
+ "Generated_with_relative_path2.txt"
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "Generated_with_full_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test3b.cmake
new file mode 100644
index 0000000..3e03a1f
--- /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.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "Generated_with_full_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "1")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "Generated_with_relative_path1.txt"
+ "Generated_with_relative_path2.txt"
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
new file mode 100644
index 0000000..953e26a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4.cmake
@@ -0,0 +1,66 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "Generated_with_relative_path1.txt"
+ "Generated_with_relative_path2.txt"
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "Generated_with_full_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test4b.cmake
new file mode 100644
index 0000000..025caa8
--- /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.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "Generated_with_full_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "0")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "Generated_with_relative_path1.txt"
+ "Generated_with_relative_path2.txt"
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
new file mode 100644
index 0000000..5349bff
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test5.cmake
@@ -0,0 +1,78 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "Generated_with_relative_path1.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "Generated_with_relative_path2.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "Generated_with_relative_path3.txt"
+)
+add_custom_target(custom7)
+target_sources(custom7 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path1.txt"
+)
+add_custom_target(custom8)
+target_sources(custom8 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+)
+add_custom_target(custom9)
+target_sources(custom9 PRIVATE
+ "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path3.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path1.txt"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_full_path1.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path2.txt"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_full_path2.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_path3.txt"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_full_path3.txt")
+
+
+set_property(SOURCE "Generated_with_relative_path1.txt"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_relative_path1.txt")
+
+set_property(SOURCE "Generated_with_relative_path2.txt"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_relative_path2.txt")
+
+set_property(SOURCE "Generated_with_relative_path3.txt"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_relative_path3.txt")
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_with_full_source_path1.txt"
+ PROPERTY GENERATED "tRue")
+get_and_print_GENERATED_property("Generated_with_full_source_path1.txt")
+
+set_property(SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/Generated_with_full_source_path2.txt"
+ PROPERTY GENERATED "SomeVar-NOTFOUND")
+get_and_print_GENERATED_property("Generated_with_full_source_path2.txt")
+
+set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/"Generated_with_full_source_path3.txt"
+ PROPERTY GENERATED "Junk-value")
+get_and_print_GENERATED_property("Generated_with_full_source_path3.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake
new file mode 100644
index 0000000..a6f28aa
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test6.cmake
@@ -0,0 +1,44 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ PROPERTY GENERATED "1")
+
+add_subdirectory(subdir-Common-Test6)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake
new file mode 100644
index 0000000..eed49b8
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test7.cmake
@@ -0,0 +1,44 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ PROPERTY GENERATED "1")
+
+add_subdirectory(subdir-Common-Test7)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
new file mode 100644
index 0000000..5cc6e99
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test8.cmake
@@ -0,0 +1,50 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test8)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake b/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
new file mode 100644
index 0000000..b7d36ef
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-Common-Test9.cmake
@@ -0,0 +1,50 @@
+include(${CMAKE_CURRENT_LIST_DIR}/CMP0118-Common-Helper.cmake)
+
+
+add_custom_target(custom1)
+target_sources(custom1 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+)
+add_custom_target(custom2)
+target_sources(custom2 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+)
+add_custom_target(custom3)
+target_sources(custom3 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+)
+add_custom_target(custom4)
+target_sources(custom4 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+)
+add_custom_target(custom5)
+target_sources(custom5 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+)
+add_custom_target(custom6)
+target_sources(custom6 PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+)
+
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source1.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source2.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source3.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+add_subdirectory(subdir-Common-Test9)
+
+get_and_print_GENERATED_property("Generated_source1.txt")
+get_and_print_GENERATED_property("Generated_source2.txt")
+get_and_print_GENERATED_property("Generated_source3.txt")
+get_and_print_GENERATED_property("Generated_source4.txt")
+get_and_print_GENERATED_property("Generated_source5.txt")
+get_and_print_GENERATED_property("Generated_source6.txt")
diff --git a/Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-unexpected-arg-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-unexpected-arg-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-result.txt
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..ec777f7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test1-build/GeneratedMain\.txt
+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/cmake_path/GET-RELATIVE_PATH-missing-output-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-missing-output-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-result.txt
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..cee4516
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test10-build/Generated_source4\.txt
+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/cmake_path/GET-RELATIVE_PATH-invalid-output-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/GET-RELATIVE_PATH-invalid-output-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-result.txt
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..422a3de
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-stderr.txt
@@ -0,0 +1,80 @@
+^(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\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test11-build/Generated_source[4-6]\.txt
+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/cmake_path/CONCAT-wrong-path-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/CONCAT-wrong-path-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test12-result.txt
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..e6c429c
--- /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 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 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/cmake_path/CONCAT-OUTPUT_VARIABLE-no-arg-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/CONCAT-OUTPUT_VARIABLE-no-arg-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test13-result.txt
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..7802538
--- /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 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[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\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 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/cmake_path/CONCAT-OUTPUT_VARIABLE-invalid-arg-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/CONCAT-OUTPUT_VARIABLE-invalid-arg-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-result.txt
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..2f42f36
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test14-build/Generated_source4\.txt
+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/cmake_path/COMPARE-NOT_EQUAL-wrong-path-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/COMPARE-NOT_EQUAL-wrong-path-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-result.txt
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..65bd577
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-stderr.txt
@@ -0,0 +1,80 @@
+^(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\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test15-build/Generated_source[4-6]\.txt
+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/cmake_path/COMPARE-EQUAL-wrong-path-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/COMPARE-EQUAL-wrong-path-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-result.txt
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..f7d9f6b
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3-stderr.txt
@@ -0,0 +1,87 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3-build/Generated_with_full_path3\.txt)
+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/cmake_path/CMAKE_PATH-wrong-path-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/CMAKE_PATH-wrong-path-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-result.txt
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..a876390
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test3b-stderr.txt
@@ -0,0 +1,87 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test3b-build/Generated_with_full_path3\.txt)
+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/cmake_path/CMAKE_PATH-unexpected-arg-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/CMAKE_PATH-unexpected-arg-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-result.txt
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..b750ae7
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4-stderr.txt
@@ -0,0 +1,167 @@
+^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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4-build/Generated_with_relative_path1\.txt)
+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/cmake_path/CMAKE_PATH-missing-output-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/CMAKE_PATH-missing-output-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-result.txt
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..580f04f
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test4b-stderr.txt
@@ -0,0 +1,167 @@
+^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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test4b-build/Generated_with_full_path1\.txt|CMP0118-NEW-Test4b-build/Generated_with_relative_path1\.txt)
+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/cmake_path/CMAKE_PATH-invalid-output-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/CMAKE_PATH-invalid-output-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-result.txt
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..e268a7a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test5-stderr.txt
@@ -0,0 +1,174 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-NEW-Test5-build/Generated_with_full_path[2-3]\.txt)
+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/cmake_path/CMAKE_PATH-OUTPUT_VARIABLE-no-arg-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/cmake_path/CMAKE_PATH-OUTPUT_VARIABLE-no-arg-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-result.txt
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..17e2b4a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test6-build/Generated_source4\.txt
+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/ObjectLibrary/ImportNotSupported-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/ObjectLibrary/ImportNotSupported-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-result.txt
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..08eb682
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-stderr.txt
@@ -0,0 +1,74 @@
+^(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\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test7-build/Generated_source[4-6]\.txt
+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/Make/CustomCommandDepfile-ERROR-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-result.txt
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..7f48bf0
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test8-build/Generated_source4\.txt
+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/File_Configure/BadArg-result.txt b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/File_Configure/BadArg-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-result.txt
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..b7c496c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-stderr.txt
@@ -0,0 +1,74 @@
+^(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\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-NEW-Test9-build/Generated_source[4-6]\.txt
+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/ExternalProject/IncludeScope-Add_Step-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-result.txt
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..58144c8
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test1-build/GeneratedMain\.txt
+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/ExternalProject/IncludeScope-Add-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/ExternalProject/IncludeScope-Add-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-result.txt
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..1f1bc90
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test10-build/Generated_source4\.txt
+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/CommandLine/E_server-arg-result.txt b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/CommandLine/E_server-arg-result.txt
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-result.txt
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..5c15f12
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-stderr.txt
@@ -0,0 +1,67 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test11-build/Generated_source[4-6]\.txt
+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..e6c429c
--- /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 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 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..75dbf23
--- /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 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 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..12a913a
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test14-build/Generated_source4\.txt
+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..62db7ee
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-stderr.txt
@@ -0,0 +1,67 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test15-build/Generated_source[4-6]\.txt
+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..7f86d38
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3-stderr.txt
@@ -0,0 +1,87 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3-build/Generated_with_full_path3\.txt)
+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..4104fc0
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test3b-stderr.txt
@@ -0,0 +1,87 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test3b-build/Generated_with_full_path3\.txt)
+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..7a16d0b
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4-stderr.txt
@@ -0,0 +1,95 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4-build/Generated_with_relative_path1\.txt)
+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..5a5c4ec
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test4b-stderr.txt
@@ -0,0 +1,95 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test4b-build/Generated_with_full_path1\.txt|CMP0118-OLD-Test4b-build/Generated_with_relative_path1\.txt)
+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..12fa617
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test5-stderr.txt
@@ -0,0 +1,111 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-OLD-Test5-build/Generated_with_full_path[2-3]\.txt)
+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..7199f04
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test6-build/Generated_source4\.txt
+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..233fd8b
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-stderr.txt
@@ -0,0 +1,77 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test7-build/Generated_source[2-6]\.txt
+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..4aed2ed
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test8-build/Generated_source4\.txt
+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..cea8c22
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-stderr.txt
@@ -0,0 +1,61 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-OLD-Test9-build/Generated_source[4-6]\.txt
+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..e2a2cf5
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-stderr.txt
@@ -0,0 +1,10 @@
+^prop: `0`
+CMake Error at CMP0118-Common-Test1\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test1-build/GeneratedMain\.txt
+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..bce7681
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test10\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test10-build/Generated_source4\.txt
+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..00c47e9
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-stderr.txt
@@ -0,0 +1,90 @@
+^((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\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test11\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test11-build/Generated_source[4-6]\.txt
+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..e6c429c
--- /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 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test12/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 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..6d59cb4
--- /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 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[4-6]' was not created in this directory\.
++
+CMake Error at subdir-Common-Test13/CMakeLists\.txt:[0-9]+ \(add_custom_command\):
+ TARGET 'custom[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\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 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..5b7994c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-stderr.txt
@@ -0,0 +1,51 @@
+^Generated_source0\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test14\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test14-build/Generated_source4\.txt
+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..c975c23
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-stderr.txt
@@ -0,0 +1,90 @@
+^((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\.txt: # 1a # GENERATED = `1`
+Generated_source0\.txt: # 1b # GENERATED = `1`
+Generated_source0\.txt: # 2a # GENERATED = `1`
+Generated_source0\.txt: # 2b # GENERATED = `1`
+Generated_source0\.txt: # 3a # GENERATED = `0`
+Generated_source0\.txt: # 3b # GENERATED = `0`
+Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test15\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test15-build/Generated_source[4-6]\.txt
+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..142d8a0
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3-stderr.txt
@@ -0,0 +1,87 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3-build/Generated_with_full_path3\.txt)
+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..d4ef667
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test3b-stderr.txt
@@ -0,0 +1,87 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `1`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test3b\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test3b-build/Generated_with_full_path3\.txt)
+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..ceeb570
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4-stderr.txt
@@ -0,0 +1,212 @@
+^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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4-build/Generated_with_relative_path1\.txt)
+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..f8484d0
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test4b-stderr.txt
@@ -0,0 +1,212 @@
+^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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test4b\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test4b-build/Generated_with_full_path1\.txt|CMP0118-WARN-Test4b-build/Generated_with_relative_path1\.txt)
+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..0556391
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test5-stderr.txt
@@ -0,0 +1,213 @@
+^Generated_with_full_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_relative_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_relative_path3\.txt: # 3b # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 1a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 1b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2a # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 2b # GENERATED = `1`
+Generated_with_full_source_path1\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path1\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path2\.txt: # 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\.txt: # 1a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 1b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 2b # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3a # GENERATED = `0`
+Generated_with_full_source_path3\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test5\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/(Generated_with_full_source_path[1-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_relative_path[2-3]\.txt|CMP0118-WARN-Test5-build/Generated_with_full_path[2-3]\.txt)
+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..7d588a2
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test6\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test6-build/Generated_source4\.txt
+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..8421061
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-stderr.txt
@@ -0,0 +1,100 @@
+^((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\.txt: # 1a # GENERATED = `1`
+Generated_source1\.txt: # 1b # GENERATED = `1`
+Generated_source1\.txt: # 2a # GENERATED = `1`
+Generated_source1\.txt: # 2b # GENERATED = `1`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test7\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test7-build/Generated_source[2-6]\.txt
+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..e0f17e6
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-stderr.txt
@@ -0,0 +1,45 @@
+^Generated_source1\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `1`
+Generated_source2\.txt: # 1b # GENERATED = `1`
+Generated_source2\.txt: # 2a # GENERATED = `1`
+Generated_source2\.txt: # 2b # GENERATED = `1`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `1`
+Generated_source3\.txt: # 1b # GENERATED = `1`
+Generated_source3\.txt: # 2a # GENERATED = `1`
+Generated_source3\.txt: # 2b # GENERATED = `1`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `1`
+Generated_source5\.txt: # 1b # GENERATED = `1`
+Generated_source5\.txt: # 2a # GENERATED = `1`
+Generated_source5\.txt: # 2b # GENERATED = `1`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `1`
+Generated_source6\.txt: # 1b # GENERATED = `1`
+Generated_source6\.txt: # 2a # GENERATED = `1`
+Generated_source6\.txt: # 2b # GENERATED = `1`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test8\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test8-build/Generated_source4\.txt
+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..80f3edf
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-stderr.txt
@@ -0,0 +1,84 @@
+^((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\.txt: # 1a # GENERATED = `0`
+Generated_source1\.txt: # 1b # GENERATED = `0`
+Generated_source1\.txt: # 2a # GENERATED = `0`
+Generated_source1\.txt: # 2b # GENERATED = `0`
+Generated_source1\.txt: # 3a # GENERATED = `0`
+Generated_source1\.txt: # 3b # GENERATED = `0`
+Generated_source2\.txt: # 1a # GENERATED = `0`
+Generated_source2\.txt: # 1b # GENERATED = `0`
+Generated_source2\.txt: # 2a # GENERATED = `0`
+Generated_source2\.txt: # 2b # GENERATED = `0`
+Generated_source2\.txt: # 3a # GENERATED = `0`
+Generated_source2\.txt: # 3b # GENERATED = `0`
+Generated_source3\.txt: # 1a # GENERATED = `0`
+Generated_source3\.txt: # 1b # GENERATED = `0`
+Generated_source3\.txt: # 2a # GENERATED = `0`
+Generated_source3\.txt: # 2b # GENERATED = `0`
+Generated_source3\.txt: # 3a # GENERATED = `0`
+Generated_source3\.txt: # 3b # GENERATED = `0`
+Generated_source4\.txt: # 1a # GENERATED = `0`
+Generated_source4\.txt: # 1b # GENERATED = `0`
+Generated_source4\.txt: # 2a # GENERATED = `0`
+Generated_source4\.txt: # 2b # GENERATED = `0`
+Generated_source4\.txt: # 3a # GENERATED = `0`
+Generated_source4\.txt: # 3b # GENERATED = `0`
+Generated_source5\.txt: # 1a # GENERATED = `0`
+Generated_source5\.txt: # 1b # GENERATED = `0`
+Generated_source5\.txt: # 2a # GENERATED = `0`
+Generated_source5\.txt: # 2b # GENERATED = `0`
+Generated_source5\.txt: # 3a # GENERATED = `0`
+Generated_source5\.txt: # 3b # GENERATED = `0`
+Generated_source6\.txt: # 1a # GENERATED = `0`
+Generated_source6\.txt: # 1b # GENERATED = `0`
+Generated_source6\.txt: # 2a # GENERATED = `0`
+Generated_source6\.txt: # 2b # GENERATED = `0`
+Generated_source6\.txt: # 3a # GENERATED = `0`
+Generated_source6\.txt: # 3b # GENERATED = `0`
+CMake Error at CMP0118-Common-Test9\.cmake:[0-9]+ \(add_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-build/Generated_source[4-6]\.txt
+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_custom_target\):
+ Cannot find source file:
+
+[ \t]*.*Tests/RunCMake/CMP0118/CMP0118-WARN-Test9-build/Generated_source[4-6]\.txt
+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..0d30651
--- /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} NONE)
+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..6bc99cb
--- /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.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..fbd7e6f
--- /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.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..916725c
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test12/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(TARGET custom4 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_command(TARGET custom5 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_command(TARGET custom6 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..f2929aa
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test13/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_command(TARGET custom4 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_command(TARGET custom5 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_command(TARGET custom6 PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ BYPRODUCT "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..7397db9
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test14/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_target(custom4_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_target(custom5_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_target(custom6_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..314e427
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test15/CMakeLists.txt
@@ -0,0 +1,33 @@
+add_custom_target(custom4_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+)
+add_custom_target(custom5_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+)
+add_custom_target(custom6_source_generator ALL
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/Source.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..fa307d1
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test6/CMakeLists.txt
@@ -0,0 +1,16 @@
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..6362f78
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test7/CMakeLists.txt
@@ -0,0 +1,16 @@
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..55debd1
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test8/CMakeLists.txt
@@ -0,0 +1,30 @@
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "1")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ 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..cdb8884
--- /dev/null
+++ b/Tests/RunCMake/CMP0118/subdir-Common-Test9/CMakeLists.txt
@@ -0,0 +1,30 @@
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source4.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source5.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_source6.txt"
+ CONTENT "int func();\nint main(){ return func(); }"
+)
+
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source1.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source2.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source3.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source4.txt"
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source5.txt"
+ DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.."
+ PROPERTY GENERATED "0")
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/../Generated_source6.txt"
+ TARGET_DIRECTORY custom1
+ PROPERTY GENERATED "0")
diff --git a/Tests/RunCMake/CMP0119/AltExtC.zzz b/Tests/RunCMake/CMP0119/AltExtC.zzz
new file mode 100644
index 0000000..5b240eb
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/AltExtC.zzz
@@ -0,0 +1,4 @@
+int main(void) {
+ int class = 0;
+ return class;
+}
diff --git a/Tests/RunCMake/CMP0119/AltExtCXX.zzz b/Tests/RunCMake/CMP0119/AltExtCXX.zzz
new file mode 100644
index 0000000..3c521ed
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/AltExtCXX.zzz
@@ -0,0 +1,3 @@
+int main() {
+ return static_cast<int>(0);
+}
diff --git a/Tests/RunCMake/CMP0119/CMP0119-Common.cmake b/Tests/RunCMake/CMP0119/CMP0119-Common.cmake
new file mode 100644
index 0000000..f45895b
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMP0119-Common.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+
+add_executable(AltExtC AltExtC.zzz)
+set_property(SOURCE AltExtC.zzz PROPERTY LANGUAGE C)
diff --git a/Tests/RunCMake/CMP0119/CMP0119-NEW.cmake b/Tests/RunCMake/CMP0119/CMP0119-NEW.cmake
new file mode 100644
index 0000000..df0ed48
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMP0119-NEW.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0119 NEW)
+include(CMP0119-Common.cmake)
+
+enable_language(CXX)
+add_executable(AltExtCXX AltExtCXX.zzz)
+set_property(SOURCE AltExtCXX.zzz PROPERTY LANGUAGE CXX)
diff --git a/Tests/RunCMake/CMP0119/CMP0119-OLD-build-result.txt b/Tests/RunCMake/CMP0119/CMP0119-OLD-build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMP0119-OLD-build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CMP0119/CMP0119-OLD-build-stderr.txt b/Tests/RunCMake/CMP0119/CMP0119-OLD-build-stderr.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMP0119-OLD-build-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/CMP0119/CMP0119-OLD.cmake b/Tests/RunCMake/CMP0119/CMP0119-OLD.cmake
new file mode 100644
index 0000000..9eaa200
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMP0119-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0119 OLD)
+include(CMP0119-Common.cmake)
diff --git a/Tests/RunCMake/CMP0119/CMP0119-WARN-build-result.txt b/Tests/RunCMake/CMP0119/CMP0119-WARN-build-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMP0119-WARN-build-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/CMP0119/CMP0119-WARN-build-stderr.txt b/Tests/RunCMake/CMP0119/CMP0119-WARN-build-stderr.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMP0119-WARN-build-stderr.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/CMP0119/CMP0119-WARN.cmake b/Tests/RunCMake/CMP0119/CMP0119-WARN.cmake
new file mode 100644
index 0000000..00281e9
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMP0119-WARN.cmake
@@ -0,0 +1,2 @@
+
+include(CMP0119-Common.cmake)
diff --git a/Tests/RunCMake/CMP0119/CMakeLists.txt b/Tests/RunCMake/CMP0119/CMakeLists.txt
new file mode 100644
index 0000000..ab1a20c
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.19)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0119/RunCMakeTest.cmake b/Tests/RunCMake/CMP0119/RunCMakeTest.cmake
new file mode 100644
index 0000000..e547ef5
--- /dev/null
+++ b/Tests/RunCMake/CMP0119/RunCMakeTest.cmake
@@ -0,0 +1,17 @@
+include(RunCMake)
+
+function(run_CMP0119 status)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0119-${status}-build)
+ run_cmake(CMP0119-${status})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(CMP0119-${status}-build "${CMAKE_COMMAND}" --build . --config Debug)
+endfunction()
+
+if(NOT RunCMake_GENERATOR MATCHES "Visual Studio|Xcode" AND
+ NOT CMAKE_C_COMPILER_ID MATCHES "(Borland|Embarcadero|Watcom)")
+ run_CMP0119(WARN)
+ run_CMP0119(OLD)
+endif()
+if((CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang|MSVC|Borland|Embarcadero|Intel|TI)"))
+ run_CMP0119(NEW)
+endif()
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 370dd76..91fe6ca 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -125,6 +125,12 @@ if(CMake_TEST_CUDA)
endif()
add_RunCMake_test(CMP0106)
add_RunCMake_test(CMP0111)
+add_RunCMake_test(CMP0115)
+if(CMAKE_GENERATOR MATCHES "Ninja")
+ add_RunCMake_test(CMP0116)
+endif()
+add_RunCMake_test(CMP0118)
+add_RunCMake_test(CMP0119 -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
@@ -175,6 +181,10 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
)
endif()
+add_RunCMake_test(ABI -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
+set_property(TEST RunCMake.ABI APPEND
+ PROPERTY LABELS "CUDA")
+
add_RunCMake_test(AndroidTestUtilities)
if(CMake_TEST_APPLE_SILICON)
add_RunCMake_test(AppleSilicon)
@@ -187,6 +197,9 @@ if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND)
set(autogen_with_qt5 TRUE)
endif ()
add_RunCMake_test(Autogen -Dwith_qt5=${autogen_with_qt5})
+
+add_RunCMake_test(ArtifactOutputDirs)
+
if(NOT DEFINED CMake_TEST_BuildDepends_GNU_AS
AND CMAKE_C_COMPILER_ID STREQUAL "GNU"
AND CMAKE_GENERATOR MATCHES "^Ninja"
@@ -198,7 +211,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")
@@ -223,6 +239,9 @@ add_RunCMake_test(FileAPI -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
add_RunCMake_test(FindBoost)
add_RunCMake_test(FindLua)
add_RunCMake_test(FindOpenGL)
+if(CMake_TEST_FindOpenSSL)
+ add_RunCMake_test(FindOpenSSL)
+endif()
if(CMake_TEST_UseSWIG)
add_RunCMake_test(FindSWIG)
add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython})
@@ -252,11 +271,12 @@ add_RunCMake_test(Graphviz)
add_RunCMake_test(TargetPropertyGeneratorExpressions)
add_RunCMake_test(Languages)
add_RunCMake_test(LinkStatic)
-if(CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|XL|XLClang)$")
+if(CMAKE_CXX_COMPILER_ID MATCHES "^(Cray|PGI|NVHPC|XL|XLClang)$")
add_RunCMake_test(MetaCompileFeatures)
endif()
if(MSVC)
add_RunCMake_test(MSVCRuntimeLibrary)
+ add_RunCMake_test(MSVCRuntimeTypeInfo)
add_RunCMake_test(MSVCWarningFlags)
endif()
add_RunCMake_test(ObjectLibrary)
@@ -274,6 +294,7 @@ add_RunCMake_test(ToolchainFile)
add_RunCMake_test(find_dependency)
add_RunCMake_test(CompileDefinitions)
add_RunCMake_test(CompileFeatures)
+add_RunCMake_test(Policy)
add_RunCMake_test(PolicyScope)
add_RunCMake_test(WriteBasicConfigVersionFile)
add_RunCMake_test(WriteCompilerDetectionHeader)
@@ -314,7 +335,7 @@ add_RunCMake_test(export)
add_RunCMake_test(cmake_language)
add_RunCMake_test(cmake_minimum_required)
add_RunCMake_test(cmake_parse_arguments)
-# add_RunCMake_test(cmake_path)
+add_RunCMake_test(cmake_path)
add_RunCMake_test(continue)
add_executable(color_warning color_warning.c)
add_executable(fake_build_command fake_build_command.c)
@@ -337,6 +358,9 @@ add_RunCMake_test(ctest_upload)
add_RunCMake_test(ctest_fixtures)
add_RunCMake_test(file)
add_RunCMake_test(file-CHMOD)
+if(HAVE_ELF_H OR CMAKE_SYSTEM_NAME STREQUAL "AIX")
+ add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DHAVE_ELF_H=${HAVE_ELF_H})
+endif()
add_RunCMake_test(find_file)
add_RunCMake_test(find_library -DCYGWIN=${CYGWIN})
add_RunCMake_test(find_package)
@@ -510,6 +534,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.
@@ -570,7 +595,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin)"
endif()
-add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
+add_executable(pseudo_llvm-rc pseudo_llvm-rc.c)
+add_RunCMake_test(CommandLine -DLLVM_RC=$<TARGET_FILE:pseudo_llvm-rc> -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
add_RunCMake_test(CommandLineTar)
if(CMAKE_PLATFORM_NO_VERSIONED_SONAME OR (NOT CMAKE_SHARED_LIBRARY_SONAME_FLAG AND NOT CMAKE_SHARED_LIBRARY_SONAME_C_FLAG))
@@ -779,6 +805,12 @@ add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
add_RunCMake_test("UnityBuild")
add_RunCMake_test(CMakePresets -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA})
+add_RunCMake_test(CMakePresetsBuild -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA})
+add_RunCMake_test(CMakePresetsTest -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA})
+
+if(${CMAKE_GENERATOR} MATCHES "Make|Ninja")
+ add_RunCMake_test(TransformDepfile)
+endif()
if(WIN32)
add_RunCMake_test(Win32GenEx)
diff --git a/Tests/RunCMake/CMakePresets/CMakePresets.json.in b/Tests/RunCMake/CMakePresets/CMakePresets.json.in
index e65c1a9..c6f943c 100644
--- a/Tests/RunCMake/CMakePresets/CMakePresets.json.in
+++ b/Tests/RunCMake/CMakePresets/CMakePresets.json.in
@@ -128,7 +128,13 @@
{
"name": "Good Spaces",
"generator": "@RunCMake_GENERATOR@",
- "binaryDir": "${sourceDir}/build"
+ "binaryDir": "${sourceDir}/build",
+ "cacheVariables": {
+ "GOOD_SPACES": {
+ "type": "STRING",
+ "value": "1"
+ }
+ }
},
{
"name": "GoodWindowsBackslash",
diff --git a/Tests/RunCMake/CMakePresets/GoodSpaces-stdout.txt b/Tests/RunCMake/CMakePresets/GoodSpaces-stdout.txt
new file mode 100644
index 0000000..d106c45
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/GoodSpaces-stdout.txt
@@ -0,0 +1,3 @@
+Preset CMake variables:
+
+ GOOD_SPACES:STRING="1"
diff --git a/Tests/RunCMake/CMakePresets/GoodSpacesEq-stdout.txt b/Tests/RunCMake/CMakePresets/GoodSpacesEq-stdout.txt
new file mode 100644
index 0000000..d106c45
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/GoodSpacesEq-stdout.txt
@@ -0,0 +1,3 @@
+Preset CMake variables:
+
+ GOOD_SPACES:STRING="1"
diff --git a/Tests/RunCMake/CMakePresets/GoodSpacesEq.cmake b/Tests/RunCMake/CMakePresets/GoodSpacesEq.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/GoodSpacesEq.cmake
diff --git a/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt
index 1758f33..60d6adb 100644
--- a/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt
+++ b/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt
@@ -1,5 +1,5 @@
^Not searching for unused variables given on the command line\.
-Available presets:
+Available configure presets:
"zzzzzz" - Sleepy
"aaaaaaaa" - Screaming
diff --git a/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt
index 1758f33..60d6adb 100644
--- a/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt
+++ b/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt
@@ -1,5 +1,5 @@
^Not searching for unused variables given on the command line\.
-Available presets:
+Available configure presets:
"zzzzzz" - Sleepy
"aaaaaaaa" - Screaming
diff --git a/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt
index 1758f33..60d6adb 100644
--- a/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt
+++ b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt
@@ -1,5 +1,5 @@
^Not searching for unused variables given on the command line\.
-Available presets:
+Available configure presets:
"zzzzzz" - Sleepy
"aaaaaaaa" - Screaming
diff --git a/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt
index 1758f33..60d6adb 100644
--- a/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt
+++ b/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt
@@ -1,5 +1,5 @@
^Not searching for unused variables given on the command line\.
-Available presets:
+Available configure presets:
"zzzzzz" - Sleepy
"aaaaaaaa" - Screaming
diff --git a/Tests/RunCMake/CMakePresets/NoPresetArgument-stderr.txt b/Tests/RunCMake/CMakePresets/NoPresetArgument-stderr.txt
index aef30d2..a53682d 100644
--- a/Tests/RunCMake/CMakePresets/NoPresetArgument-stderr.txt
+++ b/Tests/RunCMake/CMakePresets/NoPresetArgument-stderr.txt
@@ -1 +1,2 @@
-^CMake Error: No preset specified for --preset$
+^CMake Error: No preset specified for --preset
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CMakePresets/NoPresetArgumentEq-result.txt b/Tests/RunCMake/CMakePresets/NoPresetArgumentEq-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/NoPresetArgumentEq-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresets/NoPresetArgumentEq-stderr.txt b/Tests/RunCMake/CMakePresets/NoPresetArgumentEq-stderr.txt
new file mode 100644
index 0000000..a53682d
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/NoPresetArgumentEq-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error: No preset specified for --preset
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
index 1f399fe..dfc56ee 100644
--- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
@@ -9,21 +9,7 @@ endif()
set(RunCMake-check-file check.cmake)
-function(validate_schema file expected_result)
- execute_process(
- COMMAND "${PYTHON_EXECUTABLE}" "${RunCMake_SOURCE_DIR}/validate_schema.py" "${file}"
- RESULT_VARIABLE _result
- OUTPUT_VARIABLE _output
- ERROR_VARIABLE _error
- )
- if(NOT _result STREQUAL expected_result)
- string(REPLACE "\n" "\n" _output_p "${_output}")
- string(REPLACE "\n" "\n" _error_p "${_error}")
- string(APPEND RunCMake_TEST_FAILED "Expected result of validating ${file}: ${expected_result}\nActual result: ${_result}\nOutput:\n${_output_p}\nError:\n${_error_p}")
- endif()
-
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
-endfunction()
+include("${RunCMake_SOURCE_DIR}/validate_schema.cmake")
function(run_cmake_presets name)
set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}")
@@ -158,7 +144,8 @@ run_cmake_presets(GoodBinaryUp)
set(CMakePresets_SOURCE_ARG "../GoodBinaryRelative")
run_cmake_presets(GoodBinaryRelative)
unset(CMakePresets_SOURCE_ARG)
-run_cmake_presets(GoodSpaces "--preset=Good Spaces")
+run_cmake_presets(GoodSpaces "--preset" "Good Spaces")
+run_cmake_presets(GoodSpacesEq "--preset=Good Spaces")
if(WIN32)
run_cmake_presets(GoodWindowsBackslash)
endif()
@@ -221,7 +208,8 @@ endif()
# Test bad command line arguments
run_cmake_presets(NoSuchPreset)
-run_cmake_presets(NoPresetArgument --preset=)
+run_cmake_presets(NoPresetArgument --preset)
+run_cmake_presets(NoPresetArgumentEq --preset= -DA=B)
run_cmake_presets(UseHiddenPreset)
# Test CMakeUserPresets.json
diff --git a/Tests/RunCMake/CMakePresets/validate_schema.cmake b/Tests/RunCMake/CMakePresets/validate_schema.cmake
new file mode 100644
index 0000000..68b638f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/validate_schema.cmake
@@ -0,0 +1,19 @@
+function(validate_schema file expected_result)
+ if (NOT CMakePresets_VALIDATE_SCRIPT_PATH)
+ set(CMakePresets_VALIDATE_SCRIPT_PATH "${RunCMake_SOURCE_DIR}/validate_schema.py")
+ endif()
+
+ execute_process(
+ COMMAND "${PYTHON_EXECUTABLE}" "${CMakePresets_VALIDATE_SCRIPT_PATH}" "${file}"
+ RESULT_VARIABLE _result
+ OUTPUT_VARIABLE _output
+ ERROR_VARIABLE _error
+ )
+ if(NOT _result STREQUAL expected_result)
+ string(REPLACE "\n" "\n " _output_p "${_output}")
+ string(REPLACE "\n" "\n " _error_p "${_error}")
+ string(APPEND RunCMake_TEST_FAILED "Expected result of validating ${file}: ${expected_result}\nActual result: ${_result}\nOutput:\n ${_output_p}\nError:\n ${_error_p}\n")
+ endif()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/CMakePresetsBuild/CMakeLists.txt.in b/Tests/RunCMake/CMakePresetsBuild/CMakeLists.txt.in
new file mode 100644
index 0000000..129184a
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/CMakeLists.txt.in
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.19)
+project("@CASE_NAME@" NONE)
+include("@CASE_SOURCE_DIR@/@CASE_NAME@.cmake")
diff --git a/Tests/RunCMake/CMakePresetsBuild/Good-build-build-other-check.cmake b/Tests/RunCMake/CMakePresetsBuild/Good-build-build-other-check.cmake
new file mode 100644
index 0000000..b2699db
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Good-build-build-other-check.cmake
@@ -0,0 +1,5 @@
+include("${RunCMake_SOURCE_DIR}/TestVariable.cmake")
+
+test_environment_variable("TEST_ENV_" "other")
+
+include("${RunCMake_SOURCE_DIR}/check.cmake")
diff --git a/Tests/RunCMake/CMakePresetsBuild/Good-build-macros-check.cmake b/Tests/RunCMake/CMakePresetsBuild/Good-build-macros-check.cmake
new file mode 100644
index 0000000..7801c3d
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Good-build-macros-check.cmake
@@ -0,0 +1,14 @@
+include("${RunCMake_SOURCE_DIR}/TestVariable.cmake")
+
+if(RunCMake_GENERATOR STREQUAL "NMake Makefiles JOM")
+ # JOM removes the '$' and content following it.
+else()
+ test_environment_variable("TEST_DOLLAR" "x\\$x")
+endif()
+test_environment_variable("TEST_GENERATOR" "${RunCMake_GENERATOR}")
+test_environment_variable("TEST_PRESET_NAME" "xmacrosx")
+test_environment_variable("TEST_SOURCE_DIR_" "x[^\n]*[/\\\\]Tests[/\\\\]RunCMake[/\\\\]CMakePresetsBuild[/\\\\]Goodx")
+test_environment_variable("TEST_SOURCE_DIR_NAME" "xGoodx")
+test_environment_variable("TEST_SOURCE_PARENT_DIR" "x[^\n]*[/\\\\]Tests[/\\\\]RunCMake[/\\\\]CMakePresetsBuildx")
+
+include("${RunCMake_SOURCE_DIR}/check.cmake")
diff --git a/Tests/RunCMake/CMakePresetsBuild/Good-build-noEnvironment-check.cmake b/Tests/RunCMake/CMakePresetsBuild/Good-build-noEnvironment-check.cmake
new file mode 100644
index 0000000..94a54ca
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Good-build-noEnvironment-check.cmake
@@ -0,0 +1,6 @@
+string(FIND "${actual_stdout}" "TEST_ENV_" TEST_ENV_POS)
+if (NOT TEST_ENV_POS EQUAL -1)
+ message(FATAL_ERROR "Found TEST_ENV_ in environment")
+endif()
+
+include("${RunCMake_SOURCE_DIR}/check.cmake")
diff --git a/Tests/RunCMake/CMakePresetsBuild/Good-build-withEnvironment-check.cmake b/Tests/RunCMake/CMakePresetsBuild/Good-build-withEnvironment-check.cmake
new file mode 100644
index 0000000..9c6b5c2
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Good-build-withEnvironment-check.cmake
@@ -0,0 +1,8 @@
+include("${RunCMake_SOURCE_DIR}/TestVariable.cmake")
+
+test_environment_variable("TEST_ENV_" "Environment variable")
+test_environment_variable("TEST_ENV_OVERRIDE_" "Overridden")
+test_environment_variable("TEST_ENV_OVERRIDE_REF" "xOverriddenx")
+test_environment_variable("TEST_ENV_REF" "xEnvironment variablex")
+
+include("${RunCMake_SOURCE_DIR}/check.cmake")
diff --git a/Tests/RunCMake/CMakePresetsBuild/Good.cmake b/Tests/RunCMake/CMakePresetsBuild/Good.cmake
new file mode 100644
index 0000000..491d367
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Good.cmake
@@ -0,0 +1,3 @@
+add_custom_target(good ALL)
+add_custom_command(TARGET good PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E environment)
diff --git a/Tests/RunCMake/CMakePresetsBuild/Good.json.in b/Tests/RunCMake/CMakePresetsBuild/Good.json.in
new file mode 100644
index 0000000..fd43c4e
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Good.json.in
@@ -0,0 +1,78 @@
+{
+ "version": 2,
+ "configurePresets": [
+ {
+ "name": "default",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build/${presetName}",
+ "environment": {
+ "TEST_ENV_": "Environment variable",
+ "TEST_ENV_OVERRIDE_": "Environment variable",
+ "TEST_ENV_OVERRIDE_REF": "x$env{TEST_ENV_OVERRIDE_}x"
+ }
+ },
+ {
+ "name": "other",
+ "inherits": "default",
+ "environment": {
+ "TEST_ENV_": "other"
+ }
+ }
+ ],
+ "buildPresets": [
+ {
+ "name": "build-default",
+ "hidden": true,
+ "inherits": [],
+ "configurePreset": "default",
+ "vendor": {},
+ "displayName": "",
+ "description": "",
+ "inheritConfigureEnvironment": true,
+ "environment": {},
+ "jobs": 0,
+ "targets": [],
+ "configuration": "",
+ "verbose": true,
+ "nativeToolOptions": []
+ },
+ {
+ "name": "build-other",
+ "configurePreset": "other"
+ },
+ {
+ "name": "withEnvironment",
+ "inherits": "build-default",
+ "environment": {
+ "TEST_ENV_OVERRIDE_": "Overridden",
+ "TEST_ENV_REF": "x$env{TEST_ENV_}x",
+ "TEST_ENV_OVERRIDE_REF": "x$env{TEST_ENV_OVERRIDE_}x"
+ }
+ },
+ {
+ "name": "noEnvironment",
+ "inherits": "build-default",
+ "inheritConfigureEnvironment": false
+ },
+ {
+ "name": "macros",
+ "inherits": "build-default",
+ "inheritConfigureEnvironment": false,
+ "environment": {
+ "TEST_SOURCE_DIR_": "x${sourceDir}x",
+ "TEST_SOURCE_PARENT_DIR": "x${sourceParentDir}x",
+ "TEST_SOURCE_DIR_NAME": "x${sourceDirName}x",
+ "TEST_PRESET_NAME": "x${presetName}x",
+ "TEST_GENERATOR": "x${generator}x",
+ "TEST_DOLLAR": "x${dollar}x"
+ }
+ },
+ {
+ "name": "vendorObject",
+ "configurePreset": "default",
+ "vendor": {
+ "example.com": "value"
+ }
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid-build-badConfigurePreset-result.txt b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-badConfigurePreset-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-badConfigurePreset-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid-build-badConfigurePreset-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-badConfigurePreset-stderr.txt
new file mode 100644
index 0000000..7c3255d
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-badConfigurePreset-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: No such configure preset in [^
+]*/Tests/RunCMake/CMakePresetsBuild/Invalid: "dne"
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid-build-hidden-result.txt b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-hidden-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-hidden-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid-build-hidden-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-hidden-stderr.txt
new file mode 100644
index 0000000..f10c7b8
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-hidden-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: Cannot use hidden build preset in [^
+]*/Tests/RunCMake/CMakePresetsBuild/Invalid: "hidden"
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid-build-vendorMacro-result.txt b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-vendorMacro-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-vendorMacro-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid-build-vendorMacro-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-vendorMacro-stderr.txt
new file mode 100644
index 0000000..a3b951f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Invalid-build-vendorMacro-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Could not evaluate build preset "vendorMacro": Invalid macro expansion
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid.cmake b/Tests/RunCMake/CMakePresetsBuild/Invalid.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Invalid.cmake
diff --git a/Tests/RunCMake/CMakePresetsBuild/Invalid.json.in b/Tests/RunCMake/CMakePresetsBuild/Invalid.json.in
new file mode 100644
index 0000000..cf56cef
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/Invalid.json.in
@@ -0,0 +1,27 @@
+{
+ "version": 2,
+ "configurePresets": [
+ {
+ "name": "default",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build/${presetName}"
+ }
+ ],
+ "buildPresets": [
+ {
+ "name": "hidden",
+ "hidden": true
+ },
+ {
+ "name": "vendorMacro",
+ "configurePreset": "default",
+ "environment": {
+ "TEST": "$vendor{bad.TEST}"
+ }
+ },
+ {
+ "name": "badConfigurePreset",
+ "configurePreset": "dne"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsBuild/ListPresets-build-x-stdout.txt b/Tests/RunCMake/CMakePresetsBuild/ListPresets-build-x-stdout.txt
new file mode 100644
index 0000000..4d30707
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/ListPresets-build-x-stdout.txt
@@ -0,0 +1,5 @@
+Available build presets:
+
+ "build-default" - build-default displayName
+ "empty"
+ "display" - display displayName
diff --git a/Tests/RunCMake/CMakePresetsBuild/ListPresets.cmake b/Tests/RunCMake/CMakePresetsBuild/ListPresets.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/ListPresets.cmake
diff --git a/Tests/RunCMake/CMakePresetsBuild/ListPresets.json.in b/Tests/RunCMake/CMakePresetsBuild/ListPresets.json.in
new file mode 100644
index 0000000..3f5e02c
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/ListPresets.json.in
@@ -0,0 +1,31 @@
+{
+ "version": 2,
+ "configurePresets": [
+ {
+ "name": "default",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build/${presetName}"
+ }
+ ],
+ "buildPresets": [
+ {
+ "name": "build-default",
+ "configurePreset": "default",
+ "displayName": "build-default displayName",
+ "description": "build-default description"
+ },
+ {
+ "name": "empty",
+ "inherits": "build-default"
+ },
+ {
+ "name": "display",
+ "inherits": "build-default",
+ "displayName": "display displayName"
+ },
+ {
+ "name": "hidden",
+ "hidden": true
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset-build-noConfigurePreset-result.txt b/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset-build-noConfigurePreset-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset-build-noConfigurePreset-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset-build-noConfigurePreset-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset-build-noConfigurePreset-stderr.txt
new file mode 100644
index 0000000..fcb37bc
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset-build-noConfigurePreset-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset: Invalid preset
diff --git a/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset.cmake b/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset.cmake
diff --git a/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset.json.in b/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset.json.in
new file mode 100644
index 0000000..81b2cde
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/NoConfigurePreset.json.in
@@ -0,0 +1,15 @@
+{
+ "version": 2,
+ "configurePresets": [
+ {
+ "name": "default",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build/${presetName}"
+ }
+ ],
+ "buildPresets": [
+ {
+ "name": "noConfigurePreset"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported-build-x-result.txt b/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported-build-x-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported-build-x-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported-build-x-stderr.txt b/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported-build-x-stderr.txt
new file mode 100644
index 0000000..d6ae62d
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported-build-x-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: Could not read presets from [^
+]*Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported: File version must be 2 or higher for build and test preset support.
diff --git a/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported.json.in b/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported.json.in
new file mode 100644
index 0000000..0028239
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/PresetsUnsupported.json.in
@@ -0,0 +1,7 @@
+{
+ "version": 1,
+ "configurePresets": [
+ ],
+ "buildPresets": [
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
new file mode 100644
index 0000000..fd95c2c
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake
@@ -0,0 +1,75 @@
+include(RunCMake)
+
+# Presets do not support legacy VS generator name architecture suffix.
+if(RunCMake_GENERATOR MATCHES "^(Visual Studio [0-9]+ [0-9]+) ")
+ set(RunCMake_GENERATOR "${CMAKE_MATCH_1}")
+endif()
+
+function(run_cmake_build_presets name CMakePresetsBuild_CONFIGURE_PRESETS CMakePresetsBuild_BUILD_PRESETS)
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_TEST_SOURCE_DIR}/build")
+ set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}")
+
+ set(RunCMake_TEST_NO_CLEAN TRUE)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ set(CASE_NAME "${name}")
+ set(CASE_SOURCE_DIR "${RunCMake_SOURCE_DIR}")
+ configure_file("${RunCMake_SOURCE_DIR}/CMakeLists.txt.in" "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" @ONLY)
+
+ if(NOT CMakePresetsBuild_FILE)
+ set(CMakePresetsBuild_FILE "${RunCMake_SOURCE_DIR}/${name}.json.in")
+ endif()
+ if(EXISTS "${CMakePresetsBuild_FILE}")
+ configure_file("${CMakePresetsBuild_FILE}" "${RunCMake_TEST_SOURCE_DIR}/CMakePresets.json" @ONLY)
+ endif()
+
+ if(NOT CMakeUserPresets_FILE)
+ set(CMakeUserPresets_FILE "${RunCMake_SOURCE_DIR}/${name}User.json.in")
+ endif()
+ if(EXISTS "${CMakeUserPresets_FILE}")
+ configure_file("${CMakeUserPresets_FILE}" "${RunCMake_TEST_SOURCE_DIR}/CMakeUserPresets.json" @ONLY)
+ endif()
+
+ if (NOT CMakePresetsBuild_BUILD_ONLY)
+ foreach(CONFIGURE_PRESET ${CMakePresetsBuild_CONFIGURE_PRESETS})
+ run_cmake_command("${name}-configure-${CONFIGURE_PRESET}"
+ "${CMAKE_COMMAND}" "--preset" "${CONFIGURE_PRESET}")
+ endforeach()
+ endif()
+
+ set(eq 0)
+ foreach(BUILD_PRESET ${CMakePresetsBuild_BUILD_PRESETS})
+ if (EXISTS "${RunCMake_SOURCE_DIR}/${name}-build-${BUILD_PRESET}-check.cmake")
+ set(RunCMake-check-file "${name}-build-${BUILD_PRESET}-check.cmake")
+ else()
+ set(RunCMake-check-file "check.cmake")
+ endif()
+
+ if(eq)
+ run_cmake_command(${name}-build-${BUILD_PRESET}
+ ${CMAKE_COMMAND} "--build" "--preset=${BUILD_PRESET}" ${ARGN})
+ set(eq 0)
+ else()
+ run_cmake_command(${name}-build-${BUILD_PRESET}
+ ${CMAKE_COMMAND} "--build" "--preset" "${BUILD_PRESET}" ${ARGN})
+ set(eq 1)
+ endif()
+ endforeach()
+endfunction()
+
+set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
+
+run_cmake_build_presets(Good "default;other" "build-other;withEnvironment;noEnvironment;macros;vendorObject")
+
+set(CMakePresetsBuild_BUILD_ONLY 1)
+run_cmake_build_presets(ListPresets "x" "x" "--list-presets")
+run_cmake_build_presets(NoConfigurePreset "x" "noConfigurePreset")
+run_cmake_build_presets(Invalid "x" "hidden;vendorMacro;badConfigurePreset")
+
+set(CMakePresets_SCHEMA_EXPECTED_RESULT 1)
+run_cmake_build_presets(PresetsUnsupported "x" "x")
+set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
+set(CMakePresetsBuild_BUILD_ONLY 0)
diff --git a/Tests/RunCMake/CMakePresetsBuild/TestVariable.cmake b/Tests/RunCMake/CMakePresetsBuild/TestVariable.cmake
new file mode 100644
index 0000000..3113dcc
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/TestVariable.cmake
@@ -0,0 +1,14 @@
+function(test_environment_variable name expected_value)
+ string(REGEX MATCH "${name}=([^\n]*)" REGEX_RESULT "${actual_stdout}")
+ if(NOT REGEX_RESULT)
+ string(APPEND RunCMake_TEST_FAILED "Environment variable '${name}' is not defined.\n")
+ else()
+ set(actual_value "${CMAKE_MATCH_1}")
+ if(NOT "${actual_value}" MATCHES "${expected_value}")
+ string(REPLACE "\n" "\n " _actual "${expected_value}")
+ string(REPLACE "\n" "\n " _expect "${actual_value}")
+ string(APPEND RunCMake_TEST_FAILED "Expected value of environment variable '${name}':\n ${_expect}\nActual value:\n ${_actual}\n")
+ endif()
+ endif()
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/CMakePresetsBuild/check.cmake b/Tests/RunCMake/CMakePresetsBuild/check.cmake
new file mode 100644
index 0000000..e79c4f1
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsBuild/check.cmake
@@ -0,0 +1,3 @@
+set(CMakePresets_VALIDATE_SCRIPT_PATH "${RunCMake_SOURCE_DIR}/../CMakePresets/validate_schema.py")
+include("${RunCMake_SOURCE_DIR}/../CMakePresets/validate_schema.cmake")
+include("${RunCMake_SOURCE_DIR}/../CMakePresets/check.cmake")
diff --git a/Tests/RunCMake/CMakePresetsTest/CMakeLists.txt.in b/Tests/RunCMake/CMakePresetsTest/CMakeLists.txt.in
new file mode 100644
index 0000000..129184a
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/CMakeLists.txt.in
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.19)
+project("@CASE_NAME@" NONE)
+include("@CASE_SOURCE_DIR@/@CASE_NAME@.cmake")
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-indexFile.txt b/Tests/RunCMake/CMakePresetsTest/Good-indexFile.txt
new file mode 100644
index 0000000..4ac2314
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-indexFile.txt
@@ -0,0 +1 @@
+2,,2
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-config-debug-stdout.txt b/Tests/RunCMake/CMakePresetsTest/Good-test-config-debug-stdout.txt
new file mode 100644
index 0000000..c281c81
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-test-config-debug-stdout.txt
@@ -0,0 +1,5 @@
+Test project [^
+]*/Tests/RunCMake/CMakePresetsTest/Good/build/default
+ Start 6: debug-only
+.*
+100% tests passed, 0 tests failed out of 1
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-config-release-stdout.txt b/Tests/RunCMake/CMakePresetsTest/Good-test-config-release-stdout.txt
new file mode 100644
index 0000000..66bfd22
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-test-config-release-stdout.txt
@@ -0,0 +1,5 @@
+Test project [^
+]*/Tests/RunCMake/CMakePresetsTest/Good/build/default
+ Start 6: release-only
+.*
+100% tests passed, 0 tests failed out of 1
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-exclude-stdout.txt b/Tests/RunCMake/CMakePresetsTest/Good-test-exclude-stdout.txt
new file mode 100644
index 0000000..5e990de
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-test-exclude-stdout.txt
@@ -0,0 +1,7 @@
+Test project [^
+]*/Tests/RunCMake/CMakePresetsTest/Good/build/default
+ Start 3: testc
+.*
+ Start 4: testd
+.*
+100% tests passed, 0 tests failed out of 2
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-index-stdout.txt b/Tests/RunCMake/CMakePresetsTest/Good-test-index-stdout.txt
new file mode 100644
index 0000000..2df6fcb
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-test-index-stdout.txt
@@ -0,0 +1,7 @@
+Test project [^
+]*/Tests/RunCMake/CMakePresetsTest/Good/build/default
+ Start 1: testa
+.*
+ Start 3: testc
+.*
+100% tests passed, 0 tests failed out of 2
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-indexFile-stdout.txt b/Tests/RunCMake/CMakePresetsTest/Good-test-indexFile-stdout.txt
new file mode 100644
index 0000000..1366876
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-test-indexFile-stdout.txt
@@ -0,0 +1,7 @@
+Test project [^
+]*/Tests/RunCMake/CMakePresetsTest/Good/build/default
+ Start 2: testb
+.*
+ Start 4: testd
+.*
+100% tests passed, 0 tests failed out of 2
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-noEnvironment-stdout.txt b/Tests/RunCMake/CMakePresetsTest/Good-test-noEnvironment-stdout.txt
new file mode 100644
index 0000000..8b4845e
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-test-noEnvironment-stdout.txt
@@ -0,0 +1,8 @@
+Test project [^
+]*/Tests/RunCMake/CMakePresetsTest/Good/build/default
+.*
+ Start 5: test-env
+.*
+5: TEST_ENV_REF=xx
+.*
+100% tests passed, 0 tests failed out of 1
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-showOnly-stdout.txt b/Tests/RunCMake/CMakePresetsTest/Good-test-showOnly-stdout.txt
new file mode 100644
index 0000000..67ddd4f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-test-showOnly-stdout.txt
@@ -0,0 +1,8 @@
+Test project [^
+]*/Tests/RunCMake/CMakePresetsTest/Good/build/default
+ Test #1: testa
+ Test #2: testb
+ Test #3: testc
+ Test #4: testd
+
+Total Tests: 4
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-withEnvironment-check.cmake b/Tests/RunCMake/CMakePresetsTest/Good-withEnvironment-check.cmake
new file mode 100644
index 0000000..0c19556
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good-withEnvironment-check.cmake
@@ -0,0 +1,8 @@
+include("${RunCMake_SOURCE_DIR}/../CMakePresetsBuild/TestVariable.cmake")
+
+test_environment_variable("TEST_ENV" "Environment variable")
+test_environment_variable("TEST_ENV_OVERRIDE" "Override")
+test_environment_variable("TEST_ENV_OVERRIDE_REF" "xOverridex")
+test_environment_variable("TEST_ENV_REF" "xEnvironment variablex")
+
+include("${RunCMake_SOURCE_DIR}/check.cmake")
diff --git a/Tests/RunCMake/CMakePresetsTest/Good.cmake b/Tests/RunCMake/CMakePresetsTest/Good.cmake
new file mode 100644
index 0000000..0a6cf57
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good.cmake
@@ -0,0 +1,27 @@
+enable_testing()
+add_test(testa ${CMAKE_COMMAND} -E echo testa)
+add_test(testb ${CMAKE_COMMAND} -E echo testb)
+add_test(testc ${CMAKE_COMMAND} -E echo testc)
+add_test(testd ${CMAKE_COMMAND} -E echo testd)
+
+set_tests_properties(testa testb testc testd
+ PROPERTIES LABELS "echo")
+set_property(TEST testa testb
+ APPEND PROPERTY LABELS ab)
+set_property(TEST testb testc
+ APPEND PROPERTY LABELS bc)
+set_property(TEST testc testd
+ APPEND PROPERTY LABELS cd)
+
+add_test(test-env ${CMAKE_COMMAND} -E environment | sort)
+set_tests_properties(test-env PROPERTIES LABELS "env")
+
+add_test(NAME debug-only
+ COMMAND ${CMAKE_COMMAND} -E echo debug-only
+ CONFIGURATIONS Debug)
+add_test(NAME release-only
+ COMMAND ${CMAKE_COMMAND} -E echo release-only
+ CONFIGURATIONS Release)
+
+set_tests_properties(debug-only release-only
+ PROPERTIES LABELS "config")
diff --git a/Tests/RunCMake/CMakePresetsTest/Good.json.in b/Tests/RunCMake/CMakePresetsTest/Good.json.in
new file mode 100644
index 0000000..57be5a5
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Good.json.in
@@ -0,0 +1,175 @@
+{
+ "version": 2,
+ "configurePresets": [
+ {
+ "name": "default",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build/${presetName}",
+ "environment": {
+ "TEST_ENV": "Environment variable",
+ "TEST_ENV_OVERRIDE": "Overridden environment variable"
+ }
+ }
+ ],
+ "buildPresets": [
+ {
+ "name": "build-default-debug",
+ "configurePreset": "default",
+ "configuration": "Debug"
+ },
+ {
+ "name": "build-default-release",
+ "inherits": "build-default-debug",
+ "configuration": "Release"
+ }
+ ],
+ "testPresets": [
+ {
+ "name": "minimal",
+ "configurePreset": "default"
+ },
+ {
+ "name": "defaults",
+ "hidden": false,
+ "inherits": [],
+ "vendor": {},
+ "displayName": "",
+ "description": "",
+ "environment": {},
+ "configurePreset": "default",
+ "inheritConfigureEnvironment": true,
+ "configuration": "",
+ "overwriteConfigurationFile": [],
+ "output": {
+ "shortProgress": false,
+ "verbosity": "default",
+ "debug": false,
+ "outputOnFailure": false,
+ "quiet": false,
+ "outputLogFile": "",
+ "labelSummary": true,
+ "subprojectSummary": true
+ },
+ "filter": {
+ "include": {
+ "name": "",
+ "label": "",
+ "useUnion": false,
+ "index": ""
+ },
+ "exclude": {
+ "name": "",
+ "label": "",
+ "fixtures": {
+ "any": "",
+ "setup": "",
+ "cleanup": ""
+ }
+ }
+ },
+ "execution": {
+ "stopOnFailure": false,
+ "enableFailover": false,
+ "jobs": 0,
+ "resourceSpecFile": "",
+ "showOnly": "human",
+ "repeat": {
+ "mode": "until-pass",
+ "count": 1
+ },
+ "interactiveDebugging": false,
+ "scheduleRandom": false,
+ "noTestsAction": "default"
+ }
+ },
+ {
+ "name": "noEnvironment",
+ "configurePreset": "default",
+ "inheritConfigureEnvironment": false,
+ "environment": {
+ "TEST_ENV_REF": "x$env{TEST_ENV}x"
+ },
+ "filter": {
+ "include": {
+ "name": "test-env"
+ }
+ },
+ "output": {
+ "verbosity": "verbose"
+ }
+ },
+ {
+ "name": "withEnvironment",
+ "inherits": "noEnvironment",
+ "inheritConfigureEnvironment": true,
+ "environment": {
+ "TEST_ENV_OVERRIDE": "Override",
+ "TEST_ENV_OVERRIDE_REF": "x$env{TEST_ENV_OVERRIDE}x",
+ "TEST_ENV_REF": "x$env{TEST_ENV}x"
+ }
+ },
+ {
+ "name": "config-debug",
+ "inherits": "minimal",
+ "configuration": "Debug",
+ "filter": {
+ "include": {
+ "label": "config"
+ }
+ }
+ },
+ {
+ "name": "config-release",
+ "inherits": "minimal",
+ "configuration": "Release",
+ "filter": {
+ "include": {
+ "label": "config"
+ }
+ }
+ },
+ {
+ "name": "exclude",
+ "inherits": "minimal",
+ "filter": {
+ "exclude": {
+ "name": "test-env",
+ "label": "(ab|config)"
+ }
+ }
+ },
+ {
+ "name": "index",
+ "inherits": "minimal",
+ "filter": {
+ "include": {
+ "index": {
+ "end": 4,
+ "stride": 2
+ }
+ }
+ }
+ },
+ {
+ "name": "indexFile",
+ "inherits": "minimal",
+ "filter": {
+ "include": {
+ "index": "${sourceDir}/Good-indexFile.txt"
+ }
+ }
+ },
+ {
+ "name": "showOnly",
+ "inherits": "minimal",
+ "filter": {
+ "include": {
+ "label": "echo"
+ }
+ },
+ "execution": {
+ "showOnly": "human"
+ }
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid-test-badConfigurePreset-result.txt b/Tests/RunCMake/CMakePresetsTest/Invalid-test-badConfigurePreset-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Invalid-test-badConfigurePreset-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid-test-badConfigurePreset-stderr.txt b/Tests/RunCMake/CMakePresetsTest/Invalid-test-badConfigurePreset-stderr.txt
new file mode 100644
index 0000000..9cf9987
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Invalid-test-badConfigurePreset-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: No such configure preset in [^
+]*/Tests/RunCMake/CMakePresetsTest/Invalid: "dne"
diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid-test-hidden-result.txt b/Tests/RunCMake/CMakePresetsTest/Invalid-test-hidden-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Invalid-test-hidden-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid-test-hidden-stderr.txt b/Tests/RunCMake/CMakePresetsTest/Invalid-test-hidden-stderr.txt
new file mode 100644
index 0000000..41b1b4e
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Invalid-test-hidden-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: Cannot use hidden test preset in [^
+]*/Tests/RunCMake/CMakePresetsTest/Invalid: "hidden"
diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid-test-vendorMacro-result.txt b/Tests/RunCMake/CMakePresetsTest/Invalid-test-vendorMacro-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Invalid-test-vendorMacro-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid-test-vendorMacro-stderr.txt b/Tests/RunCMake/CMakePresetsTest/Invalid-test-vendorMacro-stderr.txt
new file mode 100644
index 0000000..ed5bb98
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Invalid-test-vendorMacro-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Could not evaluate test preset "vendorMacro": Invalid macro expansion
diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid.cmake b/Tests/RunCMake/CMakePresetsTest/Invalid.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Invalid.cmake
diff --git a/Tests/RunCMake/CMakePresetsTest/Invalid.json.in b/Tests/RunCMake/CMakePresetsTest/Invalid.json.in
new file mode 100644
index 0000000..c7096f2
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/Invalid.json.in
@@ -0,0 +1,27 @@
+{
+ "version": 2,
+ "configurePresets": [
+ {
+ "name": "default",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build/${presetName}"
+ }
+ ],
+ "testPresets": [
+ {
+ "name": "hidden",
+ "hidden": true
+ },
+ {
+ "name": "vendorMacro",
+ "configurePreset": "default",
+ "environment": {
+ "TEST": "$vendor{bad.TEST}"
+ }
+ },
+ {
+ "name": "badConfigurePreset",
+ "configurePreset": "dne"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsTest/ListPresets-test-x-stdout.txt b/Tests/RunCMake/CMakePresetsTest/ListPresets-test-x-stdout.txt
new file mode 100644
index 0000000..46ffbcf
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/ListPresets-test-x-stdout.txt
@@ -0,0 +1,12 @@
+Available test presets:
+
+ "minimal"
+ "defaults"
+ "noEnvironment"
+ "withEnvironment"
+ "config-debug"
+ "config-release"
+ "exclude"
+ "index"
+ "indexFile"
+ "showOnly"
diff --git a/Tests/RunCMake/CMakePresetsTest/ListPresets.cmake b/Tests/RunCMake/CMakePresetsTest/ListPresets.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/ListPresets.cmake
diff --git a/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset-test-noConfigurePreset-result.txt b/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset-test-noConfigurePreset-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset-test-noConfigurePreset-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset-test-noConfigurePreset-stderr.txt b/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset-test-noConfigurePreset-stderr.txt
new file mode 100644
index 0000000..b167f68
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset-test-noConfigurePreset-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: Could not read presets from [^
+]*/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset: Invalid preset
diff --git a/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset.cmake b/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset.cmake
diff --git a/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset.json.in b/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset.json.in
new file mode 100644
index 0000000..4591cc8
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/NoConfigurePreset.json.in
@@ -0,0 +1,15 @@
+{
+ "version": 2,
+ "configurePresets": [
+ {
+ "name": "default",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build/${presetName}"
+ }
+ ],
+ "testPresets": [
+ {
+ "name": "noConfigurePreset"
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsTest/NoTestsAction-test-noTestsAction-result.txt b/Tests/RunCMake/CMakePresetsTest/NoTestsAction-test-noTestsAction-result.txt
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/NoTestsAction-test-noTestsAction-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/CMakePresetsTest/NoTestsAction-test-noTestsAction-stderr.txt b/Tests/RunCMake/CMakePresetsTest/NoTestsAction-test-noTestsAction-stderr.txt
new file mode 100644
index 0000000..eafba1c
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/NoTestsAction-test-noTestsAction-stderr.txt
@@ -0,0 +1 @@
+No tests were found!!!
diff --git a/Tests/RunCMake/CMakePresetsTest/NoTestsAction.cmake b/Tests/RunCMake/CMakePresetsTest/NoTestsAction.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/NoTestsAction.cmake
diff --git a/Tests/RunCMake/CMakePresetsTest/NoTestsAction.json.in b/Tests/RunCMake/CMakePresetsTest/NoTestsAction.json.in
new file mode 100644
index 0000000..20a50d6
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/NoTestsAction.json.in
@@ -0,0 +1,19 @@
+{
+ "version": 2,
+ "configurePresets": [
+ {
+ "name": "default",
+ "generator": "@RunCMake_GENERATOR@",
+ "binaryDir": "${sourceDir}/build/${presetName}"
+ }
+ ],
+ "testPresets": [
+ {
+ "name": "noTestsAction",
+ "configurePreset": "default",
+ "execution": {
+ "noTestsAction": "error"
+ }
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported-test-x-result.txt b/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported-test-x-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported-test-x-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported-test-x-stderr.txt b/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported-test-x-stderr.txt
new file mode 100644
index 0000000..eb0ec1a
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported-test-x-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: Could not read presets from [^
+]*Tests/RunCMake/CMakePresetsTest/PresetsUnsupported: File version must be 2 or higher for build and test preset support.
diff --git a/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported.json.in b/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported.json.in
new file mode 100644
index 0000000..ff1b000
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/PresetsUnsupported.json.in
@@ -0,0 +1,7 @@
+{
+ "version": 1,
+ "configurePresets": [
+ ],
+ "testPresets": [
+ ]
+}
diff --git a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake
new file mode 100644
index 0000000..4ffdfab
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake
@@ -0,0 +1,102 @@
+include(RunCMake)
+
+# Presets do not support legacy VS generator name architecture suffix.
+if(RunCMake_GENERATOR MATCHES "^(Visual Studio [0-9]+ [0-9]+) ")
+ set(RunCMake_GENERATOR "${CMAKE_MATCH_1}")
+endif()
+
+function(run_cmake_test_presets name CMakePresetsTest_CONFIGURE_PRESETS CMakePresetsTest_BUILD_PRESETS CMakePresetsTest_TEST_PRESETS)
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_TEST_SOURCE_DIR}/build")
+ set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}")
+
+ set(RunCMake_TEST_NO_CLEAN TRUE)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ set(CASE_NAME "${name}")
+ set(CASE_SOURCE_DIR "${RunCMake_SOURCE_DIR}")
+ configure_file("${RunCMake_SOURCE_DIR}/CMakeLists.txt.in" "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" @ONLY)
+
+ if(NOT CMakePresetsTest_FILE)
+ set(CMakePresetsTest_FILE "${RunCMake_SOURCE_DIR}/${name}.json.in")
+ endif()
+ if(EXISTS "${CMakePresetsTest_FILE}")
+ configure_file("${CMakePresetsTest_FILE}" "${RunCMake_TEST_SOURCE_DIR}/CMakePresets.json" @ONLY)
+ endif()
+
+ if(NOT CMakeUserPresets_FILE)
+ set(CMakeUserPresets_FILE "${RunCMake_SOURCE_DIR}/${name}User.json.in")
+ endif()
+ if(EXISTS "${CMakeUserPresets_FILE}")
+ configure_file("${CMakeUserPresets_FILE}" "${RunCMake_TEST_SOURCE_DIR}/CMakeUserPresets.json" @ONLY)
+ endif()
+
+ foreach(ASSET ${CMakePresetsTest_ASSETS})
+ configure_file("${RunCMake_SOURCE_DIR}/${ASSET}" "${RunCMake_TEST_SOURCE_DIR}" COPYONLY)
+ endforeach()
+
+ if (NOT CMakePresetsTest_NO_CONFIGURE)
+ foreach(CONFIGURE_PRESET ${CMakePresetsTest_CONFIGURE_PRESETS})
+ run_cmake_command("${name}-configure-${CONFIGURE_PRESET}"
+ "${CMAKE_COMMAND}" "--preset" "${CONFIGURE_PRESET}")
+ endforeach()
+ endif()
+
+ if (NOT CMakePresetsTest_NO_BUILD)
+ foreach(BUILD_PRESET ${CMakePresetsTest_BUILD_PRESETS})
+ run_cmake_command("${name}-build-${BUILD_PRESET}"
+ "${CMAKE_COMMAND}" "--build" "--preset" "${BUILD_PRESET}")
+ endforeach()
+ endif()
+
+ set(eq 0)
+ foreach(TEST_PRESET ${CMakePresetsTest_TEST_PRESETS})
+ if (EXISTS "${RunCMake_SOURCE_DIR}/${name}-test-${TEST_PRESET}-check.cmake")
+ set(RunCMake-check-file "${name}-test-${TEST_PRESET}-check.cmake")
+ else()
+ set(RunCMake-check-file "check.cmake")
+ endif()
+
+ if(eq)
+ run_cmake_command(${name}-test-${TEST_PRESET}
+ ${CMAKE_CTEST_COMMAND} "--preset=${TEST_PRESET}" ${ARGN})
+ set(eq 0)
+ else()
+ run_cmake_command(${name}-test-${TEST_PRESET}
+ ${CMAKE_CTEST_COMMAND} "--preset" "${TEST_PRESET}" ${ARGN})
+ set(eq 1)
+ endif()
+ endforeach()
+endfunction()
+
+set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
+set(CMakePresetsTest_NO_BUILD 1)
+
+set(CMakePresetsTest_ASSETS "Good-indexFile.txt")
+set(GoodTestPresets
+ "minimal;defaults;noEnvironment;withEnvironment"
+ "config-debug;config-release"
+ "exclude;index;indexFile;showOnly")
+run_cmake_test_presets(Good
+ "default"
+ ""
+ "${GoodTestPresets}")
+unset(CMakePresetsTest_ASSETS)
+
+set(CMakePresetsTest_NO_CONFIGURE 1)
+set(CMakePresetsTest_FILE "${RunCMake_SOURCE_DIR}/Good.json.in")
+run_cmake_test_presets(ListPresets "" "" "x" "--list-presets")
+unset(CMakePresetsTest_FILE)
+
+run_cmake_test_presets(NoConfigurePreset "" "" "noConfigurePreset")
+run_cmake_test_presets(NoTestsAction "default" "" "noTestsAction")
+run_cmake_test_presets(Invalid "" "" "hidden;vendorMacro;badConfigurePreset")
+
+set(CMakePresets_SCHEMA_EXPECTED_RESULT 1)
+run_cmake_test_presets(PresetsUnsupported "" "" "x")
+set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
+set(CMakePresetsTest_NO_CONFIGURE 0)
+
+set(CMakePresetsTest_NO_BUILD 0)
diff --git a/Tests/RunCMake/CMakePresetsTest/check.cmake b/Tests/RunCMake/CMakePresetsTest/check.cmake
new file mode 100644
index 0000000..e79c4f1
--- /dev/null
+++ b/Tests/RunCMake/CMakePresetsTest/check.cmake
@@ -0,0 +1,3 @@
+set(CMakePresets_VALIDATE_SCRIPT_PATH "${RunCMake_SOURCE_DIR}/../CMakePresets/validate_schema.py")
+include("${RunCMake_SOURCE_DIR}/../CMakePresets/validate_schema.cmake")
+include("${RunCMake_SOURCE_DIR}/../CMakePresets/check.cmake")
diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
index 24f54c6..3ec4c69 100644
--- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake
+++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
@@ -21,6 +21,12 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
# TODO this should be executed only once per ctest run (not per generator)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ # Set permissions to those expected by the test
+ file(CHMOD "${RunCMake_TEST_BINARY_DIR}"
+ PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ WORLD_EXECUTE)
if(EXISTS "${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-Prerequirements.cmake")
include("${RunCMake_SOURCE_DIR}/tests/${TEST_NAME}/${GENERATOR_TYPE}-Prerequirements.cmake")
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 530bcdf..15bfb60 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -21,8 +21,8 @@ run_cpack_test(LONG_FILENAMES "DEB.LONG_FILENAMES" false "MONOLITHIC")
run_cpack_test_subtests(MAIN_COMPONENT "invalid;found" "RPM.MAIN_COMPONENT" false "COMPONENT")
run_cpack_test(MINIMAL "RPM.MINIMAL;DEB.MINIMAL;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT")
run_cpack_test_package_target(MINIMAL "RPM.MINIMAL;DEB.MINIMAL;7Z;TBZ2;TGZ;TXZ;TZ;ZIP;STGZ;External" false "MONOLITHIC;COMPONENT")
-run_cpack_test_package_target(THREADED_ALL "TXZ" false "MONOLITHIC;COMPONENT")
-run_cpack_test_package_target(THREADED "TXZ" false "MONOLITHIC;COMPONENT")
+run_cpack_test_package_target(THREADED_ALL "TXZ;DEB" false "MONOLITHIC;COMPONENT")
+run_cpack_test_package_target(THREADED "TXZ;DEB" false "MONOLITHIC;COMPONENT")
run_cpack_test_subtests(PACKAGE_CHECKSUM "invalid;MD5;SHA1;SHA224;SHA256;SHA384;SHA512" "TGZ" false "MONOLITHIC")
run_cpack_test(PARTIALLY_RELOCATABLE_WARNING "RPM.PARTIALLY_RELOCATABLE_WARNING" false "COMPONENT")
run_cpack_test(PER_COMPONENT_FIELDS "RPM.PER_COMPONENT_FIELDS;DEB.PER_COMPONENT_FIELDS" false "COMPONENT")
diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake
index 345b37f..0ab545a 100644
--- a/Tests/RunCMake/CPack/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/VerifyResult.cmake
@@ -79,6 +79,11 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0)
"which does not match:${msg_expected}\n"
"${output_error_message}")
endif()
+ elseif(foundFilescount_ EQUAL 0)
+ message(FATAL_ERROR
+ "Found no files for file No. '${file_no_}'!"
+ " Globbing expression: '${EXPECTED_FILE_${file_no_}}'"
+ "${output_error_message}")
else()
message(FATAL_ERROR
"Found more than one file for file No. '${file_no_}'!"
diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake
index cf2e8ac..cf4aa51 100644
--- a/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/ExpectedFiles.cmake
@@ -1,6 +1,6 @@
set(whitespaces_ "[\t\n\r ]*")
-set(EXPECTED_FILES_COUNT "5")
+set(EXPECTED_FILES_COUNT "6")
set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE)
if(GENERATOR_TYPE STREQUAL "RPM")
@@ -39,3 +39,6 @@ elseif(GENERATOR_TYPE STREQUAL "DEB")
set(EXPECTED_FILE_5 "TestDinfo-pkg-libs-dbgsym.ddeb")
set(EXPECTED_FILE_CONTENT_5 ".*/usr/lib/debug/.build-id/.*\.debug.*")
endif()
+
+set(EXPECTED_FILE_6 "TestDinfo-pkg*-appheaders.${PKG}")
+set(EXPECTED_FILE_CONTENT_6_LIST "/include;/include/test_lib.hpp")
diff --git a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake
index 161a36a..9ff1f8a 100644
--- a/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake
+++ b/Tests/RunCMake/CPack/tests/DEBUGINFO/test.cmake
@@ -1,7 +1,7 @@
set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
-# PGI compiler doesn't add build id to binaries by default
-if(CMAKE_CXX_COMPILER_ID STREQUAL "PGI")
+# Some compilers do not add build id to binaries by default.
+if(CMAKE_CXX_COMPILER_ID MATCHES "^(IntelLLVM|PGI|NVHPC)$")
string(APPEND CMAKE_EXE_LINKER_FLAGS "-Wl,--build-id")
string(APPEND CMAKE_SHARED_LINKER_FLAGS "-Wl,--build-id")
endif()
@@ -23,6 +23,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
add_executable(test_prog "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
target_link_libraries(test_prog test_lib)
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/test_lib.hpp" DESTINATION include COMPONENT appheaders)
install(TARGETS test_prog DESTINATION foo COMPONENT applications)
install(FILES CMakeLists.txt DESTINATION bar COMPONENT headers)
install(TARGETS test_lib DESTINATION bas COMPONENT libs)
@@ -40,6 +41,10 @@ set(CPACK_RPM_LIBS_DEBUGINFO_PACKAGE ON)
set(CPACK_DEBIAN_PACKAGE_NAME "Debuginfo")
set(CPACK_DEBIAN_LIBS_DEBUGINFO_PACKAGE ON)
+# Test that a component with debug info requested but without any debug info produces none
+set(CPACK_RPM_APPHEADERS_DEBUGINFO_PACKAGE ON)
+set(CPACK_DEBIAN_APPHEADERS_DEBUGINFO_PACKAGE ON)
+
# test debuginfo package rename
set(CPACK_RPM_DEBUGINFO_FILE_NAME
"@cpack_component@-DebugInfoPackage.rpm")
diff --git a/Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt b/Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt
new file mode 100644
index 0000000..37360e8
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/EXTRA/DEB-stderr.txt
@@ -0,0 +1,6 @@
+CPack Warning: Adding file to tar:
+#top level directory: .*/Tests/RunCMake/DEB.EXTRA/CPack/EXTRA-build/_CPack_Packages/Linux/DEB/extra-0.1.1-Linux/bas
+#missing file: .*/Tests/RunCMake/DEB.EXTRA/CPack/EXTRA-build/conffiles
+CPack Warning: Adding file to tar:
+#top level directory: .*/Tests/RunCMake/DEB.EXTRA/CPack/EXTRA-build/_CPack_Packages/Linux/DEB/extra-0.1.1-Linux/foo
+#missing file: .*/Tests/RunCMake/DEB.EXTRA/CPack/EXTRA-build/conffiles
diff --git a/Tests/RunCMake/CPack/tests/THREADED/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/THREADED/DEB-Prerequirements.cmake
new file mode 100644
index 0000000..7b2692c
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/THREADED/DEB-Prerequirements.cmake
@@ -0,0 +1 @@
+set(CPACK_DEBIAN_COMPRESSION_TYPE xz)
diff --git a/Tests/RunCMake/CPack/tests/THREADED/test.cmake b/Tests/RunCMake/CPack/tests/THREADED/test.cmake
index 78fc9e9..9e82e8c 100644
--- a/Tests/RunCMake/CPack/tests/THREADED/test.cmake
+++ b/Tests/RunCMake/CPack/tests/THREADED/test.cmake
@@ -1,6 +1,6 @@
install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
-set(CPACK_ARCHIVE_THREADS 2)
+set(CPACK_THREADS 2)
if(PACKAGING_TYPE STREQUAL "COMPONENT")
set(CPACK_COMPONENTS_ALL test)
diff --git a/Tests/RunCMake/CPack/tests/THREADED_ALL/DEB-Prerequirements.cmake b/Tests/RunCMake/CPack/tests/THREADED_ALL/DEB-Prerequirements.cmake
new file mode 100644
index 0000000..7b2692c
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/THREADED_ALL/DEB-Prerequirements.cmake
@@ -0,0 +1 @@
+set(CPACK_DEBIAN_COMPRESSION_TYPE xz)
diff --git a/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake b/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake
index 34051b8..6f37201 100644
--- a/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake
+++ b/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake
@@ -1,6 +1,6 @@
install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
-set(CPACK_ARCHIVE_THREADS 0)
+set(CPACK_THREADS 0)
if(PACKAGING_TYPE STREQUAL "COMPONENT")
set(CPACK_COMPONENTS_ALL test)
diff --git a/Tests/RunCMake/CTest/RunCMakeTest.cmake b/Tests/RunCMake/CTest/RunCMakeTest.cmake
index ffc8f78..b81f319 100644
--- a/Tests/RunCMake/CTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTest/RunCMakeTest.cmake
@@ -5,6 +5,7 @@ run_cmake(BeforeProject)
unset(RunCMake_TEST_OPTIONS)
run_cmake(NotOn)
+run_cmake(Site)
function(run_CMakeCTestArguments)
run_cmake_with_options(CMakeCTestArguments "-DCMAKE_CTEST_ARGUMENTS=--quiet\\;--output-log\\;output-log.txt")
diff --git a/Tests/RunCMake/CTest/Site.cmake b/Tests/RunCMake/CTest/Site.cmake
new file mode 100644
index 0000000..2c96f23
--- /dev/null
+++ b/Tests/RunCMake/CTest/Site.cmake
@@ -0,0 +1,5 @@
+include(CTest)
+get_property(site CACHE SITE PROPERTY VALUE)
+if(NOT "${site}" STREQUAL "${SITE}")
+ message(FATAL_ERROR "SITE is not a cache entry")
+endif()
diff --git a/Tests/RunCMake/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/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index e05ad79..6cf1476 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -380,3 +380,20 @@ run_MemCheckSan(Leak "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode
run_MemCheckSan(Memory "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode=55")
run_MemCheckSan(Thread "report_bugs=1:history_size=5:exitcode=55")
run_MemCheckSan(UndefinedBehavior "simulate_sanitizer=1")
+
+run_cmake_command(test-dir-invalid-arg ${CMAKE_CTEST_COMMAND} --test-dir)
+run_cmake_command(test-dir-non-existing-dir ${CMAKE_CTEST_COMMAND} --test-dir non-existing-dir)
+
+function(run_testDir)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/testDir)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/sub")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/sub/CTestTestfile.cmake" "
+ add_test(Test1 \"${CMAKE_COMMAND}\" -E true)
+ add_test(Test2 \"${CMAKE_COMMAND}\" -E true)
+ ")
+ run_cmake_command(testDir ${CMAKE_CTEST_COMMAND} --test-dir "${RunCMake_TEST_BINARY_DIR}/sub")
+endfunction()
+run_testDir()
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/CTestCommandLine/test-dir-invalid-arg-result.txt b/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-stderr.txt b/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-stderr.txt
new file mode 100644
index 0000000..15908a7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test-dir-invalid-arg-stderr.txt
@@ -0,0 +1 @@
+CMake Error: '--test-dir' requires an argument
diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-result.txt b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stderr.txt b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stderr.txt
new file mode 100644
index 0000000..017ccb0
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stderr.txt
@@ -0,0 +1 @@
+Failed to change working directory to ".*/non-existing-dir" : No such file or directory
diff --git a/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stdout.txt b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stdout.txt
new file mode 100644
index 0000000..ddcd238
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test-dir-non-existing-dir-stdout.txt
@@ -0,0 +1 @@
+Internal ctest changing into directory: .*/non-existing-dir
diff --git a/Tests/RunCMake/CheckModules/CMP0075-stderr.txt b/Tests/RunCMake/CheckModules/CMP0075-stderr.txt
index 960fe94..97833f5 100644
--- a/Tests/RunCMake/CheckModules/CMP0075-stderr.txt
+++ b/Tests/RunCMake/CheckModules/CMP0075-stderr.txt
@@ -47,4 +47,15 @@ CMake Warning \(dev\) at [^
Call Stack \(most recent call first\):
CMP0075.cmake:41 \(check_include_files\)
CMakeLists.txt:[0-9]+ \(include\)
-This warning is for project developers. Use -Wno-dev to suppress it.$
+This warning is for project developers. Use -Wno-dev to suppress it.
++
+CMake Deprecation Warning at CMP0075.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0075 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ClangTidy/OBJC-Build-stdout.txt b/Tests/RunCMake/ClangTidy/OBJC-Build-stdout.txt
new file mode 100644
index 0000000..571ec02
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/OBJC-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[/\]RunCMake[/\]ClangTidy[/\]main\.m:0:0: warning: message \[checker\]
diff --git a/Tests/RunCMake/ClangTidy/OBJC-launch-Build-stdout.txt b/Tests/RunCMake/ClangTidy/OBJC-launch-Build-stdout.txt
new file mode 100644
index 0000000..571ec02
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/OBJC-launch-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[/\]RunCMake[/\]ClangTidy[/\]main\.m:0:0: warning: message \[checker\]
diff --git a/Tests/RunCMake/ClangTidy/OBJC-launch.cmake b/Tests/RunCMake/ClangTidy/OBJC-launch.cmake
new file mode 100644
index 0000000..43e8521
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/OBJC-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJC.cmake)
diff --git a/Tests/RunCMake/ClangTidy/OBJC.cmake b/Tests/RunCMake/ClangTidy/OBJC.cmake
new file mode 100644
index 0000000..43eae30
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/OBJC.cmake
@@ -0,0 +1,3 @@
+enable_language(OBJC)
+set(CMAKE_OBJC_CLANG_TIDY "${PSEUDO_TIDY}" -some -args)
+add_executable(main main.m)
diff --git a/Tests/RunCMake/ClangTidy/OBJCXX-Build-stdout.txt b/Tests/RunCMake/ClangTidy/OBJCXX-Build-stdout.txt
new file mode 100644
index 0000000..cbc7629
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/OBJCXX-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[/\]RunCMake[/\]ClangTidy[/\]main\.mm:0:0: warning: message \[checker\]
diff --git a/Tests/RunCMake/ClangTidy/OBJCXX-launch-Build-stdout.txt b/Tests/RunCMake/ClangTidy/OBJCXX-launch-Build-stdout.txt
new file mode 100644
index 0000000..cbc7629
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/OBJCXX-launch-Build-stdout.txt
@@ -0,0 +1 @@
+Tests[/\]RunCMake[/\]ClangTidy[/\]main\.mm:0:0: warning: message \[checker\]
diff --git a/Tests/RunCMake/ClangTidy/OBJCXX-launch.cmake b/Tests/RunCMake/ClangTidy/OBJCXX-launch.cmake
new file mode 100644
index 0000000..5a54bff
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/OBJCXX-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJCXX.cmake)
diff --git a/Tests/RunCMake/ClangTidy/OBJCXX.cmake b/Tests/RunCMake/ClangTidy/OBJCXX.cmake
new file mode 100644
index 0000000..ccc5c2c
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/OBJCXX.cmake
@@ -0,0 +1,3 @@
+enable_language(OBJCXX)
+set(CMAKE_OBJCXX_CLANG_TIDY "${PSEUDO_TIDY}" -some -args)
+add_executable(main main.mm)
diff --git a/Tests/RunCMake/ClangTidy/RunCMakeTest.cmake b/Tests/RunCMake/ClangTidy/RunCMakeTest.cmake
index 2f41e50..ee41d94 100644
--- a/Tests/RunCMake/ClangTidy/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ClangTidy/RunCMakeTest.cmake
@@ -16,8 +16,16 @@ endfunction()
run_tidy(C)
run_tidy(CXX)
+if (APPLE)
+ run_tidy(OBJC)
+ run_tidy(OBJCXX)
+endif()
if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
run_tidy(C-launch)
run_tidy(CXX-launch)
+ if (APPLE)
+ run_tidy(OBJC-launch)
+ run_tidy(OBJCXX-launch)
+ endif()
endif()
run_tidy(C-bad)
diff --git a/Tests/RunCMake/ClangTidy/main.m b/Tests/RunCMake/ClangTidy/main.m
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/RunCMake/ClangTidy/main.m
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/Server/buildsystem1/main.cpp b/Tests/RunCMake/ClangTidy/main.mm
index 766b775..f8b643a 100644
--- a/Tests/Server/buildsystem1/main.cpp
+++ b/Tests/RunCMake/ClangTidy/main.mm
@@ -1,4 +1,3 @@
-
int main()
{
return 0;
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt
index e73d760..16f8be8 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-bad-number-stderr.txt
@@ -1,3 +1,3 @@
^'--parallel' invalid number '12ab' given\.
+
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt
index 94fc157..e7b9aaa 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-large-stderr.txt
@@ -1,3 +1,3 @@
^The <jobs> value is too large\.
+
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt
index e73d760..16f8be8 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-no-space-bad-number-stderr.txt
@@ -1,3 +1,3 @@
^'--parallel' invalid number '12ab' given\.
+
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt
index 8ed4fee..d1241f4 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build--parallel-zero-stderr.txt
@@ -1,3 +1,3 @@
^The <jobs> value requires a positive integer argument\.
+
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt
index c810087..d52b165 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-bad-number-stderr.txt
@@ -1,3 +1,3 @@
^'-j' invalid number '12ab' given\.
+
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt
index 94fc157..e7b9aaa 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-large-stderr.txt
@@ -1,3 +1,3 @@
^The <jobs> value is too large\.
+
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt
index c810087..d52b165 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-no-space-bad-number-stderr.txt
@@ -1,3 +1,3 @@
^'-j' invalid number '12ab' given\.
+
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt
index 8ed4fee..d1241f4 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-jobs-zero-stderr.txt
@@ -1,3 +1,3 @@
^The <jobs> value requires a positive integer argument\.
+
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt
index 40d9bec..2dd9bc4 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-first-stderr.txt
@@ -1,2 +1,2 @@
^Error: Building 'clean' and other targets together is not supported\.
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt
index 40d9bec..2dd9bc4 100644
--- a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-with-clean-second-stderr.txt
@@ -1,2 +1,2 @@
^Error: Building 'clean' and other targets together is not supported\.
-Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt
index 0570d8f..5992dcd 100644
--- a/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt
+++ b/Tests/RunCMake/CommandLine/C-no-arg-stderr.txt
@@ -1,2 +1,2 @@
^CMake Error: -C must be followed by a file name.
-CMake Error: Problem processing arguments. Aborting.$
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt
index 5e43bca..8503767 100644
--- a/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt
+++ b/Tests/RunCMake/CommandLine/D-no-arg-stderr.txt
@@ -1,2 +1,2 @@
^CMake Error: -D must be followed with VAR=VALUE.
-CMake Error: Problem processing arguments. Aborting.$
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
index e24e131..c76c92d 100644
--- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
+++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
@@ -1 +1 @@
-^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":2}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":true,"version":{.*}}$
+^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":2}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"version":{.*}}$
diff --git a/Tests/RunCMake/CommandLine/E_server-arg-stderr.txt b/Tests/RunCMake/CommandLine/E_server-arg-stderr.txt
deleted file mode 100644
index 4dcbab9..0000000
--- a/Tests/RunCMake/CommandLine/E_server-arg-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^CMake Error: Unknown argument for server mode$
diff --git a/Tests/RunCMake/CommandLine/E_server-pipe-stderr.txt b/Tests/RunCMake/CommandLine/E_server-pipe-stderr.txt
deleted file mode 100644
index 7193ba6..0000000
--- a/Tests/RunCMake/CommandLine/E_server-pipe-stderr.txt
+++ /dev/null
@@ -1 +0,0 @@
-^CMake Error: No pipe given after --pipe=$
diff --git a/Tests/RunCMake/CommandLine/E_server-result.txt b/Tests/RunCMake/CommandLine/E_server-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_server-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_server-stderr.txt b/Tests/RunCMake/CommandLine/E_server-stderr.txt
new file mode 100644
index 0000000..0cd0e56
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_server-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: CMake server mode has been removed in favor of the file-api\.$
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 b23c8c2..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)
@@ -25,8 +27,7 @@ run_cmake_command(E_compare_files-ignore-eol-nonexistent ${CMAKE_COMMAND} -E com
run_cmake_command(E_compare_files-invalid-arguments ${CMAKE_COMMAND} -E compare_files file1.txt file2.txt file3.txt)
run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append)
run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename)
-run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg)
-run_cmake_command(E_server-pipe ${CMAKE_COMMAND} -E server --pipe=)
+run_cmake_command(E_server ${CMAKE_COMMAND} -E server)
run_cmake_command(E_true ${CMAKE_COMMAND} -E true)
run_cmake_command(E_true-extraargs ${CMAKE_COMMAND} -E true ignored)
run_cmake_command(E_false ${CMAKE_COMMAND} -E false)
@@ -202,8 +203,8 @@ function(run_BuildDir)
run_cmake_command(BuildDir--build--parallel-large ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build --parallel 4294967293)
- # No default jobs for Xcode and FreeBSD build command
- if(NOT RunCMake_GENERATOR MATCHES "Xcode" AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ # No default jobs for FreeBSD build command
+ if(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
run_cmake_command(BuildDir--build-jobs-no-number ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build -j)
run_cmake_command(BuildDir--build-jobs-no-number-trailing--target ${CMAKE_COMMAND} -E chdir ..
@@ -672,6 +673,10 @@ set(RunCMake_TEST_OPTIONS -Wno-error=deprecated)
run_cmake(Wno-error_deprecated)
unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS -Werror=deprecated -Wno-error=deprecated)
+run_cmake(Wno-error_deprecated)
+unset(RunCMake_TEST_OPTIONS)
+
# Dev warnings should be on by default
run_cmake(Wdev)
@@ -790,7 +795,7 @@ function(run_llvm_rc)
"test.tmp was not deleted")
endif()
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir")
- run_cmake_command(llvm_rc_full_run ${CMAKE_COMMAND} -E cmake_llvm_rc ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/source_file test.tmp ${CMAKE_COMMAND} -E echo "This is a test" ++ ${CMAKE_COMMAND} -E copy test.tmp SOURCE_DIR/llvmrc.result )
+ run_cmake_command(llvm_rc_full_run ${CMAKE_COMMAND} -E cmake_llvm_rc ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/source_file test.tmp ${CMAKE_COMMAND} -E echo "This is a test" ++ ${LLVM_RC} -bad /FO SOURCE_DIR/llvmrc.result test.tmp )
if(EXISTS ${RunCMake_TEST_BINARY_DIR}/ExpandSourceDir/test.tmp)
message(SEND_ERROR "${test} - FAILED:\n"
"test.tmp was not deleted")
diff --git a/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt b/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt
index c34ef94..20715cf 100644
--- a/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt
+++ b/Tests/RunCMake/CommandLine/U-no-arg-stderr.txt
@@ -1,2 +1,2 @@
^CMake Error: -U must be followed with VAR.
-CMake Error: Problem processing arguments. Aborting.$
+CMake Error: Run 'cmake --help' for all supported options.$
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
index 0c0f613..139511b 100644
--- a/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
+++ b/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt
@@ -1,2 +1,2 @@
CMake Error: -W must be followed with \[no-\]<name>.
-CMake Error: Problem processing arguments. Aborting.
+CMake Error: Run 'cmake --help' for all supported options.
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
index cc643df..5d416fc 100644
--- a/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
+++ b/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt
@@ -1,2 +1,2 @@
CMake Error: No warning name provided.
-CMake Error: Problem processing arguments. Aborting.
+CMake Error: Run 'cmake --help' for all supported options.
diff --git a/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
index cc643df..5d416fc 100644
--- a/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
+++ b/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt
@@ -1,2 +1,2 @@
CMake Error: No warning name provided.
-CMake Error: Problem processing arguments. Aborting.
+CMake Error: Run 'cmake --help' for all supported options.
diff --git a/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt b/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt
index 8d518f6..9b4d26b 100644
--- a/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt
+++ b/Tests/RunCMake/CommandLine/build-no-dir-stderr.txt
@@ -1 +1 @@
-^Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
+^Usage: cmake --build \[<dir> \| --preset <preset>\] \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/cmake_depends-check.cmake b/Tests/RunCMake/CommandLine/cmake_depends-check.cmake
index 031478b..e0e3054 100644
--- a/Tests/RunCMake/CommandLine/cmake_depends-check.cmake
+++ b/Tests/RunCMake/CommandLine/cmake_depends-check.cmake
@@ -3,8 +3,9 @@ if(EXISTS "${depend_make}")
file(READ "${depend_make}" depend_make_content)
string(REGEX REPLACE "\n+$" "" depend_make_content "${depend_make_content}")
if(NOT depend_make_content MATCHES "
-CMakeFiles/DepTarget.dir/test.c.o: .*/Tests/RunCMake/CommandLine/cmake_depends/test.c
-CMakeFiles/DepTarget.dir/test.c.o: .*/Tests/RunCMake/CommandLine/cmake_depends/test.h$")
+CMakeFiles/DepTarget.dir/test.c.o: \\\\
+ .*/Tests/RunCMake/CommandLine/cmake_depends/test.c \\\\
+ .*/Tests/RunCMake/CommandLine/cmake_depends/test.h$")
string(REPLACE "\n" "\n " depend_make_content " ${depend_make_content}")
set(RunCMake_TEST_FAILED "depend.make does not have expected content:\n${depend_make_content}")
endif()
diff --git a/Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake b/Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake
index cb0d541..891e138 100644
--- a/Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake
+++ b/Tests/RunCMake/DependencyGraph/RunCMakeTest.cmake
@@ -10,7 +10,8 @@ function(check_files dir)
set(actual)
foreach(i IN LISTS glob)
if(NOT i MATCHES "(\\.manifest$)|(\\.exp$)|(\\.tds$)")
- list(APPEND actual ${i})
+ get_filename_component(real_path ${i} REALPATH)
+ list(APPEND actual ${real_path})
endif()
endforeach()
list(REMOVE_DUPLICATES actual)
diff --git a/Tests/RunCMake/ExportCompileCommands/Properties.cmake b/Tests/RunCMake/ExportCompileCommands/Properties.cmake
new file mode 100644
index 0000000..c7a38b7
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/Properties.cmake
@@ -0,0 +1,22 @@
+enable_language(C)
+
+add_library(Unset STATIC empty.c)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+add_library(SetOn STATIC empty.c)
+set(CMAKE_EXPORT_COMPILE_COMMANDS OFF)
+add_library(SetOff STATIC empty.c)
+
+get_property(_set TARGET Unset PROPERTY EXPORT_COMPILE_COMMANDS)
+if(_set)
+ message(SEND_ERROR "EXPORT_COMPILE_COMMANDS property should be unset for Unset target (got \"${_set}\")")
+endif()
+
+get_property(_on TARGET SetOn PROPERTY EXPORT_COMPILE_COMMANDS)
+if(NOT _on STREQUAL "ON")
+ message(SEND_ERROR "EXPORT_COMPILE_COMMANDS property should be \"ON\" for SetOn target (got \"${_on}\")")
+endif()
+
+get_property(_off TARGET SetOff PROPERTY EXPORT_COMPILE_COMMANDS)
+if(NOT _off STREQUAL "OFF")
+ message(SEND_ERROR "EXPORT_COMPILE_COMMANDS property should be \"OFF\" for SetOff target (got \"${_off}\")")
+endif()
diff --git a/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand-check.cmake b/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand-check.cmake
new file mode 100644
index 0000000..d698742
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand-check.cmake
@@ -0,0 +1,32 @@
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+ set(RunCMake_TEST_FAILED "compile_commands.json not generated")
+ return()
+endif()
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/compile_commands.json" compile_commands)
+
+macro(check_error)
+ if(error)
+ message(SEND_ERROR "Unexpected error \"${error}\"\nFor: ${compile_commands}")
+ endif()
+endmacro()
+
+string(JSON num_commands ERROR_VARIABLE error LENGTH "${compile_commands}")
+check_error()
+
+# Only one of the targets has the EXPORT_COMPILE_COMMANDS property enabled.
+if(NOT num_commands STREQUAL 1)
+ message(SEND_ERROR "Expected 1 compile command, got ${num_commands} for ${compile_commands}")
+endif()
+
+# Get the compile command generated.
+string(JSON result ERROR_VARIABLE error GET "${compile_commands}" 0)
+check_error()
+string(JSON result ERROR_VARIABLE error GET "${result}" file)
+check_error()
+
+# And ensure the correct target is in that compile command.
+cmake_path(COMPARE "${result}" EQUAL "${RunCMake_TEST_SOURCE_DIR}/expected_file.c" good)
+if(NOT good)
+ message(SEND_ERROR "Expected \"${result}\" in \"${RunCMake_TEST_SOURCE_DIR}/expected_file.c\"")
+endif()
diff --git a/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake b/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake
new file mode 100644
index 0000000..46c8845
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/PropertiesGenerateCommand.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+
+add_library(Unset STATIC empty.c)
+add_library(ToBeSet STATIC expected_file.c)
+
+# Only one target with EXPORT_COMPILE_COMMANDS property.
+set_property(TARGET ToBeSet PROPERTY EXPORT_COMPILE_COMMANDS TRUE)
diff --git a/Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake b/Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake
index 9e7e732..b691637 100644
--- a/Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake
@@ -1,4 +1,12 @@
include(RunCMake)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug)
+else()
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+endif()
+
run_cmake_with_options(BeforeProject -DCMAKE_PROJECT_INCLUDE_BEFORE=BeforeProjectBEFORE.cmake)
run_cmake(CustomCompileRule)
+run_cmake(Properties)
+run_cmake(PropertiesGenerateCommand)
diff --git a/Tests/RunCMake/ExportCompileCommands/expected_file.c b/Tests/RunCMake/ExportCompileCommands/expected_file.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/expected_file.c
diff --git a/Tests/RunCMake/ExternalData/BadArguments-stderr.txt b/Tests/RunCMake/ExternalData/BadArguments-stderr.txt
new file mode 100644
index 0000000..44efe7e
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadArguments-stderr.txt
@@ -0,0 +1,7 @@
+CMake Warning \(dev\) at .*/Modules/ExternalData.cmake:[0-9]+ \(message\):
+ Ignoring unrecognized arguments passed to ExternalData_add_target:
+ `UNKNOWN_ARGUMENT`
+Call Stack \(most recent call first\):
+ BadArguments.cmake:[0-9]+ \(ExternalData_Add_Target\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/ExternalData/BadArguments.cmake b/Tests/RunCMake/ExternalData/BadArguments.cmake
new file mode 100644
index 0000000..dad0007
--- /dev/null
+++ b/Tests/RunCMake/ExternalData/BadArguments.cmake
@@ -0,0 +1,5 @@
+include(ExternalData)
+set(ExternalData_URL_TEMPLATES
+ "file:///path/to/%(algo)/%(hash)"
+ )
+ExternalData_Add_Target(Data UNKNOWN_ARGUMENT)
diff --git a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
index b5ab22d..b4cc95e 100644
--- a/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalData/RunCMakeTest.cmake
@@ -2,6 +2,7 @@ include(RunCMake)
run_cmake(BadAlgoMap1)
run_cmake(BadAlgoMap2)
+run_cmake(BadArguments)
run_cmake(BadCustom1)
run_cmake(BadCustom2)
run_cmake(BadCustom3)
diff --git a/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD-rebuild-check.cmake b/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD-rebuild-check.cmake
new file mode 100644
index 0000000..887da0f
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD-rebuild-check.cmake
@@ -0,0 +1,19 @@
+file(TIMESTAMP "${STAMP_DIR}/proj1-configure" PROJ1_CONFIGURE_TIMESTAMP_AFTER "%s")
+# When BUILD_ALWAYS is set, the build stamp is never created.
+file(TIMESTAMP "${STAMP_DIR}/proj2-configure" PROJ2_CONFIGURE_TIMESTAMP_AFTER "%s")
+file(TIMESTAMP "${STAMP_DIR}/proj2-build" PROJ2_BUILD_TIMESTAMP_AFTER "%s")
+
+if(NOT PROJ1_CONFIGURE_TIMESTAMP_BEFORE EQUAL PROJ1_CONFIGURE_TIMESTAMP_AFTER)
+ set(RunCMake_TEST_FAILED "Unexpected rebuild of proj1 configure step (${PROJ1_CONFIGURE_TIMESTAMP_BEFORE} != ${PROJ1_CONFIGURE_TIMESTAMP_AFTER})")
+ return()
+endif()
+
+if(NOT PROJ2_CONFIGURE_TIMESTAMP_BEFORE EQUAL PROJ2_CONFIGURE_TIMESTAMP_AFTER)
+ set(RunCMake_TEST_FAILED "Unexpected rebuild of proj2 configure step (${PROJ2_CONFIGURE_TIMESTAMP_BEFORE} != ${PROJ2_CONFIGURE_TIMESTAMP_AFTER})")
+ return()
+endif()
+
+if(PROJ2_BUILD_TIMESTAMP_BEFORE EQUAL PROJ2_BUILD_TIMESTAMP_AFTER)
+ set(RunCMake_TEST_FAILED "proj2 build step did not rebuild (${PROJ2_BUILD_TIMESTAMP_BEFORE} != ${PROJ2_BUILD_TIMESTAMP_AFTER})")
+ return()
+endif()
diff --git a/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake b/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake
new file mode 100644
index 0000000..6dbf0f4
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/CONFIGURE_HANDLED_BY_BUILD.cmake
@@ -0,0 +1,28 @@
+include(ExternalProject)
+
+# Given this setup, on the first build, both configure steps and both build
+# steps will run. On a noop rebuild, only the build steps will run. Without
+# CONFIGURE_HANDLED_BY_BUILD, the configure step of proj2 would also run on a
+# noop rebuild.
+
+ExternalProject_Add(proj1
+ DOWNLOAD_COMMAND ""
+ SOURCE_DIR ""
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "Doing something"
+ # file(TIMESTAMP) gives back the timestamp in seconds so we sleep a second to
+ # make sure we get a different timestamp on the stamp file
+ BUILD_COMMAND ${CMAKE_COMMAND} -E sleep 1.125
+ INSTALL_COMMAND ""
+ BUILD_ALWAYS ON
+ STAMP_DIR "stamp"
+)
+ExternalProject_Add(proj2
+ DOWNLOAD_COMMAND ""
+ SOURCE_DIR ""
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E echo "Doing something"
+ BUILD_COMMAND ${CMAKE_COMMAND} -E sleep 1.125
+ INSTALL_COMMAND ""
+ CONFIGURE_HANDLED_BY_BUILD ON
+ DEPENDS proj1
+ STAMP_DIR "stamp"
+)
diff --git a/Tests/RunCMake/ExternalProject/FetchGitTags.cmake b/Tests/RunCMake/ExternalProject/FetchGitTags.cmake
new file mode 100644
index 0000000..37d1b40
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/FetchGitTags.cmake
@@ -0,0 +1,67 @@
+find_package(Git QUIET REQUIRED)
+
+include(ExternalProject)
+
+set(srcRepo ${CMAKE_CURRENT_BINARY_DIR}/srcRepo)
+set(srcDir ${CMAKE_CURRENT_BINARY_DIR}/src)
+set(binDir ${CMAKE_CURRENT_BINARY_DIR}/build)
+file(MAKE_DIRECTORY ${srcRepo})
+file(MAKE_DIRECTORY ${srcDir})
+
+file(GLOB entries ${srcRepo}/*)
+file(REMOVE_RECURSE ${entries} ${binDir})
+file(TOUCH ${srcRepo}/firstFile.txt)
+configure_file(${CMAKE_CURRENT_LIST_DIR}/FetchGitTags/CMakeLists.txt
+ ${srcDir}/CMakeLists.txt COPYONLY)
+
+function(execGitCommand)
+ execute_process(
+ WORKING_DIRECTORY ${srcRepo}
+ COMMAND ${GIT_EXECUTABLE} ${ARGN}
+ COMMAND_ECHO STDOUT
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+endfunction()
+
+function(configureAndBuild tag)
+ execute_process(COMMAND ${CMAKE_COMMAND}
+ -G ${CMAKE_GENERATOR} -T "${CMAKE_GENERATOR_TOOLSET}"
+ -A "${CMAKE_GENERATOR_PLATFORM}"
+ -D repoDir:PATH=${srcRepo}
+ -D gitTag:STRING=${tag}
+ -B ${binDir}
+ -S ${srcDir}
+ COMMAND_ECHO STDOUT
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+
+ execute_process(COMMAND ${CMAKE_COMMAND} --build ${binDir} --target fetcher
+ WORKING_DIRECTORY ${binDir}
+ COMMAND_ECHO STDOUT
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+endfunction()
+
+# Setup a fresh source repo with a predictable default branch across all
+# git versions
+execGitCommand(-c init.defaultBranch=master init)
+execGitCommand(config --add user.email "testauthor@cmake.org")
+execGitCommand(config --add user.name testauthor)
+
+# Create the initial repo structure
+execGitCommand(add firstFile.txt)
+execGitCommand(commit -m "First file")
+
+message(STATUS "First configure-and-build")
+configureAndBuild(master)
+
+# Create a tagged commit that is not on any branch. With git 2.20 or later,
+# this commit won't be fetched without the --tags option.
+file(TOUCH ${srcRepo}/secondFile.txt)
+execGitCommand(add secondFile.txt)
+execGitCommand(commit -m "Second file")
+execGitCommand(tag -a -m "Adding tag" tag_of_interest)
+execGitCommand(reset --hard HEAD~1)
+
+message(STATUS "Second configure-and-build")
+configureAndBuild(tag_of_interest)
diff --git a/Tests/RunCMake/ExternalProject/FetchGitTags/CMakeLists.txt b/Tests/RunCMake/ExternalProject/FetchGitTags/CMakeLists.txt
new file mode 100644
index 0000000..d9a380c
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/FetchGitTags/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.19)
+project(FetchTags LANGUAGES NONE)
+
+include(ExternalProject)
+
+# repoDir and gitTag are expected to be set as cache variables
+
+ExternalProject_Add(fetcher
+ GIT_REPOSITORY ${repoDir}
+ GIT_TAG ${gitTag}
+ GIT_REMOTE_UPDATE_STRATEGY CHECKOUT
+ CONFIGURE_COMMAND ""
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+)
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt
deleted file mode 100644
index ff3e5c1..0000000
--- a/Tests/RunCMake/ExternalProject/IncludeScope-Add-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
- error: ExternalProject module must be explicitly included before using
- ExternalProject_Add function
-Call Stack \(most recent call first\):
- .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_parse_arguments\)
- IncludeScope-Add.cmake:[0-9]+ \(ExternalProject_Add\)
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake b/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake
deleted file mode 100644
index 1061ffd..0000000
--- a/Tests/RunCMake/ExternalProject/IncludeScope-Add.cmake
+++ /dev/null
@@ -1,12 +0,0 @@
-function(IncludeScope_IncludeOnly)
- include(ExternalProject)
-endfunction()
-
-IncludeScope_IncludeOnly()
-
-ExternalProject_Add(MyProj
- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
-)
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt
deleted file mode 100644
index cbad4be..0000000
--- a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
- error: ExternalProject module must be explicitly included before using
- ExternalProject_Add_Step function
-Call Stack \(most recent call first\):
- .*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_parse_arguments\)
- IncludeScope-Add_Step.cmake:[0-9]+ \(ExternalProject_Add_Step\)
- CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake b/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake
deleted file mode 100644
index 2a820f8..0000000
--- a/Tests/RunCMake/ExternalProject/IncludeScope-Add_Step.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-function(IncludeScope_DefineProj)
- include(ExternalProject)
- ExternalProject_Add(MyProj
- SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- )
-endfunction()
-
-IncludeScope_DefineProj()
-
-ExternalProject_Add_Step(MyProj extraStep COMMENT "Foo")
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
index 598671f..3205dd5 100644
--- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
@@ -8,8 +8,6 @@ unset(ENV{https_proxy})
run_cmake(BadIndependentStep1)
run_cmake(BadIndependentStep2)
-run_cmake(IncludeScope-Add)
-run_cmake(IncludeScope-Add_Step)
run_cmake(NoOptions)
run_cmake(SourceEmpty)
run_cmake(SourceMissing)
@@ -151,3 +149,42 @@ endif()
if(doSubstitutionTest)
__ep_test_with_build(Substitutions)
endif()
+
+function(__ep_test_CONFIGURE_HANDLED_BY_BUILD)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CONFIGURE_HANDLED_BY_BUILD-build)
+ run_cmake(CONFIGURE_HANDLED_BY_BUILD)
+
+ if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(BUILD_CONFIG --config Debug)
+ set(STAMP_DIR "${RunCMake_TEST_BINARY_DIR}/stamp/Debug")
+ else()
+ set(BUILD_CONFIG "")
+ set(STAMP_DIR "${RunCMake_TEST_BINARY_DIR}/stamp")
+ endif()
+
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(CONFIGURE_HANDLED_BY_BUILD-build ${CMAKE_COMMAND} --build . ${BUILD_CONFIG})
+
+ # Calculate timestamps before rebuilding so we can compare before and after in
+ # CONFIGURE_HANDLED_BY_BUILD-rebuild-check.cmake
+
+ file(TIMESTAMP "${STAMP_DIR}/proj1-configure" PROJ1_CONFIGURE_TIMESTAMP_BEFORE "%s")
+ # When BUILD_ALWAYS is set, the build stamp is never created.
+ file(TIMESTAMP "${STAMP_DIR}/proj2-configure" PROJ2_CONFIGURE_TIMESTAMP_BEFORE "%s")
+ file(TIMESTAMP "${STAMP_DIR}/proj2-build" PROJ2_BUILD_TIMESTAMP_BEFORE "%s")
+
+ run_cmake_command(CONFIGURE_HANDLED_BY_BUILD-rebuild ${CMAKE_COMMAND} --build . ${BUILD_CONFIG})
+endfunction()
+
+if(NOT RunCMake_GENERATOR MATCHES "Visual Studio 9 ")
+ __ep_test_CONFIGURE_HANDLED_BY_BUILD()
+endif()
+
+find_package(Git QUIET)
+if(GIT_EXECUTABLE)
+ # Note that there appear to be differences in where git writes its output to
+ # on some platforms. It may go to stdout or stderr, so force it to be merged.
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ run_cmake(FetchGitTags)
+ set(RunCMake_TEST_OUTPUT_MERGE FALSE)
+endif()
diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
index 4449ff1..ae3d179 100644
--- a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
@@ -24,6 +24,7 @@ function(check_python case)
file(GLOB index ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/reply/index-*.json)
execute_process(
COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py" "${index}" "${CMAKE_CXX_COMPILER_ID}"
+ "${RunCMake_TEST_BINARY_DIR}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
@@ -50,7 +51,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} .)
@@ -60,3 +63,4 @@ endfunction()
run_object(codemodel-v2)
run_object(cache-v2)
run_object(cmakeFiles-v1)
+run_object(toolchains-v1)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index c66757f..df2410a 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -608,7 +608,7 @@ def gen_check_targets(c, g, inSource):
read_codemodel_json_data("targets/generated_exe.json"),
]
- if cxx_compiler_id in ['Clang', 'AppleClang', 'GNU', 'Intel', 'MSVC', 'Embarcadero'] and g["name"] != "Xcode":
+ if cxx_compiler_id in ['Clang', 'AppleClang', 'GNU', 'Intel', 'IntelLLVM', 'MSVC', 'Embarcadero'] and g["name"] != "Xcode":
for e in expected:
if e["name"] == "cxx_exe":
if matches(g["name"], "^(Visual Studio |Ninja Multi-Config)"):
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json
index a7106fc..483ae79 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json
@@ -7,7 +7,7 @@
"isGeneratorProvided": null,
"sources": [
{
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$",
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt(-(Debug|Release|RelWithDebInfo|MinSizeRel))?$",
"isGenerated": true,
"sourceGroupName": "",
"compileGroupLanguage": null,
@@ -27,7 +27,7 @@
]
},
{
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$",
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt(-\\(CONFIG\\))?\\.rule$",
"isGenerated": true,
"sourceGroupName": "CMake Rules",
"compileGroupLanguage": null,
@@ -45,13 +45,13 @@
{
"name": "",
"sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$"
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt(-(Debug|Release|RelWithDebInfo|MinSizeRel))?$"
]
},
{
"name": "CMake Rules",
"sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$"
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt(-\\(CONFIG\\))?\\.rule$"
]
}
],
diff --git a/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-check.cmake b/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-check.cmake
new file mode 100644
index 0000000..ce38461
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/query.json
+ reply
+ reply/index-[0-9.T-]+.json
+ reply/toolchains-v1-[0-9a-f]+.json
+ )
+check_api("^${expect}$")
+
+check_python(toolchains-v1)
diff --git a/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-prep.cmake b/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-prep.cmake
new file mode 100644
index 0000000..ca62edf
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateful-prep.cmake
@@ -0,0 +1,4 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/query.json" [[
+{ "requests": [ { "kind": "toolchains", "version" : 1 } ] }
+]])
diff --git a/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateless-check.cmake b/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateless-check.cmake
new file mode 100644
index 0000000..4676dd8
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateless-check.cmake
@@ -0,0 +1,11 @@
+set(expect
+ query
+ query/client-foo
+ query/client-foo/toolchains-v1
+ reply
+ reply/index-[0-9.T-]+.json
+ reply/toolchains-v1-[0-9a-f]+.json
+ )
+check_api("^${expect}$")
+
+check_python(toolchains-v1)
diff --git a/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateless-prep.cmake b/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateless-prep.cmake
new file mode 100644
index 0000000..7edff93
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/toolchains-v1-ClientStateless-prep.cmake
@@ -0,0 +1,2 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/client-foo/toolchains-v1" "")
diff --git a/Tests/RunCMake/FileAPI/toolchains-v1-SharedStateless-check.cmake b/Tests/RunCMake/FileAPI/toolchains-v1-SharedStateless-check.cmake
new file mode 100644
index 0000000..8e83758
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/toolchains-v1-SharedStateless-check.cmake
@@ -0,0 +1,10 @@
+set(expect
+ query
+ query/toolchains-v1
+ reply
+ reply/index-[0-9.T-]+.json
+ reply/toolchains-v1-[0-9a-f]+.json
+ )
+check_api("^${expect}$")
+
+check_python(toolchains-v1)
diff --git a/Tests/RunCMake/FileAPI/toolchains-v1-SharedStateless-prep.cmake b/Tests/RunCMake/FileAPI/toolchains-v1-SharedStateless-prep.cmake
new file mode 100644
index 0000000..2db73a1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/toolchains-v1-SharedStateless-prep.cmake
@@ -0,0 +1,2 @@
+file(REMOVE_RECURSE ${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query)
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/.cmake/api/v1/query/toolchains-v1" "")
diff --git a/Tests/RunCMake/FileAPI/toolchains-v1-check.py b/Tests/RunCMake/FileAPI/toolchains-v1-check.py
new file mode 100644
index 0000000..a0e50c2
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/toolchains-v1-check.py
@@ -0,0 +1,86 @@
+from check_index import *
+import os
+
+class ExpectedVar(object):
+ def __init__(self, name):
+ self.name = name
+
+class ExpectedList(object):
+ def __init__(self, name):
+ self.name = name
+
+EXPECTED_TOOLCHAIN = {
+ "language": "CXX",
+ "compiler": {
+ "path": ExpectedVar("CMAKE_CXX_COMPILER"),
+ "id": ExpectedVar("CMAKE_CXX_COMPILER_ID"),
+ "version": ExpectedVar("CMAKE_CXX_COMPILER_VERSION"),
+ "target": ExpectedVar("CMAKE_CXX_COMPILER_TARGET"),
+ "implicit": {
+ "includeDirectories": \
+ ExpectedList("CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES"),
+ "linkDirectories": \
+ ExpectedList("CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES"),
+ "linkFrameworkDirectories": \
+ ExpectedList(
+ "CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES"),
+ "linkLibraries": \
+ ExpectedList("CMAKE_CXX_IMPLICIT_LINK_LIBRARIES"),
+ }
+ },
+ "sourceFileExtensions": \
+ ExpectedList("CMAKE_CXX_SOURCE_FILE_EXTENSIONS"),
+}
+
+def check_objects(o):
+ assert is_list(o)
+ assert len(o) == 1
+ check_index_object(o[0], "toolchains", 1, 0, check_object_toolchains)
+
+def check_object_toolchains(o):
+ assert sorted(o.keys()) == ["kind", "toolchains", "version"]
+ # The "kind" and "version" members are handled by check_index_object.
+ toolchains = o["toolchains"]
+ assert is_list(toolchains)
+
+ # Other platform-specific toolchains may exist (like RC on Windows).
+ has_cxx_toolchain = False
+ for toolchain in toolchains:
+ assert is_dict(toolchain)
+ assert "language" in toolchain
+ if toolchain["language"] == "CXX":
+ check_object_toolchain(toolchain, EXPECTED_TOOLCHAIN)
+ has_cxx_toolchain = True
+
+ assert has_cxx_toolchain
+
+def check_object_toolchain(o, expected):
+ expected_keys = [
+ key for (key, value) in expected.items()
+ if is_string(value) or is_dict(value)
+ or (type(value) in (ExpectedVar, ExpectedList)
+ and variables[value.name]["defined"])]
+ assert sorted(o.keys()) == sorted(expected_keys)
+
+ for key in expected_keys:
+ value = expected[key]
+ if is_string(value):
+ assert o[key] == value
+ elif is_dict(value):
+ check_object_toolchain(o[key], value)
+ elif type(value) == ExpectedVar:
+ assert o[key] == variables[value.name]["value"]
+ elif type(value) == ExpectedList:
+ expected_items = filter(
+ None, variables[value.name]["value"].split(";"))
+ check_list_match(lambda a, b: a == b, o[key], expected_items)
+ else:
+ assert False
+
+with open(os.path.join(sys.argv[3], "toolchain_variables.json")) as f:
+ variables = json.load(f)
+
+assert is_dict(variables)
+assert is_dict(index)
+assert sorted(index.keys()) == ["cmake", "objects", "reply"]
+check_objects(index["objects"])
diff --git a/Tests/RunCMake/FileAPI/toolchains-v1.cmake b/Tests/RunCMake/FileAPI/toolchains-v1.cmake
new file mode 100644
index 0000000..367aade
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/toolchains-v1.cmake
@@ -0,0 +1,22 @@
+enable_language(CXX)
+
+set(variable_suffixes
+ COMPILER COMPILER_ID COMPILER_VERSION COMPILER_TARGET
+ IMPLICIT_INCLUDE_DIRECTORIES IMPLICIT_LINK_DIRECTORIES
+ IMPLICIT_LINK_FRAMEWORK_DIRECTORIES IMPLICIT_LINK_LIBRARIES
+ SOURCE_FILE_EXTENSIONS)
+set(language CXX)
+set(json "{}")
+
+foreach(variable_suffix ${variable_suffixes})
+ set(variable "CMAKE_${language}_${variable_suffix}")
+ string(JSON json SET "${json}" "${variable}" "{}")
+ if(DEFINED "${variable}")
+ string(JSON json SET "${json}" "${variable}" "defined" "true")
+ string(JSON json SET "${json}" "${variable}" "value" "\"${${variable}}\"")
+ else()
+ string(JSON json SET "${json}" "${variable}" "defined" "false")
+ endif()
+endforeach()
+
+file(WRITE ${CMAKE_BINARY_DIR}/toolchain_variables.json "${json}")
diff --git a/Tests/RunCMake/File_Configure/AtOnly.cmake b/Tests/RunCMake/File_Configure/AtOnly.cmake
new file mode 100644
index 0000000..cc5304a
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/AtOnly.cmake
@@ -0,0 +1,12 @@
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/atonly.txt)
+set(var_a "a")
+set(var_b "b")
+file(CONFIGURE
+ OUTPUT ${file_name}
+ CONTENT "-->@var_a@<-- -->${var_b}<--"
+ @ONLY
+)
+file(READ ${file_name} file_content)
+if(NOT file_content STREQUAL "-->a<-- -->${var_b}<--")
+ message(FATAL_ERROR "@ONLY doesn't work")
+endif()
diff --git a/Tests/RunCMake/File_Configure/BadArg-stderr.txt b/Tests/RunCMake/File_Configure/BadArg-stderr.txt
deleted file mode 100644
index 5423a28..0000000
--- a/Tests/RunCMake/File_Configure/BadArg-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at BadArg.cmake:[0-9]+ \(file\):
- file Incorrect arguments to CONFIGURE subcommand.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Configure/BadArgContent-result.txt b/Tests/RunCMake/File_Configure/BadArgContent-result.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgContent-result.txt
diff --git a/Tests/RunCMake/File_Configure/BadArgContent-stderr.txt b/Tests/RunCMake/File_Configure/BadArgContent-stderr.txt
new file mode 100644
index 0000000..a6ea314
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgContent-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at BadArgContent.cmake:[0-9]+ \(file\):
+ file CONFIGURE CONTENT option needs a value.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Configure/BadArgContent.cmake b/Tests/RunCMake/File_Configure/BadArgContent.cmake
new file mode 100644
index 0000000..282dc18
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgContent.cmake
@@ -0,0 +1 @@
+file(CONFIGURE CONTENT)
diff --git a/Tests/RunCMake/File_Configure/BadArgOutput-result.txt b/Tests/RunCMake/File_Configure/BadArgOutput-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgOutput-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Configure/BadArgOutput-stderr.txt b/Tests/RunCMake/File_Configure/BadArgOutput-stderr.txt
new file mode 100644
index 0000000..b5a924c
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgOutput-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at BadArgOutput.cmake:[0-9]+ \(file\):
+ file CONFIGURE OUTPUT option needs a value.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Configure/BadArg.cmake b/Tests/RunCMake/File_Configure/BadArgOutput.cmake
index 7c7fcda..7c7fcda 100644
--- a/Tests/RunCMake/File_Configure/BadArg.cmake
+++ b/Tests/RunCMake/File_Configure/BadArgOutput.cmake
diff --git a/Tests/RunCMake/File_Configure/EscapeQuotes.cmake b/Tests/RunCMake/File_Configure/EscapeQuotes.cmake
new file mode 100644
index 0000000..1136c87
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/EscapeQuotes.cmake
@@ -0,0 +1,12 @@
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/escape_quotes.txt)
+set(var "\t")
+set(ref "${var}")
+file(CONFIGURE
+ CONTENT "-->@ref@<--"
+ OUTPUT ${file_name}
+ ESCAPE_QUOTES
+)
+file(READ ${file_name} file_content)
+if(NOT file_content MATCHES "^-->\t<--$")
+ message(FATAL_ERROR "ESCAPE_QUOTES doesn't work")
+endif()
diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake b/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake
index e384873..5e35e5c 100644
--- a/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake
+++ b/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake
@@ -1,10 +1,13 @@
set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt)
function(test_eol style in out)
+ if (style)
+ set(newline_stle NEWLINE_STYLE ${style})
+ endif()
file(CONFIGURE
OUTPUT ${file_name}
CONTENT "@in@"
- NEWLINE_STYLE ${style}
+ ${newline_stle}
)
file(READ ${file_name} new HEX)
if(NOT "${new}" STREQUAL "${out}")
@@ -18,3 +21,9 @@ test_eol(CRLF "c" "630d0a")
test_eol(UNIX "d" "640a")
test_eol(LF "e" "650a")
+
+if (WIN32)
+ test_eol("" "a\nb" "610d0a62")
+elseif(UNIX)
+ test_eol("" "a\nb" "610a62")
+endif()
diff --git a/Tests/RunCMake/File_Configure/RunCMakeTest.cmake b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake
index e79de79..5022985 100644
--- a/Tests/RunCMake/File_Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake
@@ -1,10 +1,14 @@
include(RunCMake)
run_cmake(AngleBracketsContent)
-run_cmake(BadArg)
+run_cmake(BadArgOutput)
+run_cmake(BadArgContent)
run_cmake(BadArgGeneratorExpressionOutput)
+run_cmake(UnrecognizedArgs)
run_cmake(DirOutput)
run_cmake(NewLineStyle-NoArg)
run_cmake(NewLineStyle-ValidArg)
run_cmake(NewLineStyle-WrongArg)
run_cmake(SubDir)
+run_cmake(AtOnly)
+run_cmake(EscapeQuotes)
diff --git a/Tests/RunCMake/File_Configure/UnrecognizedArgs-result.txt b/Tests/RunCMake/File_Configure/UnrecognizedArgs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/UnrecognizedArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Configure/UnrecognizedArgs-stderr.txt b/Tests/RunCMake/File_Configure/UnrecognizedArgs-stderr.txt
new file mode 100644
index 0000000..1dd1a20
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/UnrecognizedArgs-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at UnrecognizedArgs.cmake:[0-9]+ \(file\):
+ file CONFIGURE Unrecognized argument: "INPUT"
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Configure/UnrecognizedArgs.cmake b/Tests/RunCMake/File_Configure/UnrecognizedArgs.cmake
new file mode 100644
index 0000000..93ea7b5
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/UnrecognizedArgs.cmake
@@ -0,0 +1 @@
+file(CONFIGURE INPUT)
diff --git a/Tests/RunCMake/File_Generate/CustomFilePermissions.cmake b/Tests/RunCMake/File_Generate/CustomFilePermissions.cmake
new file mode 100644
index 0000000..0000ef9
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CustomFilePermissions.cmake
@@ -0,0 +1,15 @@
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/customfilepermissions.txt")
+
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/customfilepermissions.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_EXECUTE
+ WORLD_EXECUTE
+ )
+
+add_custom_target(checkCustomFilePermissions ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/customfilepermissions.txt
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/CustomFilePermissionsVerify.cmake"
+ )
diff --git a/Tests/RunCMake/File_Generate/CustomFilePermissionsVerify.cmake b/Tests/RunCMake/File_Generate/CustomFilePermissionsVerify.cmake
new file mode 100644
index 0000000..a87e916
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CustomFilePermissionsVerify.cmake
@@ -0,0 +1,36 @@
+if(NOT EXISTS "${generatedFile}")
+ message(SEND_ERROR "Missing file:\n ${generatedFile}")
+endif()
+
+if (UNIX)
+ find_program(STAT_EXECUTABLE NAMES stat)
+ if(NOT STAT_EXECUTABLE)
+ return()
+ endif()
+
+ if (CMAKE_HOST_SYSTEM_NAME MATCHES "FreeBSD")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${generatedFile}"
+ OUTPUT_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ elseif (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${generatedFile}"
+ OUTPUT_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ else()
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${generatedFile}"
+ OUTPUT_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ endif()
+
+ if (NOT output EQUAL "711")
+ message(SEND_ERROR "file generate has different permissions source "
+ "permissions: \"${output}\" desired permissions: \"711\"")
+ endif()
+
+endif()
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-Default.cmake b/Tests/RunCMake/File_Generate/NewLineStyle-Default.cmake
new file mode 100644
index 0000000..9df8ffe
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-Default.cmake
@@ -0,0 +1,35 @@
+function(generate_from_file in out)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file_ip.txt "${in}")
+ file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/file_op.txt
+ INPUT ${CMAKE_CURRENT_BINARY_DIR}/file_ip.txt
+ )
+
+ add_custom_target(verifyContentFromFile ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/file_op.txt
+ -DexpectedContent=${out}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/VerifyContent.cmake"
+ )
+endfunction()
+
+function(generate_from_content in out)
+ file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/content_op.txt
+ CONTENT ${in}
+ )
+
+ add_custom_target(verifyContentFromContent ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/content_op.txt
+ -DexpectedContent=${out}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/VerifyContent.cmake"
+ )
+endfunction()
+
+if (WIN32)
+ generate_from_file("a" "610d0a") # 62->b, 0d0a->\r\n
+elseif(UNIX)
+ generate_from_file("a" "610a") # 62->b, 0a->\n
+endif()
+generate_from_content("a" "61")
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg-result.txt b/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg-stderr.txt b/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg-stderr.txt
new file mode 100644
index 0000000..44e32d0
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at NewLineStyle-InvalidArg.cmake:[0-9]+ \(file\):
+ file GENERATE NEWLINE_STYLE sets an unknown style, only LF, CRLF, UNIX,
+ DOS, and WIN32 are supported
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg.cmake b/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg.cmake
new file mode 100644
index 0000000..578cf21
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-InvalidArg.cmake
@@ -0,0 +1,7 @@
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ CONTENT "int main() { return 0; }\n"
+ NEWLINE_STYLE FOO
+ )
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-NoArg-result.txt b/Tests/RunCMake/File_Generate/NewLineStyle-NoArg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-NoArg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-NoArg-stderr.txt b/Tests/RunCMake/File_Generate/NewLineStyle-NoArg-stderr.txt
new file mode 100644
index 0000000..bc71f2f
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-NoArg-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NewLineStyle-NoArg.cmake:[0-9]+ \(file\):
+ file Incorrect arguments to GENERATE subcommand.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-NoArg.cmake b/Tests/RunCMake/File_Generate/NewLineStyle-NoArg.cmake
new file mode 100644
index 0000000..9bd2ffa
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-NoArg.cmake
@@ -0,0 +1,7 @@
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ CONTENT "int main() { return 0; }\n"
+ NEWLINE_STYLE
+ )
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-Unix.cmake b/Tests/RunCMake/File_Generate/NewLineStyle-Unix.cmake
new file mode 100644
index 0000000..7c26217
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-Unix.cmake
@@ -0,0 +1,33 @@
+function(generate_from_file in out)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file_ip.txt "${in}")
+ file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/file_op.txt
+ INPUT ${CMAKE_CURRENT_BINARY_DIR}/file_ip.txt
+ NEWLINE_STYLE UNIX
+ )
+
+ add_custom_target(verifyContentFromFile ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/file_op.txt
+ -DexpectedContent=${out}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/VerifyContent.cmake"
+ )
+endfunction()
+
+function(generate_from_content in out)
+ file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/content_op.txt
+ CONTENT ${in}
+ NEWLINE_STYLE UNIX
+ )
+
+ add_custom_target(verifyContentFromContent ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/content_op.txt
+ -DexpectedContent=${out}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/VerifyContent.cmake"
+ )
+endfunction()
+
+generate_from_file("a" "610a") # 62->b, 0a->\n
+generate_from_content("a" "610a")
diff --git a/Tests/RunCMake/File_Generate/NewLineStyle-Win32.cmake b/Tests/RunCMake/File_Generate/NewLineStyle-Win32.cmake
new file mode 100644
index 0000000..394ef75
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NewLineStyle-Win32.cmake
@@ -0,0 +1,33 @@
+function(generate_from_file in out)
+ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/file_ip.txt "${in}")
+ file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/file_op.txt
+ INPUT ${CMAKE_CURRENT_BINARY_DIR}/file_ip.txt
+ NEWLINE_STYLE WIN32
+ )
+
+ add_custom_target(verifyContentFromFile ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/file_op.txt
+ -DexpectedContent=${out}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/VerifyContent.cmake"
+ )
+endfunction()
+
+function(generate_from_content in out)
+ file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/content_op.txt
+ CONTENT ${in}
+ NEWLINE_STYLE WIN32
+ )
+
+ add_custom_target(verifyContentFromContent ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/content_op.txt
+ -DexpectedContent=${out}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/VerifyContent.cmake"
+ )
+endfunction()
+
+generate_from_file("a" "610d0a") # 62->b, 0d0a->\r\n
+generate_from_content("a" "610d0a")
diff --git a/Tests/RunCMake/File_Generate/NoSourcePermissions.cmake b/Tests/RunCMake/File_Generate/NoSourcePermissions.cmake
new file mode 100644
index 0000000..868a045
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NoSourcePermissions.cmake
@@ -0,0 +1,10 @@
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/nosourcepermissions.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ NO_SOURCE_PERMISSIONS
+ )
+
+add_custom_target(checkNoSourcePermission ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/nosourcepermissions.txt
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/NoSourcePermissionsVerify.cmake"
+ )
diff --git a/Tests/RunCMake/File_Generate/NoSourcePermissionsVerify.cmake b/Tests/RunCMake/File_Generate/NoSourcePermissionsVerify.cmake
new file mode 100644
index 0000000..7981ccc
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/NoSourcePermissionsVerify.cmake
@@ -0,0 +1,36 @@
+if(NOT EXISTS "${generatedFile}")
+ message(SEND_ERROR "Missing generated file:\n ${generatedFile}")
+endif()
+
+if (UNIX)
+ find_program(STAT_EXECUTABLE NAMES stat)
+ if(NOT STAT_EXECUTABLE)
+ return()
+ endif()
+
+ if (CMAKE_HOST_SYSTEM_NAME MATCHES "FreeBSD")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${generatedFile}"
+ OUTPUT_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${generatedFile}"
+ OUTPUT_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ else()
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${generatedFile}"
+ OUTPUT_VARIABLE output
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ endif()
+
+ if (NOT output EQUAL "644")
+ message(SEND_ERROR "generated file has different permissions than "
+ "desired, generated permissions: \"${output}\"")
+ endif()
+
+endif()
diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
index 48fb71c..be3bf04 100644
--- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
+++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake
@@ -123,3 +123,35 @@ set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(AdjacentInOut-nowork ${CMAKE_COMMAND} --build .)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
+
+run_cmake(SourcePermissions1)
+run_cmake(SourcePermissions2)
+run_cmake(SourcePermissions3)
+run_cmake(SourcePermissions4)
+run_cmake(SourcePermissions5)
+
+function(run_cmake_and_verify_after_build case)
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${case}-build")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_CONFIGURATION_TYPES=Debug)
+ else()
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ run_cmake(${case})
+ run_cmake_command("${case}-build" ${CMAKE_COMMAND} --build .)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(RunCMake_TEST_BINARY_DIR)
+endfunction()
+
+run_cmake_and_verify_after_build(NoSourcePermissions)
+run_cmake_and_verify_after_build(UseSourcePermissions)
+run_cmake_and_verify_after_build(CustomFilePermissions)
+
+run_cmake(NewLineStyle-NoArg)
+run_cmake(NewLineStyle-InvalidArg)
+run_cmake_and_verify_after_build(NewLineStyle-Default)
+run_cmake_and_verify_after_build(NewLineStyle-Unix)
+run_cmake_and_verify_after_build(NewLineStyle-Win32)
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions1-result.txt b/Tests/RunCMake/File_Generate/SourcePermissions1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions1-stderr.txt b/Tests/RunCMake/File_Generate/SourcePermissions1-stderr.txt
new file mode 100644
index 0000000..730800d
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions1-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissions1.cmake:[0-9]+ \(file\):
+ file given both NO_SOURCE_PERMISSIONS and USE_SOURCE_PERMISSIONS. Only one
+ option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions1.cmake b/Tests/RunCMake/File_Generate/SourcePermissions1.cmake
new file mode 100644
index 0000000..d25e66a
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions1.cmake
@@ -0,0 +1,5 @@
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output-sourcepermission1.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ NO_SOURCE_PERMISSIONS
+ USE_SOURCE_PERMISSIONS
+ )
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions2-result.txt b/Tests/RunCMake/File_Generate/SourcePermissions2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions2-stderr.txt b/Tests/RunCMake/File_Generate/SourcePermissions2-stderr.txt
new file mode 100644
index 0000000..e8184cc
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions2-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissions2.cmake:[0-9]+ \(file\):
+ file given both NO_SOURCE_PERMISSIONS and FILE_PERMISSIONS. Only one
+ option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions2.cmake b/Tests/RunCMake/File_Generate/SourcePermissions2.cmake
new file mode 100644
index 0000000..2a1e3ea
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions2.cmake
@@ -0,0 +1,5 @@
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output-sourcepermission2.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ NO_SOURCE_PERMISSIONS
+ FILE_PERMISSIONS OWNER_READ
+ )
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions3-result.txt b/Tests/RunCMake/File_Generate/SourcePermissions3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions3-stderr.txt b/Tests/RunCMake/File_Generate/SourcePermissions3-stderr.txt
new file mode 100644
index 0000000..1143c78
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions3-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissions3.cmake:[0-9]+ \(file\):
+ file given both USE_SOURCE_PERMISSIONS and FILE_PERMISSIONS. Only one
+ option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions3.cmake b/Tests/RunCMake/File_Generate/SourcePermissions3.cmake
new file mode 100644
index 0000000..97e0deb
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions3.cmake
@@ -0,0 +1,5 @@
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output-sourcepermission3.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ USE_SOURCE_PERMISSIONS
+ FILE_PERMISSIONS OWNER_READ
+ )
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions4-result.txt b/Tests/RunCMake/File_Generate/SourcePermissions4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions4-stderr.txt b/Tests/RunCMake/File_Generate/SourcePermissions4-stderr.txt
new file mode 100644
index 0000000..84368cd
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions4-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourcePermissions4.cmake:[0-9]+ \(file\):
+ file given USE_SOURCE_PERMISSIONS without a file INPUT.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions4.cmake b/Tests/RunCMake/File_Generate/SourcePermissions4.cmake
new file mode 100644
index 0000000..f4127a6
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions4.cmake
@@ -0,0 +1,4 @@
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output-sourcepermission4.txt"
+ CONTENT "Input is content"
+ USE_SOURCE_PERMISSIONS
+ )
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions5-result.txt b/Tests/RunCMake/File_Generate/SourcePermissions5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions5-stderr.txt b/Tests/RunCMake/File_Generate/SourcePermissions5-stderr.txt
new file mode 100644
index 0000000..d66d488
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions5-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourcePermissions5.cmake:[0-9]+ \(file\):
+ file given invalid permission "GROUP_RWX","USER_ALL".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/File_Generate/SourcePermissions5.cmake b/Tests/RunCMake/File_Generate/SourcePermissions5.cmake
new file mode 100644
index 0000000..4eb4c36
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/SourcePermissions5.cmake
@@ -0,0 +1,4 @@
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output-sourcepermission5.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ FILE_PERMISSIONS OWNER_READ GROUP_RWX USER_ALL
+ )
diff --git a/Tests/RunCMake/File_Generate/UseSourcePermissions.cmake b/Tests/RunCMake/File_Generate/UseSourcePermissions.cmake
new file mode 100644
index 0000000..7cca9bf
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/UseSourcePermissions.cmake
@@ -0,0 +1,11 @@
+file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/usesourcepermissions.txt"
+ INPUT "${CMAKE_CURRENT_SOURCE_DIR}/input.txt"
+ USE_SOURCE_PERMISSIONS
+ )
+
+add_custom_target(checkUseSourcePermissions ALL
+ COMMAND ${CMAKE_COMMAND}
+ -DsourceFile=${CMAKE_CURRENT_SOURCE_DIR}/input.txt
+ -DgeneratedFile=${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>>/usesourcepermissions.txt
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/UseSourcePermissionsVerify.cmake"
+ )
diff --git a/Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake b/Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake
new file mode 100644
index 0000000..8b30f96
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/UseSourcePermissionsVerify.cmake
@@ -0,0 +1,51 @@
+if(NOT EXISTS "${generatedFile}")
+ message(SEND_ERROR "Missing generated file:\n ${generatedFile}")
+endif()
+
+if (UNIX)
+ find_program(STAT_EXECUTABLE NAMES stat)
+ if(NOT STAT_EXECUTABLE)
+ return()
+ endif()
+
+ if (CMAKE_HOST_SYSTEM_NAME MATCHES "FreeBSD")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${sourceFile}"
+ OUTPUT_VARIABLE output1
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${generatedFile}"
+ OUTPUT_VARIABLE output2
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ elseif (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${sourceFile}"
+ OUTPUT_VARIABLE output1
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${generatedFile}"
+ OUTPUT_VARIABLE output2
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ else()
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${sourceFile}"
+ OUTPUT_VARIABLE output1
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${generatedFile}"
+ OUTPUT_VARIABLE output2
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ COMMAND_ERROR_IS_FATAL ANY
+ )
+ endif()
+
+ if (NOT output1 EQUAL output2)
+ message(SEND_ERROR "generated file has a different permissions source "
+ "permissions: \"${output1}\" generated permissions: \"${output2}\"")
+ endif()
+
+endif()
diff --git a/Tests/RunCMake/File_Generate/VerifyContent.cmake b/Tests/RunCMake/File_Generate/VerifyContent.cmake
new file mode 100644
index 0000000..8563708
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/VerifyContent.cmake
@@ -0,0 +1,4 @@
+file(READ ${generatedFile} actualContent HEX)
+if(NOT "${actualContent}" STREQUAL "${expectedContent}")
+ message(SEND_ERROR "Content mismatch actual: \"${actualContent}\" expected: \"${expectedContent}\"")
+endif()
diff --git a/Tests/RunCMake/FindOpenSSL/CMakeLists.txt b/Tests/RunCMake/FindOpenSSL/CMakeLists.txt
new file mode 100644
index 0000000..4fc11ae
--- /dev/null
+++ b/Tests/RunCMake/FindOpenSSL/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.19...3.20)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FindOpenSSL/RunCMakeTest.cmake b/Tests/RunCMake/FindOpenSSL/RunCMakeTest.cmake
new file mode 100644
index 0000000..f941a85
--- /dev/null
+++ b/Tests/RunCMake/FindOpenSSL/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(version)
+run_cmake(version-exact)
+run_cmake(version-range)
diff --git a/Tests/RunCMake/FindOpenSSL/version-exact.cmake b/Tests/RunCMake/FindOpenSSL/version-exact.cmake
new file mode 100644
index 0000000..29c2ce3
--- /dev/null
+++ b/Tests/RunCMake/FindOpenSSL/version-exact.cmake
@@ -0,0 +1,19 @@
+cmake_minimum_required (VERSION 3.19...3.20)
+
+find_package (OpenSSL REQUIRED COMPONENTS Crypto)
+# Store version without a possibly trailing letter.
+string (REGEX MATCH "^([0-9.]+)" version "${OPENSSL_VERSION}")
+
+# clean-up OpenSSL variables
+unset (OPENSSL_INCLUDE_DIR)
+unset (OPENSSL_CRYPTO_LIBRARY)
+unset (OPENSSL_CRYPTO_LIBRARIES)
+unset (OPENSSL_LIBRARIES)
+unset (OPENSSL_VERSION)
+unset (OPENSSL_FOUND)
+
+
+find_package (OpenSSL ${version} EXACT COMPONENTS Crypto)
+if (NOT OPENSSL_FOUND)
+ message (FATAL_ERROR "Failed to find OpenSSL with version ${version} EXACT")
+endif()
diff --git a/Tests/RunCMake/FindOpenSSL/version-range.cmake b/Tests/RunCMake/FindOpenSSL/version-range.cmake
new file mode 100644
index 0000000..9390032
--- /dev/null
+++ b/Tests/RunCMake/FindOpenSSL/version-range.cmake
@@ -0,0 +1,37 @@
+cmake_minimum_required (VERSION 3.19...3.20)
+
+find_package (OpenSSL REQUIRED COMPONENTS Crypto)
+# Store version without a possibly trailing letter.
+string (REGEX MATCH "^([0-9.]+)" version "${OPENSSL_VERSION}")
+
+# clean-up OpenSSL variables
+unset (OPENSSL_INCLUDE_DIR)
+unset (OPENSSL_CRYPTO_LIBRARY)
+unset (OPENSSL_CRYPTO_LIBRARIES)
+unset (OPENSSL_LIBRARIES)
+unset (OPENSSL_VERSION)
+unset (OPENSSL_FOUND)
+
+## Specify a range including current OpenSSL version
+string (REGEX MATCH "^([0-9]+)" upper_version "${version}")
+math (EXPR upper_version "${upper_version} + 1")
+
+find_package (OpenSSL 0.9...${upper_version}.0 COMPONENTS Crypto)
+if (NOT OPENSSL_FOUND)
+ message (FATAL_ERROR "Failed to find OpenSSL with version range 0.9...${upper_version}.0")
+endif()
+
+# clean-up OpenSSL variables
+unset (OPENSSL_INCLUDE_DIR)
+unset (OPENSSL_CRYPTO_LIBRARY)
+unset (OPENSSL_CRYPTO_LIBRARIES)
+unset (OPENSSL_LIBRARIES)
+unset (OPENSSL_VERSION)
+unset (OPENSSL_FOUND)
+
+## Specify a range excluding current OpenSSL version
+set (range 0.9...<${version})
+find_package (OpenSSL ${range} COMPONENTS Crypto)
+if (OPENSSL_FOUND)
+ message (FATAL_ERROR "Unexpectedly find OpenSSL with version range ${range}")
+endif()
diff --git a/Tests/RunCMake/FindOpenSSL/version.cmake b/Tests/RunCMake/FindOpenSSL/version.cmake
new file mode 100644
index 0000000..d06cd1f
--- /dev/null
+++ b/Tests/RunCMake/FindOpenSSL/version.cmake
@@ -0,0 +1,19 @@
+cmake_minimum_required (VERSION 3.19...3.20)
+
+find_package (OpenSSL REQUIRED COMPONENTS Crypto)
+# Store version without a possibly trailing letter.
+string (REGEX MATCH "^([0-9.]+)" version "${OPENSSL_VERSION}")
+
+# clean-up OpenSSL variables
+unset (OPENSSL_INCLUDE_DIR)
+unset (OPENSSL_CRYPTO_LIBRARY)
+unset (OPENSSL_CRYPTO_LIBRARIES)
+unset (OPENSSL_LIBRARIES)
+unset (OPENSSL_VERSION)
+unset (OPENSSL_FOUND)
+
+
+find_package (OpenSSL ${version} COMPONENTS Crypto)
+if (NOT OPENSSL_FOUND)
+ message (FATAL_ERROR "Failed to find OpenSSL with version ${version}")
+endif()
diff --git a/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt b/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt
new file mode 100644
index 0000000..ec9a2dd
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/GetAbs-stderr.txt
@@ -0,0 +1,12 @@
+^PROJ1_FULL_BINDIR='/usr/bin'
+CMake Warning \(dev\) at [^
+]*/Modules/GNUInstallDirs.cmake:[0-9]+ \(message\):
+ GNUInstallDirs_get_absolute_install_dir called without third argument.
+ Using \${dir} from the caller's scope for compatibility with CMake 3.19 and
+ below.
+Call Stack \(most recent call first\):
+ GetAbs.cmake:10 \(GNUInstallDirs_get_absolute_install_dir\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
++
+PROJ2_FULL_BINDIR='/usr/bin'$
diff --git a/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake b/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake
new file mode 100644
index 0000000..7d5bfc8
--- /dev/null
+++ b/Tests/RunCMake/GNUInstallDirs/GetAbs.cmake
@@ -0,0 +1,11 @@
+set(CMAKE_SIZEOF_VOID_P 8)
+set(CMAKE_LIBRARY_ARCHITECTURE "arch")
+set(CMAKE_INSTALL_PREFIX /usr)
+include(GNUInstallDirs)
+
+GNUInstallDirs_get_absolute_install_dir(PROJ1_FULL_BINDIR CMAKE_INSTALL_BINDIR BINDIR)
+message("PROJ1_FULL_BINDIR='${PROJ1_FULL_BINDIR}'")
+
+set(dir BINDIR)
+GNUInstallDirs_get_absolute_install_dir(PROJ2_FULL_BINDIR CMAKE_INSTALL_BINDIR)
+message("PROJ2_FULL_BINDIR='${PROJ2_FULL_BINDIR}'")
diff --git a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
index 529e10a..395ff30 100644
--- a/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GNUInstallDirs/RunCMakeTest.cmake
@@ -21,4 +21,5 @@ foreach(case
unset(RunCMake-stderr-file)
endforeach()
+run_cmake(GetAbs)
run_cmake(NoSystem)
diff --git a/Tests/RunCMake/GenerateExportHeader/GEH.cmake b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
index ae9a84c..431d1ce 100644
--- a/Tests/RunCMake/GenerateExportHeader/GEH.cmake
+++ b/Tests/RunCMake/GenerateExportHeader/GEH.cmake
@@ -103,7 +103,7 @@ add_executable(GenerateExportHeader exportheader_test.cpp)
target_link_libraries(GenerateExportHeader ${link_libraries})
if (WIN32 OR CYGWIN)
- if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
+ if((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") AND
CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
set(_platform Win32-Clang)
elseif(MSVC AND COMPILER_HAS_DEPRECATED)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 6349112..edeb6bd 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -35,6 +35,9 @@ run_cmake(TARGET_NAME_IF_EXISTS-no-arg)
run_cmake(TARGET_NAME_IF_EXISTS-empty-arg)
run_cmake(TARGET_NAME_IF_EXISTS)
run_cmake(TARGET_NAME_IF_EXISTS-not-a-target)
+run_cmake(TARGET_NAME_IF_EXISTS-alias-target)
+run_cmake(TARGET_NAME_IF_EXISTS-imported-target)
+run_cmake(TARGET_NAME_IF_EXISTS-imported-global-target)
run_cmake(REMOVE_DUPLICATES-empty)
run_cmake(REMOVE_DUPLICATES-1)
run_cmake(REMOVE_DUPLICATES-2)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target-check.cmake
new file mode 100644
index 0000000..8ae2ecc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target-check.cmake
@@ -0,0 +1,5 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/TARGET_NAME_IF_EXISTS-generated-alias.txt" content)
+
+if(NOT content STREQUAL aliasTarget)
+ set(RunCMake_TEST_FAILED "actual content:\n ${content}\nbut expected [[aliasTarget]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target.cmake
new file mode 100644
index 0000000..d3ef0f8
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-alias-target.cmake
@@ -0,0 +1,8 @@
+enable_language(CXX)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy_executable.cpp" "int main(int,char**) { return 0; }\n")
+add_executable(executableTarget "${CMAKE_CURRENT_BINARY_DIR}/dummy_executable.cpp")
+add_executable(aliasTarget ALIAS executableTarget)
+
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT TARGET_NAME_IF_EXISTS-generated-alias.txt CONTENT "$<TARGET_NAME_IF_EXISTS:aliasTarget>")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target-check.cmake
new file mode 100644
index 0000000..b14c9e1
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target-check.cmake
@@ -0,0 +1,5 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/TARGET_NAME_IF_EXISTS-generated-imported-global.txt" content)
+
+if(NOT content STREQUAL importedGlobalTarget)
+ set(RunCMake_TEST_FAILED "actual content:\n ${content}\nbut expected [[importedGlobalTarget]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target.cmake
new file mode 100644
index 0000000..b685558
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-global-target.cmake
@@ -0,0 +1,4 @@
+add_executable(importedGlobalTarget IMPORTED GLOBAL)
+
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT TARGET_NAME_IF_EXISTS-generated-imported-global.txt CONTENT "$<TARGET_NAME_IF_EXISTS:importedGlobalTarget>")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target-check.cmake
new file mode 100644
index 0000000..9615893
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target-check.cmake
@@ -0,0 +1,5 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/TARGET_NAME_IF_EXISTS-generated-imported.txt" content)
+
+if(NOT content STREQUAL importedTarget)
+ set(RunCMake_TEST_FAILED "actual content:\n ${content}\nbut expected [[importedTarget]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target.cmake
new file mode 100644
index 0000000..2008907
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_NAME_IF_EXISTS-imported-target.cmake
@@ -0,0 +1,4 @@
+add_executable(importedTarget IMPORTED)
+
+cmake_policy(SET CMP0070 NEW)
+file(GENERATE OUTPUT TARGET_NAME_IF_EXISTS-generated-imported.txt CONTENT "$<TARGET_NAME_IF_EXISTS:importedTarget>")
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
index 7fb3919..2a53c5b 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
@@ -1,31 +1,35 @@
Test project .*
Start 1: TEST:basic\.case_foo!1
- 1/11 Test #1: TEST:basic\.case_foo!1 \.+ +Passed +[0-9.]+ sec
+ 1/13 Test #1: TEST:basic\.case_foo!1 \.+ +Passed +[0-9.]+ sec
Start 2: TEST:basic\.case_bar!1
- 2/11 Test #2: TEST:basic\.case_bar!1 \.+ +Passed +[0-9.]+ sec
+ 2/13 Test #2: TEST:basic\.case_bar!1 \.+ +Passed +[0-9.]+ sec
Start 3: TEST:basic\.disabled_case!1
- 3/11 Test #3: TEST:basic\.disabled_case!1 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
- Start 4: TEST:disabled\.case!1
- 4/11 Test #4: TEST:disabled\.case!1 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
- Start 5: TEST:typed/short\.case!1
- 5/11 Test #5: TEST:typed/short\.case!1 \.+ +Passed +[0-9.]+ sec
- Start 6: TEST:typed/float\.case!1
- 6/11 Test #6: TEST:typed/float\.case!1 \.+ +Passed +[0-9.]+ sec
- Start 7: TEST:value/test\.case/1!1
- 7/11 Test #7: TEST:value/test\.case/1!1 \.+ +Passed +[0-9.]+ sec
- Start 8: TEST:value/test\.case/"foo"!1
- 8/11 Test #8: TEST:value/test\.case/"foo"!1 \.+ +Passed +[0-9.]+ sec
- Start 9: TEST:param/special\.case/"semicolon;"!1
- 9/11 Test #9: TEST:param/special\.case/"semicolon;"!1 \.+ +Passed +[0-9.]+ sec
- Start 10: TEST:param/special\.case/"backslash\\"!1
-10/11 Test #10: TEST:param/special\.case/"backslash\\"!1 \.+ +Passed +[0-9.]+ sec
- Start 11: TEST:param/special\.case/"\$\{var\}"!1
-11/11 Test #11: TEST:param/special\.case/"\$\{var\}"!1 \.+ +Passed +[0-9.]+ sec
+ 3/13 Test #3: TEST:basic\.disabled_case!1 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
+ Start 4: TEST:basic\.DISABLEDnot_really_case!1
+ 4/13 Test #4: TEST:basic\.DISABLEDnot_really_case!1 \.+ +Passed +[0-9.]+ sec
+ Start 5: TEST:disabled\.case!1
+ 5/13 Test #5: TEST:disabled\.case!1 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
+ Start 6: TEST:DISABLEDnotreally\.case!1
+ 6/13 Test #6: TEST:DISABLEDnotreally\.case!1 \.+ +Passed +[0-9.]+ sec
+ Start 7: TEST:typed/short\.case!1
+ 7/13 Test #7: TEST:typed/short\.case!1 \.+ +Passed +[0-9.]+ sec
+ Start 8: TEST:typed/float\.case!1
+ 8/13 Test #8: TEST:typed/float\.case!1 \.+ +Passed +[0-9.]+ sec
+ Start 9: TEST:value/test\.case/1!1
+ 9/13 Test #9: TEST:value/test\.case/1!1 \.+ +Passed +[0-9.]+ sec
+ Start 10: TEST:value/test\.case/"foo"!1
+10/13 Test #10: TEST:value/test\.case/"foo"!1 \.+ +Passed +[0-9.]+ sec
+ Start 11: TEST:param/special\.case/"semicolon;"!1
+11/13 Test #11: TEST:param/special\.case/"semicolon;"!1 \.+ +Passed +[0-9.]+ sec
+ Start 12: TEST:param/special\.case/"backslash\\"!1
+12/13 Test #12: TEST:param/special\.case/"backslash\\"!1 \.+ +Passed +[0-9.]+ sec
+ Start 13: TEST:param/special\.case/"\$\{var\}"!1
+13/13 Test #13: TEST:param/special\.case/"\$\{var\}"!1 \.+ +Passed +[0-9.]+ sec
-100% tests passed, 0 tests failed out of 9
+100% tests passed, 0 tests failed out of 11
Total Test time \(real\) = +[0-9.]+ sec
The following tests did not run:
.*3 - TEST:basic\.disabled_case!1 \(Disabled\)
-.*4 - TEST:disabled\.case!1 \(Disabled\)
+.*5 - TEST:disabled\.case!1 \(Disabled\)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
index 58c4d10..5b68e10 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
@@ -1,31 +1,35 @@
Test project .*
- Start 12: TEST:basic\.case_foo!2
- 1/11 Test #12: TEST:basic\.case_foo!2 \.+ +Passed +[0-9.]+ sec
- Start 13: TEST:basic\.case_bar!2
- 2/11 Test #13: TEST:basic\.case_bar!2 \.+ +Passed +[0-9.]+ sec
- Start 14: TEST:basic\.disabled_case!2
- 3/11 Test #14: TEST:basic\.disabled_case!2 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
- Start 15: TEST:disabled\.case!2
- 4/11 Test #15: TEST:disabled\.case!2 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
- Start 16: TEST:typed/short\.case!2
- 5/11 Test #16: TEST:typed/short\.case!2 \.+ +Passed +[0-9.]+ sec
- Start 17: TEST:typed/float\.case!2
- 6/11 Test #17: TEST:typed/float\.case!2 \.+ +Passed +[0-9.]+ sec
- Start 18: TEST:value/test\.case/1!2
- 7/11 Test #18: TEST:value/test\.case/1!2 \.+ +Passed +[0-9.]+ sec
- Start 19: TEST:value/test\.case/"foo"!2
- 8/11 Test #19: TEST:value/test\.case/"foo"!2 \.+ +Passed +[0-9.]+ sec
- Start 20: TEST:param/special\.case/"semicolon;"!2
- 9/11 Test #20: TEST:param/special\.case/"semicolon;"!2 \.+ +Passed +[0-9.]+ sec
- Start 21: TEST:param/special\.case/"backslash\\"!2
-10/11 Test #21: TEST:param/special\.case/"backslash\\"!2 \.+ +Passed +[0-9.]+ sec
- Start 22: TEST:param/special\.case/"\$\{var\}"!2
-11/11 Test #22: TEST:param/special\.case/"\$\{var\}"!2 \.+ +Passed +[0-9.]+ sec
+ Start 14: TEST:basic\.case_foo!2
+ 1/13 Test #14: TEST:basic\.case_foo!2 \.+ +Passed +[0-9.]+ sec
+ Start 15: TEST:basic\.case_bar!2
+ 2/13 Test #15: TEST:basic\.case_bar!2 \.+ +Passed +[0-9.]+ sec
+ Start 16: TEST:basic\.disabled_case!2
+ 3/13 Test #16: TEST:basic\.disabled_case!2 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
+ Start 17: TEST:basic\.DISABLEDnot_really_case!2
+ 4/13 Test #17: TEST:basic\.DISABLEDnot_really_case!2 \.+ +Passed +[0-9.]+ sec
+ Start 18: TEST:disabled\.case!2
+ 5/13 Test #18: TEST:disabled\.case!2 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
+ Start 19: TEST:DISABLEDnotreally\.case!2
+ 6/13 Test #19: TEST:DISABLEDnotreally\.case!2 \.+ +Passed +[0-9.]+ sec
+ Start 20: TEST:typed/short\.case!2
+ 7/13 Test #20: TEST:typed/short\.case!2 \.+ +Passed +[0-9.]+ sec
+ Start 21: TEST:typed/float\.case!2
+ 8/13 Test #21: TEST:typed/float\.case!2 \.+ +Passed +[0-9.]+ sec
+ Start 22: TEST:value/test\.case/1!2
+ 9/13 Test #22: TEST:value/test\.case/1!2 \.+ +Passed +[0-9.]+ sec
+ Start 23: TEST:value/test\.case/"foo"!2
+10/13 Test #23: TEST:value/test\.case/"foo"!2 \.+ +Passed +[0-9.]+ sec
+ Start 24: TEST:param/special\.case/"semicolon;"!2
+11/13 Test #24: TEST:param/special\.case/"semicolon;"!2 \.+ +Passed +[0-9.]+ sec
+ Start 25: TEST:param/special\.case/"backslash\\"!2
+12/13 Test #25: TEST:param/special\.case/"backslash\\"!2 \.+ +Passed +[0-9.]+ sec
+ Start 26: TEST:param/special\.case/"\$\{var\}"!2
+13/13 Test #26: TEST:param/special\.case/"\$\{var\}"!2 \.+ +Passed +[0-9.]+ sec
-100% tests passed, 0 tests failed out of 9
+100% tests passed, 0 tests failed out of 11
Total Test time \(real\) = +[0-9.]+ sec
The following tests did not run:
-.*14 - TEST:basic\.disabled_case!2 \(Disabled\)
-.*15 - TEST:disabled\.case!2 \(Disabled\)
+.*16 - TEST:basic\.disabled_case!2 \(Disabled\)
+.*18 - TEST:disabled\.case!2 \(Disabled\)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest.cmake b/Tests/RunCMake/GoogleTest/GoogleTest.cmake
index 6aa2658..8efd117 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest.cmake
+++ b/Tests/RunCMake/GoogleTest/GoogleTest.cmake
@@ -1,9 +1,12 @@
-project(test_include_dirs LANGUAGES CXX)
+enable_language(CXX)
include(GoogleTest)
enable_testing()
+include(xcode_sign_adhoc.cmake)
+
add_executable(fake_gtest fake_gtest.cpp)
+xcode_sign_adhoc(fake_gtest)
gtest_discover_tests(
fake_gtest
@@ -22,6 +25,7 @@ gtest_discover_tests(
)
add_executable(no_tests_defined no_tests_defined.cpp)
+xcode_sign_adhoc(no_tests_defined)
gtest_discover_tests(
no_tests_defined
@@ -33,6 +37,7 @@ gtest_discover_tests(
# 3.10.3 and later behavior, old behavior added in 3.10.1
# is not supported.
add_executable(property_timeout_test timeout_test.cpp)
+xcode_sign_adhoc(property_timeout_test)
target_compile_definitions(property_timeout_test PRIVATE sleepSec=10)
gtest_discover_tests(
@@ -50,6 +55,7 @@ gtest_discover_tests(
)
add_executable(skip_test skip_test.cpp)
+xcode_sign_adhoc(skip_test)
gtest_discover_tests(
skip_test
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake
index df784fe..2fae1e2 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake
+++ b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake
@@ -1,9 +1,12 @@
-project(test_include_dirs LANGUAGES CXX)
+enable_language(CXX)
include(GoogleTest)
enable_testing()
+include(xcode_sign_adhoc.cmake)
+
add_executable(configuration_gtest configuration_gtest.cpp)
+xcode_sign_adhoc(configuration_gtest)
target_compile_definitions(configuration_gtest PRIVATE $<$<CONFIG:Debug>:DEBUG=1>)
gtest_discover_tests(
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake
index 20e9d65..5c24d41 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake
+++ b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake
@@ -1,9 +1,12 @@
-project(test_include_dirs LANGUAGES CXX)
+enable_language(CXX)
include(GoogleTest)
enable_testing()
+include(xcode_sign_adhoc.cmake)
+
add_executable(discovery_timeout_test timeout_test.cpp)
+xcode_sign_adhoc(discovery_timeout_test)
target_compile_definitions(discovery_timeout_test PRIVATE discoverySleepSec=10)
gtest_discover_tests(
discovery_timeout_test
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake
index fb91c0e..53eedc0 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake
+++ b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake
@@ -1,8 +1,10 @@
-project(test_include_dirs LANGUAGES CXX)
+enable_language(CXX)
include(GoogleTest)
enable_testing()
+include(xcode_sign_adhoc.cmake)
+
# This creates the folder structure for the paramterized tests
# to avoid handling missing folders in C++
#
@@ -15,6 +17,7 @@ enable_testing()
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/GoogleTestXMLSpecial/cases.case")
add_executable(xml_output xml_output.cpp)
+xcode_sign_adhoc(xml_output)
gtest_discover_tests(
xml_output
XML_OUTPUT_DIR ${CMAKE_BINARY_DIR}
diff --git a/Tests/RunCMake/GoogleTest/fake_gtest.cpp b/Tests/RunCMake/GoogleTest/fake_gtest.cpp
index a8127bf..1956c37 100644
--- a/Tests/RunCMake/GoogleTest/fake_gtest.cpp
+++ b/Tests/RunCMake/GoogleTest/fake_gtest.cpp
@@ -12,8 +12,11 @@ int main(int argc, char** argv)
std::cout << " case_foo" << std::endl;
std::cout << " case_bar" << std::endl;
std::cout << " DISABLED_disabled_case" << std::endl;
+ std::cout << " DISABLEDnot_really_case" << std::endl;
std::cout << "DISABLED_disabled." << std::endl;
std::cout << " case" << std::endl;
+ std::cout << "DISABLEDnotreally." << std::endl;
+ std::cout << " case" << std::endl;
std::cout << "typed/0. # TypeParam = short" << std::endl;
std::cout << " case" << std::endl;
std::cout << "typed/1. # TypeParam = float" << std::endl;
diff --git a/Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake b/Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake
new file mode 100644
index 0000000..d2dc530
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/xcode_sign_adhoc.cmake
@@ -0,0 +1,8 @@
+function(xcode_sign_adhoc target)
+ if(CMAKE_GENERATOR STREQUAL "Xcode" AND
+ "${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64")
+ # Xcode runs POST_BUILD before signing, so let the linker use ad-hoc signing.
+ # See CMake Issue 21845.
+ target_link_options(${target} PRIVATE LINKER:-adhoc_codesign)
+ endif()
+endfunction()
diff --git a/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-NEW.cmake b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-NEW.cmake
new file mode 100644
index 0000000..c8b0a91
--- /dev/null
+++ b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0117 NEW)
+include(CMP0117-common.cmake)
diff --git a/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD.cmake b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD.cmake
new file mode 100644
index 0000000..c0a61d0
--- /dev/null
+++ b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0117 OLD)
+include(CMP0117-common.cmake)
diff --git a/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-WARN.cmake b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-WARN.cmake
new file mode 100644
index 0000000..37d1b64
--- /dev/null
+++ b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-WARN.cmake
@@ -0,0 +1,2 @@
+
+include(CMP0117-common.cmake)
diff --git a/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-common.cmake b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-common.cmake
new file mode 100644
index 0000000..5dda623
--- /dev/null
+++ b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMP0117-common.cmake
@@ -0,0 +1,12 @@
+enable_language(CXX)
+
+cmake_policy(GET CMP0117 cmp0117)
+if(cmp0117 STREQUAL "NEW")
+ if(" ${CMAKE_CXX_FLAGS} " MATCHES " ([/-]GR) ")
+ message(SEND_ERROR "CMAKE_CXX_FLAGS has '${CMAKE_MATCH_1}' under NEW behavior")
+ endif()
+else()
+ if(NOT " ${CMAKE_CXX_FLAGS} " MATCHES " /GR ")
+ message(SEND_ERROR "CMAKE_CXX_FLAGS does not have '/GR' under OLD behavior")
+ endif()
+endif()
diff --git a/Tests/RunCMake/MSVCRuntimeTypeInfo/CMakeLists.txt b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMakeLists.txt
new file mode 100644
index 0000000..3e470a2
--- /dev/null
+++ b/Tests/RunCMake/MSVCRuntimeTypeInfo/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.14)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/MSVCRuntimeTypeInfo/RunCMakeTest.cmake b/Tests/RunCMake/MSVCRuntimeTypeInfo/RunCMakeTest.cmake
new file mode 100644
index 0000000..c870f59
--- /dev/null
+++ b/Tests/RunCMake/MSVCRuntimeTypeInfo/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+run_cmake(CMP0117-WARN)
+run_cmake(CMP0117-OLD)
+run_cmake(CMP0117-NEW)
diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt
deleted file mode 100644
index 74d62a4..0000000
--- a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Error at CustomCommandDepfile-ERROR.cmake:1 \(add_custom_command\):
- add_custom_command Option DEPFILE not supported by [^
-]+
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake b/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake
deleted file mode 100644
index bad7955..0000000
--- a/Tests/RunCMake/Make/CustomCommandDepfile-ERROR.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-add_custom_command(
- OUTPUT hello.copy.c
- COMMAND "${CMAKE_COMMAND}" -E copy
- "${CMAKE_CURRENT_SOURCE_DIR}/hello.c"
- hello.copy.c
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
- DEPFILE "test.d"
- )
diff --git a/Tests/RunCMake/Make/MakefileConflict.cmake b/Tests/RunCMake/Make/MakefileConflict.cmake
new file mode 100644
index 0000000..6a8406f
--- /dev/null
+++ b/Tests/RunCMake/Make/MakefileConflict.cmake
@@ -0,0 +1,5 @@
+add_custom_target(Custom)
+
+# Write a file that GNU make will prefer over "Makefile"
+# if 'cmake --build' does not explicitly specify it.
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/GNUmakefile" "")
diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake
index 5562aca..c7717ec 100644
--- a/Tests/RunCMake/Make/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Make/RunCMakeTest.cmake
@@ -39,9 +39,16 @@ function(run_VerboseBuild)
endfunction()
run_VerboseBuild()
-run_cmake(CustomCommandDepfile-ERROR)
run_cmake(IncludeRegexSubdir)
+function(run_MakefileConflict)
+ run_cmake(MakefileConflict)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/MakefileConflict-build)
+ run_cmake_command(MakefileConflict-build ${CMAKE_COMMAND} --build . --target Custom)
+endfunction()
+run_MakefileConflict()
+
function(run_CMP0113 val)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0113-${val}-build)
run_cmake(CMP0113-${val})
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/Ninja/Qt5AutoMocDeps.cmake b/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake
index d69a119..7456608 100644
--- a/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake
+++ b/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake
@@ -7,3 +7,7 @@ set(CMAKE_AUTOMOC ON)
add_library(simple_lib SHARED simple_lib.cpp)
add_executable(app_with_qt app.cpp app_qt.cpp)
target_link_libraries(app_with_qt PRIVATE simple_lib Qt5::Core)
+
+add_subdirectory(QtSubDir1)
+add_subdirectory(QtSubDir2)
+add_subdirectory(QtSubDir3)
diff --git a/Tests/RunCMake/Ninja/QtSubDir1/CMakeLists.txt b/Tests/RunCMake/Ninja/QtSubDir1/CMakeLists.txt
new file mode 100644
index 0000000..64016b6
--- /dev/null
+++ b/Tests/RunCMake/Ninja/QtSubDir1/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0116 OLD)
+
+add_executable(sub_exe_1 ../app.cpp)
+target_link_libraries(sub_exe_1 PRIVATE Qt5::Core)
diff --git a/Tests/RunCMake/Ninja/QtSubDir2/CMakeLists.txt b/Tests/RunCMake/Ninja/QtSubDir2/CMakeLists.txt
new file mode 100644
index 0000000..3176426
--- /dev/null
+++ b/Tests/RunCMake/Ninja/QtSubDir2/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0116 NEW)
+
+add_executable(sub_exe_2 ../app.cpp)
+target_link_libraries(sub_exe_2 PRIVATE Qt5::Core)
diff --git a/Tests/RunCMake/Ninja/QtSubDir3/CMakeLists.txt b/Tests/RunCMake/Ninja/QtSubDir3/CMakeLists.txt
new file mode 100644
index 0000000..d38cfe0
--- /dev/null
+++ b/Tests/RunCMake/Ninja/QtSubDir3/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_executable(sub_exe_3 ../app.cpp)
+target_link_libraries(sub_exe_3 PRIVATE Qt5::Core)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 35be2ec..1b252cd 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -340,8 +340,17 @@ function(run_Qt5AutoMocDeps)
# Build and assert that AUTOMOC was not run for app_with_qt.
run_ninja("${RunCMake_TEST_BINARY_DIR}")
if(ninja_stdout MATCHES "Automatic MOC for target app_with_qt")
- message(FATAL_ERROR
- "AUTOMOC should not have executed for 'app_with_qt' target:\nstdout:\n${ninja_stdout}")
+ message(FATAL_ERROR
+ "AUTOMOC should not have executed for 'app_with_qt' target:\nstdout:\n${ninja_stdout}")
+ endif()
+ # Assert that the subdir executables were not rebuilt.
+ if(ninja_stdout MATCHES "Automatic MOC for target sub_exe_1")
+ message(FATAL_ERROR
+ "AUTOMOC should not have executed for 'sub_exe_1' target:\nstdout:\n${ninja_stdout}")
+ endif()
+ if(ninja_stdout MATCHES "Automatic MOC for target sub_exe_2")
+ message(FATAL_ERROR
+ "AUTOMOC should not have executed for 'sub_exe_2' target:\nstdout:\n${ninja_stdout}")
endif()
endif()
endfunction()
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-again-ninja-check.cmake
index 1e4cbe1..1e4cbe1 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-again-ninja-check.cmake
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..cc2e49a
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating depend_echo_genex_Debug\.txt
+depend_echo_genex_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-ninja-stdout.txt
new file mode 100644
index 0000000..cc2e49a
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating depend_echo_genex_Debug\.txt
+depend_echo_genex_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..214e747
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Release[\/]echo(\.exe)?
+\[3/3\] Generating depend_echo_genex_cmd_Debug\.txt
+depend_echo_genex_cmd_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-ninja-stdout.txt
new file mode 100644
index 0000000..842336d
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating depend_echo_genex_cmd_Debug\.txt
+depend_echo_genex_cmd_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..eafe30b
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating depend_echo_genex_out_Debug\.txt
+depend_echo_genex_out_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-ninja-stdout.txt
new file mode 100644
index 0000000..eafe30b
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating depend_echo_genex_out_Debug\.txt
+depend_echo_genex_out_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..e7b74b9
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Release[\/]echo(\.exe)?
+\[3/3\] Generating depend_echo_raw_Debug\.txt
+depend_echo_raw_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-ninja-stdout.txt
new file mode 100644
index 0000000..2e01d6a
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating depend_echo_raw_Debug\.txt
+depend_echo_raw_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..7455c25
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] Generating echo_depend_Debug\.txt
+echo_depend_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-ninja-stdout.txt
new file mode 100644
index 0000000..7455c25
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] Generating echo_depend_Debug\.txt
+echo_depend_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..6d5620d
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Release\.txt
+depend_Release\.txt
+\[2/2\] Generating echo_depend_cmd_Debug\.txt
+echo_depend_cmd_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-ninja-stdout.txt
new file mode 100644
index 0000000..2f0f1f1
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] Generating echo_depend_cmd_Debug\.txt
+echo_depend_cmd_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..39f5471
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] Generating echo_depend_out_Debug\.txt
+echo_depend_out_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-ninja-stdout.txt
new file mode 100644
index 0000000..39f5471
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] Generating echo_depend_out_Debug\.txt
+echo_depend_out_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..cc43cda
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Release[\/]echo(\.exe)?
+\[3/3\] Generating echo_genex_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Release' 'echo_genex_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-ninja-stdout.txt
new file mode 100644
index 0000000..11985c6
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating echo_genex_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_genex_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..68a8cd1
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating echo_genex_out_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_genex_out_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-ninja-stdout.txt
new file mode 100644
index 0000000..76b409d
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating echo_genex_out_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_genex_out_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-stderr.txt
new file mode 100644
index 0000000..86f7995
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-stderr.txt
@@ -0,0 +1 @@
+ninja: error: 'echo_no_cross_byproduct_Debug\.txt', needed by 'CMakeFiles/echo_no_cross_byproduct-Debug', missing and no known rule to make it
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-ninja-stdout.txt
new file mode 100644
index 0000000..1c74b71
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating echo_no_cross_byproduct_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_no_cross_byproduct_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-stderr.txt
new file mode 100644
index 0000000..e41cb17
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-stderr.txt
@@ -0,0 +1 @@
+ninja: error: 'echo_no_cross_byproduct_if_Debug\.txt', needed by 'CMakeFiles/echo_no_cross_byproduct_if-Debug', missing and no known rule to make it
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-ninja-stdout.txt
new file mode 100644
index 0000000..294d48b
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating echo_no_cross_byproduct_if_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_no_cross_byproduct_if_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-result.txt
new file mode 100644
index 0000000..d197c91
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-stderr.txt
new file mode 100644
index 0000000..2ea22fa
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-stderr.txt
@@ -0,0 +1 @@
+ninja: error: 'echo_no_cross_output_Debug\.txt', needed by 'CMakeFiles/echo_no_cross_output-Debug', missing and no known rule to make it
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-ninja-stdout.txt
new file mode 100644
index 0000000..1f4cc41
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating echo_no_cross_output\.txt, echo_no_cross_output_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_no_cross_output_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-stderr.txt
new file mode 100644
index 0000000..fde66ea
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-stderr.txt
@@ -0,0 +1 @@
+ninja: error: 'echo_no_cross_output_if_Debug\.txt', needed by 'CMakeFiles/echo_no_cross_output_if-Debug', missing and no known rule to make it
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-ninja-stdout.txt
new file mode 100644
index 0000000..dc31f3b
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating echo_no_cross_output_a\.txt, echo_no_cross_output_if_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_no_cross_output_if_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..01ebae3
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Release[\/]echo(\.exe)?
+\[3/3\] Generating echo_raw_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Debug' 'echo_raw_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-ninja-stdout.txt
new file mode 100644
index 0000000..242c9b0
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] Generating echo_raw_Debug\.txt
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_raw_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..e77ef1a
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] echo_target_depend
+echo_target_depend_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-ninja-stdout.txt
new file mode 100644
index 0000000..e77ef1a
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] echo_target_depend
+echo_target_depend_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..8196fcb
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Release\.txt
+depend_Release\.txt
+\[2/2\] echo_target_depend_cmd
+echo_target_depend_cmd_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-ninja-stdout.txt
new file mode 100644
index 0000000..d45dcc2
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] echo_target_depend_cmd
+echo_target_depend_cmd_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..45f2e57
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,5 @@
+^(Recompacting log\.\.\.
+)?\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] echo_target_depend_out
+echo_target_depend_out_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-ninja-stdout.txt
new file mode 100644
index 0000000..d90a2f3
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] Generating depend_Debug\.txt
+depend_Debug\.txt
+\[2/2\] echo_target_depend_out
+echo_target_depend_out_Debug\.txt$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..73b403f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Release[\/]echo(\.exe)?
+\[3/3\] echo_target_genex
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Release' 'echo_target_genex_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-ninja-stdout.txt
new file mode 100644
index 0000000..c374ce8
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] echo_target_genex
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_target_genex_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..ad6d6e0
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] echo_target_genex_out
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_target_genex_out_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-ninja-stdout.txt
new file mode 100644
index 0000000..e819fdf
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] echo_target_genex_out
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_target_genex_out_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..34df645
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Release[\/]echo(\.exe)?
+\[3/3\] echo_target_raw
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Debug' 'echo_target_raw_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-ninja-stdout.txt
new file mode 100644
index 0000000..3fa5488
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] echo_target_raw
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_target_raw_Debug\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-in-release-graph-ninja-stdout.txt
new file mode 100644
index 0000000..f504d98
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-in-release-graph-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Release[\/]echo(\.exe)?
+\[3/3\] target_no_cross_byproduct
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Release' 'target_no_cross_byproduct\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-ninja-stdout.txt
new file mode 100644
index 0000000..6e933b2
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj)
+\[2/3\] Linking C executable Debug[\/]echo(\.exe)?
+\[3/3\] target_no_cross_byproduct
+'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'target_no_cross_byproduct\.txt'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake
new file mode 100644
index 0000000..5d6f421
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake
@@ -0,0 +1,167 @@
+enable_language(C)
+
+add_executable(echo echo.c)
+
+add_custom_command(
+ OUTPUT echo_raw_$<CONFIG>.txt
+ COMMAND echo $<CONFIG> echo_raw_$<CONFIG>.txt
+ WORKING_DIRECTORY $<CONFIG>
+ )
+
+add_custom_command(
+ OUTPUT echo_genex_$<IF:$<CONFIG:Debug>,Debug,$<IF:$<CONFIG:Release>,Release,$<IF:$<CONFIG:MinSizeRel>,MinSizeRel,RelWithDebInfo>>>.txt
+ COMMAND $<TARGET_FILE:echo> $<COMMAND_CONFIG:$<CONFIG>> echo_genex_$<OUTPUT_CONFIG:$<CONFIG>>.txt
+ WORKING_DIRECTORY $<OUTPUT_CONFIG:$<CONFIG>>
+ )
+
+add_custom_command(
+ OUTPUT echo_genex_out_$<CONFIG>.txt
+ COMMAND $<OUTPUT_CONFIG:$<TARGET_FILE:echo>> $<CONFIG> echo_genex_out_$<CONFIG>.txt
+ WORKING_DIRECTORY $<COMMAND_CONFIG:$<CONFIG>>
+ )
+
+add_custom_command(
+ OUTPUT depend_$<CONFIG>.txt
+ COMMAND ${CMAKE_COMMAND} -E echo depend_$<CONFIG>.txt
+ )
+
+add_custom_command(
+ OUTPUT echo_depend_$<CONFIG>.txt
+ COMMAND ${CMAKE_COMMAND} -E echo echo_depend_$<CONFIG>.txt
+ DEPENDS depend_$<CONFIG>.txt
+ )
+
+add_custom_command(
+ OUTPUT echo_depend_out_$<CONFIG>.txt
+ COMMAND ${CMAKE_COMMAND} -E echo echo_depend_out_$<CONFIG>.txt
+ DEPENDS $<OUTPUT_CONFIG:depend_$<CONFIG>.txt>
+ )
+
+add_custom_command(
+ OUTPUT echo_depend_cmd_$<CONFIG>.txt
+ COMMAND ${CMAKE_COMMAND} -E echo echo_depend_cmd_$<CONFIG>.txt
+ DEPENDS $<COMMAND_CONFIG:depend_$<CONFIG>.txt>
+ )
+
+add_custom_command(
+ OUTPUT depend_echo_raw_$<CONFIG>.txt
+ COMMAND ${CMAKE_COMMAND} -E echo depend_echo_raw_$<CONFIG>.txt
+ DEPENDS echo
+ )
+
+add_custom_command(
+ OUTPUT depend_echo_genex_$<CONFIG>.txt
+ COMMAND ${CMAKE_COMMAND} -E echo depend_echo_genex_$<CONFIG>.txt
+ DEPENDS $<TARGET_FILE:echo>
+ )
+
+add_custom_command(
+ OUTPUT depend_echo_genex_out_$<CONFIG>.txt
+ COMMAND ${CMAKE_COMMAND} -E echo depend_echo_genex_out_$<CONFIG>.txt
+ DEPENDS $<OUTPUT_CONFIG:$<TARGET_FILE:echo>>
+ )
+
+add_custom_command(
+ OUTPUT depend_echo_genex_cmd_$<CONFIG>.txt
+ COMMAND ${CMAKE_COMMAND} -E echo depend_echo_genex_cmd_$<CONFIG>.txt
+ DEPENDS $<COMMAND_CONFIG:$<TARGET_FILE:echo>>
+ )
+
+# An OUTPUT that is not per-config prevents cross-config generation.
+add_custom_command(
+ OUTPUT echo_no_cross_output.txt echo_no_cross_output_$<CONFIG>.txt
+ COMMAND echo $<CONFIG> echo_no_cross_output_$<CONFIG>.txt
+ WORKING_DIRECTORY $<CONFIG>
+ )
+add_custom_command(
+ OUTPUT echo_no_cross_output_$<IF:$<CONFIG:Debug>,a,b>.txt echo_no_cross_output_if_$<CONFIG>.txt
+ COMMAND echo $<CONFIG> echo_no_cross_output_if_$<CONFIG>.txt
+ WORKING_DIRECTORY $<CONFIG>
+ )
+
+# BYPRODUCTS that are not per-config prevent cross-config generation.
+add_custom_command(
+ OUTPUT echo_no_cross_byproduct_$<CONFIG>.txt
+ BYPRODUCTS echo_no_cross_byproduct.txt
+ COMMAND echo $<CONFIG> echo_no_cross_byproduct_$<CONFIG>.txt
+ WORKING_DIRECTORY $<CONFIG>
+ )
+add_custom_command(
+ OUTPUT echo_no_cross_byproduct_if_$<CONFIG>.txt
+ BYPRODUCTS echo_no_cross_byproduct_$<IF:$<CONFIG:Debug>,a,b>.txt
+ COMMAND echo $<CONFIG> echo_no_cross_byproduct_if_$<CONFIG>.txt
+ WORKING_DIRECTORY $<CONFIG>
+ )
+
+foreach(case
+ echo_raw
+ echo_genex
+ echo_genex_out
+ echo_depend
+ echo_depend_out
+ echo_depend_cmd
+ depend
+ depend_echo_raw
+ depend_echo_genex
+ depend_echo_genex_out
+ depend_echo_genex_cmd
+ echo_no_cross_output
+ echo_no_cross_output_if
+ echo_no_cross_byproduct
+ echo_no_cross_byproduct_if
+ )
+ set_property(SOURCE
+ ${CMAKE_CURRENT_BINARY_DIR}/${case}_Debug.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/${case}_Release.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/${case}_MinSizeRel.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/${case}_RelWithDebInfo.txt
+ PROPERTY SYMBOLIC 1)
+ add_custom_target(${case} DEPENDS ${case}_$<CONFIG>.txt)
+endforeach()
+
+add_custom_target(echo_target_raw
+ BYPRODUCTS echo_target_raw_$<CONFIG>.txt
+ COMMENT echo_target_raw
+ COMMAND echo $<CONFIG> echo_target_raw_$<CONFIG>.txt
+ WORKING_DIRECTORY $<CONFIG>
+ )
+
+add_custom_target(echo_target_genex
+ BYPRODUCTS echo_target_genex_$<CONFIG>.txt
+ COMMENT echo_target_genex
+ COMMAND $<TARGET_FILE:echo> $<COMMAND_CONFIG:$<CONFIG>> echo_target_genex_$<OUTPUT_CONFIG:$<CONFIG>>.txt
+ WORKING_DIRECTORY $<OUTPUT_CONFIG:$<CONFIG>>
+ )
+
+add_custom_target(echo_target_genex_out
+ BYPRODUCTS echo_target_genex_out_$<CONFIG>.txt
+ COMMENT echo_target_genex_out
+ COMMAND $<OUTPUT_CONFIG:$<TARGET_FILE:echo>> $<CONFIG> echo_target_genex_out_$<CONFIG>.txt
+ WORKING_DIRECTORY $<COMMAND_CONFIG:$<CONFIG>>
+ )
+
+add_custom_target(echo_target_depend
+ COMMAND ${CMAKE_COMMAND} -E echo echo_target_depend_$<CONFIG>.txt
+ DEPENDS depend_$<CONFIG>.txt
+ COMMENT echo_target_depend
+ )
+
+add_custom_target(echo_target_depend_out
+ COMMAND ${CMAKE_COMMAND} -E echo echo_target_depend_out_$<CONFIG>.txt
+ DEPENDS $<OUTPUT_CONFIG:depend_$<CONFIG>.txt>
+ COMMENT echo_target_depend_out
+ )
+
+add_custom_target(echo_target_depend_cmd
+ COMMAND ${CMAKE_COMMAND} -E echo echo_target_depend_cmd_$<CONFIG>.txt
+ DEPENDS $<COMMAND_CONFIG:depend_$<CONFIG>.txt>
+ COMMENT echo_target_depend_cmd
+ )
+
+# BYPRODUCTS that are not per-config block cross-configs.
+add_custom_target(target_no_cross_byproduct
+ BYPRODUCTS target_no_cross_byproduct.txt
+ COMMENT target_no_cross_byproduct
+ COMMAND echo $<CONFIG> target_no_cross_byproduct.txt
+ WORKING_DIRECTORY $<CONFIG>
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/PostBuild-debug-in-release-graph-build-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/PostBuild-debug-in-release-graph-build-stdout.txt
new file mode 100644
index 0000000..fad923a
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/PostBuild-debug-in-release-graph-build-stdout.txt
@@ -0,0 +1,2 @@
+Running post-build command with Debug
+Generating Debug\.txt
diff --git a/Tests/RunCMake/NinjaMultiConfig/PostBuild-release-build-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/PostBuild-release-build-stdout.txt
new file mode 100644
index 0000000..485a52c
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/PostBuild-release-build-stdout.txt
@@ -0,0 +1,3 @@
+Running post-build command with Release
+Generating out\.txt with Release
+Generating Release\.txt
diff --git a/Tests/RunCMake/NinjaMultiConfig/PostBuild.cmake b/Tests/RunCMake/NinjaMultiConfig/PostBuild.cmake
new file mode 100644
index 0000000..5fcff74
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/PostBuild.cmake
@@ -0,0 +1,6 @@
+enable_language(C)
+
+add_executable(Exe main.c)
+add_custom_command(TARGET Exe POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "Running post-build command with $<CONFIG>")
+add_custom_command(TARGET Exe POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "Generating out.txt with $<CONFIG>" BYPRODUCTS out.txt)
+add_custom_command(TARGET Exe POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo "Generating $<CONFIG>.txt" BYPRODUCTS $<CONFIG>.txt)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake b/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake
index 3a1c7f5..578256a 100644
--- a/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake
@@ -16,12 +16,13 @@ if(Qt5Core_VERSION VERSION_GREATER_EQUAL "5.15.0")
set(moc_writes_depfiles 1)
endif()
-set(autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/mocs_compilation.cpp")
+set(autogen_files)
if(moc_writes_depfiles)
list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/deps")
list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/timestamp")
endif()
foreach(c IN LISTS CMAKE_CONFIGURATION_TYPES)
+ list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/mocs_compilation_${c}.cpp")
list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${c}/moc_qt5.cpp")
if(moc_writes_depfiles)
list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${c}/moc_qt5.cpp.d")
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 6699a09..21c2658 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -85,6 +85,9 @@ set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=RelWithDebInfo\\;Debug\\;
run_cmake_configure(Simple)
unset(RunCMake_TEST_OPTIONS)
include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_ninja(Simple targets-default build.ninja -t targets)
+run_ninja(Simple targets-debug build-Debug.ninja -t targets)
+run_ninja(Simple targets-release build-Debug.ninja -t targets)
run_cmake_build(Simple debug-target Debug simpleexe)
run_ninja(Simple debug-target build-Debug.ninja simplestatic)
get_filename_component(simpleshared_Release "${TARGET_FILE_simpleshared_Release}" NAME)
@@ -187,6 +190,12 @@ run_ninja(SimpleCrossConfigs clean-all-in-release-graph build-Release.ninja clea
run_cmake_build(SimpleCrossConfigs all-all-in-release-graph Release all:all)
run_cmake_build(SimpleCrossConfigs all-relwithdebinfo-in-release-graph Release all:RelWithDebInfo)
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/PostBuild-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all")
+run_cmake_configure(PostBuild)
+run_cmake_build(PostBuild release Release Exe)
+run_cmake_build(PostBuild debug-in-release-graph Release Exe:Debug)
+
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Framework-build)
set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all")
run_cmake_configure(Framework)
@@ -215,7 +224,7 @@ run_ninja(CustomCommandGenerator debug-clean build-Debug.ninja clean)
run_cmake_build(CustomCommandGenerator release-clean Release clean)
run_cmake_build(CustomCommandGenerator debug-in-release-graph Release generated:Debug)
run_cmake_command(CustomCommandGenerator-debug-in-release-graph-generated "${TARGET_FILE_generated_Debug}")
-run_ninja(CustomCommandGenerator debug-in-release-graph-clean build-Debug.ninja clean:Debug)
+run_ninja(CustomCommandGenerator debug-clean-again build-Debug.ninja clean:Debug)
run_ninja(CustomCommandGenerator release-in-debug-graph build-Debug.ninja generated:Release)
run_cmake_command(CustomCommandGenerator-release-in-debug-graph-generated "${TARGET_FILE_generated_Release}")
unset(RunCMake_TEST_NO_CLEAN)
@@ -242,6 +251,102 @@ run_ninja(CustomCommandsAndTargets release-leaf-exe build-Release.ninja LeafExe)
run_cmake_build(CustomCommandsAndTargets release-clean Release clean:all)
run_ninja(CustomCommandsAndTargets release-leaf-byproduct build-Release.ninja main.c)
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandOutputGenex-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo;-DCMAKE_CROSS_CONFIGS=all")
+run_cmake_configure(CustomCommandOutputGenex)
+set(RunCMake_TEST_NO_CLEAN 1)
+unset(RunCMake_TEST_OPTIONS)
+# echo_raw
+run_ninja(CustomCommandOutputGenex echo_raw-debug build-Debug.ninja echo_raw:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_raw-debug-in-release-graph build-Release.ninja echo_raw:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# echo_genex
+run_ninja(CustomCommandOutputGenex echo_genex-debug build-Debug.ninja echo_genex:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_genex-debug-in-release-graph build-Release.ninja echo_genex:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# echo_genex_out
+run_ninja(CustomCommandOutputGenex echo_genex_out-debug build-Debug.ninja echo_genex_out:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_genex_out-debug-in-release-graph build-Release.ninja echo_genex_out:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# echo_depend*
+run_ninja(CustomCommandOutputGenex echo_depend-debug build-Debug.ninja echo_depend:Debug)
+run_ninja(CustomCommandOutputGenex echo_depend_out-debug build-Debug.ninja echo_depend_out_Debug.txt)
+run_ninja(CustomCommandOutputGenex echo_depend_cmd-debug build-Debug.ninja echo_depend_cmd_Debug.txt)
+run_ninja(CustomCommandOutputGenex echo_depend-debug-in-release-graph build-Release.ninja echo_depend:Debug)
+run_ninja(CustomCommandOutputGenex echo_depend_out-debug-in-release-graph build-Release.ninja echo_depend_out_Debug.txt)
+run_ninja(CustomCommandOutputGenex echo_depend_cmd-debug-in-release-graph build-Release.ninja echo_depend_cmd_Debug.txt)
+# depend_echo_raw
+run_ninja(CustomCommandOutputGenex depend_echo_raw-debug build-Debug.ninja depend_echo_raw:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex depend_echo_raw-debug-in-release-graph build-Release.ninja depend_echo_raw:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# depend_echo_genex
+run_ninja(CustomCommandOutputGenex depend_echo_genex-debug build-Debug.ninja depend_echo_genex:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex depend_echo_genex-debug-in-release-graph build-Release.ninja depend_echo_genex:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# depend_echo_genex_out
+run_ninja(CustomCommandOutputGenex depend_echo_genex_out-debug build-Debug.ninja depend_echo_genex_out:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex depend_echo_genex_out-debug-in-release-graph build-Release.ninja depend_echo_genex_out:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# depend_echo_genex_cmd
+run_ninja(CustomCommandOutputGenex depend_echo_genex_cmd-debug build-Debug.ninja depend_echo_genex_cmd:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex depend_echo_genex_cmd-debug-in-release-graph build-Release.ninja depend_echo_genex_cmd:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# no_cross_output
+run_ninja(CustomCommandOutputGenex echo_no_cross_output-debug build-Debug.ninja echo_no_cross_output:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_no_cross_output-debug-in-release-graph build-Release.ninja echo_no_cross_output:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# no_cross_output_if
+run_ninja(CustomCommandOutputGenex echo_no_cross_output_if-debug build-Debug.ninja echo_no_cross_output_if:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_no_cross_output_if-debug-in-release-graph build-Release.ninja echo_no_cross_output_if:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# no_cross_byproduct
+run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct-debug build-Debug.ninja echo_no_cross_byproduct:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct-debug-in-release-graph build-Release.ninja echo_no_cross_byproduct:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# no_cross_byproduct_if
+run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct_if-debug build-Debug.ninja echo_no_cross_byproduct_if:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct_if-debug-in-release-graph build-Release.ninja echo_no_cross_byproduct_if:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# echo_target_raw
+run_ninja(CustomCommandOutputGenex echo_target_raw-debug build-Debug.ninja echo_target_raw:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_target_raw-debug-in-release-graph build-Release.ninja echo_target_raw:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# echo_target_genex
+run_ninja(CustomCommandOutputGenex echo_target_genex-debug build-Debug.ninja echo_target_genex:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_target_genex-debug-in-release-graph build-Release.ninja echo_target_genex:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# echo_target_genex_out
+run_ninja(CustomCommandOutputGenex echo_target_genex_out-debug build-Debug.ninja echo_target_genex_out:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex echo_target_genex_out-debug-in-release-graph build-Release.ninja echo_target_genex_out:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# echo_target_depend*
+run_ninja(CustomCommandOutputGenex echo_target_depend-debug build-Debug.ninja echo_target_depend:Debug)
+run_ninja(CustomCommandOutputGenex echo_target_depend_out-debug build-Debug.ninja echo_target_depend_out:Debug)
+run_ninja(CustomCommandOutputGenex echo_target_depend_cmd-debug build-Debug.ninja CMakeFiles/echo_target_depend_cmd-Debug) # undocumented
+run_ninja(CustomCommandOutputGenex echo_target_depend-debug-in-release-graph build-Release.ninja echo_target_depend:Debug)
+run_ninja(CustomCommandOutputGenex echo_target_depend_out-debug-in-release-graph build-Release.ninja echo_target_depend_out:Debug)
+run_ninja(CustomCommandOutputGenex echo_target_depend_cmd-debug-in-release-graph build-Release.ninja CMakeFiles/echo_target_depend_cmd-Debug) # undocumented
+# target_no_cross_*
+run_ninja(CustomCommandOutputGenex target_no_cross_byproduct-debug build-Debug.ninja target_no_cross_byproduct:Debug)
+run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
+run_ninja(CustomCommandOutputGenex target_no_cross_byproduct-debug-in-release-graph build-Release.ninja target_no_cross_byproduct:Debug)
+run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+unset(RunCMake_TEST_NO_CLEAN)
+
unset(RunCMake_TEST_BINARY_DIR)
run_cmake(CustomCommandDepfile)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-targets-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-targets-debug-ninja-stdout.txt
new file mode 100644
index 0000000..f72516f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-targets-debug-ninja-stdout.txt
@@ -0,0 +1,3 @@
+(rebuild_cache: phony.*
+edit_cache: phony|edit_cache: phony.*
+rebuild_cache: phony)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-targets-default-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-targets-default-ninja-stdout.txt
new file mode 100644
index 0000000..f72516f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-targets-default-ninja-stdout.txt
@@ -0,0 +1,3 @@
+(rebuild_cache: phony.*
+edit_cache: phony|edit_cache: phony.*
+rebuild_cache: phony)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-targets-release-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-targets-release-ninja-stdout.txt
new file mode 100644
index 0000000..f72516f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-targets-release-ninja-stdout.txt
@@ -0,0 +1,3 @@
+(rebuild_cache: phony.*
+edit_cache: phony|edit_cache: phony.*
+rebuild_cache: phony)
diff --git a/Tests/RunCMake/NinjaMultiConfig/echo.c b/Tests/RunCMake/NinjaMultiConfig/echo.c
new file mode 100644
index 0000000..48a187f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/echo.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#if defined(_WIN32)
+# include <direct.h>
+# define getcwd _getcwd
+#else
+# include <unistd.h>
+#endif
+
+int main(int argc, char** argv)
+{
+ int i;
+ char cwd[1024];
+ if (getcwd(cwd, sizeof(cwd)) != NULL) {
+ printf("'%s'$", cwd);
+ }
+ for (i = 0; i < argc; ++i) {
+ printf(" '%s'", argv[i]);
+ }
+ printf("\n");
+ return 0;
+}
diff --git a/Tests/RunCMake/ObjectLibrary/ImportMultiArch-check.cmake b/Tests/RunCMake/ObjectLibrary/ImportMultiArch-check.cmake
new file mode 100644
index 0000000..af1df78
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/ImportMultiArch-check.cmake
@@ -0,0 +1,15 @@
+set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/ImportMultiArch.xcodeproj/project.pbxproj")
+if(NOT EXISTS "${xcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.")
+ return()
+endif()
+
+file(READ ${xcProjectFile} pbxFileContents)
+foreach(config IN ITEMS Debug Release RelWithDebInfo MinSizeRel)
+ set(regex "--findconfig-${config}[^
+]*\\$\\(CURRENT_ARCH\\)")
+ if(NOT pbxFileContents MATCHES "${regex}")
+ set(RunCMake_TEST_FAILED "$(CURRENT_ARCH) not preserved for config ${config}")
+ return()
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/ObjectLibrary/ImportMultiArch.cmake b/Tests/RunCMake/ObjectLibrary/ImportMultiArch.cmake
new file mode 100644
index 0000000..64029ee
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/ImportMultiArch.cmake
@@ -0,0 +1,13 @@
+
+add_library(A OBJECT IMPORTED)
+
+# We don't actually build this example so just configure dummy
+# object files to test. They do not have to exist.
+set_target_properties(A PROPERTIES
+ IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/$(CURRENT_ARCH)/does_not_exist.o"
+)
+
+add_library(B SHARED $<TARGET_OBJECTS:A> b.c)
+
+# We use this to find the relevant lines of the project.pbx file
+target_link_options(B PRIVATE --findconfig-$<CONFIG>)
diff --git a/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt b/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt
deleted file mode 100644
index 0fadac2..0000000
--- a/Tests/RunCMake/ObjectLibrary/ImportNotSupported-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-CMake Error at ImportNotSupported.cmake:[0-9]+ \(add_library\):
- The OBJECT library type may not be used for IMPORTED libraries under Xcode
- with multiple architectures.
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake b/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake
deleted file mode 100644
index 806b44a..0000000
--- a/Tests/RunCMake/ObjectLibrary/ImportNotSupported.cmake
+++ /dev/null
@@ -1 +0,0 @@
-add_library(A OBJECT IMPORTED)
diff --git a/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake b/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake
index 0a76932..3d60556 100644
--- a/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake
+++ b/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake
@@ -12,4 +12,10 @@ add_executable(LinkObjLHSShared LinkObjLHSShared.c)
target_link_libraries(LinkObjLHSShared AnObjLib)
# Verify that our dependency on OtherLib generated its versioning symlinks.
+if(CMAKE_GENERATOR STREQUAL "Xcode" AND
+ "${CMAKE_SYSTEM_NAME};${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "Darwin;arm64")
+ # Xcode runs POST_BUILD before signing, so let the linker use ad-hoc signing.
+ # See CMake Issue 21845.
+ target_link_options(LinkObjLHSShared PRIVATE LINKER:-adhoc_codesign)
+endif()
add_custom_command(TARGET LinkObjLHSShared POST_BUILD COMMAND LinkObjLHSShared)
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index 5ec4018..8515ba5 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -6,7 +6,7 @@ run_cmake(BadSourceExpression3)
run_cmake(BadObjSource1)
run_cmake(BadObjSource2)
if(RunCMake_GENERATOR STREQUAL "Xcode" AND "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]")
- run_cmake(ImportNotSupported)
+ run_cmake(ImportMultiArch)
run_cmake(InstallNotSupported)
else()
run_cmake(Import)
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
index bb6beb2..c46d044 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
@@ -50,6 +50,7 @@ else()
endif()
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
+include(${CMAKE_ROOT}/Modules/CMakeParseLibraryArchitecture.cmake)
#
# load_compiler_info: read infile, parsing out cmake compiler info
@@ -80,6 +81,7 @@ function(load_compiler_info infile lang_var outcmvars_var outstr_var)
message("load_compiler_info: ${infile} no LANG info; default to C")
set(lang C)
endif()
+
set(${lang_var} "${lang}" PARENT_SCOPE)
set(${outcmvars_var} "${outcmvars}" PARENT_SCOPE)
set(${outstr_var} "${outstr}" PARENT_SCOPE)
@@ -94,6 +96,21 @@ function(unload_compiler_info cmvars)
endforeach()
endfunction()
+
+#
+# load_platform_info: establish CMAKE_LIBRARY_ARCHITECTURE_REGEX
+# based on the target platform.
+#
+function(load_platform_info target)
+ if(target MATCHES "linux-")
+ set(CMAKE_LIBRARY_ARCHITECTURE_REGEX "[a-z0-9_]+(-[a-z0-9_]+)?-linux-gnu[a-z0-9_]*" PARENT_SCOPE)
+ set(CMAKE_LIBRARY_ARCHITECTURE_REGEX_VERSIONED "gcc/[a-z0-9_]+(-[a-z0-9_]+)?-linux(-gnu)?/[0-9]+(\\.[0-9]+\\.[0-9]+)*" PARENT_SCOPE)
+ else()
+ unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX PARENT_SCOPE)
+ unset(CMAKE_LIBRARY_ARCHITECTURE_REGEX_VERSIONED PARENT_SCOPE)
+ endif()
+endfunction()
+
#
# main test loop
#
@@ -112,10 +129,12 @@ foreach(t ${targets})
endif()
load_compiler_info(${infile} lang cmvars input)
+ load_platform_info(${t})
# Need to handle files with empty entries for both libs or dirs
set(implicit_lib_output "")
set(idirs_output "")
+ set(library_arch_output "")
file(STRINGS ${outfile} outputs)
foreach(line IN LISTS outputs)
if(line MATCHES "libs=")
@@ -124,13 +143,19 @@ foreach(t ${targets})
if(line MATCHES "dirs=")
string(REPLACE "dirs=" "" idirs_output "${line}")
endif()
+ if(line MATCHES "library_arch=")
+ string(REPLACE "library_arch=" "" library_arch_output "${line}")
+ endif()
endforeach()
cmake_parse_implicit_link_info("${input}" implicit_libs idirs implicit_fwks log
"${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
+ set(library_arch)
+ cmake_parse_library_architecture("${idirs}" library_arch)
+
# File format
- # file(WRITE ${outfile} "libs=${implicit_libs}\ndirs=${idirs}\n")
+ # file(WRITE ${outfile} "libs=${implicit_libs}\ndirs=${idirs}\nlibrary_arch=${library_arch}")
if(t MATCHES "-empty$") # empty isn't supposed to parse
if("${state}" STREQUAL "done")
@@ -140,6 +165,8 @@ foreach(t ${targets})
message("${t} parse failed: state=${state}, '${idirs}' does not match '${idirs_output}'")
elseif(NOT "${implicit_libs}" STREQUAL "${implicit_lib_output}")
message("${t} parse failed: state=${state}, '${implicit_libs}' does not match '${implicit_lib_output}'")
+ elseif(library_arch AND NOT "${library_arch}" STREQUAL "${library_arch_output}")
+ message("${t} parse failed: state=${state}, '${library_arch}' does not match '${library_arch_output}'")
endif()
unload_compiler_info("${cmvars}")
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output
index 63b51a1..0cf3a49 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output
@@ -1,2 +1,3 @@
libs=gcc;gcc_s;c;gcc;gcc_s
dirs=/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output
index b61e097..55852c0 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output
@@ -1,2 +1,3 @@
libs=imf;svml;irng;m;ipgo;decimal;cilkrts;stdc++;gcc;gcc_s;irc;svml;c;gcc;gcc_s;irc_s;dl;c
dirs=/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7;/usr/lib/gcc/x86_64-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib;/lib
+library_arch=x86_64-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output
index 7b20915..7931102 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output
@@ -1,2 +1,3 @@
libs=pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output
index de407f2..de8c8eb 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output
@@ -1,2 +1,3 @@
libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
+library_arch=ppc64-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output
index de515e7..cd672d5 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output
@@ -1,2 +1,3 @@
libs=xlopt;xl;dl;gcc_s;pthread;gcc;m;c;gcc_s;gcc
dirs=/opt/ibm/xlsmp/5.1.0/lib;/opt/ibm/xlmass/9.1.0/lib;/opt/ibm/xlC/16.1.0/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib
+library_arch=ppc64le-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
index a657b85..813457a 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
@@ -1,2 +1,3 @@
libs=cudadevrt;cudart_static;rt;pthread;dl;stdc++;m;gcc_s;gcc;c;gcc_s;gcc
dirs=/usr/local/cuda/targets/x86_64-linux/lib/stubs;/usr/local/cuda/targets/x86_64-linux/lib;/usr/lib/gcc/x86_64-linux-gnu/8;/usr/lib/x86_64-linux-gnu;/lib/x86_64-linux-gnu;/lib64;/usr/lib;/usr/lib/llvm-8/lib;/lib
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output
index 58ae64d..8824772 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output
@@ -1,2 +1,3 @@
libs=cudadevrt;cudart_static;rt;pthread;dl;xlopt;xl;ibmc++;stdc++;m;dl;gcc_s;gcc;pthread;m;c;gcc_s;gcc
dirs=/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib/stubs;/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib;/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/xl-16.1.1-3/spectrum-mpi-10.3.0.1-20190611-aqjt3jo53mogrrhcrd2iufr435azcaha/lib;/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-csygoqyym3m3ysoaperhxlhoiluvpa2u/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlsmp/5.1.1/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlmass/9.1.1/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlC/16.1.1/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/autofs/nccs-svm1_sw/peak/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-ytwv7xbkub6mqnpvygdthwqa7mhjqbc5/lib;/usr/lib
+library_arch=ppc64le-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output
index 7c99bf6..275fe40 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output
@@ -1,2 +1,3 @@
libs=cudadevrt;cudart_static;rt;pthread;dl;stdc++;m;gcc_s;gcc;c;gcc_s;gcc
dirs=/usr/lib/x86_64-linux-gnu/stubs;/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output
index 4fc7937..4957f5c 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output
@@ -1,2 +1,3 @@
libs=stdc++;m;gcc_s;gcc;c;gcc_s;gcc
dirs=/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output
index 5d85789..6a2a105 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output
@@ -1,2 +1,3 @@
libs=imf;svml;irng;stdc++;m;ipgo;decimal;cilkrts;stdc++;gcc;gcc_s;irc;svml;c;gcc;gcc_s;irc_s;dl;c
dirs=/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7;/usr/lib/gcc/x86_64-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib;/lib
+library_arch=x86_64-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output
index db0b29c..cd15054 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output
@@ -1,2 +1,3 @@
libs=atomic;pgatm;stdc++;pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output
index 4466415..9fbc844 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output
@@ -1,2 +1,3 @@
libs=xlopt;xl;ibmc++;xlopt;xl;stdc++;m;dl;gcc_s;gcc;m;c;gcc_s;gcc;dl;gcc_s;gcc;m;c;gcc_s;gcc
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
+library_arch=ppc64-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output
index 8124911..4e9ab0a 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output
@@ -1,2 +1,3 @@
libs=xlopt;xl;ibmc++;stdc++;m;dl;gcc_s;gcc;pthread;m;c;gcc_s;gcc
dirs=/opt/ibm/xlsmp/5.1.0/lib;/opt/ibm/xlmass/9.1.0/lib;/opt/ibm/xlC/16.1.0/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib
+library_arch=ppc64le-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output
index f985a03..09b720e 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output
@@ -1,2 +1,3 @@
libs=gfortran;m;gcc_s;gcc;quadmath;m;gcc_s;gcc;c;gcc_s;gcc
dirs=/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output
index d40f81e..f3cc551 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output
@@ -1,2 +1,3 @@
libs=pgf90rtl;pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output
index 3c5d23b..68be4c5 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output
@@ -1,2 +1,3 @@
libs=xlf90;xlopt;xlomp_ser;xl;xlfmath;gcc_s;dl;rt;pthread;gcc;m;c;gcc_s;gcc
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
+library_arch=ppc64-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output
index 7b20915..e44c84d 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output
@@ -1,2 +1,3 @@
libs=pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
+library_arch=x86_64-linux-gnu2
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output
index de407f2..de8c8eb 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output
@@ -1,2 +1,3 @@
libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
+library_arch=ppc64-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output
index db0b29c..cd15054 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output
@@ -1,2 +1,3 @@
libs=atomic;pgatm;stdc++;pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output
index 4466415..9fbc844 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output
@@ -1,2 +1,3 @@
libs=xlopt;xl;ibmc++;xlopt;xl;stdc++;m;dl;gcc_s;gcc;m;c;gcc_s;gcc;dl;gcc_s;gcc;m;c;gcc_s;gcc
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
+library_arch=ppc64-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output
index d40f81e..f3cc551 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output
@@ -1,2 +1,3 @@
libs=pgf90rtl;pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output
index de407f2..de8c8eb 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output
@@ -1,2 +1,3 @@
libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
+library_arch=ppc64-redhat-linux
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output
index 7b523ea..8f68358 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output
@@ -1,2 +1,3 @@
libs=pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
+library_arch=x86_64-linux-gnu
diff --git a/Tests/RunCMake/Policy/CMakeLists.txt b/Tests/RunCMake/Policy/CMakeLists.txt
new file mode 100644
index 0000000..667561e
--- /dev/null
+++ b/Tests/RunCMake/Policy/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/Policy/InvalidMaxVersion-result.txt b/Tests/RunCMake/Policy/InvalidMaxVersion-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidMaxVersion-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Policy/InvalidMaxVersion-stderr.txt b/Tests/RunCMake/Policy/InvalidMaxVersion-stderr.txt
new file mode 100644
index 0000000..25d22f5
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidMaxVersion-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at InvalidMaxVersion.cmake:[0-9]+ \(cmake_policy\):
+ Invalid policy max version value "[A-Za-z0-9]+.[A-Za-z0-9]*.[A-Za-z0-9]*.[A-Za-z0-9]*"\. A numeric
+ major.minor\[\.patch\[\.tweak\]\] must be given\.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/InvalidMaxVersion.cmake b/Tests/RunCMake/Policy/InvalidMaxVersion.cmake
new file mode 100644
index 0000000..be3270f
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidMaxVersion.cmake
@@ -0,0 +1,5 @@
+if(NOT version)
+ message(SEND_ERROR "Vesrion string is empty: ${version}")
+endif()
+
+cmake_policy(VERSION 3.1...${version})
diff --git a/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven-result.txt b/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven-result.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven-result.txt
diff --git a/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven-stderr.txt b/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven-stderr.txt
new file mode 100644
index 0000000..a48feb3
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at InvalidRangeMaxVersionNotGiven.cmake:[0-9]+ \(cmake_policy\):
+ cmake_policy VERSION "3.15..." does not have a version on both sides of
+ "...".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven.cmake b/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven.cmake
new file mode 100644
index 0000000..e55803c
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidRangeMaxVersionNotGiven.cmake
@@ -0,0 +1 @@
+cmake_policy(VERSION 3.15...)
diff --git a/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven-result.txt b/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven-stderr.txt b/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven-stderr.txt
new file mode 100644
index 0000000..84e9b88
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at InvalidRangeMinVersionNotGiven.cmake:[0-9]+ \(cmake_policy\):
+ cmake_policy VERSION "...3.15" does not have a version on both sides of
+ "...".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven.cmake b/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven.cmake
new file mode 100644
index 0000000..60e7e25
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidRangeMinVersionNotGiven.cmake
@@ -0,0 +1 @@
+cmake_policy(VERSION ...3.15)
diff --git a/Tests/RunCMake/Policy/InvalidVersion-result.txt b/Tests/RunCMake/Policy/InvalidVersion-result.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidVersion-result.txt
diff --git a/Tests/RunCMake/Policy/InvalidVersion-stderr.txt b/Tests/RunCMake/Policy/InvalidVersion-stderr.txt
new file mode 100644
index 0000000..783f4ed
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidVersion-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at InvalidVersion.cmake:[0-9]+ \(cmake_policy\):
+ Invalid policy version value "[A-Za-z0-9]+.[A-Za-z0-9]*.[A-Za-z0-9]*.[A-Za-z0-9]*"\. A numeric
+ major\.minor\[\.patch\[\.tweak\]\] must be given\.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/InvalidVersion.cmake b/Tests/RunCMake/Policy/InvalidVersion.cmake
new file mode 100644
index 0000000..b135ba6
--- /dev/null
+++ b/Tests/RunCMake/Policy/InvalidVersion.cmake
@@ -0,0 +1,5 @@
+if(NOT version)
+ message(SEND_ERROR "Vesrion string is empty: ${version}")
+endif()
+
+cmake_policy(VERSION ${version})
diff --git a/Tests/RunCMake/Policy/MinVersionLargerThanMax-result.txt b/Tests/RunCMake/Policy/MinVersionLargerThanMax-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Policy/MinVersionLargerThanMax-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Policy/MinVersionLargerThanMax-stderr.txt b/Tests/RunCMake/Policy/MinVersionLargerThanMax-stderr.txt
new file mode 100644
index 0000000..0b0308f
--- /dev/null
+++ b/Tests/RunCMake/Policy/MinVersionLargerThanMax-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at MinVersionLargerThanMax.cmake:[0-9]+ \(cmake_policy\):
+ Policy VERSION range "3.12...3.8" specifies a larger minimum than maximum.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/MinVersionLargerThanMax.cmake b/Tests/RunCMake/Policy/MinVersionLargerThanMax.cmake
new file mode 100644
index 0000000..67d5f85
--- /dev/null
+++ b/Tests/RunCMake/Policy/MinVersionLargerThanMax.cmake
@@ -0,0 +1 @@
+cmake_policy(VERSION 3.12...3.8)
diff --git a/Tests/RunCMake/Policy/RunCMakeTest.cmake b/Tests/RunCMake/Policy/RunCMakeTest.cmake
new file mode 100644
index 0000000..74c7d63
--- /dev/null
+++ b/Tests/RunCMake/Policy/RunCMakeTest.cmake
@@ -0,0 +1,19 @@
+include(RunCMake)
+
+run_cmake(VersionNotGiven)
+run_cmake(TooManyVersionsGiven)
+run_cmake(InvalidRangeMinVersionNotGiven)
+run_cmake(InvalidRangeMaxVersionNotGiven)
+
+set(RunCMake_TEST_OPTIONS "-Dversion=three")
+run_cmake(InvalidVersion)
+run_cmake(InvalidMaxVersion)
+unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS "-Dversion=3.one")
+run_cmake(InvalidVersion)
+run_cmake(InvalidMaxVersion)
+unset(RunCMake_TEST_OPTIONS)
+
+run_cmake(VersionLowerThan2_4)
+run_cmake(MinVersionLargerThanMax)
+run_cmake(VeryHighVersion)
diff --git a/Tests/RunCMake/Policy/TooManyVersionsGiven-result.txt b/Tests/RunCMake/Policy/TooManyVersionsGiven-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Policy/TooManyVersionsGiven-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Policy/TooManyVersionsGiven-stderr.txt b/Tests/RunCMake/Policy/TooManyVersionsGiven-stderr.txt
new file mode 100644
index 0000000..7a4f8c7
--- /dev/null
+++ b/Tests/RunCMake/Policy/TooManyVersionsGiven-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at TooManyVersionsGiven.cmake:[0-9]+ \(cmake_policy\):
+ cmake_policy VERSION given too many arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/TooManyVersionsGiven.cmake b/Tests/RunCMake/Policy/TooManyVersionsGiven.cmake
new file mode 100644
index 0000000..6c99af2
--- /dev/null
+++ b/Tests/RunCMake/Policy/TooManyVersionsGiven.cmake
@@ -0,0 +1 @@
+cmake_policy(VERSION 1 2 3)
diff --git a/Tests/RunCMake/Policy/VersionLowerThan2_4-result.txt b/Tests/RunCMake/Policy/VersionLowerThan2_4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Policy/VersionLowerThan2_4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Policy/VersionLowerThan2_4-stderr.txt b/Tests/RunCMake/Policy/VersionLowerThan2_4-stderr.txt
new file mode 100644
index 0000000..3f19192
--- /dev/null
+++ b/Tests/RunCMake/Policy/VersionLowerThan2_4-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at VersionLowerThan2_4.cmake:[0-9]+ \(cmake_policy\):
+ Compatibility with CMake < 2.4 is not supported by CMake >= 3.0. For
+ compatibility with older versions please use any CMake 2.8.x release or
+ lower.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/VersionLowerThan2_4.cmake b/Tests/RunCMake/Policy/VersionLowerThan2_4.cmake
new file mode 100644
index 0000000..f1a4fd9
--- /dev/null
+++ b/Tests/RunCMake/Policy/VersionLowerThan2_4.cmake
@@ -0,0 +1 @@
+cmake_policy(VERSION 2.2)
diff --git a/Tests/RunCMake/Policy/VersionNotGiven-result.txt b/Tests/RunCMake/Policy/VersionNotGiven-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Policy/VersionNotGiven-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Policy/VersionNotGiven-stderr.txt b/Tests/RunCMake/Policy/VersionNotGiven-stderr.txt
new file mode 100644
index 0000000..8eeb177
--- /dev/null
+++ b/Tests/RunCMake/Policy/VersionNotGiven-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at VersionNotGiven.cmake:[0-9]+ \(cmake_policy\):
+ cmake_policy VERSION not given an argument
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/VersionNotGiven.cmake b/Tests/RunCMake/Policy/VersionNotGiven.cmake
new file mode 100644
index 0000000..53b3d7f
--- /dev/null
+++ b/Tests/RunCMake/Policy/VersionNotGiven.cmake
@@ -0,0 +1 @@
+cmake_policy(VERSION)
diff --git a/Tests/RunCMake/Policy/VeryHighVersion-result.txt b/Tests/RunCMake/Policy/VeryHighVersion-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Policy/VeryHighVersion-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Policy/VeryHighVersion-stderr.txt b/Tests/RunCMake/Policy/VeryHighVersion-stderr.txt
new file mode 100644
index 0000000..7cca91b
--- /dev/null
+++ b/Tests/RunCMake/Policy/VeryHighVersion-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at VeryHighVersion.cmake:[0-9]+ \(cmake_policy\):
+ An attempt was made to set the policy version of CMake to "99.1" which is
+ greater than this version of CMake. This is not allowed because the
+ greater version may have new policies not known to this CMake. You may
+ need a newer CMake version to build this project.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Policy/VeryHighVersion.cmake b/Tests/RunCMake/Policy/VeryHighVersion.cmake
new file mode 100644
index 0000000..3d4af8c
--- /dev/null
+++ b/Tests/RunCMake/Policy/VeryHighVersion.cmake
@@ -0,0 +1 @@
+cmake_policy(VERSION 99.1)
diff --git a/Tests/RunCMake/PrecompileHeaders/CXXnotC.cmake b/Tests/RunCMake/PrecompileHeaders/CXXnotC.cmake
new file mode 100644
index 0000000..9ec1b36
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/CXXnotC.cmake
@@ -0,0 +1,15 @@
+enable_language(C)
+enable_language(CXX)
+
+add_executable(main
+ no_pch.c
+ use_pch.cxx
+)
+
+target_include_directories(main PUBLIC include)
+target_precompile_headers(main PRIVATE
+ "$<$<COMPILE_LANGUAGE:CXX>:${CMAKE_CURRENT_SOURCE_DIR}/include/cxx_pch.h>"
+ )
+
+enable_testing()
+add_test(NAME main COMMAND main)
diff --git a/Tests/RunCMake/PrecompileHeaders/PchReuseFromObjLib.cmake b/Tests/RunCMake/PrecompileHeaders/PchReuseFromObjLib.cmake
new file mode 100644
index 0000000..ba504a3
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchReuseFromObjLib.cmake
@@ -0,0 +1,131 @@
+cmake_minimum_required(VERSION 3.18)
+
+project(PchReuseFromObjLib)
+
+set(CMAKE_PCH_WARN_INVALID OFF)
+
+if(CMAKE_CXX_COMPILE_OPTIONS_USE_PCH)
+ add_definitions(-DHAVE_PCH_SUPPORT)
+endif()
+
+######################################################################
+
+file(WRITE ${CMAKE_BINARY_DIR}/CONFIG/config.hxx "/*empty*/\n")
+
+file(WRITE ${CMAKE_BINARY_DIR}/pch.cxx [=[
+void nothing()
+{
+}
+]=])
+
+file(WRITE ${CMAKE_BINARY_DIR}/string.hxx [=[
+#include <string.h>
+
+namespace std {
+ struct string
+ {
+ char storage[20];
+
+ string(const char* s) {
+ strcpy(storage, s);
+ }
+
+ const char* c_str() const {
+ return storage;
+ }
+ };
+}
+]=])
+
+add_library(pch-generator OBJECT ${CMAKE_BINARY_DIR}/pch.cxx)
+set_property(TARGET pch-generator PROPERTY POSITION_INDEPENDENT_CODE ON)
+target_precompile_headers(pch-generator PRIVATE ${CMAKE_BINARY_DIR}/string.hxx)
+
+target_include_directories(pch-generator PRIVATE ${CMAKE_BINARY_DIR}/CONFIG)
+
+######################################################################
+
+file(WRITE ${CMAKE_BINARY_DIR}/message.cxx [=[
+#include "message.hxx"
+
+#ifndef HAVE_PCH_SUPPORT
+ #include "string.hxx"
+#endif
+
+const char* message()
+{
+ static std::string greeting("hi there");
+ return greeting.c_str();
+}
+]=])
+
+file(WRITE ${CMAKE_BINARY_DIR}/message.hxx [=[
+#include "config.hxx"
+#ifdef WIN32_BUILD_SHARED
+ #ifdef BUILD_LIBRARY
+ #define MESSAGE_EXPORT __declspec(dllexport)
+ #else
+ #define MESSAGE_EXPORT __declspec(dllimport)
+ #endif
+#else
+ #define MESSAGE_EXPORT
+#endif
+
+MESSAGE_EXPORT const char* message();
+]=])
+
+######################################################################
+
+file(WRITE ${CMAKE_BINARY_DIR}/main.cxx [=[
+#include "message.hxx"
+#include <string.h>
+
+int main()
+{
+ return strcmp(message(), "hi there");
+}
+]=])
+
+######################################################################
+
+enable_testing()
+
+function(add_library_and_executable type)
+ add_library(message_${type} ${type} ${CMAKE_BINARY_DIR}/message.cxx)
+ target_precompile_headers(message_${type} REUSE_FROM pch-generator)
+
+ set_property(TARGET message_${type} PROPERTY POSITION_INDEPENDENT_CODE ON)
+ set_property(TARGET message_${type} PROPERTY DEFINE_SYMBOL "")
+
+ if (WIN32 AND type STREQUAL "SHARED")
+ file(WRITE ${CMAKE_BINARY_DIR}/SHARED/config.hxx [=[
+ #define BUILD_LIBRARY
+ #define WIN32_BUILD_SHARED
+ ]=])
+ target_include_directories(message_${type} PRIVATE ${CMAKE_BINARY_DIR}/SHARED)
+
+ # Workaround for VS2008, the compiler fails with
+ # c1xx : fatal error C1083: Cannot open source file: '_WINDLL': No such file or directory
+ file(WRITE ${CMAKE_BINARY_DIR}/_WINDLL "/*empty*/\n")
+ else()
+ target_include_directories(message_${type} PRIVATE ${CMAKE_BINARY_DIR}/CONFIG)
+ endif()
+
+ add_executable(main_${type} ${CMAKE_BINARY_DIR}/main.cxx)
+ target_include_directories(main_${type} PRIVATE ${CMAKE_BINARY_DIR})
+
+ if (WIN32 AND type STREQUAL "SHARED")
+ file(WRITE ${CMAKE_BINARY_DIR}/main_SHARED/config.hxx "#define WIN32_BUILD_SHARED\n")
+ target_include_directories(main_${type} PRIVATE ${CMAKE_BINARY_DIR}/main_SHARED)
+ else()
+ target_include_directories(main_${type} PRIVATE ${CMAKE_BINARY_DIR}/CONFIG)
+ endif()
+
+ target_link_libraries(main_${type} PRIVATE message_${type})
+
+ add_test(NAME main_${type} COMMAND main_${type})
+endfunction()
+
+foreach(type OBJECT STATIC SHARED)
+ add_library_and_executable(${type})
+endforeach()
diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
index 74670ba..8cc59d2 100644
--- a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
@@ -14,6 +14,7 @@ run_cmake(PchDebugGenex)
run_test(PchInterface)
run_cmake(PchPrologueEpilogue)
run_test(SkipPrecompileHeaders)
+run_test(CXXnotC)
run_test(PchReuseFrom)
run_test(PchReuseFromPrefixed)
run_test(PchReuseFromSubdir)
@@ -26,3 +27,4 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
run_cmake(PchInstantiateTemplates)
endif()
endif()
+run_test(PchReuseFromObjLib)
diff --git a/Tests/RunCMake/PrecompileHeaders/include/cxx_pch.h b/Tests/RunCMake/PrecompileHeaders/include/cxx_pch.h
new file mode 100644
index 0000000..3282cec
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/include/cxx_pch.h
@@ -0,0 +1 @@
+#define CXX_PCH
diff --git a/Tests/RunCMake/PrecompileHeaders/no_pch.c b/Tests/RunCMake/PrecompileHeaders/no_pch.c
new file mode 100644
index 0000000..8d22580
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/no_pch.c
@@ -0,0 +1,7 @@
+#ifdef CXX_PCH
+# error "CXX PCH included in C source."
+#endif
+int no_pch(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/PrecompileHeaders/use_pch.cxx b/Tests/RunCMake/PrecompileHeaders/use_pch.cxx
new file mode 100644
index 0000000..caf115b
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/use_pch.cxx
@@ -0,0 +1,9 @@
+#include "cxx_pch.h"
+#ifndef CXX_PCH
+# error "CXX PCH not included in CXX source."
+#endif
+extern "C" int no_pch(void);
+int main()
+{
+ return no_pch();
+}
diff --git a/Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt b/Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt
index 306c255..87fa746 100644
--- a/Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt
+++ b/Tests/RunCMake/Syntax/FunctionUnmatched-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error in FunctionUnmatched.cmake:
- A logical block opening on the line
-
- .*/Tests/RunCMake/Syntax/FunctionUnmatched.cmake:[0-9]+ \(function\)
-
- is not closed.
+^CMake Error at FunctionUnmatched\.cmake:[0-9]+ \(function\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt
index f4ff709..7904b87 100644
--- a/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt
+++ b/Tests/RunCMake/Syntax/FunctionUnmatchedForeach-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error at FunctionUnmatchedForeach.cmake:[0-9]+ \(f\):
- A logical block opening on the line
-
- .*/Tests/RunCMake/Syntax/FunctionUnmatchedForeach.cmake:[0-9]+ \(foreach\)
-
- is not closed.
+^CMake Error at FunctionUnmatchedForeach\.cmake:[0-9]+ \(endfunction\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/ImproperNesting-result.txt b/Tests/RunCMake/Syntax/ImproperNesting-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ImproperNesting-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/ImproperNesting-stderr.txt b/Tests/RunCMake/Syntax/ImproperNesting-stderr.txt
new file mode 100644
index 0000000..a209ef6
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ImproperNesting-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at ImproperNesting\.cmake:[0-9]+ \(endforeach\):
+ Flow control statements are not properly nested\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/ImproperNesting.cmake b/Tests/RunCMake/Syntax/ImproperNesting.cmake
new file mode 100644
index 0000000..47ff9f9
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ImproperNesting.cmake
@@ -0,0 +1,7 @@
+message(FATAL_ERROR "This should not happen")
+
+foreach(i 1 2)
+ if(1)
+endforeach()
+endif()
+endif()
diff --git a/Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt b/Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt
index 440d863..a7af590 100644
--- a/Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt
+++ b/Tests/RunCMake/Syntax/MacroUnmatched-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error in MacroUnmatched.cmake:
- A logical block opening on the line
-
- .*/Tests/RunCMake/Syntax/MacroUnmatched.cmake:[0-9]+ \(macro\)
-
- is not closed.
+^CMake Error at MacroUnmatched\.cmake:[0-9]+ \(macro\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt b/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt
index 820cd2e..30c4a4c 100644
--- a/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt
+++ b/Tests/RunCMake/Syntax/MacroUnmatchedForeach-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error at MacroUnmatchedForeach.cmake:[0-9]+ \(m\):
- A logical block opening on the line
-
- .*/Tests/RunCMake/Syntax/MacroUnmatchedForeach.cmake:[0-9]+ \(foreach\)
-
- is not closed.
+^CMake Error at MacroUnmatchedForeach\.cmake:[0-9]+ \(endmacro\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt b/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt
index cf6dad5..71e8db3 100644
--- a/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt
+++ b/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt
@@ -7,6 +7,6 @@
\${var
- syntax error, unexpected \$end, expecting } \(6\)
+ syntax error, unexpected end of file, expecting } \(6\)
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt b/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt
index 70e7c12..84ccdbe 100644
--- a/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt
+++ b/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt
@@ -7,6 +7,6 @@
\${var
- syntax error, unexpected \$end, expecting } \(6\)
+ syntax error, unexpected end of file, expecting } \(6\)
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/Override.cmake b/Tests/RunCMake/Syntax/Override.cmake
new file mode 100644
index 0000000..af62db1
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Override.cmake
@@ -0,0 +1,6 @@
+function(override)
+ function(${FUNCTION_NAME})
+ endfunction()
+endfunction()
+override()
+message(FATAL_ERROR "This shouldn't happen")
diff --git a/Tests/RunCMake/Syntax/OverrideBreak-result.txt b/Tests/RunCMake/Syntax/OverrideBreak-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideBreak-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideContinue-result.txt b/Tests/RunCMake/Syntax/OverrideContinue-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideContinue-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideElse-result.txt b/Tests/RunCMake/Syntax/OverrideElse-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideElse-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideElseIf-result.txt b/Tests/RunCMake/Syntax/OverrideElseIf-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideElseIf-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndForeach-result.txt b/Tests/RunCMake/Syntax/OverrideEndForeach-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndForeach-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndFunction-result.txt b/Tests/RunCMake/Syntax/OverrideEndFunction-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndFunction-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndIf-result.txt b/Tests/RunCMake/Syntax/OverrideEndIf-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndIf-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndMacro-result.txt b/Tests/RunCMake/Syntax/OverrideEndMacro-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndMacro-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideEndWhile-result.txt b/Tests/RunCMake/Syntax/OverrideEndWhile-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideEndWhile-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideForeach-result.txt b/Tests/RunCMake/Syntax/OverrideForeach-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideForeach-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideFunction-result.txt b/Tests/RunCMake/Syntax/OverrideFunction-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideFunction-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideIf-result.txt b/Tests/RunCMake/Syntax/OverrideIf-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideIf-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideMacro-result.txt b/Tests/RunCMake/Syntax/OverrideMacro-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideMacro-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideReturn-result.txt b/Tests/RunCMake/Syntax/OverrideReturn-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideReturn-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/OverrideWhile-result.txt b/Tests/RunCMake/Syntax/OverrideWhile-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/OverrideWhile-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
index 144b57c..24c810b 100644
--- a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
+++ b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
@@ -9,12 +9,12 @@ This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at ParenInENV.cmake:2 \(message\):
Syntax error in cmake code at
- .*Tests/RunCMake/Syntax/ParenInENV.cmake:2
+ .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2
when parsing string
-->\$ENV{e
- syntax error, unexpected \$end, expecting } \(10\)
+ syntax error, unexpected end of file, expecting } \(10\)
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index 8d74dc1..4d24657 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -72,6 +72,7 @@ run_cmake(UnterminatedBrace2)
run_cmake(UnterminatedBracket0)
run_cmake(UnterminatedBracket1)
run_cmake(UnterminatedBracketComment)
+run_cmake(ImproperNesting)
# Variable expansion tests
run_cmake(ExpandInAt)
@@ -122,3 +123,30 @@ run_cmake(FunctionUnmatched)
run_cmake(FunctionUnmatchedForeach)
run_cmake(MacroUnmatched)
run_cmake(MacroUnmatchedForeach)
+
+function(run_override name)
+ string(TOLOWER "${name}" lname)
+ set(RunCMake_DEFAULT_stderr "^CMake Error at [^
+]*/Tests/RunCMake/Syntax/Override\\.cmake:[0-9]+ \\(function\\):
+ Built-in flow control command \"${lname}\" cannot be overridden\\.
+Call Stack \\(most recent call first\\):
+ [^
+]*/Tests/RunCMake/Syntax/Override\\.cmake:[0-9]+ \\(override\\)$")
+ run_cmake_command(Override${name} "${CMAKE_COMMAND}" -DFUNCTION_NAME=${name} -P "${RunCMake_SOURCE_DIR}/Override.cmake")
+endfunction()
+
+run_override(Break)
+run_override(Continue)
+run_override(Else)
+run_override(ElseIf)
+run_override(EndForeach)
+run_override(EndFunction)
+run_override(EndIf)
+run_override(EndMacro)
+run_override(EndWhile)
+run_override(Foreach)
+run_override(Function)
+run_override(If)
+run_override(Macro)
+run_override(Return)
+run_override(While)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt
index cf63dbe..b309c3b 100644
--- a/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt
@@ -7,6 +7,6 @@ CMake Error at UnterminatedBrace0.cmake:2 \(set\):
\${
- syntax error, unexpected \$end, expecting } \(3\)
+ syntax error, unexpected end of file, expecting } \(3\)
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
index 0e6f786..ffe0e2a 100644
--- a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
@@ -7,7 +7,7 @@ CMake Warning \(dev\) at UnterminatedBrace1.cmake:3 \(set\):
\${
- syntax error, unexpected \$end, expecting } \(3\)
+ syntax error, unexpected end of file, expecting } \(3\)
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/TargetObjects/CMakeLists.txt b/Tests/RunCMake/TargetObjects/CMakeLists.txt
index 44b5d30..e9a0a3f 100644
--- a/Tests/RunCMake/TargetObjects/CMakeLists.txt
+++ b/Tests/RunCMake/TargetObjects/CMakeLists.txt
@@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 3.3)
-project(${RunCMake_TEST})
+project(${RunCMake_TEST} LANGUAGES NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake
index 30b9fee..d2b3032 100644
--- a/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetObjects/RunCMakeTest.cmake
@@ -2,3 +2,7 @@ include(RunCMake)
run_cmake(NoTarget)
run_cmake(NotObjlibTarget)
+
+if(RunCMake_GENERATOR STREQUAL "Xcode" AND "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]")
+ run_cmake(XcodeVariableNoGenexExpansion)
+endif()
diff --git a/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion-result.txt b/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion-stderr.txt b/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion-stderr.txt
new file mode 100644
index 0000000..1360015
--- /dev/null
+++ b/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error at XcodeVariableNoGenexExpansion\.cmake:9 \(file\):
+ Error evaluating generator expression:
+
+ \$\<TARGET_OBJECTS:A\>
+
+ The evaluation of the TARGET_OBJECTS generator expression is only suitable
+ for consumption by CMake \(limited under Xcode with multiple architectures\)\.
+ It is not suitable for writing out elsewhere\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion.cmake b/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion.cmake
new file mode 100644
index 0000000..83d7210
--- /dev/null
+++ b/Tests/RunCMake/TargetObjects/XcodeVariableNoGenexExpansion.cmake
@@ -0,0 +1,12 @@
+add_library(A OBJECT IMPORTED)
+
+# We don't actually build this example so just configure a dummy
+# object file to test. It does not have to exist.
+set_target_properties(A PROPERTIES
+ IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/$(CURRENT_ARCH)/does_not_exist.o"
+)
+
+file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/objects.txt
+ CONTENT "$<TARGET_OBJECTS:A>"
+)
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index b3f3a5e..3846d7c 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -34,6 +34,7 @@
\* CMP0108
\* CMP0112
\* CMP0113
+ \* CMP0119
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake
new file mode 100644
index 0000000..1787e87
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetCheckProperty.cmake
@@ -0,0 +1,16 @@
+add_custom_target(target1 ALL)
+target_sources(target1 PRIVATE main.cpp)
+get_property(actualProp1 TARGET target1 PROPERTY SOURCES)
+set(desiredProp1 main.cpp)
+if(NOT desiredProp1 STREQUAL actualProp1)
+ message("source property not set. desired: \"${desiredProp1}\" actual: \"${actualProp1}\"")
+endif()
+
+add_custom_target(target2 ALL SOURCES main.cpp)
+target_sources(target2 PRIVATE empty_1.cpp empty_2.cpp)
+target_sources(target2 PRIVATE empty_3.cpp)
+get_property(actualProp2 TARGET target2 PROPERTY SOURCES)
+set(desiredProp2 main.cpp empty_1.cpp empty_2.cpp empty_3.cpp)
+if (NOT desiredProp2 STREQUAL actualProp2)
+ message("source property not set. desired: \"${desiredProp2}\" actual: \"${actualProp2}\"")
+endif()
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake
new file mode 100644
index 0000000..0078eab
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetGenx.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target PRIVATE $<IF:1,${CMAKE_CURRENT_LIST_DIR}/main.cpp,${CMAKE_CURRENT_LIST_DIR}/empty_1.cpp>)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt
new file mode 100644
index 0000000..9334bf6
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at AddCustomTargetInterfaceSources.cmake:2 \(target_sources\):
+ target_sources may only set PRIVATE properties on custom targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake
new file mode 100644
index 0000000..42a8ca2
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetInterfaceSources.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target INTERFACE main.cpp)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake
new file mode 100644
index 0000000..11f0258
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetPrivateSources.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target PRIVATE main.cpp)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt
new file mode 100644
index 0000000..afba4be
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at AddCustomTargetPublicSources.cmake:2 \(target_sources\):
+ target_sources may only set PRIVATE properties on custom targets
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake
new file mode 100644
index 0000000..d9e82c0
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetPublicSources.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target PUBLIC main.cpp)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt b/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetSources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt b/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt
new file mode 100644
index 0000000..4a153e9
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetSources-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at AddCustomTargetSources.cmake:2 \(target_sources\):
+ target_sources called with invalid arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake b/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake
new file mode 100644
index 0000000..dd688d3
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/AddCustomTargetSources.cmake
@@ -0,0 +1,2 @@
+add_custom_target(target ALL)
+target_sources(target main.cpp)
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index 0d462ba..b56ee44 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -14,3 +14,9 @@ run_cmake(RelativePathInSubdirInterface)
run_cmake(RelativePathInSubdirPrivate)
run_cmake(RelativePathInSubdirInclude)
run_cmake(ExportBuild)
+run_cmake(AddCustomTargetPublicSources)
+run_cmake(AddCustomTargetPrivateSources)
+run_cmake(AddCustomTargetInterfaceSources)
+run_cmake(AddCustomTargetSources)
+run_cmake(AddCustomTargetCheckProperty)
+run_cmake(AddCustomTargetGenx)
diff --git a/Tests/RunCMake/ToolchainFile/CheckLanguage-stdout.txt b/Tests/RunCMake/ToolchainFile/CheckLanguage-stdout.txt
new file mode 100644
index 0000000..b96eee6
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CheckLanguage-stdout.txt
@@ -0,0 +1 @@
+-- Looking for a C compiler - NOTFOUND
diff --git a/Tests/RunCMake/ToolchainFile/CheckLanguage-toolchain.cmake b/Tests/RunCMake/ToolchainFile/CheckLanguage-toolchain.cmake
new file mode 100644
index 0000000..081f905
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CheckLanguage-toolchain.cmake
@@ -0,0 +1,4 @@
+get_property(in_try_compile GLOBAL PROPERTY IN_TRY_COMPILE)
+if(in_try_compile)
+ message(FATAL_ERROR "Toolchain file included")
+endif()
diff --git a/Tests/RunCMake/ToolchainFile/CheckLanguage.cmake b/Tests/RunCMake/ToolchainFile/CheckLanguage.cmake
new file mode 100644
index 0000000..854b3d4
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/CheckLanguage.cmake
@@ -0,0 +1,2 @@
+include(CheckLanguage)
+check_language(C)
diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
index 7eb4485..659523c 100644
--- a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
@@ -7,6 +7,7 @@ endfunction()
run_cmake_toolchain(CallEnableLanguage)
run_cmake_toolchain(CallProject)
+run_cmake_toolchain(CheckLanguage)
run_cmake_toolchain(FlagsInit)
run_cmake_toolchain(LinkFlagsInit)
diff --git a/Tests/RunCMake/TransformDepfile/RunCMakeTest.cmake b/Tests/RunCMake/TransformDepfile/RunCMakeTest.cmake
new file mode 100644
index 0000000..9a38b95
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/RunCMakeTest.cmake
@@ -0,0 +1,21 @@
+include(RunCMake)
+
+function(run_transform_depfile name)
+ set(RunCMake-check-file gccdepfile.cmake)
+ run_cmake_command(${name}-gcc
+ ${CMAKE_COMMAND} -E cmake_transform_depfile "${RunCMake_GENERATOR}" gccdepfile "${RunCMake_SOURCE_DIR}" "${RunCMake_SOURCE_DIR}/subdir" "${RunCMake_BINARY_DIR}" "${RunCMake_BINARY_DIR}/subdir" "${CMAKE_CURRENT_LIST_DIR}/${name}.d" out.d
+ )
+ set(RunCMake-check-file vstlog.cmake)
+ run_cmake_command(${name}-tlog
+ ${CMAKE_COMMAND} -E cmake_transform_depfile "${RunCMake_GENERATOR}" vstlog "${RunCMake_SOURCE_DIR}" "${RunCMake_SOURCE_DIR}/subdir" "${RunCMake_BINARY_DIR}" "${RunCMake_BINARY_DIR}/subdir" "${CMAKE_CURRENT_LIST_DIR}/${name}.d" out.tlog
+ )
+endfunction()
+
+if(WIN32)
+ run_transform_depfile(deps-windows)
+else()
+ run_transform_depfile(deps-unix)
+endif()
+run_transform_depfile(noexist)
+run_transform_depfile(empty)
+run_transform_depfile(invalid)
diff --git a/Tests/RunCMake/TransformDepfile/deps-unix.d b/Tests/RunCMake/TransformDepfile/deps-unix.d
new file mode 100644
index 0000000..5da5be8
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/deps-unix.d
@@ -0,0 +1,6 @@
+out1 /home/build/out2: in1 /home/build/in2
+
+out3 \
+ /home/build/out4: \
+ in3 \
+ /home/build/in4
diff --git a/Tests/RunCMake/TransformDepfile/deps-unix.d.txt b/Tests/RunCMake/TransformDepfile/deps-unix.d.txt
new file mode 100644
index 0000000..fbdecc0
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/deps-unix.d.txt
@@ -0,0 +1,8 @@
+subdir/out1 \
+ /home/build/out2: \
+ subdir/in1 \
+ /home/build/in2
+subdir/out3 \
+ /home/build/out4: \
+ subdir/in3 \
+ /home/build/in4
diff --git a/Tests/RunCMake/TransformDepfile/deps-unix.tlog.txt b/Tests/RunCMake/TransformDepfile/deps-unix.tlog.txt
new file mode 100644
index 0000000..70bac5d
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/deps-unix.tlog.txt
@@ -0,0 +1,6 @@
+^subdir/out1|/home/build/out2
+subdir/in1
+/home/build/in2
+^subdir/out3|/home/build/out4
+subdir/in3
+/home/build/in4
diff --git a/Tests/RunCMake/TransformDepfile/deps-windows.d b/Tests/RunCMake/TransformDepfile/deps-windows.d
new file mode 100644
index 0000000..c926670
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/deps-windows.d
@@ -0,0 +1,6 @@
+out1 C:/build/out2: in1 C:/build/in2
+
+out3 \
+ C:/build/out4: \
+ in3 \
+ C:/build/in4
diff --git a/Tests/RunCMake/TransformDepfile/deps-windows.d.txt b/Tests/RunCMake/TransformDepfile/deps-windows.d.txt
new file mode 100644
index 0000000..e09ae37
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/deps-windows.d.txt
@@ -0,0 +1,8 @@
+subdir/out1 \
+ C:/build/out2: \
+ subdir/in1 \
+ C:/build/in2
+subdir/out3 \
+ C:/build/out4: \
+ subdir/in3 \
+ C:/build/in4
diff --git a/Tests/RunCMake/TransformDepfile/deps-windows.tlog.txt b/Tests/RunCMake/TransformDepfile/deps-windows.tlog.txt
new file mode 100644
index 0000000..09f9e97
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/deps-windows.tlog.txt
@@ -0,0 +1,6 @@
+^subdir\out1|C:\build\out2
+subdir\in1
+C:\build\in2
+^subdir\out3|C:\build\out4
+subdir\in3
+C:\build\in4
diff --git a/Tests/RunCMake/TransformDepfile/empty.d b/Tests/RunCMake/TransformDepfile/empty.d
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/empty.d
diff --git a/Tests/RunCMake/TransformDepfile/empty.d.txt b/Tests/RunCMake/TransformDepfile/empty.d.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/empty.d.txt
diff --git a/Tests/RunCMake/TransformDepfile/empty.tlog.txt b/Tests/RunCMake/TransformDepfile/empty.tlog.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/empty.tlog.txt
diff --git a/Tests/RunCMake/TransformDepfile/gccdepfile.cmake b/Tests/RunCMake/TransformDepfile/gccdepfile.cmake
new file mode 100644
index 0000000..be1e210
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/gccdepfile.cmake
@@ -0,0 +1,16 @@
+if(EXISTS "${RunCMake_SOURCE_DIR}/${name}.d.txt")
+ file(READ "${RunCMake_SOURCE_DIR}/${name}.d.txt" expected_contents)
+
+ if(EXISTS "${RunCMake_TEST_BINARY_DIR}/out.d")
+ file(READ "${RunCMake_TEST_BINARY_DIR}/out.d" actual_contents)
+ if(NOT actual_contents STREQUAL expected_contents)
+ string(REPLACE "\n" "\n " p_expected_contents "${expected_contents}")
+ string(REPLACE "\n" "\n " p_actual_contents "${actual_contents}")
+ string(APPEND RunCMake_TEST_FAILED "Expected contents of ${RunCMake_TEST_BINARY_DIR}/out.d:\n ${p_expected_contents}\nActual contents:\n ${p_actual_contents}")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/out.d should exist\n")
+ endif()
+elseif(EXISTS "${RunCMake_TEST_BINARY_DIR}/out.d")
+ string(APPEND RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/out.d should not exist\n")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_server-pipe-result.txt b/Tests/RunCMake/TransformDepfile/invalid-gcc-result.txt
index 0cfbf08..0cfbf08 100644
--- a/Tests/RunCMake/CommandLine/E_server-pipe-result.txt
+++ b/Tests/RunCMake/TransformDepfile/invalid-gcc-result.txt
diff --git a/Tests/RunCMake/TransformDepfile/invalid-tlog-result.txt b/Tests/RunCMake/TransformDepfile/invalid-tlog-result.txt
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/invalid-tlog-result.txt
@@ -0,0 +1 @@
+2
diff --git a/Tests/RunCMake/TransformDepfile/invalid.d b/Tests/RunCMake/TransformDepfile/invalid.d
new file mode 100644
index 0000000..9977a28
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/invalid.d
@@ -0,0 +1 @@
+invalid
diff --git a/Tests/RunCMake/TransformDepfile/noexist.d.txt b/Tests/RunCMake/TransformDepfile/noexist.d.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/noexist.d.txt
diff --git a/Tests/RunCMake/TransformDepfile/noexist.tlog.txt b/Tests/RunCMake/TransformDepfile/noexist.tlog.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/noexist.tlog.txt
diff --git a/Tests/RunCMake/TransformDepfile/vstlog.cmake b/Tests/RunCMake/TransformDepfile/vstlog.cmake
new file mode 100644
index 0000000..afa78d0
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/vstlog.cmake
@@ -0,0 +1,16 @@
+if(EXISTS "${RunCMake_SOURCE_DIR}/${name}.tlog.txt")
+ file(READ "${RunCMake_SOURCE_DIR}/${name}.tlog.txt" expected_contents)
+
+ if(EXISTS "${RunCMake_TEST_BINARY_DIR}/out.tlog")
+ file(READ "${RunCMake_TEST_BINARY_DIR}/out.tlog" actual_contents)
+ if(NOT actual_contents STREQUAL expected_contents)
+ string(REPLACE "\n" "\n " p_expected_contents "${expected_contents}")
+ string(REPLACE "\n" "\n " p_actual_contents "${actual_contents}")
+ string(APPEND RunCMake_TEST_FAILED "Expected contents of ${RunCMake_TEST_BINARY_DIR}/out.tlog:\n ${p_expected_contents}\nActual contents:\n ${p_actual_contents}")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/out.tlog should exist\n")
+ endif()
+elseif(EXISTS "${RunCMake_TEST_BINARY_DIR}/out.tlog")
+ string(APPEND RunCMake_TEST_FAILED "${RunCMake_TEST_BINARY_DIR}/out.tlog should not exist\n")
+endif()
diff --git a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
index 9ba3c85..c00f78b 100644
--- a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
+++ b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
@@ -1,5 +1,14 @@
include(RunCMake)
+function(run_build name)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake(${name})
+ run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug)
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endfunction()
+
run_cmake(unitybuild_c)
run_cmake(unitybuild_c_batch)
run_cmake(unitybuild_c_group)
@@ -15,6 +24,9 @@ run_cmake(unitybuild_c_no_unity_build)
run_cmake(unitybuild_c_no_unity_build_group)
run_cmake(unitybuild_order)
run_cmake(unitybuild_invalid_mode)
+run_build(unitybuild_anon_ns)
+run_build(unitybuild_anon_ns_no_unity_build)
+run_build(unitybuild_anon_ns_group_mode)
function(run_test name)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
diff --git a/Tests/RunCMake/UnityBuild/f.cxx b/Tests/RunCMake/UnityBuild/f.cxx
new file mode 100644
index 0000000..d5813c6
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/f.cxx
@@ -0,0 +1,5 @@
+int f(int x)
+{
+ (void)x;
+ return 0;
+}
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_anon_ns-build-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns-build-check.cmake
new file mode 100644
index 0000000..746be32
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns-build-check.cmake
@@ -0,0 +1,10 @@
+set(unitybuild_0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_cxx.cxx")
+
+file(STRINGS ${unitybuild_0} src)
+
+foreach(expectedRegex IN ITEMS "SRC_f\\.cxx" "BLD_s1\\.cpp")
+ if(NOT "${src}" MATCHES "${expectedRegex}")
+ set(RunCMake_TEST_FAILED "Generated unity file doesn't have a match for expected unity ID regex ${expectedRegex}")
+ return()
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_anon_ns.cmake b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns.cmake
new file mode 100644
index 0000000..e05863d
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns.cmake
@@ -0,0 +1,11 @@
+project(unitybuild_anon_ns CXX)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/unitybuild_anon_ns_test_files.cmake)
+
+write_unity_build_anon_ns_test_files(srcs)
+
+add_library(tgt SHARED f.cxx ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD_UNIQUE_ID MY_ANON_ID)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_group_mode.cmake b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_group_mode.cmake
new file mode 100644
index 0000000..a91fc74
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_group_mode.cmake
@@ -0,0 +1,19 @@
+project(unitybuild_anon_ns_group_mode CXX)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/unitybuild_anon_ns_test_files.cmake)
+
+write_unity_build_anon_ns_test_files(srcs)
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON
+ UNITY_BUILD_MODE GROUP)
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD_UNIQUE_ID MY_ANON_ID)
+
+set_source_files_properties(s1.cpp s2.cpp s5.cpp s7.cpp s8.cpp
+ PROPERTIES UNITY_GROUP "a"
+ )
+set_source_files_properties(s3.cpp s4.cpp s6.cpp
+ PROPERTIES UNITY_GROUP "b"
+ )
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_no_unity_build.cmake b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_no_unity_build.cmake
new file mode 100644
index 0000000..9f0a9e1
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_no_unity_build.cmake
@@ -0,0 +1,11 @@
+project(unitybuild_anon_ns_no_unity_build CXX)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/unitybuild_anon_ns_test_files.cmake)
+
+write_unity_build_anon_ns_test_files(srcs)
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD OFF)
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD_UNIQUE_ID MY_ANON_ID)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_test_files.cmake b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_test_files.cmake
new file mode 100644
index 0000000..06a600e
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_anon_ns_test_files.cmake
@@ -0,0 +1,31 @@
+
+function(write_unity_build_anon_ns_test_files OUTVAR)
+ set(srcs)
+ foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.cpp")
+ file(WRITE "${src}" "
+#ifndef CONFIG_H
+#define CONFIG_H
+#define MY_ANON_NAMESPACE MY_ANON_ID
+#define MY_ANON(Name) MY_ANON_NAMESPACE::Name
+#define MY_ANON_USING_NAMESPACE using namespace MY_ANON_NAMESPACE
+#endif
+
+namespace { namespace MY_ANON_NAMESPACE {
+ int i = ${s};
+}}
+int use_plain_${s}() {
+ return MY_ANON_NAMESPACE::i;
+}
+int func_like_macro_${s}() {
+ return MY_ANON(i);
+}
+int using_macro_${s}() {
+ MY_ANON_USING_NAMESPACE;
+ return i;
+}
+")
+ list(APPEND srcs "${src}")
+ endforeach()
+ set(${OUTVAR} ${srcs} PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/VS10Project/CustomCommandGenex-check.cmake b/Tests/RunCMake/VS10Project/CustomCommandGenex-check.cmake
new file mode 100644
index 0000000..a7047bc
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/CustomCommandGenex-check.cmake
@@ -0,0 +1,37 @@
+set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
+if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+endif()
+
+set(found_CustomBuild_out 0)
+set(found_CustomBuild_out_CONFIG 0)
+set(found_CustomBuild_out_CONFIG_CONFIG 0)
+set(found_CustomBuild_out_HASH 0)
+file(STRINGS "${vcProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES [[<CustomBuild Include=".*\\out\.txt\.rule">]])
+ set(found_CustomBuild_out 1)
+ endif()
+ if(line MATCHES [[<CustomBuild Include=".*\\out-\(CONFIG\)\.txt\.rule">]])
+ set(found_CustomBuild_out_CONFIG 1)
+ endif()
+ if(line MATCHES [[<CustomBuild Include=".*\\out-\(CONFIG\)-\(CONFIG\)\.txt\.rule">]])
+ set(found_CustomBuild_out_CONFIG_CONFIG 1)
+ endif()
+ if(line MATCHES [[<CustomBuild Include=".*\\[0-9A-Fa-f]+\.rule">]])
+ set(found_CustomBuild_out_HASH 1)
+ endif()
+endforeach()
+if(NOT found_CustomBuild_out)
+ string(APPEND RunCMake_TEST_FAILED "CustomBuild for out.txt.rule not found in\n ${vcProjectFile}\n")
+endif()
+if(NOT found_CustomBuild_out_CONFIG)
+ string(APPEND RunCMake_TEST_FAILED "CustomBuild for out-(CONFIG).txt.rule not found in\n ${vcProjectFile}\n")
+endif()
+if(NOT found_CustomBuild_out_CONFIG_CONFIG)
+ string(APPEND RunCMake_TEST_FAILED "CustomBuild for out-(CONFIG)-(CONFIG).txt.rule not found in\n ${vcProjectFile}\n")
+endif()
+if(NOT found_CustomBuild_out_HASH)
+ string(APPEND RunCMake_TEST_FAILED "CustomBuild for <hash>.rule not found in\n ${vcProjectFile}\n")
+endif()
diff --git a/Tests/RunCMake/VS10Project/CustomCommandGenex.cmake b/Tests/RunCMake/VS10Project/CustomCommandGenex.cmake
new file mode 100644
index 0000000..5b69dc2
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/CustomCommandGenex.cmake
@@ -0,0 +1,21 @@
+add_custom_command(
+ OUTPUT "$<1:out.txt>"
+ COMMAND ${CMAKE_COMMAND} -E touch "out.txt"
+ VERBATIM
+ )
+add_custom_command(
+ OUTPUT "out-$<CONFIG>.txt"
+ COMMAND ${CMAKE_COMMAND} -E touch "out-$<CONFIG>.txt"
+ VERBATIM
+ )
+add_custom_command(
+ OUTPUT "out-$<CONFIG>-$<CONFIG>.txt"
+ COMMAND ${CMAKE_COMMAND} -E touch "out-$<CONFIG>-$<CONFIG>.txt"
+ VERBATIM
+ )
+add_custom_command(
+ OUTPUT "out-$<CONFIG>-$<CONFIG:Debug>.txt"
+ COMMAND ${CMAKE_COMMAND} -E touch "out-$<CONFIG>-$<CONFIG:Debug>.txt"
+ VERBATIM
+ )
+add_custom_target(foo DEPENDS "out.txt" "out-$<CONFIG>.txt" "out-$<CONFIG>-$<CONFIG>.txt" "out-$<CONFIG>-$<CONFIG:Debug>.txt")
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 133dacc..d5ed136 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -7,6 +7,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREA
run_cmake(LanguageStandard)
endif()
+run_cmake(CustomCommandGenex)
run_cmake(VsCsharpSourceGroup)
run_cmake(VsCSharpCompilerOpts)
run_cmake(ExplicitCMakeLists)
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-stderr.txt
new file mode 100644
index 0000000..4e0d756
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at [^
+]*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\):
+ The WriteCompilerDetectionHeader module has been removed by policy CMP0120.
+Call Stack \(most recent call first\):
+ CMP0120-NEW-Direct.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct.cmake
new file mode 100644
index 0000000..4cd2c56
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-Direct.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0120 NEW)
+include(${CMAKE_ROOT}/Modules/WriteCompilerDetectionHeader.cmake)
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-result.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-stderr.txt
new file mode 100644
index 0000000..2f7ad70
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at CMP0120-NEW.cmake:[0-9]+ \(include\):
+ include could not find requested file:
+
+ WriteCompilerDetectionHeader
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW.cmake
new file mode 100644
index 0000000..3d39a97
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0120 NEW)
+include(WriteCompilerDetectionHeader)
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct.cmake
new file mode 100644
index 0000000..48517e6
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD-Direct.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0120 OLD)
+include(${CMAKE_ROOT}/Modules/WriteCompilerDetectionHeader.cmake)
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD.cmake
new file mode 100644
index 0000000..c513186
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0120 OLD)
+include(WriteCompilerDetectionHeader)
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct-stderr.txt
new file mode 100644
index 0000000..88cd8f7
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Warning \(dev\) at [^
+]*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\):
+ The WriteCompilerDetectionHeader module will be removed by policy CMP0120.
+ Projects should be ported away from the module, perhaps by bundling a copy
+ of the generated header or using a third-party alternative.
+Call Stack \(most recent call first\):
+ CMP0120-WARN-Direct.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct.cmake
new file mode 100644
index 0000000..d3c7f77
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-Direct.cmake
@@ -0,0 +1,2 @@
+
+include(${CMAKE_ROOT}/Modules/WriteCompilerDetectionHeader.cmake)
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-stderr.txt b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-stderr.txt
new file mode 100644
index 0000000..315b4b1
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN-stderr.txt
@@ -0,0 +1,18 @@
+^CMake Warning \(dev\) at CMP0120-WARN.cmake:[0-9]+ \(include\):
+ Policy CMP0120 is not set: The WriteCompilerDetectionHeader module is
+ removed. Run "cmake --help-policy CMP0120" for policy details. Use the
+ cmake_policy command to set the policy and suppress this warning.
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at [^
+]*/Modules/WriteCompilerDetectionHeader.cmake:[0-9]+ \(message\):
+ The WriteCompilerDetectionHeader module will be removed by policy CMP0120.
+ Projects should be ported away from the module, perhaps by bundling a copy
+ of the generated header or using a third-party alternative.
+Call Stack \(most recent call first\):
+ CMP0120-WARN.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN.cmake
new file mode 100644
index 0000000..1f95e3e
--- /dev/null
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/CMP0120-WARN.cmake
@@ -0,0 +1,2 @@
+
+include(WriteCompilerDetectionHeader)
diff --git a/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake
index a834e6d..7589f74 100644
--- a/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake
+++ b/Tests/RunCMake/WriteCompilerDetectionHeader/RunCMakeTest.cmake
@@ -1,5 +1,12 @@
include(RunCMake)
+run_cmake(CMP0120-WARN)
+run_cmake(CMP0120-OLD)
+run_cmake(CMP0120-NEW)
+run_cmake(CMP0120-WARN-Direct)
+run_cmake(CMP0120-OLD-Direct)
+run_cmake(CMP0120-NEW-Direct)
+
run_cmake(InvalidArgs)
run_cmake(NoCompiler)
run_cmake(NoFeature)
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 794274c..8b03216 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -3,6 +3,7 @@ include(RunCMake)
run_cmake(ExplicitCMakeLists)
run_cmake(ImplicitCMakeLists)
run_cmake(InterfaceLibSources)
+run_cmake_with_options(SearchPaths -DCMAKE_CONFIGURATION_TYPES=Debug)
run_cmake(XcodeFileType)
run_cmake(XcodeAttributeLocation)
@@ -51,6 +52,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/SearchPaths-check.cmake b/Tests/RunCMake/XcodeProject/SearchPaths-check.cmake
new file mode 100644
index 0000000..71b7d8f
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/SearchPaths-check.cmake
@@ -0,0 +1,76 @@
+set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/SearchPaths.xcodeproj/project.pbxproj")
+if(NOT EXISTS "${xcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.")
+ return()
+endif()
+
+set(relevant_lines "")
+set(found_project_FRAMEWORK_SEARCH_PATHS 0)
+set(found_target_both_FRAMEWORK_SEARCH_PATHS 0)
+set(found_target_include_FRAMEWORK_SEARCH_PATHS 0)
+set(found_target_library_FRAMEWORK_SEARCH_PATHS 0)
+set(found_inherited_FRAMEWORK_SEARCH_PATHS 0)
+set(found_project_LIBRARY_SEARCH_PATHS 0)
+set(found_target_library_LIBRARY_SEARCH_PATHS 0)
+set(found_inherited_LIBRARY_SEARCH_PATHS 0)
+file(STRINGS "${xcProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES [[FRAMEWORK_SEARCH_PATHS]])
+ string(APPEND relevant_lines " ${line}\n")
+ if(line MATCHES [[FRAMEWORK_SEARCH_PATHS = "[^"]*/Tests/RunCMake/XcodeProject/SearchPaths-build/ProjectSearchPath";]])
+ set(found_project_FRAMEWORK_SEARCH_PATHS 1)
+ endif()
+ if(line MATCHES [[FRAMEWORK_SEARCH_PATHS = \("(\\")?[^"]*/Tests/RunCMake/XcodeProject/SearchPaths-build/TargetSearchPathInc(\\")?","(\\")?[^"]*/Tests/RunCMake/XcodeProject/SearchPaths-build/TargetSearchPathLib(\\")?","\$\(inherited\)"\);]])
+ set(found_target_both_FRAMEWORK_SEARCH_PATHS 1)
+ endif()
+ if(line MATCHES [[FRAMEWORK_SEARCH_PATHS = \("(\\")?[^"]*/Tests/RunCMake/XcodeProject/SearchPaths-build/TargetSearchPathInc(\\")?","\$\(inherited\)"\);]])
+ set(found_target_include_FRAMEWORK_SEARCH_PATHS 1)
+ endif()
+ if(line MATCHES [[FRAMEWORK_SEARCH_PATHS = \("(\\")?[^"]*/Tests/RunCMake/XcodeProject/SearchPaths-build/TargetSearchPathLib(\\")?","\$\(inherited\)"\);]])
+ set(found_target_library_FRAMEWORK_SEARCH_PATHS 1)
+ endif()
+ if(line MATCHES [[FRAMEWORK_SEARCH_PATHS = \("\$\(inherited\)"\);]])
+ set(found_inherited_FRAMEWORK_SEARCH_PATHS 1)
+ endif()
+ endif()
+
+ if(line MATCHES [[LIBRARY_SEARCH_PATHS]])
+ string(APPEND relevant_lines " ${line}\n")
+ if(line MATCHES [[LIBRARY_SEARCH_PATHS = "[^"]*/Tests/RunCMake/XcodeProject/SearchPaths-build/ProjectSearchPath";]])
+ set(found_project_LIBRARY_SEARCH_PATHS 1)
+ endif()
+ if(line MATCHES [[LIBRARY_SEARCH_PATHS = \("(\\")?[^"]*/Tests/RunCMake/XcodeProject/SearchPaths-build/TargetSearchPathLib/\$\(CONFIGURATION\)\$\(EFFECTIVE_PLATFORM_NAME\)(\\")?","(\\")?[^"]*/Tests/RunCMake/XcodeProject/SearchPaths-build/TargetSearchPathLib(\\")?","\$\(inherited\)"\);]])
+ set(found_target_library_LIBRARY_SEARCH_PATHS 1)
+ endif()
+ if(line MATCHES [[LIBRARY_SEARCH_PATHS = \("\$\(inherited\)"\);]])
+ set(found_inherited_LIBRARY_SEARCH_PATHS 1)
+ endif()
+ endif()
+endforeach()
+if(NOT found_project_FRAMEWORK_SEARCH_PATHS)
+ string(APPEND RunCMake_TEST_FAILED "Did not find expected FRAMEWORK_SEARCH_PATHS for project in\n ${xcProjectFile}\n")
+endif()
+if(NOT found_target_both_FRAMEWORK_SEARCH_PATHS)
+ string(APPEND RunCMake_TEST_FAILED "Did not find expected FRAMEWORK_SEARCH_PATHS for target 'both' in\n ${xcProjectFile}\n")
+endif()
+if(NOT found_target_include_FRAMEWORK_SEARCH_PATHS)
+ string(APPEND RunCMake_TEST_FAILED "Did not find expected LIBRARY_SEARCH_PATHS for target 'include' in\n ${xcProjectFile}\n")
+endif()
+if(NOT found_target_library_FRAMEWORK_SEARCH_PATHS)
+ string(APPEND RunCMake_TEST_FAILED "Did not find expected LIBRARY_SEARCH_PATHS for target 'library' in\n ${xcProjectFile}\n")
+endif()
+if(found_inherited_FRAMEWORK_SEARCH_PATHS)
+ string(APPEND RunCMake_TEST_FAILED "Found unexpected LIBRARY_SEARCH_PATHS inherited-only value in\n ${xcProjectFile}\n")
+endif()
+if(NOT found_project_LIBRARY_SEARCH_PATHS)
+ string(APPEND RunCMake_TEST_FAILED "Did not find expected LIBRARY_SEARCH_PATHS for project in\n ${xcProjectFile}\n")
+endif()
+if(NOT found_target_library_LIBRARY_SEARCH_PATHS)
+ string(APPEND RunCMake_TEST_FAILED "Did not find expected LIBRARY_SEARCH_PATHS for target 'library' in\n ${xcProjectFile}\n")
+endif()
+if(found_inherited_LIBRARY_SEARCH_PATHS)
+ string(APPEND RunCMake_TEST_FAILED "Found unexpected LIBRARY_SEARCH_PATHS inherited-only value in\n ${xcProjectFile}\n")
+endif()
+if(RunCMake_TEST_FAILED)
+ string(APPEND RunCMake_TEST_FAILED "Relevant lines include\n${relevant_lines}")
+endif()
diff --git a/Tests/RunCMake/XcodeProject/SearchPaths.cmake b/Tests/RunCMake/XcodeProject/SearchPaths.cmake
new file mode 100644
index 0000000..ef97709
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/SearchPaths.cmake
@@ -0,0 +1,21 @@
+enable_language(C)
+
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/ProjectSearchPath")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/TargetSearchPathInc/TargetInc.framework")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/TargetSearchPathLib/TargetLib.framework")
+
+set(CMAKE_XCODE_ATTRIBUTE_FRAMEWORK_SEARCH_PATHS "${CMAKE_CURRENT_BINARY_DIR}/ProjectSearchPath")
+set(CMAKE_XCODE_ATTRIBUTE_LIBRARY_SEARCH_PATHS "${CMAKE_CURRENT_BINARY_DIR}/ProjectSearchPath")
+
+add_executable(neither main.c)
+
+add_executable(both main.c)
+target_include_directories(both PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/TargetSearchPathInc/TargetInc.framework")
+target_link_libraries(both PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/TargetSearchPathLib/TargetLib.framework")
+
+add_executable(include main.c)
+target_include_directories(include PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/TargetSearchPathInc/TargetInc.framework")
+
+add_executable(library main.c)
+target_link_libraries(library PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/TargetSearchPathLib/TargetLib.framework")
+target_link_directories(library PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/TargetSearchPathLib")
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/add_custom_command/AppendNotOutput-stderr.txt b/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt
index b7ee23a..9324302 100644
--- a/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt
+++ b/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt
@@ -1,5 +1,5 @@
CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
- add_custom_command given APPEND option with output
+ Attempt to APPEND to custom command with output
.*RunCMake/add_custom_command/AppendNotOutput-build/out
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
index 086e397..547fb1c 100644
--- a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
+++ b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
@@ -1,36 +1,67 @@
CMake Error at BadByproduct.cmake:2 \(add_custom_command\):
- add_custom_command called with BYPRODUCTS containing a "#". This character
- is not allowed.
+ BYPRODUCTS containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadByproduct.cmake:3 \(add_custom_command\):
- add_custom_command called with BYPRODUCTS containing a "<". This character
- is not allowed.
+ BYPRODUCTS containing a "<" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadByproduct.cmake:4 \(add_custom_command\):
- add_custom_command called with BYPRODUCTS containing a ">". This character
- is not allowed.
+ BYPRODUCTS containing a ">" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+(
CMake Error at BadByproduct.cmake:5 \(add_custom_command\):
- add_custom_command called with BYPRODUCTS containing a "<". This character
- is not allowed.
+ BYPRODUCTS containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+)+
CMake Error at BadByproduct.cmake:6 \(add_custom_command\):
- add_custom_command attempted to have a file
+ BYPRODUCTS path
.*RunCMake/add_custom_command/f
in a source directory as an output of custom command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
+(
+CMake Error at BadByproduct.cmake:7 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:prop>
+
+ \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not
+ be used with add_custom_command or add_custom_target. Specify the target
+ to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+(
+CMake Error at BadByproduct.cmake:8 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<OUTPUT_CONFIG:h>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+(
+CMake Error at BadByproduct.cmake:9 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<COMMAND_CONFIG:i>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct.cmake b/Tests/RunCMake/add_custom_command/BadByproduct.cmake
index 91bca52..cf00f5b 100644
--- a/Tests/RunCMake/add_custom_command/BadByproduct.cmake
+++ b/Tests/RunCMake/add_custom_command/BadByproduct.cmake
@@ -4,3 +4,6 @@ add_custom_command(OUTPUT b BYPRODUCTS "a<")
add_custom_command(OUTPUT c BYPRODUCTS "a>")
add_custom_command(OUTPUT d BYPRODUCTS "$<CONFIG>/#")
add_custom_command(OUTPUT e BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/f)
+add_custom_command(OUTPUT f BYPRODUCTS "$<TARGET_PROPERTY:prop>")
+add_custom_command(OUTPUT h BYPRODUCTS "$<OUTPUT_CONFIG:h>")
+add_custom_command(OUTPUT i BYPRODUCTS "$<COMMAND_CONFIG:i>")
diff --git a/Tests/RunCMake/add_custom_command/BadCommand-result.txt b/Tests/RunCMake/add_custom_command/BadCommand-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadCommand-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/BadCommand-stderr.txt b/Tests/RunCMake/add_custom_command/BadCommand-stderr.txt
new file mode 100644
index 0000000..470afd6
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadCommand-stderr.txt
@@ -0,0 +1,21 @@
+(CMake Error at BadCommand.cmake:1 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<OUTPUT_CONFIG:a>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+)+(CMake Error at BadCommand.cmake:2 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<COMMAND_CONFIG:b>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+)+
diff --git a/Tests/RunCMake/add_custom_command/BadCommand.cmake b/Tests/RunCMake/add_custom_command/BadCommand.cmake
new file mode 100644
index 0000000..8c9c3f9
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadCommand.cmake
@@ -0,0 +1,3 @@
+add_custom_command(OUTPUT "a" COMMAND "$<1:$<OUTPUT_CONFIG:a>>")
+add_custom_command(OUTPUT "b" COMMAND "$<1:$<COMMAND_CONFIG:b>>")
+add_custom_target(drive DEPENDS "a" "b")
diff --git a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
index 731e58d..2e43568 100644
--- a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
+++ b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
@@ -1,36 +1,67 @@
CMake Error at BadOutput.cmake:2 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a "#". This character is
- not allowed.
+ OUTPUT containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadOutput.cmake:3 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a "<". This character is
- not allowed.
+ OUTPUT containing a "<" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadOutput.cmake:4 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a ">". This character is
- not allowed.
+ OUTPUT containing a ">" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+(
CMake Error at BadOutput.cmake:5 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a "<". This character is
- not allowed.
+ OUTPUT containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+)+
CMake Error at BadOutput.cmake:6 \(add_custom_command\):
- add_custom_command attempted to have a file
+ OUTPUT path
.*RunCMake/add_custom_command/e
in a source directory as an output of custom command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
+(
+CMake Error at BadOutput.cmake:7 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:prop>
+
+ \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not
+ be used with add_custom_command or add_custom_target. Specify the target
+ to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+(
+CMake Error at BadOutput.cmake:8 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<OUTPUT_CONFIG:h>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+(
+CMake Error at BadOutput.cmake:9 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<COMMAND_CONFIG:i>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+
diff --git a/Tests/RunCMake/add_custom_command/BadOutput.cmake b/Tests/RunCMake/add_custom_command/BadOutput.cmake
index 6875fe9..f04bdd1 100644
--- a/Tests/RunCMake/add_custom_command/BadOutput.cmake
+++ b/Tests/RunCMake/add_custom_command/BadOutput.cmake
@@ -4,3 +4,6 @@ add_custom_command(OUTPUT "a<" COMMAND b)
add_custom_command(OUTPUT "a>" COMMAND c)
add_custom_command(OUTPUT "$<CONFIG>/#" COMMAND d)
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/e COMMAND f)
+add_custom_command(OUTPUT "$<TARGET_PROPERTY:prop>" COMMAND g)
+add_custom_command(OUTPUT "$<OUTPUT_CONFIG:h>" COMMAND h)
+add_custom_command(OUTPUT "$<COMMAND_CONFIG:i>" COMMAND i)
diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
index aac085d..9c59b4b 100644
--- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
@@ -6,6 +6,7 @@ run_cmake(AppendNotOutput)
run_cmake(BadArgument)
run_cmake(BadByproduct)
run_cmake(BadOutput)
+run_cmake(BadCommand)
run_cmake(GeneratedProperty)
run_cmake(LiteralQuotes)
run_cmake(NoArguments)
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
index 0f58550..da9af49 100644
--- a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
+++ b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
@@ -1,36 +1,67 @@
CMake Error at BadByproduct.cmake:2 \(add_custom_target\):
- add_custom_target called with BYPRODUCTS containing a "#". This character
- is not allowed.
+ BYPRODUCTS containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadByproduct.cmake:3 \(add_custom_target\):
- add_custom_target called with BYPRODUCTS containing a "<". This character
- is not allowed.
+ BYPRODUCTS containing a "<" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadByproduct.cmake:4 \(add_custom_target\):
- add_custom_target called with BYPRODUCTS containing a ">". This character
- is not allowed.
+ BYPRODUCTS containing a ">" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+(
CMake Error at BadByproduct.cmake:5 \(add_custom_target\):
- add_custom_target called with BYPRODUCTS containing a "<". This character
- is not allowed.
+ BYPRODUCTS containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+)+
CMake Error at BadByproduct.cmake:6 \(add_custom_target\):
- add_custom_target attempted to have a file
+ BYPRODUCTS path
.*RunCMake/add_custom_target/j
in a source directory as an output of custom command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
+(
+CMake Error at BadByproduct.cmake:7 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:prop>
+
+ \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not
+ be used with add_custom_command or add_custom_target. Specify the target
+ to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+(
+CMake Error at BadByproduct.cmake:8 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<OUTPUT_CONFIG:n>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+(
+CMake Error at BadByproduct.cmake:9 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<COMMAND_CONFIG:p>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct.cmake b/Tests/RunCMake/add_custom_target/BadByproduct.cmake
index 963d641..c317b83 100644
--- a/Tests/RunCMake/add_custom_target/BadByproduct.cmake
+++ b/Tests/RunCMake/add_custom_target/BadByproduct.cmake
@@ -4,3 +4,6 @@ add_custom_target(c BYPRODUCTS "a<" COMMAND d)
add_custom_target(e BYPRODUCTS "a>" COMMAND f)
add_custom_target(g BYPRODUCTS "$<CONFIG>/#" COMMAND h)
add_custom_target(i BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/j COMMAND k)
+add_custom_target(l BYPRODUCTS "$<TARGET_PROPERTY:prop>" COMMAND m)
+add_custom_target(n BYPRODUCTS "$<OUTPUT_CONFIG:n>" COMMAND o)
+add_custom_target(p BYPRODUCTS "$<COMMAND_CONFIG:p>" COMMAND q)
diff --git a/Tests/RunCMake/add_custom_target/BadCommand-result.txt b/Tests/RunCMake/add_custom_target/BadCommand-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadCommand-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_target/BadCommand-stderr.txt b/Tests/RunCMake/add_custom_target/BadCommand-stderr.txt
new file mode 100644
index 0000000..dfdf8f8
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadCommand-stderr.txt
@@ -0,0 +1,21 @@
+(CMake Error at BadCommand.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<OUTPUT_CONFIG:a>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+)+(CMake Error at BadCommand.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<COMMAND_CONFIG:b>
+
+ Expression did not evaluate to a known generator expression
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+)+
diff --git a/Tests/RunCMake/add_custom_target/BadCommand.cmake b/Tests/RunCMake/add_custom_target/BadCommand.cmake
new file mode 100644
index 0000000..dadf038
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadCommand.cmake
@@ -0,0 +1,4 @@
+add_custom_target(drive
+ COMMAND "$<1:$<OUTPUT_CONFIG:a>>"
+ COMMAND "$<1:$<COMMAND_CONFIG:b>>"
+ )
diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
index f5d5dd2..22a9ed4 100644
--- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
@@ -1,6 +1,7 @@
include(RunCMake)
run_cmake(BadByproduct)
+run_cmake(BadCommand)
run_cmake(BadTargetName)
run_cmake(ByproductsNoCommand)
run_cmake(CommandExpandsEmpty)
diff --git a/Tests/RunCMake/add_library/CMP0073-stderr.txt b/Tests/RunCMake/add_library/CMP0073-stderr.txt
new file mode 100644
index 0000000..7f43fd7
--- /dev/null
+++ b/Tests/RunCMake/add_library/CMP0073-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0073.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0073 will be removed from a future version
+ of CMake.
+
+ The cmake-policies\(7\) manual explains that the OLD behaviors of all
+ policies are deprecated and that a policy should be set to OLD only under
+ specific short-term circumstances. Projects should be ported to the NEW
+ behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/cmake_path/APPEND_STRING-OUTPUT_VARIABLE-invalid-arg-result.txt b/Tests/RunCMake/cmake_path/APPEND_STRING-OUTPUT_VARIABLE-invalid-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/APPEND_STRING-OUTPUT_VARIABLE-invalid-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/APPEND_STRING-OUTPUT_VARIABLE-no-arg-result.txt b/Tests/RunCMake/cmake_path/APPEND_STRING-OUTPUT_VARIABLE-no-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/APPEND_STRING-OUTPUT_VARIABLE-no-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/APPEND_STRING-wrong-path-result.txt b/Tests/RunCMake/cmake_path/APPEND_STRING-wrong-path-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/APPEND_STRING-wrong-path-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/CONCAT.cmake b/Tests/RunCMake/cmake_path/APPEND_STRING.cmake
index 62b5eb0..ea5f2dd 100644
--- a/Tests/RunCMake/cmake_path/CONCAT.cmake
+++ b/Tests/RunCMake/cmake_path/APPEND_STRING.cmake
@@ -3,13 +3,13 @@ include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)
set (path "/a/b")
-cmake_path (CONCAT path "cd")
+cmake_path (APPEND_STRING path "cd")
if (NOT path STREQUAL "/a/bcd")
list (APPEND errors "'${path}' instead of 'a/bcd'")
endif()
set (path "/a/b")
-cmake_path (CONCAT path "cd" "ef" OUTPUT_VARIABLE output)
+cmake_path (APPEND_STRING path "cd" "ef" OUTPUT_VARIABLE output)
if (NOT path STREQUAL "/a/b")
list (APPEND errors "input changed unexpectedly")
endif()
@@ -17,4 +17,4 @@ if (NOT output STREQUAL "/a/bcdef")
list (APPEND errors "'${output}' instead of 'a/bcdef'")
endif()
-check_errors (CONCAT ${errors})
+check_errors (APPEND_STRING ${errors})
diff --git a/Tests/RunCMake/cmake_path/COMPARE.cmake b/Tests/RunCMake/cmake_path/COMPARE.cmake
index bc6b9b4..ecf7c82 100644
--- a/Tests/RunCMake/cmake_path/COMPARE.cmake
+++ b/Tests/RunCMake/cmake_path/COMPARE.cmake
@@ -2,19 +2,19 @@
include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)
-set (path "a///b/c")
-cmake_path(COMPARE path EQUAL "a/b/c" output)
+set(path "a///b/c")
+cmake_path(COMPARE "${path}" EQUAL "a/b/c" output)
if (NOT output)
list (APPEND errors "'${path}' not equal to 'a/b/c'")
endif()
set (path "a/b/d/../c")
-cmake_path(COMPARE path NOT_EQUAL "a/b/c" output)
+cmake_path(COMPARE "${path}" NOT_EQUAL "a/b/c" output)
if (NOT output)
list (APPEND errors "'${path}' equal to 'a/b/c'")
endif()
cmake_path(NORMAL_PATH path)
-cmake_path(COMPARE path EQUAL "a/b/c" output)
+cmake_path(COMPARE "${path}" EQUAL "a/b/c" output)
if (NOT output)
list (APPEND errors "'${path}' not equal to 'a/b/c'")
endif()
diff --git a/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-invalid-output-result.txt b/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-invalid-output-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-invalid-output-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-missing-output-result.txt b/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-missing-output-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-missing-output-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-unexpected-arg-result.txt b/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-unexpected-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-unexpected-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-wrong-path-result.txt b/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-wrong-path-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/GET-RELATIVE_PART-wrong-path-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/GET.cmake b/Tests/RunCMake/cmake_path/GET.cmake
index e68e654..463bc47 100644
--- a/Tests/RunCMake/cmake_path/GET.cmake
+++ b/Tests/RunCMake/cmake_path/GET.cmake
@@ -61,9 +61,9 @@ if (NOT output STREQUAL "cc.ext1")
list (APPEND errors "STEM LAST_ONLY returns bad data: ${output}")
endif()
-cmake_path(GET path RELATIVE_PATH output)
+cmake_path(GET path RELATIVE_PART output)
if (NOT output STREQUAL "aa/bb/cc.ext1.ext2")
- list (APPEND errors "RELATIVE_PATH returns bad data: ${output}")
+ list (APPEND errors "RELATIVE_PART returns bad data: ${output}")
endif()
cmake_path(GET path PARENT_PATH output)
@@ -112,9 +112,9 @@ if (NOT output STREQUAL "")
list (APPEND errors "STEM returns bad data: ${output}")
endif()
-cmake_path(GET path RELATIVE_PATH output)
+cmake_path(GET path RELATIVE_PART output)
if (NOT output STREQUAL path)
- list (APPEND errors "RELATIVE_PATH returns bad data: ${output}")
+ list (APPEND errors "RELATIVE_PART returns bad data: ${output}")
endif()
cmake_path(GET path PARENT_PATH output)
@@ -173,9 +173,9 @@ if (NOT output STREQUAL "")
list (APPEND errors "STEM returns bad data: ${output}")
endif()
-cmake_path(GET path RELATIVE_PATH output)
+cmake_path(GET path RELATIVE_PART output)
if (NOT output STREQUAL "")
- list (APPEND errors "RELATIVE_PATH returns bad data: ${output}")
+ list (APPEND errors "RELATIVE_PART returns bad data: ${output}")
endif()
cmake_path(GET path PARENT_PATH output)
diff --git a/Tests/RunCMake/cmake_path/HASH.cmake b/Tests/RunCMake/cmake_path/HASH.cmake
index dfcf2b2..eb04f7f 100644
--- a/Tests/RunCMake/cmake_path/HASH.cmake
+++ b/Tests/RunCMake/cmake_path/HASH.cmake
@@ -14,11 +14,6 @@ set (path1 "a///b/c/../d")
cmake_path(HASH path1 hash1)
set (path2 "a/b////d")
cmake_path(HASH path2 hash2)
-if (hash1 STREQUAL hash2)
- list (APPEND errors "'hash values equal for '${path1}' and '${path2}'")
-endif()
-cmake_path(HASH path1 hash1 NORMALIZE)
-cmake_path(HASH path2 NORMALIZE hash2)
if (NOT hash1 STREQUAL hash2)
list (APPEND errors "'hash values not equal for '${path1}' and '${path2}'")
endif()
diff --git a/Tests/RunCMake/cmake_path/HAS_ITEM.cmake b/Tests/RunCMake/cmake_path/HAS_ITEM.cmake
index eb73bd5..e76776c 100644
--- a/Tests/RunCMake/cmake_path/HAS_ITEM.cmake
+++ b/Tests/RunCMake/cmake_path/HAS_ITEM.cmake
@@ -96,14 +96,14 @@ if (output)
endif()
set (path "/a/b")
-cmake_path(HAS_RELATIVE_PATH path output)
+cmake_path(HAS_RELATIVE_PART path output)
if (NOT output)
- list (APPEND errors "RELATIVE_PATH: ${path} does not have relative path")
+ list (APPEND errors "RELATIVE_PART: ${path} does not have relative part")
endif()
set (path "/")
-cmake_path(HAS_RELATIVE_PATH path output)
+cmake_path(HAS_RELATIVE_PART path output)
if (output)
- list (APPEND errors "RELATIVE_PATH: ${path} has relative path")
+ list (APPEND errors "RELATIVE_PART: ${path} has relative part")
endif()
set (path "/a/b")
@@ -180,21 +180,21 @@ if (WIN32)
endif()
set (path "c:/a/b")
- cmake_path(HAS_RELATIVE_PATH path output)
+ cmake_path(HAS_RELATIVE_PART path output)
if (NOT output)
- list (APPEND errors "RELATIVE_PATH: ${path} does not have relative path")
+ list (APPEND errors "RELATIVE_PART: ${path} does not have relative part")
endif()
set (path "c:a/b")
- cmake_path(HAS_RELATIVE_PATH path output)
+ cmake_path(HAS_RELATIVE_PART path output)
if (NOT output)
- list (APPEND errors "RELATIVE_PATH: ${path} does not have relative path")
+ list (APPEND errors "RELATIVE_PART: ${path} does not have relative part")
endif()
set (path "//host/b")
- cmake_path(HAS_RELATIVE_PATH path output)
+ cmake_path(HAS_RELATIVE_PART path output)
if (NOT output)
- list (APPEND errors "RELATIVE_PATH: ${path} does not have relative path")
+ list (APPEND errors "RELATIVE_PART: ${path} does not have relative part")
endif()
set (path "c:/a/b")
diff --git a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-invalid-output-result.txt b/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-invalid-output-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-invalid-output-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-missing-output-result.txt b/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-missing-output-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-missing-output-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-unexpected-arg-result.txt b/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-unexpected-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-unexpected-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-wrong-path-result.txt b/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-wrong-path-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/HAS_RELATIVE_PART-wrong-path-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/IS_PREFIX.cmake b/Tests/RunCMake/cmake_path/IS_PREFIX.cmake
index 53da93b..9160dab 100644
--- a/Tests/RunCMake/cmake_path/IS_PREFIX.cmake
+++ b/Tests/RunCMake/cmake_path/IS_PREFIX.cmake
@@ -18,5 +18,10 @@ if (NOT output)
list (APPEND errors "'${path} is not prefix of 'a/b/d/e'")
endif()
+set(path "/a/b/..")
+cmake_path(IS_PREFIX path "/a/c/../b" NORMALIZE output)
+if (NOT output)
+ list (APPEND errors "'${path} is not prefix of '/a/c/../b'")
+endif()
check_errors (IS_PREFIX ${errors})
diff --git a/Tests/RunCMake/cmake_path/PROXIMATE_PATH.cmake b/Tests/RunCMake/cmake_path/PROXIMATE_PATH.cmake
deleted file mode 100644
index ad23377..0000000
--- a/Tests/RunCMake/cmake_path/PROXIMATE_PATH.cmake
+++ /dev/null
@@ -1,41 +0,0 @@
-
-include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
-unset (errors)
-
-if (WIN32)
- set (path "c:/a/d")
- cmake_path(PROXIMATE_PATH path BASE_DIRECTORY "e/d/c")
- if (NOT path STREQUAL "c:/a/d")
- list (APPEND errors "'${path}' instead of 'c:/a/d'")
- endif()
-else()
- set (path "/a/d")
- cmake_path(PROXIMATE_PATH path BASE_DIRECTORY "e/d/c")
- if (NOT path STREQUAL "/a/d")
- list (APPEND errors "'${path}' instead of '/a/d'")
- endif()
-endif()
-
-set (path "/a/d")
-cmake_path(PROXIMATE_PATH path BASE_DIRECTORY "/a/b/c" OUTPUT_VARIABLE output)
-if (NOT path STREQUAL "/a/d")
- list (APPEND errors "input changed unexpectedly")
-endif()
-if (NOT output STREQUAL "../../d")
- list (APPEND errors "'${output}' instead of '../../d'")
-endif()
-
-set (path "${CMAKE_CURRENT_SOURCE_DIR}/a/d")
-cmake_path(PROXIMATE_PATH path)
-if (NOT path STREQUAL "a/d")
- list (APPEND errors "'${path}' instead of 'a/d'")
-endif()
-
-set (path "a/b/c")
-cmake_path(PROXIMATE_PATH path)
-if (NOT path STREQUAL "a/b/c")
- list (APPEND errors "'${path}' instead of 'a/b/c'")
-endif()
-
-
-check_errors (PROXIMATE_PATH ${errors})
diff --git a/Tests/RunCMake/cmake_path/RunCMakeTest.cmake b/Tests/RunCMake/cmake_path/RunCMakeTest.cmake
index ca9cba6..991f46b 100644
--- a/Tests/RunCMake/cmake_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/cmake_path/RunCMakeTest.cmake
@@ -7,25 +7,20 @@ set (RunCMake-stderr-file "wrong-path-stderr.txt")
### GET sub-command
foreach (subcommand IN ITEMS ROOT_NAME ROOT_DIRECTORY ROOT_PATH FILENAME EXTENSION
- STEM RELATIVE_PATH PARENT_PATH)
+ STEM RELATIVE_PART PARENT_PATH)
run_cmake_command (GET-${subcommand}-wrong-path "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=GET wrong_path ${subcommand} output" -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
-### COMPARE sub-command
-foreach (subcommand IN ITEMS EQUAL NOT_EQUAL)
- run_cmake_command (COMPARE-${subcommand}-wrong-path "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=COMPARE wrong_path ${subcommand} path2 output" -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
-endforeach()
-
-foreach (command IN ITEMS CONCAT REMOVE_FILENAME REPLACE_FILENAME
+foreach (command IN ITEMS APPEND_STRING REMOVE_FILENAME REPLACE_FILENAME
REMOVE_EXTENSION REPLACE_EXTENSION NORMAL_PATH
- RELATIVE_PATH PROXIMATE_PATH ABSOLUTE_PATH)
+ RELATIVE_PATH ABSOLUTE_PATH)
run_cmake_command (${command}-wrong-path "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=${command} wrong_path" -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
foreach (command IN ITEMS NATIVE_PATH
HAS_ROOT_NAME HAS_ROOT_DIRECTORY HAS_ROOT_PATH
HAS_FILENAME HAS_EXTENSION HAS_STEM
- HAS_RELATIVE_PATH HAS_PARENT_PATH
+ HAS_RELATIVE_PART HAS_PARENT_PATH
IS_ABSOLUTE IS_RELATIVE IS_PREFIX HASH)
if (command STREQUAL "IS_PREFIX")
set (extra_args path2)
@@ -41,7 +36,7 @@ set (RunCMake-stderr-file "missing-output-stderr.txt")
### GET sub-command
foreach (subcommand IN ITEMS ROOT_NAME ROOT_DIRECTORY ROOT_PATH FILENAME EXTENSION
- STEM RELATIVE_PATH PARENT_PATH)
+ STEM RELATIVE_PART PARENT_PATH)
run_cmake_command (GET-${subcommand}-missing-output "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=GET path ${subcommand}" -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
@@ -55,10 +50,10 @@ foreach (subcommand IN ITEMS EQUAL NOT_EQUAL)
run_cmake_command (COMPARE-${subcommand}-missing-output "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=COMPARE path ${subcommand} path2" -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
-foreach (command IN ITEMS CMAKE_PATH NATIVE_PATH
+foreach (command IN ITEMS SET NATIVE_PATH
HAS_ROOT_NAME HAS_ROOT_DIRECTORY HAS_ROOT_PATH
HAS_FILENAME HAS_EXTENSION HAS_STEM
- HAS_RELATIVE_PATH HAS_PARENT_PATH
+ HAS_RELATIVE_PART HAS_PARENT_PATH
IS_ABSOLUTE IS_RELATIVE IS_PREFIX HASH)
if (command STREQUAL "IS_PREFIX")
set (extra_args path2)
@@ -72,9 +67,9 @@ endforeach()
## OUTPUT_VARIABLE without argument
set (RunCMake-stderr-file "OUTPUT_VARIABLE-no-arg-stderr.txt")
-foreach (command IN ITEMS APPEND CONCAT REMOVE_FILENAME REPLACE_FILENAME
+foreach (command IN ITEMS APPEND APPEND_STRING REMOVE_FILENAME REPLACE_FILENAME
REMOVE_EXTENSION REPLACE_EXTENSION NORMAL_PATH
- RELATIVE_PATH PROXIMATE_PATH ABSOLUTE_PATH)
+ RELATIVE_PATH ABSOLUTE_PATH)
run_cmake_command (${command}-OUTPUT_VARIABLE-no-arg "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=${command} path OUTPUT_VARIABLE" -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
@@ -84,7 +79,7 @@ set (RunCMake-stderr-file "invalid-output-var-stderr.txt")
### GET sub-command
foreach (subcommand IN ITEMS ROOT_NAME ROOT_DIRECTORY ROOT_PATH FILENAME EXTENSION
- STEM RELATIVE_PATH PARENT_PATH)
+ STEM RELATIVE_PART PARENT_PATH)
run_cmake_command (GET-${subcommand}-invalid-output "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=GET path ${subcommand}" -DCHECK_INVALID_OUTPUT=ON -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
@@ -98,10 +93,10 @@ foreach (subcommand IN ITEMS EQUAL NOT_EQUAL)
run_cmake_command (COMPARE-${subcommand}-invalid-output "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=COMPARE path ${subcommand} path2" -DCHECK_INVALID_OUTPUT=ON -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
-foreach (command IN ITEMS CMAKE_PATH NATIVE_PATH
+foreach (command IN ITEMS NATIVE_PATH
HAS_ROOT_NAME HAS_ROOT_DIRECTORY HAS_ROOT_PATH
HAS_FILENAME HAS_EXTENSION HAS_STEM
- HAS_RELATIVE_PATH HAS_PARENT_PATH
+ HAS_RELATIVE_PART HAS_PARENT_PATH
IS_ABSOLUTE IS_RELATIVE IS_PREFIX HASH)
if (command STREQUAL "IS_PREFIX")
set (extra_args path2)
@@ -111,9 +106,9 @@ foreach (command IN ITEMS CMAKE_PATH NATIVE_PATH
run_cmake_command (${command}-invalid-output "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=${command} path ${extra_args}" -DCHECK_INVALID_OUTPUT=ON -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
-foreach (command IN ITEMS APPEND CONCAT REMOVE_FILENAME REPLACE_FILENAME
+foreach (command IN ITEMS APPEND APPEND_STRING REMOVE_FILENAME REPLACE_FILENAME
REMOVE_EXTENSION REPLACE_EXTENSION NORMAL_PATH
- RELATIVE_PATH PROXIMATE_PATH ABSOLUTE_PATH)
+ RELATIVE_PATH ABSOLUTE_PATH)
run_cmake_command (${command}-OUTPUT_VARIABLE-invalid-arg "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=${command} path OUTPUT_VARIABLE" -DCHECK_INVALID_OUTPUT=ON -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
@@ -123,7 +118,7 @@ set (RunCMake-stderr-file "unexpected-arg-stderr.txt")
### GET sub-command
foreach (subcommand IN ITEMS ROOT_NAME ROOT_DIRECTORY ROOT_PATH FILENAME EXTENSION
- STEM RELATIVE_PATH PARENT_PATH)
+ STEM RELATIVE_PART PARENT_PATH)
if (subcommand STREQUAL "EXTENSION" OR subcommand STREQUAL "STEM")
set (extra_args LAST_ONLY)
else()
@@ -139,7 +134,7 @@ endforeach()
foreach (command IN ITEMS REMOVE_FILENAME REPLACE_FILENAME
REMOVE_EXTENSION REPLACE_EXTENSION NORMAL_PATH
- RELATIVE_PATH PROXIMATE_PATH ABSOLUTE_PATH)
+ RELATIVE_PATH ABSOLUTE_PATH)
if (command STREQUAL "REPLACE_FILENAME" OR command STREQUAL "REPLACE_EXTENSION")
set (extra_args input)
else()
@@ -148,10 +143,10 @@ foreach (command IN ITEMS REMOVE_FILENAME REPLACE_FILENAME
run_cmake_command (${command}-unexpected-arg "${CMAKE_COMMAND}" "-DCMAKE_PATH_ARGUMENTS=${command} path ${extra_args} unexpected" -P "${RunCMake_SOURCE_DIR}/call-cmake_path.cmake")
endforeach()
-foreach (command IN ITEMS CMAKE_PATH NATIVE_PATH
+foreach (command IN ITEMS SET NATIVE_PATH
HAS_ROOT_NAME HAS_ROOT_DIRECTORY HAS_ROOT_PATH
HAS_FILENAME HAS_EXTENSION HAS_STEM
- HAS_RELATIVE_PATH HAS_PARENT_PATH
+ HAS_RELATIVE_PART HAS_PARENT_PATH
IS_ABSOLUTE IS_RELATIVE IS_PREFIX
HASH)
if (command STREQUAL "IS_PREFIX")
@@ -170,17 +165,16 @@ run_cmake(COMPARE-wrong-operator)
set (RunCMake_TEST_OPTIONS "-DRunCMake_SOURCE_DIR=${RunCMake_SOURCE_DIR}")
run_cmake(GET)
+run_cmake(SET)
run_cmake(APPEND)
-run_cmake(CONCAT)
+run_cmake(APPEND_STRING)
run_cmake(REMOVE_FILENAME)
run_cmake(REPLACE_FILENAME)
run_cmake(REMOVE_EXTENSION)
run_cmake(REPLACE_EXTENSION)
run_cmake(NORMAL_PATH)
run_cmake(RELATIVE_PATH)
-run_cmake(PROXIMATE_PATH)
run_cmake(ABSOLUTE_PATH)
-run_cmake(CMAKE_PATH)
run_cmake(NATIVE_PATH)
run_cmake(CONVERT)
run_cmake(COMPARE)
diff --git a/Tests/RunCMake/cmake_path/SET-missing-output-result.txt b/Tests/RunCMake/cmake_path/SET-missing-output-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/SET-missing-output-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/SET-unexpected-arg-result.txt b/Tests/RunCMake/cmake_path/SET-unexpected-arg-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/cmake_path/SET-unexpected-arg-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_path/CMAKE_PATH.cmake b/Tests/RunCMake/cmake_path/SET.cmake
index b9320f3..445783e 100644
--- a/Tests/RunCMake/cmake_path/CMAKE_PATH.cmake
+++ b/Tests/RunCMake/cmake_path/SET.cmake
@@ -2,42 +2,42 @@
include ("${RunCMake_SOURCE_DIR}/check_errors.cmake")
unset (errors)
-cmake_path(CMAKE_PATH path "/x/y/z/../../a/d")
+cmake_path(SET path "/x/y/z/../../a/d")
if (NOT path STREQUAL "/x/y/z/../../a/d")
list (APPEND errors "'${path}' instead of '/x/y/z/../../a/d'")
endif()
-cmake_path(CMAKE_PATH path NORMALIZE "/x/y/z/../../a/d")
+cmake_path(SET path NORMALIZE "/x/y/z/../../a/d")
if (NOT path STREQUAL "/x/a/d")
list (APPEND errors "'${path}' instead of '/x/a/d'")
endif()
if (WIN32)
- cmake_path(CMAKE_PATH path "/x\\y/z\\..\\../a/d")
+ cmake_path(SET path "/x\\y/z\\..\\../a/d")
if (NOT path STREQUAL "/x/y/z/../../a/d")
list (APPEND errors "'${path}' instead of '/x/y/z/../../a/d'")
endif()
- cmake_path(CMAKE_PATH path NORMALIZE "/x\\y/z\\..\\../a/d")
+ cmake_path(SET path NORMALIZE "/x\\y/z\\..\\../a/d")
if (NOT path STREQUAL "/x/a/d")
list (APPEND errors "'${path}' instead of '/x/a/d'")
endif()
- cmake_path(CMAKE_PATH path "//?/c:/x\\y/z\\..\\../a/d")
+ cmake_path(SET path "//?/c:/x\\y/z\\..\\../a/d")
if (NOT path STREQUAL "c:/x/y/z/../../a/d")
list (APPEND errors "'${path}' instead of 'c:/x/y/z/../../a/d'")
endif()
- cmake_path(CMAKE_PATH path NORMALIZE "//?/c:/x\\y/z\\..\\../a/d")
+ cmake_path(SET path NORMALIZE "//?/c:/x\\y/z\\..\\../a/d")
if (NOT path STREQUAL "c:/x/a/d")
list (APPEND errors "'${path}' instead of 'c:/x/a/d'")
endif()
- cmake_path(CMAKE_PATH path "\\\\?\\UNC/host/x\\y/z\\..\\../a/d")
+ cmake_path(SET path "\\\\?\\UNC/host/x\\y/z\\..\\../a/d")
if (NOT path STREQUAL "//host/x/y/z/../../a/d")
list (APPEND errors "'${path}' instead of '//host/x/y/z/../../a/d'")
endif()
- cmake_path(CMAKE_PATH path NORMALIZE "\\\\?\\UNC\\host/x\\y/z\\..\\../a/d")
+ cmake_path(SET path NORMALIZE "\\\\?\\UNC\\host/x\\y/z\\..\\../a/d")
if (NOT path STREQUAL "//host/x/a/d")
list (APPEND errors "'${path}' instead of '//host/x/a/d'")
endif()
endif()
-check_errors (CMAKE_PATH ${errors})
+check_errors (SET ${errors})
diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
index 71694fb..0a2e3f9 100644
--- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
@@ -16,6 +16,13 @@ run_cmake(NewLineStyle-WrongArg)
run_cmake(NewLineStyle-ValidArg)
run_cmake(NewLineStyle-COPYONLY)
run_cmake(NoSourcePermissions)
+run_cmake(SourcePermissionsInvalidArg-1)
+run_cmake(SourcePermissionsInvalidArg-2)
+run_cmake(SourcePermissionsInvalidArg-3)
+run_cmake(SourcePermissionsInvalidArg-4)
+run_cmake(SourcePermissionsInvalidArg-5)
+run_cmake(UseSourcePermissions)
+run_cmake(SourcePermissions)
if(RunCMake_GENERATOR MATCHES "Make")
# Use a single build tree for a few tests without cleaning.
diff --git a/Tests/RunCMake/configure_file/SourcePermissions-result.txt b/Tests/RunCMake/configure_file/SourcePermissions-result.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissions-result.txt
diff --git a/Tests/RunCMake/configure_file/SourcePermissions-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissions-stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissions-stderr.txt
diff --git a/Tests/RunCMake/configure_file/SourcePermissions.cmake b/Tests/RunCMake/configure_file/SourcePermissions.cmake
new file mode 100644
index 0000000..50330fc
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissions.cmake
@@ -0,0 +1,34 @@
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE
+ WORLD_READ
+)
+
+if (UNIX)
+ find_program(STAT_EXECUTABLE NAMES stat)
+ if(NOT STAT_EXECUTABLE)
+ return()
+ endif()
+
+ if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt"
+ OUTPUT_VARIABLE output
+ )
+ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt"
+ OUTPUT_VARIABLE output
+ )
+ else()
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt"
+ OUTPUT_VARIABLE output
+ )
+ endif()
+
+ if (NOT output EQUAL "554")
+ message(FATAL_ERROR "configure file has different permissions than "
+ "desired, generated permissions: ${output}")
+ endif()
+
+endif()
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-stderr.txt
new file mode 100644
index 0000000..d483d34
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissionsInvalidArg-1.cmake:1 \(configure_file\):
+ configure_file given both USE_SOURCE_PERMISSIONS and NO_SOURCE_PERMISSIONS.
+ Only one option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1.cmake
new file mode 100644
index 0000000..4969880
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-1.cmake
@@ -0,0 +1,5 @@
+configure_file(sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile.txt
+ NO_SOURCE_PERMISSIONS
+ USE_SOURCE_PERMISSIONS
+)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-stderr.txt
new file mode 100644
index 0000000..2fcfe58
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissionsInvalidArg-2.cmake:1 \(configure_file\):
+ configure_file given both FILE_PERMISSIONS and NO_SOURCE_PERMISSIONS. Only
+ one option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2.cmake
new file mode 100644
index 0000000..8a3fb87
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-2.cmake
@@ -0,0 +1,5 @@
+configure_file(sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile.txt
+ NO_SOURCE_PERMISSIONS
+ FILE_PERMISSIONS OWNER_READ
+)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-stderr.txt
new file mode 100644
index 0000000..29fae1b
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at SourcePermissionsInvalidArg-3.cmake:1 \(configure_file\):
+ configure_file given both FILE_PERMISSIONS and USE_SOURCE_PERMISSIONS.
+ Only one option allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3.cmake
new file mode 100644
index 0000000..78ecb0f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-3.cmake
@@ -0,0 +1,5 @@
+configure_file(sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile.txt
+ USE_SOURCE_PERMISSIONS
+ FILE_PERMISSIONS OWNER_READ
+)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-stderr.txt
new file mode 100644
index 0000000..7d477cb
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourcePermissionsInvalidArg-4.cmake:1 \(configure_file\):
+ configure_file given FILE_PERMISSIONS without any options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4.cmake
new file mode 100644
index 0000000..308b455
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-4.cmake
@@ -0,0 +1,4 @@
+configure_file(sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile.txt
+ FILE_PERMISSIONS
+)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-result.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-stderr.txt b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-stderr.txt
new file mode 100644
index 0000000..7cab120
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at SourcePermissionsInvalidArg-5.cmake:1 \(configure_file\):
+ configure_file given invalid permission "OWNER_RX","GROUP_RWX".
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5.cmake b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5.cmake
new file mode 100644
index 0000000..15c6f9a
--- /dev/null
+++ b/Tests/RunCMake/configure_file/SourcePermissionsInvalidArg-5.cmake
@@ -0,0 +1,6 @@
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile-source-permissions.txt
+ FILE_PERMISSIONS
+ OWNER_READ OWNER_RX
+ GROUP_RWX
+)
diff --git a/Tests/RunCMake/configure_file/UseSourcePermissions.cmake b/Tests/RunCMake/configure_file/UseSourcePermissions.cmake
new file mode 100644
index 0000000..f7aedd1
--- /dev/null
+++ b/Tests/RunCMake/configure_file/UseSourcePermissions.cmake
@@ -0,0 +1,40 @@
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt
+ ${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt
+ USE_SOURCE_PERMISSIONS
+)
+
+if (UNIX)
+ find_program(STAT_EXECUTABLE NAMES stat)
+ if(NOT STAT_EXECUTABLE)
+ return()
+ endif()
+
+ if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt"
+ OUTPUT_VARIABLE output1
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %Lp "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt"
+ OUTPUT_VARIABLE output2
+ )
+ elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt"
+ OUTPUT_VARIABLE output1
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -f %A "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt"
+ OUTPUT_VARIABLE output2
+ )
+ else()
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${CMAKE_CURRENT_SOURCE_DIR}/sourcefile.txt"
+ OUTPUT_VARIABLE output1
+ )
+ execute_process(COMMAND "${STAT_EXECUTABLE}" -c %a "${CMAKE_CURRENT_BINARY_DIR}/sourcefile-use-source-permissions.txt"
+ OUTPUT_VARIABLE output2
+ )
+ endif()
+
+ if (NOT output1 EQUAL output2)
+ message(FATAL_ERROR "configure file has different permissions source "
+ "permissions: ${output1} generated permissions: ${output2}")
+ endif()
+
+endif()
diff --git a/Tests/RunCMake/configure_file/sourcefile.txt b/Tests/RunCMake/configure_file/sourcefile.txt
new file mode 100644
index 0000000..2296808
--- /dev/null
+++ b/Tests/RunCMake/configure_file/sourcefile.txt
@@ -0,0 +1 @@
+an empty file
diff --git a/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in b/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in
index 140e4be..c35397c 100644
--- a/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in
+++ b/Tests/RunCMake/ctest_submit/CTestConfig.cmake.in
@@ -3,3 +3,7 @@
# so that any ctest_submit calls fail with an error message.
set(CTEST_DROP_METHOD "@CASE_DROP_METHOD@")
set(CTEST_DROP_SITE "@CASE_DROP_SITE@")
+
+# do not use proxy for lookup of invalid site (DNS failure by proxy looks
+# different than DNS failure without proxy)
+set(ENV{no_proxy} "$ENV{no_proxy},@CASE_DROP_SITE@")
diff --git a/Tests/CMakeTests/ELFTest.cmake.in b/Tests/RunCMake/file-RPATH/Common.cmake
index 85c2360..cc1efb5 100644
--- a/Tests/CMakeTests/ELFTest.cmake.in
+++ b/Tests/RunCMake/file-RPATH/Common.cmake
@@ -1,15 +1,6 @@
-set(names
- elf32lsb.bin
- elf32msb.bin
- elf64lsb.bin
- elf64msb.bin
- )
-
# Prepare binaries on which to operate.
-set(in "@CMAKE_CURRENT_SOURCE_DIR@/ELF")
-set(out "@CMAKE_CURRENT_BINARY_DIR@/ELF-Out")
-file(REMOVE_RECURSE "${out}")
-file(MAKE_DIRECTORY "${out}")
+set(in "${CMAKE_CURRENT_LIST_DIR}/${format}")
+set(out "${CMAKE_CURRENT_BINARY_DIR}")
foreach(f ${names})
file(COPY ${in}/${f} DESTINATION ${out} NO_SOURCE_PERMISSIONS)
list(APPEND files "${out}/${f}")
diff --git a/Tests/RunCMake/file-RPATH/ELF.cmake b/Tests/RunCMake/file-RPATH/ELF.cmake
new file mode 100644
index 0000000..558b2e2
--- /dev/null
+++ b/Tests/RunCMake/file-RPATH/ELF.cmake
@@ -0,0 +1,9 @@
+set(names
+ elf32lsb.bin
+ elf32msb.bin
+ elf64lsb.bin
+ elf64msb.bin
+ )
+set(format ELF)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
diff --git a/Tests/CMakeTests/ELF/elf32lsb.bin b/Tests/RunCMake/file-RPATH/ELF/elf32lsb.bin
index 803ac43..803ac43 100644..100755
--- a/Tests/CMakeTests/ELF/elf32lsb.bin
+++ b/Tests/RunCMake/file-RPATH/ELF/elf32lsb.bin
Binary files differ
diff --git a/Tests/CMakeTests/ELF/elf32msb.bin b/Tests/RunCMake/file-RPATH/ELF/elf32msb.bin
index d04aaf7..d04aaf7 100644..100755
--- a/Tests/CMakeTests/ELF/elf32msb.bin
+++ b/Tests/RunCMake/file-RPATH/ELF/elf32msb.bin
Binary files differ
diff --git a/Tests/CMakeTests/ELF/elf64lsb.bin b/Tests/RunCMake/file-RPATH/ELF/elf64lsb.bin
index a21e3ea..a21e3ea 100644..100755
--- a/Tests/CMakeTests/ELF/elf64lsb.bin
+++ b/Tests/RunCMake/file-RPATH/ELF/elf64lsb.bin
Binary files differ
diff --git a/Tests/CMakeTests/ELF/elf64msb.bin b/Tests/RunCMake/file-RPATH/ELF/elf64msb.bin
index bbe2551..bbe2551 100644..100755
--- a/Tests/CMakeTests/ELF/elf64msb.bin
+++ b/Tests/RunCMake/file-RPATH/ELF/elf64msb.bin
Binary files differ
diff --git a/Tests/RunCMake/file-RPATH/RunCMakeTest.cmake b/Tests/RunCMake/file-RPATH/RunCMakeTest.cmake
new file mode 100644
index 0000000..eb7b497
--- /dev/null
+++ b/Tests/RunCMake/file-RPATH/RunCMakeTest.cmake
@@ -0,0 +1,9 @@
+include(RunCMake)
+
+if(HAVE_ELF_H)
+ run_cmake_command(ELF ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/ELF.cmake)
+endif()
+
+if(CMAKE_SYSTEM_NAME STREQUAL "AIX")
+ run_cmake_command(XCOFF ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/XCOFF.cmake)
+endif()
diff --git a/Tests/RunCMake/file-RPATH/XCOFF.cmake b/Tests/RunCMake/file-RPATH/XCOFF.cmake
new file mode 100644
index 0000000..b570920
--- /dev/null
+++ b/Tests/RunCMake/file-RPATH/XCOFF.cmake
@@ -0,0 +1,7 @@
+set(names
+ xcoff32.bin
+ xcoff64.bin
+ )
+set(format XCOFF)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
diff --git a/Tests/RunCMake/file-RPATH/XCOFF/xcoff32.bin b/Tests/RunCMake/file-RPATH/XCOFF/xcoff32.bin
new file mode 100644
index 0000000..2d8d961
--- /dev/null
+++ b/Tests/RunCMake/file-RPATH/XCOFF/xcoff32.bin
Binary files differ
diff --git a/Tests/RunCMake/file-RPATH/XCOFF/xcoff64.bin b/Tests/RunCMake/file-RPATH/XCOFF/xcoff64.bin
new file mode 100644
index 0000000..bb5f5a7
--- /dev/null
+++ b/Tests/RunCMake/file-RPATH/XCOFF/xcoff64.bin
Binary files differ
diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake
index c4ee53d..2143fa2 100644
--- a/Tests/RunCMake/get_property/RunCMakeTest.cmake
+++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake
@@ -2,6 +2,9 @@ include(RunCMake)
run_cmake(cache_properties)
run_cmake(directory_properties)
+run_cmake(get_directory_property_empty)
+run_cmake(get_directory_property_missing)
+run_cmake(get_directory_property_missingWithDir)
run_cmake(global_properties)
run_cmake(install_properties)
run_cmake(source_properties)
diff --git a/Tests/RunCMake/get_property/get_directory_property_empty-result.txt b/Tests/RunCMake/get_property/get_directory_property_empty-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_empty-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/get_property/get_directory_property_empty-stderr.txt b/Tests/RunCMake/get_property/get_directory_property_empty-stderr.txt
new file mode 100644
index 0000000..baa73f3
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_empty-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at get_directory_property_empty.cmake:1 \(get_directory_property\):
+ get_directory_property given empty string for the property name to get
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/get_property/get_directory_property_empty.cmake b/Tests/RunCMake/get_property/get_directory_property_empty.cmake
new file mode 100644
index 0000000..b49be1c
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_empty.cmake
@@ -0,0 +1 @@
+get_directory_property(outVar "")
diff --git a/Tests/RunCMake/get_property/get_directory_property_missing-result.txt b/Tests/RunCMake/get_property/get_directory_property_missing-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_missing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/get_property/get_directory_property_missing-stderr.txt b/Tests/RunCMake/get_property/get_directory_property_missing-stderr.txt
new file mode 100644
index 0000000..e101c76
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_missing-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at get_directory_property_missing.cmake:1 \(get_directory_property\):
+ get_directory_property called with incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/get_property/get_directory_property_missing.cmake b/Tests/RunCMake/get_property/get_directory_property_missing.cmake
new file mode 100644
index 0000000..c28157e
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_missing.cmake
@@ -0,0 +1 @@
+get_directory_property(outVar)
diff --git a/Tests/RunCMake/get_property/get_directory_property_missingWithDir-result.txt b/Tests/RunCMake/get_property/get_directory_property_missingWithDir-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_missingWithDir-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/get_property/get_directory_property_missingWithDir-stderr.txt b/Tests/RunCMake/get_property/get_directory_property_missingWithDir-stderr.txt
new file mode 100644
index 0000000..66deabb
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_missingWithDir-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at get_directory_property_missingWithDir.cmake:1 \(get_directory_property\):
+ get_directory_property called with incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/get_property/get_directory_property_missingWithDir.cmake b/Tests/RunCMake/get_property/get_directory_property_missingWithDir.cmake
new file mode 100644
index 0000000..573e14a
--- /dev/null
+++ b/Tests/RunCMake/get_property/get_directory_property_missingWithDir.cmake
@@ -0,0 +1 @@
+get_directory_property(outVar DIRECTORY .)
diff --git a/Tests/RunCMake/if/duplicate-deep-else-stderr.txt b/Tests/RunCMake/if/duplicate-deep-else-stderr.txt
index ac2335c..ee886e0 100644
--- a/Tests/RunCMake/if/duplicate-deep-else-stderr.txt
+++ b/Tests/RunCMake/if/duplicate-deep-else-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at duplicate-deep-else.cmake:[0-9]+ \(else\):
- A duplicate ELSE command was found inside an IF block.
+CMake Error at duplicate-deep-else\.cmake:[0-9]+ \(else\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt b/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt
index ba6765c..60c8484 100644
--- a/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt
+++ b/Tests/RunCMake/if/duplicate-else-after-elseif-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at duplicate-else-after-elseif.cmake:[0-9]+ \(else\):
- A duplicate ELSE command was found inside an IF block.
+CMake Error at duplicate-else-after-elseif\.cmake:[0-9]+ \(else\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/if/duplicate-else-stderr.txt b/Tests/RunCMake/if/duplicate-else-stderr.txt
index e0dd01f..518c43f 100644
--- a/Tests/RunCMake/if/duplicate-else-stderr.txt
+++ b/Tests/RunCMake/if/duplicate-else-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at duplicate-else.cmake:[0-9]+ \(else\):
- A duplicate ELSE command was found inside an IF block.
+CMake Error at duplicate-else\.cmake:[0-9]+ \(else\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/if/misplaced-elseif-stderr.txt b/Tests/RunCMake/if/misplaced-elseif-stderr.txt
index c4b0266..5138f11 100644
--- a/Tests/RunCMake/if/misplaced-elseif-stderr.txt
+++ b/Tests/RunCMake/if/misplaced-elseif-stderr.txt
@@ -1,4 +1,4 @@
-CMake Error at misplaced-elseif.cmake:[0-9]+ \(elseif\):
- An ELSEIF command was found after an ELSE command.
+CMake Error at misplaced-elseif\.cmake:[0-9]+ \(elseif\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
+ CMakeLists\.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/include/ExportExportInclude-stderr.txt b/Tests/RunCMake/include/ExportExportInclude-stderr.txt
index 70d013c..6d5c02f 100644
--- a/Tests/RunCMake/include/ExportExportInclude-stderr.txt
+++ b/Tests/RunCMake/include/ExportExportInclude-stderr.txt
@@ -1,5 +1,5 @@
CMake Error at ExportExportInclude.cmake:6 \(include\):
- include could not find load file:
+ include could not find requested file:
.*/Tests/RunCMake/include/ExportExportInclude-build/theTargets.cmake
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/include/IncludeIsDirectory-result.txt b/Tests/RunCMake/include/IncludeIsDirectory-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include/IncludeIsDirectory-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include/IncludeIsDirectory-stderr.txt b/Tests/RunCMake/include/IncludeIsDirectory-stderr.txt
new file mode 100644
index 0000000..5735c29
--- /dev/null
+++ b/Tests/RunCMake/include/IncludeIsDirectory-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error at IncludeIsDirectory.cmake:1 \(include\):
+ include requested file is a directory:
+
+ .*/Tests/RunCMake/include/IncludeIsDirectory-build
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/include/IncludeIsDirectory.cmake b/Tests/RunCMake/include/IncludeIsDirectory.cmake
new file mode 100644
index 0000000..74189e3
--- /dev/null
+++ b/Tests/RunCMake/include/IncludeIsDirectory.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/Tests/RunCMake/include/IncludeMalformed-result.txt b/Tests/RunCMake/include/IncludeMalformed-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include/IncludeMalformed-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include/IncludeMalformed-stderr.txt b/Tests/RunCMake/include/IncludeMalformed-stderr.txt
new file mode 100644
index 0000000..fc75549
--- /dev/null
+++ b/Tests/RunCMake/include/IncludeMalformed-stderr.txt
@@ -0,0 +1,13 @@
+CMake Error at malformedInclude.cmake:1:
+ Parse error. Function missing ending "\)". End of file reached.
+Call Stack \(most recent call first\):
+ IncludeMalformed.cmake:1 \(include\)
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at IncludeMalformed.cmake:1 \(include\):
+ include could not load requested file:
+
+ malformedInclude.cmake
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/include/IncludeMalformed.cmake b/Tests/RunCMake/include/IncludeMalformed.cmake
new file mode 100644
index 0000000..9560142
--- /dev/null
+++ b/Tests/RunCMake/include/IncludeMalformed.cmake
@@ -0,0 +1 @@
+include("malformedInclude.cmake")
diff --git a/Tests/RunCMake/include/RunCMakeTest.cmake b/Tests/RunCMake/include/RunCMakeTest.cmake
index bea7d5c..8fb7201 100644
--- a/Tests/RunCMake/include/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include/RunCMakeTest.cmake
@@ -5,3 +5,5 @@ run_cmake(EmptyStringOptional)
run_cmake(CMP0024-WARN)
run_cmake(CMP0024-NEW)
run_cmake(ExportExportInclude)
+run_cmake(IncludeIsDirectory)
+run_cmake(IncludeMalformed)
diff --git a/Tests/RunCMake/include/malformedInclude.cmake b/Tests/RunCMake/include/malformedInclude.cmake
new file mode 100644
index 0000000..3cec3ad
--- /dev/null
+++ b/Tests/RunCMake/include/malformedInclude.cmake
@@ -0,0 +1 @@
+if(
diff --git a/Tests/RunCMake/install/FILES-RENAME-all-check.cmake b/Tests/RunCMake/install/FILES-RENAME-all-check.cmake
new file mode 100644
index 0000000..7e9b103
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-RENAME-all-check.cmake
@@ -0,0 +1 @@
+check_installed([[^src;src/script_Debug\.ps]])
diff --git a/Tests/RunCMake/install/FILES-RENAME-bad-result.txt b/Tests/RunCMake/install/FILES-RENAME-bad-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-RENAME-bad-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/FILES-RENAME-bad-stderr.txt b/Tests/RunCMake/install/FILES-RENAME-bad-stderr.txt
new file mode 100644
index 0000000..9844158
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-RENAME-bad-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<NOTAGENEX>
+
+ Expression did not evaluate to a known generator expression
diff --git a/Tests/RunCMake/install/FILES-RENAME-bad.cmake b/Tests/RunCMake/install/FILES-RENAME-bad.cmake
new file mode 100644
index 0000000..5be0bb2
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-RENAME-bad.cmake
@@ -0,0 +1,4 @@
+install(FILES empty.c
+ DESTINATION mybin
+ RENAME $<NOTAGENEX>
+ )
diff --git a/Tests/RunCMake/install/FILES-RENAME.cmake b/Tests/RunCMake/install/FILES-RENAME.cmake
new file mode 100644
index 0000000..5896e64
--- /dev/null
+++ b/Tests/RunCMake/install/FILES-RENAME.cmake
@@ -0,0 +1,4 @@
+install(FILES script.bat
+ DESTINATION src
+ RENAME script_$<CONFIG>.ps
+ )
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index d64d88b..efd03df 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -48,14 +48,16 @@ in directory:
endif()
endfunction()
-# Wrapper for run_cmake() that skips platforms that are non-ELF or have no RPATH support
-function(run_cmake_ELFRPATH_only case)
- if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+# Wrapper for run_cmake() that skips platforms on which we do not support editing the RPATH.
+function(run_cmake_EDIT_RPATH_only case)
+ if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT MATCHES "^(ELF|XCOFF)$")
run_cmake(${case})
else()
# Sanity check against a platform known to be ELF-based
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(FATAL_ERROR "Expected platform Linux to advertize itself as ELF-based, but it did not.")
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX")
+ message(FATAL_ERROR "Expected platform AIX to advertize itself as XCOFF-based, but it did not.")
else()
message(STATUS "${case} - SKIPPED (No ELF-based platform found)")
endif()
@@ -63,7 +65,7 @@ function(run_cmake_ELFRPATH_only case)
endfunction()
run_cmake(TARGETS-FILE_RPATH_CHANGE-old_rpath)
-run_cmake_ELFRPATH_only(TARGETS-FILE_RPATH_CHANGE-new_rpath)
+run_cmake_EDIT_RPATH_only(TARGETS-FILE_RPATH_CHANGE-new_rpath)
run_cmake(DIRECTORY-MESSAGE_NEVER)
run_cmake(DIRECTORY-PATTERN-MESSAGE_NEVER)
run_cmake(DIRECTORY-message)
@@ -74,6 +76,7 @@ run_cmake(SkipInstallRulesNoWarning2)
run_cmake(DIRECTORY-DIRECTORY-bad)
run_cmake(DIRECTORY-DESTINATION-bad)
run_cmake(FILES-DESTINATION-bad)
+run_cmake(FILES-RENAME-bad)
run_cmake(TARGETS-DESTINATION-bad)
run_cmake(EXPORT-OldIFace)
run_cmake(EXPORT-UnknownExport)
@@ -91,6 +94,10 @@ run_cmake(TARGETS-NAMELINK_COMPONENT-bad-exc)
run_cmake(FILES-DESTINATION-TYPE)
run_cmake(DIRECTORY-DESTINATION-TYPE)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_BUILD_TYPE:STRING=Debug")
+run_install_test(FILES-RENAME)
+unset(RunCMake_TEST_OPTIONS)
+
if(APPLE)
run_cmake(TARGETS-Apple-Defaults)
endif()
diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake
index 673fdde..6b2faa3 100644
--- a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake
+++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake
@@ -22,6 +22,8 @@ macro(skip_without_rpath_change_rule)
# Sanity check against a platform known to generate a file(RPATH_CHANGE) rule
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(FATAL_ERROR "Expected generated file(RPATH_CHANGE) rule on platform Linux.")
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX")
+ message(FATAL_ERROR "Expected generated file(RPATH_CHANGE) rule on platform AIX.")
else()
message(STATUS "${test} - All checks skipped. No file(RPATH_CHANGE) rule found on this platform.")
return()
diff --git a/Tests/RunCMake/list/REMOVE_ITEM-NoItemArg.cmake b/Tests/RunCMake/list/REMOVE_ITEM-NoItemArg.cmake
new file mode 100644
index 0000000..f69c024
--- /dev/null
+++ b/Tests/RunCMake/list/REMOVE_ITEM-NoItemArg.cmake
@@ -0,0 +1,5 @@
+set(ls "a" "b" "c")
+list(REMOVE_ITEM ls alpha)
+if (NOT ls STREQUAL "a;b;c")
+ message(FATAL_ERROR "list(REMOVE_ITEM) modified for empty item")
+endif ()
diff --git a/Tests/RunCMake/list/RunCMakeTest.cmake b/Tests/RunCMake/list/RunCMakeTest.cmake
index b4a91bc..c11891c 100644
--- a/Tests/RunCMake/list/RunCMakeTest.cmake
+++ b/Tests/RunCMake/list/RunCMakeTest.cmake
@@ -30,6 +30,7 @@ run_cmake(FILTER-NotList)
run_cmake(REMOVE_AT-NotList)
run_cmake(REMOVE_DUPLICATES-NotList)
run_cmake(REMOVE_ITEM-NotList)
+run_cmake(REMOVE_ITEM-NoItemArg)
run_cmake(REVERSE-NotList)
run_cmake(SORT-NotList)
diff --git a/Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt b/Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt
index 22226f2..da44726 100644
--- a/Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt
+++ b/Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error at MATH-InvalidExpression.cmake:1 \(math\):
- math cannot parse the expression: "INVALID": syntax error, unexpected \$end
- \(7\).
+ math cannot parse the expression: "INVALID": syntax error, unexpected end
+ of file \(7\).
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/pseudo_llvm-rc.c b/Tests/RunCMake/pseudo_llvm-rc.c
new file mode 100644
index 0000000..7acb2a3
--- /dev/null
+++ b/Tests/RunCMake/pseudo_llvm-rc.c
@@ -0,0 +1,30 @@
+#include <stdio.h>
+#include <string.h>
+
+int main(int argc, char* argv[])
+{
+ FILE* source;
+ FILE* target;
+ int i;
+ for (i = 1; i < argc; ++i) {
+ if (strcmp(argv[i], "-bad") == 0) {
+ fprintf(stdout, "stdout from bad command line arg '-bad'\n");
+ fprintf(stderr, "stderr from bad command line arg '-bad'\n");
+ return 1;
+ }
+ }
+ source = fopen(argv[argc - 1], "rb");
+ if (source == NULL) {
+ return 1;
+ }
+ target = fopen(argv[argc - 2], "wb");
+ if (target != NULL) {
+ char buffer[500];
+ size_t n = fread(buffer, 1, sizeof(buffer), source);
+ fwrite(buffer, 1, n, target);
+ fclose(source);
+ fclose(target);
+ return 0;
+ }
+ return 1;
+}
diff --git a/Tests/RunCMake/separate_arguments/ProgramCommand.cmake b/Tests/RunCMake/separate_arguments/ProgramCommand.cmake
index 8325def..bdf5810 100644
--- a/Tests/RunCMake/separate_arguments/ProgramCommand.cmake
+++ b/Tests/RunCMake/separate_arguments/ProgramCommand.cmake
@@ -7,7 +7,7 @@ endif()
set (TEST_EXE_DIR "${CMAKE_CURRENT_BINARY_DIR}/TestExe")
file(MAKE_DIRECTORY "${TEST_EXE_DIR}")
file(COPY "${CMAKE_COMMAND}" DESTINATION "${TEST_EXE_DIR}")
-get_filename_component (cmake_exe "${CMAKE_COMMAND}" NAME)
+cmake_path (GET CMAKE_COMMAND FILENAME cmake_exe)
set (ENV{PATH} "${TEST_EXE_DIR}")
diff --git a/Tests/RunCMake/separate_arguments/ProgramCommandWithSeparateArgs.cmake b/Tests/RunCMake/separate_arguments/ProgramCommandWithSeparateArgs.cmake
index 07572ba..2826cc9 100644
--- a/Tests/RunCMake/separate_arguments/ProgramCommandWithSeparateArgs.cmake
+++ b/Tests/RunCMake/separate_arguments/ProgramCommandWithSeparateArgs.cmake
@@ -7,7 +7,7 @@ endif()
set (TEST_EXE_DIR "${CMAKE_CURRENT_BINARY_DIR}/TestExe")
file(MAKE_DIRECTORY "${TEST_EXE_DIR}")
file(COPY "${CMAKE_COMMAND}" DESTINATION "${TEST_EXE_DIR}")
-get_filename_component (cmake_exe "${CMAKE_COMMAND}" NAME)
+cmake_path (GET CMAKE_COMMAND FILENAME cmake_exe)
set (ENV{PATH} "${TEST_EXE_DIR}")
diff --git a/Tests/RunCMake/target_include_directories/RunCMakeTest.cmake b/Tests/RunCMake/target_include_directories/RunCMakeTest.cmake
index b67c598..48a750d 100644
--- a/Tests/RunCMake/target_include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_include_directories/RunCMakeTest.cmake
@@ -1,3 +1,6 @@
include(RunCMake)
run_cmake(empty_keyword_args)
+run_cmake(include_before)
+run_cmake(include_after)
+run_cmake(include_default)
diff --git a/Tests/RunCMake/target_include_directories/include_after.cmake b/Tests/RunCMake/target_include_directories/include_after.cmake
new file mode 100644
index 0000000..68a08a7
--- /dev/null
+++ b/Tests/RunCMake/target_include_directories/include_after.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.c" "int main() { return 0;}")
+
+set(include_dir "${CMAKE_CURRENT_BINARY_DIR}/dir")
+set(after_include_dir "${CMAKE_CURRENT_BINARY_DIR}/dirAfter")
+file(MAKE_DIRECTORY "${include_dir}")
+file(MAKE_DIRECTORY "${after_include_dir}")
+
+add_executable(main "${CMAKE_CURRENT_BINARY_DIR}/main.c")
+include_directories("${include_dir}")
+target_include_directories(main AFTER PRIVATE "${after_include_dir}")
+
+get_target_property(actual_include_dirs main INCLUDE_DIRECTORIES)
+set(desired_include_dirs "${include_dir}" "${after_include_dir}")
+
+if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs}")
+ message(SEND_ERROR "include after does not work")
+endif()
diff --git a/Tests/RunCMake/target_include_directories/include_before.cmake b/Tests/RunCMake/target_include_directories/include_before.cmake
new file mode 100644
index 0000000..9bebecd
--- /dev/null
+++ b/Tests/RunCMake/target_include_directories/include_before.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.c" "int main() { return 0;}")
+
+set(include_dir "${CMAKE_CURRENT_BINARY_DIR}/dir")
+set(before_include_dir "${CMAKE_CURRENT_BINARY_DIR}/dirBefore")
+file(MAKE_DIRECTORY "${include_dir}")
+file(MAKE_DIRECTORY "${before_include_dir}")
+
+add_executable(main "${CMAKE_CURRENT_BINARY_DIR}/main.c")
+include_directories("${include_dir}")
+target_include_directories(main BEFORE PRIVATE "${before_include_dir}")
+
+get_target_property(actual_include_dirs main INCLUDE_DIRECTORIES)
+set(desired_include_dirs "${before_include_dir}" "${include_dir}")
+
+if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs}")
+ message(SEND_ERROR "include before does not work")
+endif()
diff --git a/Tests/RunCMake/target_include_directories/include_default.cmake b/Tests/RunCMake/target_include_directories/include_default.cmake
new file mode 100644
index 0000000..88b2502
--- /dev/null
+++ b/Tests/RunCMake/target_include_directories/include_default.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.c" "int main() { return 0;}")
+
+set(include_dir "${CMAKE_CURRENT_BINARY_DIR}/dir")
+set(default_include_dir "${CMAKE_CURRENT_BINARY_DIR}/dirDefault")
+file(MAKE_DIRECTORY "${include_dir}")
+file(MAKE_DIRECTORY "${default_include_dir}")
+
+add_executable(main "${CMAKE_CURRENT_BINARY_DIR}/main.c")
+include_directories("${include_dir}")
+target_include_directories(main AFTER PRIVATE "${default_include_dir}")
+
+get_target_property(actual_include_dirs main INCLUDE_DIRECTORIES)
+set(desired_include_dirs "${include_dir}" "${default_include_dir}")
+
+if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs}")
+ message(SEND_ERROR "include default does not work")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake
index 0f0e5d8..f43a7c6 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake
@@ -34,6 +34,7 @@ if (RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Visual Studio|Xcode|Watcom WMake
run_cmake_target(genex CXX_interface2 LinkLibraries_CXX_interface2 --config Release)
run_cmake_target(genex C_static LinkLibraries_C_static --config Release)
run_cmake_target(genex CXX_static LinkLibraries_CXX_static --config Release)
+ run_cmake_target(genex C_static_CXX LinkLibraries_C_static_CXX --config Release)
unset(RunCMake_TEST_OPTIONS)
unset(RunCMake_TEST_OUTPUT_MERGE)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx
index a12caca..ee6811c 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx
@@ -1,7 +1,18 @@
-#if defined(_WIN32)
-__declspec(dllexport)
+#if !defined(BUILD_STATIC) && defined(_WIN32)
+# define EXPORT_SYMBOL __declspec(dllexport)
+#else
+# define EXPORT_SYMBOL
#endif
- void func_cxx()
+
+EXPORT_SYMBOL
+void func_cxx()
{
}
+
+extern "C" {
+EXPORT_SYMBOL
+void func_c_cxx()
+{
+}
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake
index f3fe955..22d3df7 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake
@@ -7,6 +7,8 @@ enable_language(CXX)
add_library(shared_C SHARED func.c)
add_library(shared_CXX SHARED func.cxx)
+add_library(static_cxx STATIC func.cxx)
+target_compile_definitions(static_cxx PRIVATE BUILD_STATIC)
add_library(static1_C STATIC empty.c)
target_link_libraries (static1_C INTERFACE $<$<LINK_LANGUAGE:C>:shared_C>)
@@ -70,3 +72,10 @@ add_executable(LinkLibraries_C_static main.c)
target_link_libraries (LinkLibraries_C_static PRIVATE static3)
add_executable(LinkLibraries_CXX_static main.cxx)
target_link_libraries (LinkLibraries_CXX_static PRIVATE static3)
+
+# $<LINK_LANGUAGE:> change, by default, link language from C to CXX
+# but because LINKER_LANGUAGE property is set, keep C as link language
+add_executable(LinkLibraries_C_static_CXX main.c)
+target_compile_definitions (LinkLibraries_C_static_CXX PRIVATE C_USE_CXX)
+target_link_libraries (LinkLibraries_C_static_CXX PRIVATE $<$<LINK_LANGUAGE:C>:static_cxx>)
+set_property(TARGET LinkLibraries_C_static_CXX PROPERTY LINKER_LANGUAGE C)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c
index a908dea..689dbd7 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c
@@ -1,12 +1,20 @@
-#if defined(_WIN32)
+#if defined(C_USE_CXX)
+void func_c_cxx();
+#else
+# if defined(_WIN32)
__declspec(dllimport)
-#endif
+# endif
void func_c();
+#endif
int main()
{
+#if defined(C_USE_CXX)
+ func_c_cxx();
+#else
func_c();
+#endif
return 0;
}
diff --git a/Tests/RunCMake/try_run/RunCMakeTest.cmake b/Tests/RunCMake/try_run/RunCMakeTest.cmake
index 3689562..fa30eb4 100644
--- a/Tests/RunCMake/try_run/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_run/RunCMakeTest.cmake
@@ -8,3 +8,5 @@ if (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$" AND
run_cmake(LinkOptions)
unset (RunCMake_TEST_OPTIONS)
endif()
+
+run_cmake(WorkingDirArg)
diff --git a/Tests/RunCMake/try_run/WorkingDirArg.cmake b/Tests/RunCMake/try_run/WorkingDirArg.cmake
new file mode 100644
index 0000000..b583823
--- /dev/null
+++ b/Tests/RunCMake/try_run/WorkingDirArg.cmake
@@ -0,0 +1,9 @@
+try_run(RUN_RESULT COMPILE_RESULT
+ ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ RUN_OUTPUT_VARIABLE OUTPUT_VARIABLE
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp/workdir
+ )
+
+if(RUN_RESULT)
+ message(SEND_ERROR "try run failed with result: ${RUN_RESULT}")
+endif()
diff --git a/Tests/RunCMake/while/EndAlone-stderr.txt b/Tests/RunCMake/while/EndAlone-stderr.txt
index 5fe6655..3195fa0 100644
--- a/Tests/RunCMake/while/EndAlone-stderr.txt
+++ b/Tests/RunCMake/while/EndAlone-stderr.txt
@@ -1,5 +1,4 @@
-^CMake Error at EndAlone.cmake:1 \(endwhile\):
- endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE
- structure. Or its arguments did not match the opening WHILE command.
+^CMake Error at EndAlone\.cmake:[0-9]+ \(endwhile\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/while/EndAloneArgs-stderr.txt b/Tests/RunCMake/while/EndAloneArgs-stderr.txt
index a8c043d..1634e3b 100644
--- a/Tests/RunCMake/while/EndAloneArgs-stderr.txt
+++ b/Tests/RunCMake/while/EndAloneArgs-stderr.txt
@@ -1,5 +1,4 @@
-^CMake Error at EndAloneArgs.cmake:1 \(endwhile\):
- endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE
- structure. Or its arguments did not match the opening WHILE command.
+^CMake Error at EndAloneArgs\.cmake:[0-9]+ \(endwhile\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/while/EndMissing-stderr.txt b/Tests/RunCMake/while/EndMissing-stderr.txt
index 964792f..1e3be4d 100644
--- a/Tests/RunCMake/while/EndMissing-stderr.txt
+++ b/Tests/RunCMake/while/EndMissing-stderr.txt
@@ -1,8 +1,4 @@
-^CMake Error in EndMissing.cmake:
- A logical block opening on the line
-
- .*/Tests/RunCMake/while/EndMissing.cmake:1 \(while\)
-
- is not closed.
+^CMake Error at EndMissing\.cmake:[0-9]+ \(while\):
+ Flow control statements are not properly nested\.
Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/while/MissingArgument-stderr.txt b/Tests/RunCMake/while/MissingArgument-stderr.txt
index 7ff0971..59e8ee3 100644
--- a/Tests/RunCMake/while/MissingArgument-stderr.txt
+++ b/Tests/RunCMake/while/MissingArgument-stderr.txt
@@ -1,4 +1,11 @@
-^CMake Error at MissingArgument.cmake:1 \(while\):
+^CMake Error at MissingArgument\.cmake:[0-9]+ \(while\):
while called with incorrect number of arguments
Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)$
+ CMakeLists\.txt:[0-9]+ \(include\)
+
+
+CMake Error at MissingArgument\.cmake:[0-9]+ \(endwhile\):
+ endwhile An ENDWHILE command was found outside of a proper WHILE ENDWHILE
+ structure\. Or its arguments did not match the opening WHILE command\.
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/while/MissingArgument.cmake b/Tests/RunCMake/while/MissingArgument.cmake
index 32eaa26..3fe2d97 100644
--- a/Tests/RunCMake/while/MissingArgument.cmake
+++ b/Tests/RunCMake/while/MissingArgument.cmake
@@ -1 +1,2 @@
while()
+endwhile()
diff --git a/Tests/Server/CMakeLists.txt b/Tests/Server/CMakeLists.txt
deleted file mode 100644
index 8321edb..0000000
--- a/Tests/Server/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-cmake_minimum_required(VERSION 3.4)
-project(Server CXX)
-
-find_package(Python REQUIRED)
-
-macro(do_test bsname file type)
- execute_process(COMMAND ${Python_EXECUTABLE}
- -B # no .pyc files
- "${CMAKE_SOURCE_DIR}/${type}-test.py"
- "${CMAKE_COMMAND}"
- "${CMAKE_SOURCE_DIR}/${file}"
- "${CMAKE_SOURCE_DIR}"
- "${CMAKE_BINARY_DIR}"
- "${CMAKE_GENERATOR}"
- RESULT_VARIABLE test_result
- )
-
- if (NOT test_result EQUAL 0)
- message(SEND_ERROR "TEST FAILED: ${test_result}")
- endif()
-endmacro()
-
-do_test("test_cache" "tc_cache.json" "server")
-do_test("test_handshake" "tc_handshake.json" "server")
-do_test("test_globalSettings" "tc_globalSettings.json" "server")
-do_test("test_buildsystem1" "tc_buildsystem1.json" "server")
-
-add_executable(Server empty.cpp)
diff --git a/Tests/Server/buildsystem1/CMakeLists.txt b/Tests/Server/buildsystem1/CMakeLists.txt
deleted file mode 100644
index d690472..0000000
--- a/Tests/Server/buildsystem1/CMakeLists.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-cmake_minimum_required(VERSION 3.4)
-
-project(buildsystem2)
-
-set(var1 123)
-
-set(var2 345)
-
-add_executable(main main.cpp)
-
-add_executable(m_other main.cpp)
-
-add_library(foo foo.cpp)
-
-function(f1)
-endfunction()
-
-set(var3 345)
-
-add_library(someImportedLib UNKNOWN IMPORTED)
-
-add_subdirectory(subdir)
diff --git a/Tests/Server/buildsystem1/subdir/CMakeLists.txt b/Tests/Server/buildsystem1/subdir/CMakeLists.txt
deleted file mode 100644
index 9157312..0000000
--- a/Tests/Server/buildsystem1/subdir/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-set(bar4 something)
-
-set(bar5 more)
-
-add_executable(ooo empty.cpp)
diff --git a/Tests/Server/cmakelib.py b/Tests/Server/cmakelib.py
deleted file mode 100644
index 546ae4c..0000000
--- a/Tests/Server/cmakelib.py
+++ /dev/null
@@ -1,380 +0,0 @@
-from __future__ import print_function
-import sys, subprocess, json, os, select, shutil, time, socket
-
-termwidth = 150
-
-print_communication = True
-
-def ordered(obj):
- if isinstance(obj, dict):
- return sorted((k, ordered(v)) for k, v in obj.items())
- if isinstance(obj, list):
- return sorted(ordered(x) for x in obj)
- else:
- return obj
-
-def col_print(title, array):
- print()
- print()
- print(title)
-
- indentwidth = 4
- indent = " " * indentwidth
-
- if not array:
- print(indent + "<None>")
- return
-
- padwidth = 2
-
- maxitemwidth = len(max(array, key=len))
-
- numCols = max(1, int((termwidth - indentwidth + padwidth) / (maxitemwidth + padwidth)))
-
- numRows = len(array) // numCols + 1
-
- pad = " " * padwidth
-
- for index in range(numRows):
- print(indent + pad.join(item.ljust(maxitemwidth) for item in array[index::numRows]))
-
-filterPacket = lambda x: x
-
-STDIN = 0
-PIPE = 1
-
-communicationMethods = [STDIN]
-
-if hasattr(socket, 'AF_UNIX'):
- communicationMethods.append(PIPE)
-
-def defaultExitWithError(proc):
- data = ""
- try:
- while select.select([proc.outPipe], [], [], 3.)[0]:
- data = data + proc.outPipe.read(1)
- if len(data):
- print("Rest of raw buffer from server:")
- printServer(data)
- except:
- pass
- proc.outPipe.close()
- proc.inPipe.close()
- proc.kill()
- sys.exit(1)
-
-exitWithError = lambda proc: defaultExitWithError(proc)
-
-serverTag = "SERVER"
-
-def printServer(*args):
- print(serverTag + ">", *args)
- print()
- sys.stdout.flush()
-
-def printClient(*args):
- print("CLIENT>", *args)
- print()
- sys.stdout.flush()
-
-def waitForRawMessage(cmakeCommand):
- stdoutdata = ""
- payload = ""
- while not cmakeCommand.poll():
- stdoutdataLine = cmakeCommand.outPipe.readline()
- if stdoutdataLine:
- stdoutdata += stdoutdataLine.decode('utf-8')
- else:
- break
- begin = stdoutdata.find('[== "CMake Server" ==[\n')
- end = stdoutdata.find(']== "CMake Server" ==]')
-
- if begin != -1 and end != -1:
- begin += len('[== "CMake Server" ==[\n')
- payload = stdoutdata[begin:end]
- jsonPayload = json.loads(payload)
- filteredPayload = filterPacket(jsonPayload)
- if print_communication and filteredPayload:
- printServer(filteredPayload)
- if filteredPayload is not None or jsonPayload is None:
- return jsonPayload
- stdoutdata = stdoutdata[(end+len(']== "CMake Server" ==]')):]
-
-# Python2 has no problem writing the output of encodes directly,
-# but Python3 returns only 'int's for encode and so must be turned
-# into bytes. We use the existence of 'to_bytes' on an int to
-# determine which behavior is appropriate. It might be more clear
-# to do this in the code which uses the flag, but introducing
-# this lookup cost at every byte sent isn't ideal.
-has_to_bytes = "to_bytes" in dir(10)
-
-def writeRawData(cmakeCommand, content):
- writeRawData.counter += 1
- payload = """
-[== "CMake Server" ==[
-%s
-]== "CMake Server" ==]
-""" % content
-
- rn = ( writeRawData.counter % 2 ) == 0
-
- if rn:
- payload = payload.replace('\n', '\r\n')
-
- if print_communication:
- printClient(content, "(Use \\r\\n:", rn, ")")
-
- # To stress test how cmake deals with fragmentation in the
- # communication channel, we send only one byte at a time.
- # Certain communication methods / platforms might still buffer
- # it all into one message since its so close together, but in
- # general this will catch places where we assume full buffers
- # come in all at once.
- encoded_payload = payload.encode('utf-8')
-
- # Python version 3+ can't write ints directly; but 'to_bytes'
- # for int was only added in python 3.2. If this is a 3+ version
- # of python without that conversion function; just write the whole
- # thing out at once.
- if sys.version_info[0] > 2 and not has_to_bytes:
- cmakeCommand.write(encoded_payload)
- else:
- for c in encoded_payload:
- if has_to_bytes:
- c = c.to_bytes(1, byteorder='big')
- cmakeCommand.write(c)
-
-writeRawData.counter = 0
-
-def writePayload(cmakeCommand, obj):
- writeRawData(cmakeCommand, json.dumps(obj))
-
-def getPipeName():
- return "/tmp/server-test-socket"
-
-def attachPipe(cmakeCommand, pipeName):
- time.sleep(1)
- sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- sock.connect(pipeName)
- global serverTag
- serverTag = "SERVER(PIPE)"
- cmakeCommand.outPipe = sock.makefile()
- cmakeCommand.inPipe = sock
- cmakeCommand.write = cmakeCommand.inPipe.sendall
-
-def writeAndFlush(pipe, val):
- pipe.write(val)
- pipe.flush()
-
-def initServerProc(cmakeCommand, comm):
- if comm == PIPE:
- pipeName = getPipeName()
- cmakeCommand = subprocess.Popen([cmakeCommand, "-E", "server", "--experimental", "--pipe=" + pipeName])
- attachPipe(cmakeCommand, pipeName)
- else:
- cmakeCommand = subprocess.Popen([cmakeCommand, "-E", "server", "--experimental", "--debug"],
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE)
- cmakeCommand.outPipe = cmakeCommand.stdout
- cmakeCommand.inPipe = cmakeCommand.stdin
- cmakeCommand.write = lambda val: writeAndFlush(cmakeCommand.inPipe, val)
-
- packet = waitForRawMessage(cmakeCommand)
- if packet == None:
- print("Not in server mode")
- sys.exit(2)
-
- if packet['type'] != 'hello':
- print("No hello message")
- sys.exit(3)
-
- return cmakeCommand
-
-def exitProc(cmakeCommand):
- # Tell the server to exit.
- cmakeCommand.stdin.close()
- cmakeCommand.stdout.close()
-
- # Wait for the server to exit.
- # If this version of python supports it, terminate the server after a timeout.
- try:
- cmakeCommand.wait(timeout=5)
- except TypeError:
- cmakeCommand.wait()
- except:
- cmakeCommand.terminate()
- raise
-
-def waitForMessage(cmakeCommand, expected):
- data = ordered(expected)
- packet = ordered(waitForRawMessage(cmakeCommand))
-
- if packet != data:
- print ("Received unexpected message; test failed")
- exitWithError(cmakeCommand)
- return packet
-
-def waitForReply(cmakeCommand, originalType, cookie, skipProgress):
- gotResult = False
- while True:
- packet = waitForRawMessage(cmakeCommand)
- t = packet['type']
- if packet['cookie'] != cookie or packet['inReplyTo'] != originalType:
- print("cookie or inReplyTo mismatch")
- sys.exit(4)
- if t == 'message' or t == 'progress':
- if skipProgress:
- continue
- if t == 'reply':
- break
- print("Unrecognized message", packet)
- sys.exit(5)
-
- return packet
-
-def waitForError(cmakeCommand, originalType, cookie, message):
- packet = waitForRawMessage(cmakeCommand)
- if packet['cookie'] != cookie or packet['type'] != 'error' or packet['inReplyTo'] != originalType or packet['errorMessage'] != message:
- sys.exit(6)
-
-def waitForProgress(cmakeCommand, originalType, cookie, current, message):
- packet = waitForRawMessage(cmakeCommand)
- if packet['cookie'] != cookie or packet['type'] != 'progress' or packet['inReplyTo'] != originalType or packet['progressCurrent'] != current or packet['progressMessage'] != message:
- sys.exit(7)
-
-def handshake(cmakeCommand, major, minor, source, build, generator, extraGenerator):
- version = { 'major': major }
- if minor >= 0:
- version['minor'] = minor
-
- writePayload(cmakeCommand, { 'type': 'handshake', 'protocolVersion': version,
- 'cookie': 'TEST_HANDSHAKE', 'sourceDirectory': source, 'buildDirectory': build,
- 'generator': generator, 'extraGenerator': extraGenerator })
- waitForReply(cmakeCommand, 'handshake', 'TEST_HANDSHAKE', False)
-
-def validateGlobalSettings(cmakeCommand, cmakeCommandPath, data):
- packet = waitForReply(cmakeCommand, 'globalSettings', '', False)
-
- capabilities = packet['capabilities']
-
- # validate version:
- cmakeoutput = subprocess.check_output([ cmakeCommandPath, "--version" ], universal_newlines=True)
- cmakeVersion = cmakeoutput.splitlines()[0][14:]
-
- version = capabilities['version']
- versionString = version['string']
- vs = str(version['major']) + '.' + str(version['minor']) + '.' + str(version['patch'])
- if (versionString != vs and not versionString.startswith(vs + '-')):
- sys.exit(8)
- if (versionString != cmakeVersion):
- sys.exit(9)
-
- # validate generators:
- generatorObjects = capabilities['generators']
-
- cmakeoutput = subprocess.check_output([ cmakeCommandPath, "--help" ], universal_newlines=True)
- index = cmakeoutput.index('\nGenerators\n\n')
- cmakeGenerators = []
- for line in cmakeoutput[index + 12:].splitlines():
- if not line:
- continue
- if line[0] == '*': # default generator marker
- line = ' ' + line[1:]
- if not line.startswith(' '):
- continue
- if line.startswith(' '):
- continue
- equalPos = line.find('=')
- tmp = ''
- if (equalPos > 0):
- tmp = line[2:equalPos].strip()
- else:
- tmp = line.strip()
- if tmp.endswith(" [arch]"):
- tmp = tmp[0:len(tmp) - 7]
- if (len(tmp) > 0) and (" - " not in tmp):
- cmakeGenerators.append(tmp)
-
- generators = []
- for genObj in generatorObjects:
- generators.append(genObj['name'])
-
- generators.sort()
- cmakeGenerators.sort()
-
- for gen in cmakeGenerators:
- if (not gen in generators):
- sys.exit(10)
-
- gen = packet['generator']
- if (gen != '' and not (gen in generators)):
- sys.exit(11)
-
- for i in data:
- print("Validating", i)
- if (packet[i] != data[i]):
- sys.exit(12)
-
-def validateCache(cmakeCommand, data):
- packet = waitForReply(cmakeCommand, 'cache', '', False)
-
- cache = packet['cache']
-
- if (data['isEmpty']):
- if (cache != []):
- print('Expected empty cache, but got data.\n')
- sys.exit(1)
- return;
-
- if (cache == []):
- print('Expected cache contents, but got none.\n')
- sys.exit(1)
-
- hadHomeDir = False
- for value in cache:
- if (value['key'] == 'CMAKE_HOME_DIRECTORY'):
- hadHomeDir = True
-
- if (not hadHomeDir):
- print('No CMAKE_HOME_DIRECTORY found in cache.')
- sys.exit(1)
-
-def handleBasicMessage(proc, obj, debug):
- if 'sendRaw' in obj:
- data = obj['sendRaw']
- if debug: print("Sending raw:", data)
- writeRawData(proc, data)
- return True
- elif 'send' in obj:
- data = obj['send']
- if debug: print("Sending:", json.dumps(data))
- writePayload(proc, data)
- return True
- elif 'recv' in obj:
- data = obj['recv']
- if debug: print("Waiting for:", json.dumps(data))
- waitForMessage(proc, data)
- return True
- elif 'message' in obj:
- print("MESSAGE:", obj["message"])
- sys.stdout.flush()
- return True
- return False
-
-def shutdownProc(proc):
- # Tell the server to exit.
- proc.inPipe.close()
- proc.outPipe.close()
-
- # Wait for the server to exit.
- # If this version of python supports it, terminate the server after a timeout.
- try:
- proc.wait(timeout=5)
- except TypeError:
- proc.wait()
- except:
- proc.terminate()
- raise
-
- print('cmake-server exited: %d' % proc.returncode)
- sys.exit(proc.returncode)
diff --git a/Tests/Server/server-test.py b/Tests/Server/server-test.py
deleted file mode 100644
index 701c6e9..0000000
--- a/Tests/Server/server-test.py
+++ /dev/null
@@ -1,105 +0,0 @@
-from __future__ import print_function
-import sys, cmakelib, json, os, shutil
-
-debug = True
-
-cmakeCommand = sys.argv[1]
-testFile = sys.argv[2]
-sourceDir = sys.argv[3]
-buildDir = sys.argv[4] + "/" + os.path.splitext(os.path.basename(testFile))[0]
-cmakeGenerator = sys.argv[5]
-
-print("Server Test:", testFile,
- "\n-- SourceDir:", sourceDir,
- "\n-- BuildDir:", buildDir,
- "\n-- Generator:", cmakeGenerator)
-
-if os.path.exists(buildDir):
- shutil.rmtree(buildDir)
-
-cmakelib.filterBase = sourceDir
-
-with open(testFile) as f:
- testData = json.loads(f.read())
-
-for communicationMethod in cmakelib.communicationMethods:
- proc = cmakelib.initServerProc(cmakeCommand, communicationMethod)
- if proc is None:
- continue
-
- for obj in testData:
- if cmakelib.handleBasicMessage(proc, obj, debug):
- pass
- elif 'reply' in obj:
- data = obj['reply']
- if debug: print("Waiting for reply:", json.dumps(data))
- originalType = ""
- cookie = ""
- skipProgress = False;
- if 'cookie' in data: cookie = data['cookie']
- if 'type' in data: originalType = data['type']
- if 'skipProgress' in data: skipProgress = data['skipProgress']
- cmakelib.waitForReply(proc, originalType, cookie, skipProgress)
- elif 'error' in obj:
- data = obj['error']
- if debug: print("Waiting for error:", json.dumps(data))
- originalType = ""
- cookie = ""
- message = ""
- if 'cookie' in data: cookie = data['cookie']
- if 'type' in data: originalType = data['type']
- if 'message' in data: message = data['message']
- cmakelib.waitForError(proc, originalType, cookie, message)
- elif 'progress' in obj:
- data = obj['progress']
- if debug: print("Waiting for progress:", json.dumps(data))
- originalType = ''
- cookie = ""
- current = 0
- message = ""
- if 'cookie' in data: cookie = data['cookie']
- if 'type' in data: originalType = data['type']
- if 'current' in data: current = data['current']
- if 'message' in data: message = data['message']
- cmakelib.waitForProgress(proc, originalType, cookie, current, message)
- elif 'handshake' in obj:
- data = obj['handshake']
- if debug: print("Doing handshake:", json.dumps(data))
- major = -1
- minor = -1
- generator = cmakeGenerator
- extraGenerator = ''
- sourceDirectory = sourceDir
- buildDirectory = buildDir
- if 'major' in data: major = data['major']
- if 'minor' in data: minor = data['minor']
- if 'buildDirectory' in data: buildDirectory = data['buildDirectory']
- if 'sourceDirectory' in data: sourceDirectory = data['sourceDirectory']
- if 'generator' in data: generator = data['generator']
- if 'extraGenerator' in data: extraGenerator = data['extraGenerator']
-
- if not os.path.isabs(buildDirectory):
- buildDirectory = buildDir + "/" + buildDirectory
- if sourceDirectory != '' and not os.path.isabs(sourceDirectory):
- sourceDirectory = sourceDir + "/" + sourceDirectory
- cmakelib.handshake(proc, major, minor, sourceDirectory, buildDirectory,
- generator, extraGenerator)
- elif 'validateGlobalSettings' in obj:
- data = obj['validateGlobalSettings']
- if not 'buildDirectory' in data: data['buildDirectory'] = buildDir
- if not 'sourceDirectory' in data: data['sourceDirectory'] = sourceDir
- if not 'generator' in data: data['generator'] = cmakeGenerator
- if not 'extraGenerator' in data: data['extraGenerator'] = ''
- cmakelib.validateGlobalSettings(proc, cmakeCommand, data)
- elif 'validateCache' in obj:
- data = obj['validateCache']
- if not 'isEmpty' in data: data['isEmpty'] = false
- cmakelib.validateCache(proc, data)
- elif 'reconnect' in obj:
- cmakelib.exitProc(proc)
- proc = cmakelib.initServerProc(cmakeCommand, communicationMethod)
- else:
- print("Unknown command:", json.dumps(obj))
- sys.exit(2)
- cmakelib.shutdownProc(proc)
- print("Completed")
diff --git a/Tests/Server/tc_buildsystem1.json b/Tests/Server/tc_buildsystem1.json
deleted file mode 100644
index 08831b7..0000000
--- a/Tests/Server/tc_buildsystem1.json
+++ /dev/null
@@ -1,27 +0,0 @@
-[
-{ "message": "Testing globalSettings" },
-
-{ "handshake": {"major": 1, "sourceDirectory":"buildsystem1","buildDirectory":"buildsystem1"} },
-
-{ "message": "Configure:" },
-{ "send": { "type": "configure", "cookie":"CONFIG" } },
-{ "reply": { "type": "configure", "cookie":"CONFIG", "skipProgress":true } },
-
-{ "message": "Compute:" },
-{ "send": { "type": "compute", "cookie":"COMPUTE" } },
-{ "reply": { "type": "compute", "cookie":"COMPUTE", "skipProgress":true } },
-
-{ "message": "Codemodel:" },
-{ "send": { "type": "codemodel", "cookie":"CODEMODEL" } },
-{ "reply": { "type": "codemodel", "cookie":"CODEMODEL" } },
-
-{ "message": "CMake Inputs:"},
-{ "send": { "type": "cmakeInputs", "cookie":"INPUTS" } },
-{ "reply": { "type": "cmakeInputs", "cookie":"INPUTS" } },
-
-{ "message": "Cache:"},
-{ "send": { "type": "cache", "cookie":"CACHE" } },
-{ "reply": { "type": "cache", "cookie":"CACHE" } },
-
-{ "message": "Everything ok." }
-]
diff --git a/Tests/Server/tc_cache.json b/Tests/Server/tc_cache.json
deleted file mode 100644
index 74af6d9..0000000
--- a/Tests/Server/tc_cache.json
+++ /dev/null
@@ -1,24 +0,0 @@
-[
-{ "message": "Testing cache" },
-
-{ "message": "Cache after first handshake is empty:" },
-{ "handshake": {"major": 1, "sourceDirectory": "buildsystem1", "buildDirectory": "buildsystem1"} },
-{ "send": { "type": "cache" } },
-{ "validateCache": { "isEmpty": true } },
-
-{ "message": "Cache after configure is populated:" },
-{ "send": { "type": "configure" } },
-{ "reply": { "type": "configure", "skipProgress":true } },
-{ "send": { "type": "cache" } },
-{ "validateCache": { "isEmpty": false } },
-
-{ "message": "Handshake for existing cache requires buildDirectory only:" },
-{ "reconnect": {} },
-{ "handshake": {"major": 1, "sourceDirectory": "", "buildDirectory": "buildsystem1"} },
-
-{ "message": "Cache after reconnect is again populated:" },
-{ "send": { "type": "cache" } },
-{ "validateCache": { "isEmpty": false } },
-
-{ "message": "Everything ok." }
-]
diff --git a/Tests/Server/tc_globalSettings.json b/Tests/Server/tc_globalSettings.json
deleted file mode 100644
index d72fb41..0000000
--- a/Tests/Server/tc_globalSettings.json
+++ /dev/null
@@ -1,140 +0,0 @@
-[
-{ "message": "Testing globalSettings" },
-
-{ "handshake": {"major": 1} },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-
-
-{ "message": "Change settings:" },
-
-{ "send": { "type": "setGlobalSettings", "warnUnused": true } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": true, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "warnUnused": false } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "debugOutput": true } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": true, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "debugOutput": false } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "warnUninitialized": true } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": true, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "warnUninitialized": false } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "traceExpand": true } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": true, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "traceExpand": false } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-
-
-{ "send": { "type": "setGlobalSettings", "trace": true } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": true, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "trace": false } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "warnUnusedCli": false } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": false, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "warnUnusedCli": true } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "checkSystemVars": true } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": true } },
-
-{ "send": { "type": "setGlobalSettings", "checkSystemVars": false } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": false, "debugOutput": false, "warnUninitialized": false, "traceExpand": false, "trace": false, "warnUnusedCli": true, "checkSystemVars": false } },
-
-{ "send": { "type": "setGlobalSettings", "warnUnused": true, "debugOutput": true, "warnUninitialized": true, "traceExpand": true, "trace": true, "warnUnusedCli": false, "checkSystemVars": true } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": true, "debugOutput": true, "warnUninitialized": true, "traceExpand": true, "trace": true, "warnUnusedCli": false, "checkSystemVars": true } },
-
-{ "message": "Ignore unknown/readonly" },
-
-{ "send": { "type": "setGlobalSettings", "unknownKey": "unknownValue", "extraGenerator": "XXX", "generator": "YYY", "sourceDirectory": "/tmp/source", "buildDirectory": "/tmp/build" } },
-{ "reply": { "type": "setGlobalSettings" } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": true, "debugOutput": true, "warnUninitialized": true, "traceExpand": true, "trace": true, "warnUnusedCli": false, "checkSystemVars": true } },
-
-{ "message": "Error paths:" },
-
-{ "send": { "type": "setGlobalSettings", "debugOutput": true, "warnUnused": 1 } },
-{ "error": { "type": "setGlobalSettings", "message": "\"warnUnused\" must be unset or a bool value." } },
-
-{ "send": { "type": "setGlobalSettings", "warnUnused": true, "debugOutput": 1 } },
-{ "error": { "type": "setGlobalSettings", "message": "\"debugOutput\" must be unset or a bool value." } },
-
-{ "send": { "type": "setGlobalSettings", "warnUninitialized": 1, "warnUnused": true, "debugOutput": true } },
-{ "error": { "type": "setGlobalSettings", "message": "\"warnUninitialized\" must be unset or a bool value." } },
-
-{ "send": { "type": "setGlobalSettings", "warnUnused": true, "debugOutput": true, "traceExpand": 1 } },
-{ "error": { "type": "setGlobalSettings", "message": "\"traceExpand\" must be unset or a bool value." } },
-
-{ "send": { "type": "setGlobalSettings", "debugOutput": true, "trace": 1, "warnUnused": true } },
-{ "error": { "type": "setGlobalSettings", "message": "\"trace\" must be unset or a bool value." } },
-
-{ "send": { "type": "setGlobalSettings", "warnUnused": true, "debugOutput": true, "warnUnusedCli": 1.0 } },
-{ "error": { "type": "setGlobalSettings", "message": "\"warnUnusedCli\" must be unset or a bool value." } },
-
-{ "send": { "type": "setGlobalSettings", "warnUnused": true, "debugOutput": true, "checkSystemVars": "some string" } },
-{ "error": { "type": "setGlobalSettings", "message": "\"checkSystemVars\" must be unset or a bool value." } },
-
-{ "send": { "type": "globalSettings"} },
-{ "validateGlobalSettings": { "warnUnused": true, "debugOutput": true, "warnUninitialized": true, "traceExpand": true, "trace": true, "warnUnusedCli": false, "checkSystemVars": true } },
-
-{ "message": "Everything ok." }
-]
diff --git a/Tests/Server/tc_handshake.json b/Tests/Server/tc_handshake.json
deleted file mode 100644
index 4bb7fa7..0000000
--- a/Tests/Server/tc_handshake.json
+++ /dev/null
@@ -1,75 +0,0 @@
-[
-{ "message": "Testing basic message handling:" },
-
-{ "sendRaw": "Sometext"},
-{ "recv": {"cookie":"","errorMessage":"Failed to parse JSON input.","inReplyTo":"","type":"error"} },
-
-{ "message": "Testing invalid json input"},
-{ "send": { "test": "sometext" } },
-{ "recv": {"cookie":"","errorMessage":"No type given in request.","inReplyTo":"","type":"error"} },
-
-{ "send": {"test": "sometext","cookie":"monster"} },
-{ "recv": {"cookie":"monster","errorMessage":"No type given in request.","inReplyTo":"","type":"error"} },
-
-{ "message": "Testing commands before handshake" },
-{ "send": {"type": "cache","cookie":"monster"} },
-{ "recv": {"cookie":"monster","errorMessage":"Waiting for type \"handshake\".","inReplyTo":"cache","type":"error"} },
-
-{ "message": "Testing handshake" },
-{ "send": {"type": "sometype","cookie":"monster2"} },
-{ "recv": {"cookie":"monster2","errorMessage":"Waiting for type \"handshake\".","inReplyTo":"sometype","type":"error"} },
-
-{ "send": {"type": "handshake"} },
-{ "recv": {"cookie":"","errorMessage":"\"protocolVersion\" is required for \"handshake\".","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","foo":"bar"} },
-{ "recv": {"cookie":"","errorMessage":"\"protocolVersion\" is required for \"handshake\".","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","protocolVersion":"bar"} },
-{ "recv": {"cookie":"","errorMessage":"\"protocolVersion\" must be a JSON object.","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","protocolVersion":{}} },
-{ "recv": {"cookie":"","errorMessage":"\"major\" must be set and an integer.","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","protocolVersion":{"major":"foo"}} },
-{ "recv": {"cookie":"","errorMessage":"\"major\" must be set and an integer.","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","protocolVersion":{"major":1, "minor":"foo"}} },
-{ "recv": {"cookie":"","errorMessage":"\"minor\" must be unset or an integer.","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","protocolVersion":{"major":-1, "minor":-1}} },
-{ "recv": {"cookie":"","errorMessage":"\"major\" must be >= 0.","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","protocolVersion":{"major":10, "minor":-1}} },
-{ "recv": {"cookie":"","errorMessage":"\"minor\" must be >= 0 when set.","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","protocolVersion":{"major":10000}} },
-{ "recv": {"cookie":"","errorMessage":"Protocol version not supported.","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"type": "handshake","protocolVersion":{"major":1, "minor":10000}} },
-{ "recv": {"cookie":"","errorMessage":"Protocol version not supported.","inReplyTo":"handshake","type":"error"} },
-
-{ "send": {"cookie":"zimtstern","type": "handshake","protocolVersion":{"major":1}} },
-{ "recv": {"cookie":"zimtstern","inReplyTo":"handshake","type":"error","errorMessage":"Failed to activate protocol version: \"buildDirectory\" is missing."} },
-
-{ "message": "Testing protocol version specific options (1.0):" },
-{ "send": {"cookie":"zimtstern","type": "handshake","protocolVersion":{"major":1},"sourceDirectory":"/tmp/src"} },
-{ "recv": {"cookie":"zimtstern","inReplyTo":"handshake","type":"error","errorMessage":"Failed to activate protocol version: \"buildDirectory\" is missing."} },
-
-{ "send": {"cookie":"zimtstern","type": "handshake","protocolVersion":{"major":1},"sourceDirectory":"/tmp/src","buildDirectory":"/tmp/build"} },
-{ "recv": {"cookie":"zimtstern","inReplyTo":"handshake","type":"error","errorMessage":"Failed to activate protocol version: \"sourceDirectory\" is not a directory."} },
-
-{ "send": {"cookie":"zimtstern","type": "handshake","protocolVersion":{"major":1},"sourceDirectory":".","buildDirectory":"/tmp/build","extraGenerator":"CodeBlocks"} },
-{ "recv": {"cookie":"zimtstern","inReplyTo":"handshake","type":"error","errorMessage":"Failed to activate protocol version: \"generator\" is unset but required."} },
-
-{ "send": {"cookie":"zimtstern","type": "handshake","protocolVersion":{"major":1},"sourceDirectory":".","buildDirectory":"/tmp/build","generator":"XXXX","extraGenerator":"CodeBlocks"} },
-{ "recv": {"cookie":"zimtstern","inReplyTo":"handshake","type":"error","errorMessage":"Failed to activate protocol version: Generator \"XXXX\" not supported."} },
-
-{ "send": {"cookie":"zimtstern","type": "handshake","protocolVersion":{"major":1},"sourceDirectory":".","buildDirectory":"/tmp/build","generator":"Ninja","extraGenerator":"XXXX"} },
-{ "recv": {"cookie":"zimtstern","inReplyTo":"handshake","type":"error","errorMessage":"Failed to activate protocol version: The combination of generator \"Ninja\" and extra generator \"XXXX\" is not supported."} },
-
-{ "send": {"cookie":"zimtstern","type": "handshake","protocolVersion":{"major":1},"sourceDirectory":".","buildDirectory":"/tmp/build","generator":"Ninja","extraGenerator":"CodeBlocks"} },
-{ "recv": {"cookie":"zimtstern","inReplyTo":"handshake","type":"reply"} },
-
-{ "message": "Everything ok." }
-]
diff --git a/Tests/SetLang/CMakeLists.txt b/Tests/SetLang/CMakeLists.txt
index 9de4fc6..3eb9185 100644
--- a/Tests/SetLang/CMakeLists.txt
+++ b/Tests/SetLang/CMakeLists.txt
@@ -15,3 +15,11 @@ if(CMAKE_GENERATOR MATCHES "^Visual Studio" AND "x${CMAKE_C_COMPILER_ID}" STREQU
add_library(stay stay_c.c stay_cxx.cxx)
set_property(TARGET stay PROPERTY COMPILE_OPTIONS "-TP")
endif()
+
+if((CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang|MSVC|Borland|Embarcadero|Intel|TI|XL)"))
+ cmake_policy(SET CMP0119 NEW)
+ add_library(zoom zoom.zzz)
+ set_source_files_properties(zoom.zzz PROPERTIES LANGUAGE CXX)
+ target_link_libraries(SetLang zoom)
+ target_compile_definitions(SetLang PRIVATE WITH_ZOOM)
+endif()
diff --git a/Tests/SetLang/bar.c b/Tests/SetLang/bar.c
index b934356..515e8c2 100644
--- a/Tests/SetLang/bar.c
+++ b/Tests/SetLang/bar.c
@@ -1,10 +1,22 @@
#include <stdio.h>
int foo();
+
+#ifdef WITH_ZOOM
+int zoom();
+#endif
+
class A
{
public:
- A() { this->i = foo(); }
+ A()
+ {
+ this->i = foo();
+#ifdef WITH_ZOOM
+ i += zoom();
+ i -= zoom();
+#endif
+ }
int i;
};
diff --git a/Tests/SetLang/zoom.zzz b/Tests/SetLang/zoom.zzz
new file mode 100644
index 0000000..a0c8899
--- /dev/null
+++ b/Tests/SetLang/zoom.zzz
@@ -0,0 +1,7 @@
+int zoom()
+{
+ int r = 10;
+ r++;
+ int ret = r + 10;
+ return ret;
+}
diff --git a/Tests/UseSWIG/BasicPerl/CMakeLists.txt b/Tests/UseSWIG/BasicPerl/CMakeLists.txt
index cf02de7..671d529 100644
--- a/Tests/UseSWIG/BasicPerl/CMakeLists.txt
+++ b/Tests/UseSWIG/BasicPerl/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1...3.13)
+cmake_minimum_required(VERSION 3.1...3.20)
project(TestBasicPerl CXX)
diff --git a/Tests/UseSWIG/BasicPython/CMakeLists.txt b/Tests/UseSWIG/BasicPython/CMakeLists.txt
index 8bbd1cb..a1163a2 100644
--- a/Tests/UseSWIG/BasicPython/CMakeLists.txt
+++ b/Tests/UseSWIG/BasicPython/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1...3.13)
+cmake_minimum_required(VERSION 3.1...3.20)
project(TestBasicPython CXX)
diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt
index e150223..d08c59c 100644
--- a/Tests/UseSWIG/CMakeLists.txt
+++ b/Tests/UseSWIG/CMakeLists.txt
@@ -1,3 +1,5 @@
+find_package(SWIG QUIET)
+
add_test(NAME UseSWIG.LegacyPython COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
@@ -64,6 +66,28 @@ add_test(NAME UseSWIG.BasicPerl COMMAND
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+if(SWIG_FOUND AND NOT SWIG_VERSION VERSION_LESS "4.0.2")
+ add_test(NAME UseSWIG.Depfile.BasicPython COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/UseSWIG/BasicPython"
+ "${CMake_BINARY_DIR}/Tests/UseSWIG/BasicPython.Depfile"
+ ${build_generator_args}
+ --build-project TestBasicPython
+ --build-options ${build_options} -DSWIG_USE_SWIG_DEPENDENCIES=ON
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME UseSWIG.Depfile.BasicPerl COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/UseSWIG/BasicPerl"
+ "${CMake_BINARY_DIR}/Tests/UseSWIG/BasicPerl.Depfile"
+ ${build_generator_args}
+ --build-project TestBasicPerl
+ --build-options ${build_options} -DSWIG_USE_SWIG_DEPENDENCIES=ON
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+endif()
if (CMake_TEST_UseSWIG_Fortran)
check_language(Fortran)
diff --git a/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt b/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
index f68e38e..abd0628 100644
--- a/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
+++ b/Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(FortranHello Fortran C)
# add a function to test for -lsunquad on sunpro sun systems.
@@ -33,7 +33,7 @@ FortranCInterface_HEADER(HelloWorldFCMangle.h
SYMBOLS hello world)
add_library(hello SHARED hello.f)
add_library(world SHARED world.f)
-target_link_libraries(hello world)
+target_link_libraries(hello PRIVATE world)
if(CMAKE_Fortran_COMPILER_ID MATCHES SunPro)
target_link_libraries(hello PRIVATE fsu)
if(CMAKE_Fortran_PLATFORM_ID MATCHES SunOS)
diff --git a/Tests/VSMidl/CMakeLists.txt b/Tests/VSMidl/CMakeLists.txt
index 3ff7c27..342b8fb 100644
--- a/Tests/VSMidl/CMakeLists.txt
+++ b/Tests/VSMidl/CMakeLists.txt
@@ -12,7 +12,7 @@ endif()
message(STATUS "CMAKE_BUILDNAME='${CMAKE_BUILDNAME}'")
message(STATUS "THIS_TESTNAME='${THIS_TESTNAME}'")
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(${THIS_TESTNAME})
include(ExternalProject)
diff --git a/Tests/VSMidl/src/CMakeLists.txt b/Tests/VSMidl/src/CMakeLists.txt
index e745fdd..7e838b4 100644
--- a/Tests/VSMidl/src/CMakeLists.txt
+++ b/Tests/VSMidl/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.12)
project(VSMidl)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/\$(IntDir)")
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index 56e4c1d..edd4330 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -119,13 +119,13 @@ set_property(SOURCE ${RELEASE_CONTENT_FILES} PROPERTY
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_TYPE Pixel)
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainPS)
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3)
-set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/DFLAGS_ADDED")
+set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_FLAGS $<1:/DFLAGS_ADDED>)
set_property(SOURCE ${PIXELSHADER_FILES} PROPERTY VS_SHADER_OUTPUT_HEADER_FILE "$(OutDir)%(Filename).h")
set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_TYPE Vertex)
set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_ENTRYPOINT mainVS)
set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_MODEL 4.0_level_9_3)
-set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_FLAGS "/DFLAGS_ADDED")
+set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_FLAGS $<1:/DFLAGS_ADDED>)
set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SHADER_OUTPUT_HEADER_FILE "$(OutDir)%(Filename).h")
set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SETTINGS "$<$<CONFIG:DEBUG>:SourceProperty1=SourceProperty1Value>")