summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/BuildDepends/CMakeLists.txt22
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt8
-rw-r--r--Tests/CMakeLib/testArgumentParser.cxx3
-rw-r--r--Tests/CMakeLib/testCTestBinPacker.cxx2
-rw-r--r--Tests/CMakeLib/testGccDepfileReader.cxx2
-rw-r--r--Tests/CMakeLib/testString.cxx5
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx2
-rw-r--r--Tests/CMakeLib/testUVRAII.cxx2
-rw-r--r--Tests/CMakeLib/testUVStreambuf.cxx3
-rw-r--r--Tests/CMakeLists.txt51
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt2
-rw-r--r--Tests/CMakeTests/ListTest.cmake.in23
-rw-r--r--Tests/CPackComponents/Issue 7470.html4
-rw-r--r--Tests/CPackNSISGenerator/CMakeLists.txt1
-rw-r--r--Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake8
-rw-r--r--Tests/CPackWiXGenerator/CMakeLists.txt3
-rw-r--r--Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake4
-rw-r--r--Tests/CPackWiXGenerator/myotherapp.cpp2
-rw-r--r--Tests/CSharpOnly/CMakeLists.txt4
-rw-r--r--Tests/CSharpOnly/csharponly.cs4
-rw-r--r--Tests/CSharpOnly/nested/lib1.cs13
-rw-r--r--Tests/CTestCoverageCollectGCOV/test.cmake.in146
-rw-r--r--Tests/CTestLimitDashJ/CMakeLists.txt2
-rw-r--r--Tests/CheckFortran.cmake3
-rw-r--r--Tests/ConfigSources/CMakeLists.txt59
-rw-r--r--Tests/ConfigSources/main.cpp9
-rw-r--r--Tests/Contracts/VTK/Dashboard.cmake.in4
-rw-r--r--Tests/Cuda/CMakeLists.txt46
-rw-r--r--Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt3
-rw-r--r--Tests/Cuda/Complex/CMakeLists.txt2
-rw-r--r--Tests/Cuda/MixedStandardLevels1/CMakeLists.txt3
-rw-r--r--Tests/Cuda/MixedStandardLevels2/CMakeLists.txt3
-rw-r--r--Tests/Cuda/MixedStandardLevels3/CMakeLists.txt2
-rw-r--r--Tests/Cuda/MixedStandardLevels4/CMakeLists.txt3
-rw-r--r--Tests/Cuda/MixedStandardLevels5/CMakeLists.txt3
-rw-r--r--Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt2
-rw-r--r--Tests/Cuda/ProperLinkFlags/CMakeLists.txt8
-rw-r--r--Tests/Cuda/Toolkit/CMakeLists.txt22
-rw-r--r--Tests/Cuda/WithC/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/Architecture/CMakeLists.txt15
-rw-r--r--Tests/CudaOnly/Architecture/main.cu9
-rw-r--r--Tests/CudaOnly/CMakeLists.txt67
-rw-r--r--Tests/CudaOnly/CircularLinkLine/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/CompileFlags/CMakeLists.txt15
-rw-r--r--Tests/CudaOnly/CompileFlags/main.cu13
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/ExportPTX/CMakeLists.txt7
-rw-r--r--Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt15
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/RuntimeControls/CMakeLists.txt3
-rw-r--r--Tests/CudaOnly/SeparateCompilation/CMakeLists.txt4
-rw-r--r--Tests/CudaOnly/Standard98/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt6
-rw-r--r--Tests/CudaOnly/Toolkit/CMakeLists.txt17
-rw-r--r--Tests/CudaOnly/WithDefs/CMakeLists.txt15
-rw-r--r--Tests/CudaOnly/WithDefs/main.notcu6
-rw-r--r--Tests/CxxOnly/CMakeLists.txt2
-rw-r--r--Tests/CxxOnly/cxxonly.cxx2
-rw-r--r--Tests/CxxOnly/test.C1
-rw-r--r--Tests/ExternalProjectUpdate/CMakeLists.txt2
-rw-r--r--Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake62
-rw-r--r--Tests/FindBLAS/CMakeLists.txt10
-rw-r--r--Tests/FindBLAS/Test/CMakeLists.txt13
-rw-r--r--Tests/FindBLAS/Test/main.c14
-rw-r--r--Tests/FindDoxygen/SimpleTest/CMakeLists.txt2
-rw-r--r--Tests/FindDoxygen/StampFile/CMakeLists.txt29
-rw-r--r--Tests/FindLAPACK/CMakeLists.txt10
-rw-r--r--Tests/FindLAPACK/Test/CMakeLists.txt13
-rw-r--r--Tests/FindLAPACK/Test/main.c20
-rw-r--r--Tests/FindLibXslt/CMakeLists.txt10
-rw-r--r--Tests/FindLibXslt/Test/CMakeLists.txt45
-rw-r--r--Tests/FindLibXslt/Test/libexslt.c16
-rw-r--r--Tests/FindLibXslt/Test/libxslt.c24
-rw-r--r--Tests/FindModulesExecuteAll/CMakeLists.txt30
-rw-r--r--Tests/FindModulesExecuteAll/main.c4
-rw-r--r--Tests/FindPython/ArtifactsInteractive/CMakeLists.txt24
-rw-r--r--Tests/FindPython/CMakeLists.txt180
-rw-r--r--Tests/FindPython/Implementation/CMakeLists.txt37
-rw-r--r--Tests/FindPython/IronPython/CMakeLists.txt11
-rw-r--r--Tests/FindPython/IronPython2/CMakeLists.txt11
-rw-r--r--Tests/FindPython/PyPy/CMakeLists.txt37
-rw-r--r--Tests/FindPython/PyPy2/CMakeLists.txt37
-rw-r--r--Tests/FindPython/PyPy3/CMakeLists.txt37
-rw-r--r--Tests/FindPython/Python/CMakeLists.txt6
-rw-r--r--Tests/FindPython/Python2/CMakeLists.txt9
-rw-r--r--Tests/FindPython/Python2Embedded/CMakeLists.txt15
-rw-r--r--Tests/FindPython/Python2Module/CMakeLists.txt37
-rw-r--r--Tests/FindPython/Python3/CMakeLists.txt15
-rw-r--r--Tests/FindPython/Python3Embedded/CMakeLists.txt15
-rw-r--r--Tests/FindPython/Python3Module/CMakeLists.txt37
-rw-r--r--Tests/FindRuby/CMakeLists.txt57
-rw-r--r--Tests/FindRuby/Fail/CMakeLists.txt5
-rw-r--r--Tests/FindRuby/FailExact/CMakeLists.txt8
-rw-r--r--Tests/FindRuby/Rvm/CMakeLists.txt75
-rw-r--r--Tests/FindRuby/Rvm/RvmDefault.cmake17
-rw-r--r--Tests/FindRuby/Rvm/RvmOnly.cmake41
-rw-r--r--Tests/FindRuby/Rvm/RvmStandard.cmake9
-rw-r--r--Tests/FindRuby/Test/CMakeLists.txt14
-rw-r--r--Tests/FindRuby/Test/ruby_version.c7
-rw-r--r--Tests/FindX11/Test/CMakeLists.txt11
-rw-r--r--Tests/FortranModules/CMakeLists.txt2
-rw-r--r--Tests/FortranOnly/CMakeLists.txt93
-rw-r--r--Tests/FortranOnly/no_preprocess_source_fpp.fpp3
-rw-r--r--Tests/FortranOnly/no_preprocess_source_lower.f3
-rw-r--r--Tests/FortranOnly/no_preprocess_source_upper.F3
-rw-r--r--Tests/FortranOnly/no_preprocess_target_fpp.fpp3
-rw-r--r--Tests/FortranOnly/no_preprocess_target_lower.f3
-rw-r--r--Tests/FortranOnly/no_preprocess_target_upper.F3
-rw-r--r--Tests/FortranOnly/preprocess2.f4
-rw-r--r--Tests/FortranOnly/preprocess3.f4
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt33
-rw-r--r--Tests/IncludeDirectories/main.cpp14
-rw-r--r--Tests/MSManifest/CMakeLists.txt3
-rw-r--r--Tests/MSManifest/Subdir/CMakeLists.txt7
-rw-r--r--Tests/MSManifest/Subdir2/CMakeLists.txt13
-rw-r--r--Tests/MSManifest/Subdir2/check.cmake22
-rw-r--r--Tests/MSManifest/Subdir2/main.c4
-rw-r--r--Tests/MSManifest/Subdir2/test_manifest1.in5
-rw-r--r--Tests/MSManifest/Subdir2/test_manifest2.in12
-rw-r--r--Tests/MSManifest/Subdir2/test_manifest3.in9
-rw-r--r--Tests/ObjectLibrary/CMakeLists.txt2
-rw-r--r--Tests/ObjectLibrary/Transitive/CMakeLists.txt12
-rw-r--r--Tests/ObjectLibrary/Transitive/FooObject.c4
-rw-r--r--Tests/ObjectLibrary/Transitive/FooStatic.c4
-rw-r--r--Tests/ObjectLibrary/Transitive/Transitive.c7
-rw-r--r--Tests/Preprocess/preprocess.c12
-rw-r--r--Tests/Preprocess/preprocess.cxx15
-rw-r--r--Tests/Properties/CMakeLists.txt178
-rw-r--r--Tests/Properties/SubDir2/CMakeLists.txt29
-rw-r--r--Tests/QtAutogen/Complex/codeeditor.cpp5
-rw-r--r--Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt1
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt96
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in9
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp15
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/main.cpp.in6
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.cpp6
-rw-r--r--Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.h13
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt4
-rw-r--r--Tests/QtAutogen/Tests.cmake1
-rw-r--r--Tests/RunCMake/AndroidTestUtilities/check.cmake2
-rw-r--r--Tests/RunCMake/AutoExportDll/AutoExport.cmake6
-rw-r--r--Tests/RunCMake/AutoExportDll/cppCLI.cxx22
-rw-r--r--Tests/RunCMake/AutoExportDll/say.cxx8
-rw-r--r--Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt4
-rw-r--r--Tests/RunCMake/BuildDepends/GNU-AS.cmake14
-rw-r--r--Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake1
-rw-r--r--Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake1
-rw-r--r--Tests/RunCMake/BuildDepends/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/BuildDepends/gnu_as.s1
-rw-r--r--Tests/RunCMake/CMP0104/CMP0104-Common.cmake2
-rw-r--r--Tests/RunCMake/CMP0104/CMP0104-NEW.cmake6
-rw-r--r--Tests/RunCMake/CMP0104/CMP0104-OFF.cmake3
-rw-r--r--Tests/RunCMake/CMP0104/CMP0104-OLD.cmake12
-rw-r--r--Tests/RunCMake/CMP0104/CMP0104-WARN-stderr.txt8
-rw-r--r--Tests/RunCMake/CMP0104/CMP0104-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0104/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0104/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/CMP0104/main.cu3
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-Common.cmake10
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-NEW-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-result.txt)0
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt9
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-NEW.cmake4
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-OLD.cmake9
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView-stderr.txt8
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView.cmake2
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-VTK-stderr.txt9
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-VTK.cmake2
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt37
-rw-r--r--Tests/RunCMake/CMP0106/CMP0106-WARN.cmake2
-rw-r--r--Tests/RunCMake/CMP0106/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CMP0106/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/CMP0106/subdir/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CMakeLists.txt84
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake4
-rw-r--r--Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake16
-rw-r--r--Tests/RunCMake/CPack/tests/THREADED/ExpectedFiles.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/THREADED/test.cmake7
-rw-r--r--Tests/RunCMake/CPack/tests/THREADED_ALL/ExpectedFiles.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake7
-rw-r--r--Tests/RunCMake/CTestCommandLine/MemCheckSan.cmake7
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake35
-rw-r--r--Tests/RunCMake/CTestCommandLine/stop-on-failure-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/stop-on-failure-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/stop-on-failure-stdout.txt10
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake36
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cache-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cmdline-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-variable-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-stderr.txt14
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-stderr.txt14
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-stderr.txt14
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-nores-check.cmake4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake8
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/test.cmake.in19
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckCLinkerFlag.cmake3
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckCXXLinkerFlag.cmake3
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckFortranLinkerFlag.cmake3
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlag.cmake14
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckOBJCLinkerFlag.cmake3
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/CheckOBJCXXLinkerFlag.cmake3
-rw-r--r--Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_directory-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_directory-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_good_cat-stdout.txt3
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_non_existing_file-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_non_existing_file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_non_readable_file-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_non_readable_file-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_option_not_handled-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/E_cat_option_not_handled-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/P_arbitrary_args.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/ProfilingTest-check.cmake31
-rw-r--r--Tests/RunCMake/CommandLine/ProfilingTest.cmake5
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake61
-rw-r--r--Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.hbin58 -> 59 bytes
-rw-r--r--Tests/RunCMake/CommandLine/profiling-all-params-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/profiling-all-params-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/profiling-invalid-format-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/profiling-invalid-format-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/profiling-missing-format-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/profiling-missing-format-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/profiling-missing-output-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target-result.txt)0
-rw-r--r--Tests/RunCMake/CommandLine/profiling-missing-output-stderr.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-common.cmake1
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake10
-rw-r--r--Tests/RunCMake/ExportCompileCommands/BeforeProject-check.cmake4
-rw-r--r--Tests/RunCMake/ExportCompileCommands/BeforeProject.cmake3
-rw-r--r--Tests/RunCMake/ExportCompileCommands/BeforeProjectBEFORE.cmake1
-rw-r--r--Tests/RunCMake/ExportCompileCommands/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ExportCompileCommands/empty.c0
-rw-r--r--Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt2
-rw-r--r--Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt6
-rw-r--r--Tests/RunCMake/ExternalProject/PreserveEmptyArgs-build-stdout.txt21
-rw-r--r--Tests/RunCMake/ExternalProject/PreserveEmptyArgs.cmake13
-rw-r--r--Tests/RunCMake/ExternalProject/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/ExternalProject/countArgs.cmake5
-rw-r--r--Tests/RunCMake/FPHSA/FindUseComponents.cmake15
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/FPHSA/all_optional_components.cmake14
-rw-r--r--Tests/RunCMake/FPHSA/required_and_optional_components.cmake14
-rw-r--r--Tests/RunCMake/FPHSA/required_components.cmake11
-rw-r--r--Tests/RunCMake/FPHSA/required_components_with_vars.cmake1
-rw-r--r--Tests/RunCMake/FetchContent/DownloadFile.cmake9
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt1
-rw-r--r--Tests/RunCMake/FetchContent/MakeAvailable.cmake13
-rw-r--r--Tests/RunCMake/FetchContent/PreserveEmptyArgs-stdout.txt4
-rw-r--r--Tests/RunCMake/FetchContent/PreserveEmptyArgs.cmake13
-rw-r--r--Tests/RunCMake/FetchContent/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/FetchContent/WithoutProject/ProjectSubdir/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FetchContent/countArgs.cmake5
-rw-r--r--Tests/RunCMake/FetchContent/dummyFile.txt1
-rw-r--r--Tests/RunCMake/FileAPI/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py4792
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json15
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json15
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json19
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json12
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json10
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json14
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json18
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json17
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json28
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json14
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json28
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json14
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json18
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json13
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json17
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json16
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json83
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json79
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json99
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json79
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json95
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json91
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json179
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json107
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json143
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json108
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json154
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json82
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json143
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json123
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json143
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json108
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json107
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json87
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json107
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json232
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json161
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json237
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json206
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json84
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json154
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json82
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json107
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json99
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json107
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json84
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json303
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json152
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json90
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json90
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json90
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json90
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json90
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json70
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json70
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json70
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json70
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json70
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json70
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json70
-rw-r--r--Tests/RunCMake/FileAPI/cxx/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/FileAPI/empty.h0
-rw-r--r--Tests/RunCMake/File_Archive/7zip-with-bad-compression-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable-result.txt)0
-rw-r--r--Tests/RunCMake/File_Archive/7zip-with-bad-compression-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Archive/7zip-with-bad-compression.cmake6
-rw-r--r--Tests/RunCMake/File_Archive/7zip.cmake7
-rw-r--r--Tests/RunCMake/File_Archive/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/File_Archive/RunCMakeTest.cmake18
-rw-r--r--Tests/RunCMake/File_Archive/gnutar-gz.cmake8
-rw-r--r--Tests/RunCMake/File_Archive/gnutar.cmake7
-rw-r--r--Tests/RunCMake/File_Archive/pax-xz.cmake8
-rw-r--r--Tests/RunCMake/File_Archive/pax-zstd.cmake8
-rw-r--r--Tests/RunCMake/File_Archive/pax.cmake7
-rw-r--r--Tests/RunCMake/File_Archive/paxr-bz2.cmake8
-rw-r--r--Tests/RunCMake/File_Archive/paxr.cmake7
-rw-r--r--Tests/RunCMake/File_Archive/roundtrip.cmake92
-rw-r--r--Tests/RunCMake/File_Archive/unsupported-format-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library-result.txt)0
-rw-r--r--Tests/RunCMake/File_Archive/unsupported-format-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Archive/unsupported-format.cmake5
-rw-r--r--Tests/RunCMake/File_Archive/zip-filtered.cmake26
-rw-r--r--Tests/RunCMake/File_Archive/zip-with-bad-compression-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test-result.txt)0
-rw-r--r--Tests/RunCMake/File_Archive/zip-with-bad-compression-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Archive/zip-with-bad-compression.cmake6
-rw-r--r--Tests/RunCMake/File_Archive/zip.cmake7
-rw-r--r--Tests/RunCMake/File_Configure/BadArg-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install-result.txt)0
-rw-r--r--Tests/RunCMake/File_Configure/BadArg-stderr.txt4
-rw-r--r--Tests/RunCMake/File_Configure/BadArg.cmake1
-rw-r--r--Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-result.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-result.txt)0
-rw-r--r--Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent.cmake4
-rw-r--r--Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-result.txt (renamed from Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1-result.txt)0
-rw-r--r--Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput.cmake4
-rw-r--r--Tests/RunCMake/File_Configure/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/File_Configure/DirOutput-stderr.txt1
-rw-r--r--Tests/RunCMake/File_Configure/DirOutput.cmake4
-rw-r--r--Tests/RunCMake/File_Configure/DirOutput.txt1
-rw-r--r--Tests/RunCMake/File_Configure/NewLineStyle-NoArg-result.txt (renamed from Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-result.txt)0
-rw-r--r--Tests/RunCMake/File_Configure/NewLineStyle-NoArg-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Configure/NewLineStyle-NoArg.cmake6
-rw-r--r--Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake20
-rw-r--r--Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-result.txt (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt)0
-rw-r--r--Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-stderr.txt5
-rw-r--r--Tests/RunCMake/File_Configure/NewLineStyle-WrongArg.cmake6
-rw-r--r--Tests/RunCMake/File_Configure/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/File_Configure/SubDir-check.cmake4
-rw-r--r--Tests/RunCMake/File_Configure/SubDir.cmake1
-rw-r--r--Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/File_Generate/CMP0070-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake48
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake48
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks.cmake13
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake29
-rw-r--r--Tests/RunCMake/FindPkgConfig/PkgConfigDoesNotExist-stdout.txt6
-rw-r--r--Tests/RunCMake/FindPkgConfig/PkgConfigDoesNotExist.cmake4
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/FindPkgConfig/pc-bletch/lib/pkgconfig/bletch-framework.pc9
-rw-r--r--Tests/RunCMake/FindSWIG/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/FindSWIG/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/FindSWIG/components-stdout.txt6
-rw-r--r--Tests/RunCMake/FindSWIG/components.cmake9
-rw-r--r--Tests/RunCMake/FindSWIG/missing-components-result.txt (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt)0
-rw-r--r--Tests/RunCMake/FindSWIG/missing-components-stderr.txt1
-rw-r--r--Tests/RunCMake/FindSWIG/missing-components.cmake3
-rw-r--r--Tests/RunCMake/Framework/FrameworkMultiConfigPostfix-build-final-check.cmake45
-rw-r--r--Tests/RunCMake/Framework/FrameworkMultiConfigPostfix.cmake25
-rw-r--r--Tests/RunCMake/Framework/RunCMakeTest.cmake36
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command-result.txt (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target-result.txt (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable-result.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library-result.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test-result.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install-result.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources-result.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-unknown-lang.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-unknown-lang.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANGUAGE/empty.c0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command-result.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target-result.txt (renamed from Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-unknown-lang.cmake (renamed from Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-unknown-lang.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake10
-rw-r--r--Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/empty.c0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command.cmake4
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target.cmake3
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable.cmake1
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library.cmake1
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test.cmake5
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install-stderr.txt7
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install.cmake5
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends-result.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends-stderr.txt7
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends.cmake7
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions-result.txt (renamed from Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions.cmake4
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options-result.txt (renamed from Tests/RunCMake/alias_targets/imported-target-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options.cmake4
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories.cmake4
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories.cmake7
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries.cmake7
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources.cmake2
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/GenEx-DEVICE_LINK/empty.c0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/GENEX_EVAL-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1.cmake (renamed from Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2.cmake (renamed from Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL.cmake (renamed from Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-GENEX_EVAL/empty.c0
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command-result.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt)0
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command.cmake4
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target.cmake3
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable.cmake1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library.cmake1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test.cmake5
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install-stderr.txt7
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install.cmake5
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends-stderr.txt7
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends.cmake7
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions.cmake4
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options.cmake4
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories.cmake4
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories.cmake7
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries.cmake7
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources.cmake2
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/GenEx-HOST_LINK/empty.c0
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target.cmake3
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable.cmake1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library.cmake1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test.cmake5
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate.cmake6
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install-stderr.txt10
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install.cmake5
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources.cmake2
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-unknown-lang.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4-stderr.txt8
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4.cmake7
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANGUAGE/empty.c0
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable.cmake5
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library.cmake2
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test.cmake5
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate.cmake6
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install-stderr.txt10
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install.cmake5
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources-stderr.txt8
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources.cmake2
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-unknown-lang.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3-stderr.txt9
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3.cmake4
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/GenEx-LINK_LANG_AND_ID/empty.c0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR.cmake (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE.cmake (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake (renamed from Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE.cmake (renamed from Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake (renamed from Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR.cmake (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE.cmake (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake (renamed from Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion.cmake (renamed from Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake31
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-imported-target-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-imported-target-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-imported-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-imported-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-imported-target-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-imported-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-imported-target-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-imported-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target-result.txt1
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target-stderr.txt (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target-stderr.txt)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target.cmake (renamed from Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE.cmake (renamed from Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE_BASE_NAME-check.cmake (renamed from Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE_BASE_NAME-check.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake (renamed from Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake)0
-rw-r--r--Tests/RunCMake/GenEx-TARGET_FILE/empty.c0
-rw-r--r--Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp6
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake56
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL-check.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL.cmake16
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-configuration-debug-stdout.txt5
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-configuration-release-stdout.txt5
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-result.txt (renamed from Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-result.txt)0
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt (renamed from Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-stdout.txt)0
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-result.txt1
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-stderr.txt2
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-stdout.txt18
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stderr.txt8
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stdout.txt1
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-skip-timeout-stdout.txt10
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt40
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt44
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest.cmake11
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake13
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake13
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestXML-result-check.cmake4
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestXML.cmake10
-rw-r--r--Tests/RunCMake/GoogleTest/RunCMakeTest.cmake132
-rw-r--r--Tests/RunCMake/GoogleTest/configuration_gtest.cpp23
-rw-r--r--Tests/RunCMake/GoogleTest/fake_gtest.cpp4
-rw-r--r--Tests/RunCMake/GoogleTest/skip_test.cpp18
-rw-r--r--Tests/RunCMake/GoogleTest/timeout_test.cpp7
-rw-r--r--Tests/RunCMake/GoogleTest/xml_output.cpp26
-rw-r--r--Tests/RunCMake/Graphviz/GraphvizTestProject.cmake2
-rw-r--r--Tests/RunCMake/Graphviz/default_options-check.cmake8
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication22
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers26
-rw-r--r--Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-result.txt1
-rw-r--r--Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-stderr.txt9
-rw-r--r--Tests/RunCMake/Languages/LINKER_LANGUAGE-genex.cmake (renamed from Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake)0
-rw-r--r--Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt9
-rw-r--r--Tests/RunCMake/Languages/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake9
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake27
-rwxr-xr-xTests/RunCMake/Ninja/SelectCompiler/1/gcc2
-rwxr-xr-xTests/RunCMake/Ninja/SelectCompiler/2/cc2
-rw-r--r--Tests/RunCMake/Ninja/SelectCompilerUNIX-result.txt1
-rw-r--r--Tests/RunCMake/Ninja/SelectCompilerUNIX-stderr.txt6
-rw-r--r--Tests/RunCMake/Ninja/SelectCompilerUNIX.cmake3
-rw-r--r--Tests/RunCMake/Ninja/SelectCompilerWindows-result.txt1
-rw-r--r--Tests/RunCMake/Ninja/SelectCompilerWindows-stderr.txt6
-rw-r--r--Tests/RunCMake/Ninja/SelectCompilerWindows.cmake3
-rw-r--r--Tests/RunCMake/Ninja/app.cpp6
-rw-r--r--Tests/RunCMake/Ninja/app_qt.cpp11
-rw-r--r--Tests/RunCMake/Ninja/simple_lib.cpp6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ObjectLibrary/b.c2
-rw-r--r--Tests/RunCMake/ObjectLibrary/requires.c2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchWarnInvalid-check.cmake22
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchWarnInvalid.cmake16
-rw-r--r--Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/PrecompileHeaders/empty.c2
-rw-r--r--Tests/RunCMake/SymlinkTrees/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/SymlinkTrees/PrintTrees.cmake6
-rw-r--r--Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake34
-rw-r--r--Tests/RunCMake/SymlinkTrees/common_symlinks-stdout.txt4
-rw-r--r--Tests/RunCMake/SymlinkTrees/common_symlinks.cmake1
-rw-r--r--Tests/RunCMake/Syntax/CommandEOF-stderr.txt2
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt3
-rw-r--r--Tests/RunCMake/UnityBuild/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/UnityBuild/f.c5
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_group-check.cmake42
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_group.cmake39
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_batch-check.cmake5
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_batch.cmake15
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_group-check.cmake11
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake17
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build_group-check.cmake5
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build_group.cmake16
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_cxx_group-check.cmake27
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_cxx_group.cmake27
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_invalid_mode-result.txt1
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_invalid_mode-stderr.txt5
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_invalid_mode.cmake12
-rw-r--r--Tests/RunCMake/VS10Project/CSharpSourceGroup/foo.cs3
-rw-r--r--Tests/RunCMake/VS10Project/CSharpSourceGroup/images/empty.bmp0
-rw-r--r--Tests/RunCMake/VS10Project/CSharpSourceGroup/nested/baz.cs3
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildNativeGrouped-check.cmake56
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildNativeGrouped.cmake20
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017Grouped-check.cmake59
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017Grouped.cmake20
-rw-r--r--Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake22
-rw-r--r--Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake16
-rw-r--r--Tests/RunCMake/VS10Project/VsCsharpSourceGroupHelpers.cmake15
-rw-r--r--Tests/RunCMake/VS10Project/VsDeployEnabled-check.cmake58
-rw-r--r--Tests/RunCMake/VS10Project/VsDeployEnabled.cmake12
-rw-r--r--Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake22
-rw-r--r--Tests/RunCMake/VS10Project/VsPackageReferences.cmake9
-rw-r--r--Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake36
-rw-r--r--Tests/RunCMake/VS10Project/VsPlatformToolset.cmake6
-rw-r--r--Tests/RunCMake/VS10Project/VsSettings-check.cmake23
-rw-r--r--Tests/RunCMake/VS10Project/VsSettings.cmake5
-rw-r--r--Tests/RunCMake/VS10Project/VsSourceSettingsTool-check.cmake34
-rw-r--r--Tests/RunCMake/VS10Project/VsSourceSettingsTool.cmake5
-rw-r--r--Tests/RunCMake/VS10Project/shader.hlsl1
-rw-r--r--Tests/RunCMake/VS10Project/shader2.hlsl1
-rw-r--r--Tests/RunCMake/add_link_options/GENEX_LINK_LANG.cmake16
-rw-r--r--Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake5
-rw-r--r--Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake5
-rw-r--r--Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake5
-rw-r--r--Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake5
-rw-r--r--Tests/RunCMake/add_link_options/LinkOptionsLib.cxx7
-rw-r--r--Tests/RunCMake/add_link_options/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-check.cmake2
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-result.txt1
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-check.cmake2
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-result.txt1
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake5
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-result.txt1
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-check.cmake5
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-result.txt1
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-validation.cmake17
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE.cmake17
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake2
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-result.txt1
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake2
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-result.txt1
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake5
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt1
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-check.cmake5
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-result.txt1
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-validation.cmake23
-rw-r--r--Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID.cmake19
-rw-r--r--Tests/RunCMake/add_test/CMakeLists.txt.in27
-rw-r--r--Tests/RunCMake/add_test/NameContainsBracketArgument1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsBracketArgument2-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsBracketArgument3-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsBracketArgument3-stderr.txt2
-rw-r--r--Tests/RunCMake/add_test/NameContainsBracketArgument4-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsBracketArgument4-stderr.txt2
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote1-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote1-stderr.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote2-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote2-stderr.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote2-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote3-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote3-stderr.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote3-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote4-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote4-stderr.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedQuote4-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedSpecialChars1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedSpecialChars2-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedSpecialChars3-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsEscapedSpecialChars4-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax2-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax3-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax4-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsOtherSpecialChars1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsOtherSpecialChars2-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsOtherSpecialChars3-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsOtherSpecialChars4-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsSemicolon1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsSemicolon2-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsSemicolon2-stderr.txt2
-rw-r--r--Tests/RunCMake/add_test/NameContainsSemicolon3-stdout.txt3
-rw-r--r--Tests/RunCMake/add_test/NameContainsSemicolon4-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsSemicolon4-stderr.txt2
-rw-r--r--Tests/RunCMake/add_test/NameContainsSpaces1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsSpaces2-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsSpaces2-stderr.txt2
-rw-r--r--Tests/RunCMake/add_test/NameContainsSpaces3-stdout.txt3
-rw-r--r--Tests/RunCMake/add_test/NameContainsSpaces4-result.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsSpaces4-stderr.txt2
-rw-r--r--Tests/RunCMake/add_test/NameContainsValidSpecialChars1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsValidSpecialChars2-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsValidSpecialChars3-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameContainsValidSpecialChars4-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameIsAlphaNumeric1-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameIsAlphaNumeric2-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameIsAlphaNumeric3-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/NameIsAlphaNumeric4-stdout.txt1
-rw-r--r--Tests/RunCMake/add_test/RunCMakeTest.cmake263
-rw-r--r--Tests/RunCMake/add_test/test.cmake.in16
-rw-r--r--Tests/RunCMake/alias_targets/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW-result.txt1
-rw-r--r--Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW-stderr.txt30
-rw-r--r--Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW.cmake4
-rw-r--r--Tests/RunCMake/alias_targets/duplicate-target-CMP0107-OLD.cmake4
-rw-r--r--Tests/RunCMake/alias_targets/duplicate-target.cmake20
-rw-r--r--Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt15
-rw-r--r--Tests/RunCMake/alias_targets/get_property.cmake59
-rw-r--r--Tests/RunCMake/alias_targets/imported-target-stderr.txt17
-rw-r--r--Tests/RunCMake/alias_targets/imported-target-subdir1/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/alias_targets/imported-target-subdir2/CMakeLists.txt20
-rw-r--r--Tests/RunCMake/alias_targets/imported-target.cmake11
-rw-r--r--Tests/RunCMake/cmake_language/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/cmake_language/CallInvalidCommand.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/CheckIncludeGuard.cmake4
-rw-r--r--Tests/RunCMake/cmake_language/CheckProject/CMakeLists.txt19
-rw-r--r--Tests/RunCMake/cmake_language/CheckProject/lib.c0
-rw-r--r--Tests/RunCMake/cmake_language/RunCMakeTest.cmake25
-rw-r--r--Tests/RunCMake/cmake_language/call_double_evaluation-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_double_evaluation.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/call_expand_command_name-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_expand_command_name.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/call_expand_function_name-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_expand_function_name.cmake11
-rw-r--r--Tests/RunCMake/cmake_language/call_expanded_command-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_expanded_command.cmake6
-rw-r--r--Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-stderr.txt4
-rw-r--r--Tests/RunCMake/cmake_language/call_expanded_command_and_arguments.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/call_invalid_command.cmake14
-rw-r--r--Tests/RunCMake/cmake_language/call_message-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_message.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/call_message_fatal_error-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_message_fatal_error-stderr.txt5
-rw-r--r--Tests/RunCMake/cmake_language/call_message_fatal_error.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/call_no_parameters-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_no_parameters-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_language/call_no_parameters.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/call_preserve_arguments-stderr.txt6
-rw-r--r--Tests/RunCMake/cmake_language/call_preserve_arguments.cmake12
-rw-r--r--Tests/RunCMake/cmake_language/call_unknown_function-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/call_unknown_function-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_language/call_unknown_function.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/call_valid_command.cmake99
-rw-r--r--Tests/RunCMake/cmake_language/eval_expand_command_name-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/eval_expand_command_name.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-stderr.txt5
-rw-r--r--Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/eval_message-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/eval_message.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/eval_message_fatal_error-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/eval_message_fatal_error-stderr.txt5
-rw-r--r--Tests/RunCMake/cmake_language/eval_message_fatal_error.cmake5
-rw-r--r--Tests/RunCMake/cmake_language/eval_no_code-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/eval_no_code-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_language/eval_no_code.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/eval_no_parameters-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/eval_no_parameters-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_language/eval_no_parameters.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/eval_variable_outside_message-stderr.txt1
-rw-r--r--Tests/RunCMake/cmake_language/eval_variable_outside_message.cmake2
-rw-r--r--Tests/RunCMake/cmake_language/no_parameters-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/no_parameters-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_language/no_parameters.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/unknown_meta_operation-result.txt1
-rw-r--r--Tests/RunCMake/cmake_language/unknown_meta_operation-stderr.txt2
-rw-r--r--Tests/RunCMake/cmake_language/unknown_meta_operation.cmake1
-rw-r--r--Tests/RunCMake/configure_file/RerunCMake.cmake6
-rw-r--r--Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/configure_file/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake2
-rw-r--r--Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake2
-rw-r--r--Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake2
-rw-r--r--Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake2
-rw-r--r--Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake2
-rw-r--r--Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake2
-rw-r--r--Tests/RunCMake/ctest_start/NoStartTimeNightly-result.txt1
-rw-r--r--Tests/RunCMake/ctest_start/NoStartTimeNightly-stderr.txt4
-rw-r--r--Tests/RunCMake/ctest_start/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ctest_start/test.cmake.in4
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake23
-rw-r--r--Tests/RunCMake/ctest_test/TestEnvironment-check.cmake10
-rw-r--r--Tests/RunCMake/ctest_test/stop-on-failure-stdout.txt13
-rw-r--r--Tests/RunCMake/execute_process/EchoVariable-stderr.txt3
-rw-r--r--Tests/RunCMake/execute_process/EchoVariable-stdout.txt1
-rw-r--r--Tests/RunCMake/execute_process/EchoVariable.cmake23
-rw-r--r--Tests/RunCMake/execute_process/EchoVariableOutput.cmake2
-rw-r--r--Tests/RunCMake/execute_process/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/exit_code.c3
-rw-r--r--Tests/RunCMake/export/DependOnDoubleExport-stderr.txt3
-rw-r--r--Tests/RunCMake/export/Repeat-CMP0103-NEW-result.txt1
-rw-r--r--Tests/RunCMake/export/Repeat-CMP0103-NEW-stderr.txt17
-rw-r--r--Tests/RunCMake/export/Repeat-CMP0103-NEW.cmake2
-rw-r--r--Tests/RunCMake/export/Repeat-CMP0103-OLD.cmake2
-rw-r--r--Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt26
-rw-r--r--Tests/RunCMake/export/Repeat-CMP0103-WARN.cmake1
-rw-r--r--Tests/RunCMake/export/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake55
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-stderr.txt18
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt23
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake44
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-stderr.txt119
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux.cmake169
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/topexe.c (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/toplib.c (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake159
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake216
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/topexe.c (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/toplib.c (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project-stderr.txt13
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-stderr.txt5
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-stderr.txt6
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-stderr.txt6
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation.cmake17
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-all-check.cmake38
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-result.txt1
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake114
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/topexe.c (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c)0
-rw-r--r--Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/toplib.c (renamed from Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c)0
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set-result.txt1
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set-stderr.txt4
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set.cmake1
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set-result.txt1
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set-stderr.txt4
-rw-r--r--Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set.cmake1
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set-result.txt1
-rw-r--r--Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set-stderr.txt4
-rw-r--r--Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set.cmake1
-rw-r--r--Tests/RunCMake/file/UPLOAD-tls-verify-not-set-result.txt1
-rw-r--r--Tests/RunCMake/file/UPLOAD-tls-verify-not-set-stderr.txt4
-rw-r--r--Tests/RunCMake/file/UPLOAD-tls-verify-not-set.cmake1
-rw-r--r--Tests/RunCMake/find_file/Required-result.txt1
-rw-r--r--Tests/RunCMake/find_file/Required-stderr.txt4
-rw-r--r--Tests/RunCMake/find_file/Required-stdout.txt1
-rw-r--r--Tests/RunCMake/find_file/Required.cmake12
-rw-r--r--Tests/RunCMake/find_file/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/find_library/LibSymLink-stderr.txt2
-rw-r--r--Tests/RunCMake/find_library/LibSymLink.cmake17
-rw-r--r--Tests/RunCMake/find_library/Required-result.txt1
-rw-r--r--Tests/RunCMake/find_library/Required-stderr.txt4
-rw-r--r--Tests/RunCMake/find_library/Required-stdout.txt1
-rw-r--r--Tests/RunCMake/find_library/Required.cmake14
-rw-r--r--Tests/RunCMake/find_library/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_path/Required-result.txt1
-rw-r--r--Tests/RunCMake/find_path/Required-stderr.txt4
-rw-r--r--Tests/RunCMake/find_path/Required-stdout.txt1
-rw-r--r--Tests/RunCMake/find_path/Required.cmake12
-rw-r--r--Tests/RunCMake/find_path/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/find_program/ExeNoRead-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/ExeNoRead.cmake4
-rw-r--r--Tests/RunCMake/find_program/Required-result.txt1
-rw-r--r--Tests/RunCMake/find_program/Required-stderr.txt4
-rw-r--r--Tests/RunCMake/find_program/Required-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/Required.cmake12
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/get_filename_component/KnownComponents.cmake8
-rwxr-xr-xTests/RunCMake/get_filename_component/KnownComponents.sh1
-rw-r--r--Tests/RunCMake/get_property/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/get_property/source_properties_failures-result.txt1
-rw-r--r--Tests/RunCMake/get_property/source_properties_failures-stderr.txt66
-rw-r--r--Tests/RunCMake/get_property/source_properties_failures.cmake14
-rw-r--r--Tests/RunCMake/install/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake32
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt18
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt23
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake44
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt119
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake169
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake157
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake216
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt13
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt5
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake38
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake114
-rw-r--r--Tests/RunCMake/message/message-indent-multiline.cmake2
-rw-r--r--Tests/RunCMake/pseudo_cppcheck.c3
-rw-r--r--Tests/RunCMake/set_property/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/set_property/SOURCE_FILE-result.txt1
-rw-r--r--Tests/RunCMake/set_property/SOURCE_FILE-stderr.txt22
-rw-r--r--Tests/RunCMake/set_property/SOURCE_FILE.cmake4
-rw-r--r--Tests/RunCMake/string/Hex.cmake20
-rw-r--r--Tests/RunCMake/string/HexNotEnoughArgs-result.txt1
-rw-r--r--Tests/RunCMake/string/HexNotEnoughArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/string/HexNotEnoughArgs.cmake1
-rw-r--r--Tests/RunCMake/string/HexTooManyArgs-result.txt1
-rw-r--r--Tests/RunCMake/string/HexTooManyArgs-stderr.txt4
-rw-r--r--Tests/RunCMake/string/HexTooManyArgs.cmake1
-rw-r--r--Tests/RunCMake/string/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/target_link_directories/CMP0099.cmake2
-rw-r--r--Tests/RunCMake/target_link_directories/RunCMakeTest.cmake13
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake5
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-check.cmake2
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-validation.cmake20
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake23
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake5
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-check.cmake2
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-validation.cmake26
-rw-r--r--Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID.cmake29
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake39
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake25
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/func.c7
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/lib.c10
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/main.c12
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake41
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang.cmake8
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage-stderr.txt8
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/empty.c0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c7
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx7
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake72
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c10
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.cxx12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/RunCMakeTest.cmake38
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang.cmake8
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/basic-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/empty.c0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/exe_c-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/exe_cxx-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.c7
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.cxx7
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/genex.cmake73
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/interface-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/lib.c10
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.c12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.cxx12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/no_language-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt5
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake9
-rw-r--r--Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/target_link_libraries/lib.c10
-rw-r--r--Tests/RunCMake/target_link_options/LinkOptionsDevice.cu14
-rw-r--r--Tests/RunCMake/target_link_options/RunCMakeTest.cmake36
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-validation.cmake22
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake51
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake5
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-check.cmake2
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-check.cmake5
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-check.cmake2
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake5
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-validation.cmake17
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE.cmake32
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake5
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake2
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-check.cmake5
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake2
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake5
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-validation.cmake23
-rw-r--r--Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID.cmake41
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake8
-rw-r--r--Tests/SourceGroups/CMakeLists.txt6
-rw-r--r--Tests/SourceGroups/main.c4
-rw-r--r--Tests/SourceGroups/nested.c4
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt24
-rw-r--r--Tests/SwiftOnly/L.swift1
-rw-r--r--Tests/SwiftOnly/M.swift2
-rw-r--r--Tests/SwiftOnly/N.swift2
-rw-r--r--Tests/TryCompile/CMakeLists.txt2
-rw-r--r--Tests/UseSWIG/BasicConfiguration.cmake3
-rw-r--r--Tests/UseSWIG/BasicFortran/CMakeLists.txt23
-rw-r--r--Tests/UseSWIG/CMakeLists.txt15
-rw-r--r--Tests/UseSWIG/runme.f9077
-rw-r--r--Tests/VSWinStorePhone/CMakeLists.txt7
-rw-r--r--Tests/VSWinStorePhone/EnsurePropertiesSet.cmake45
-rw-r--r--Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp2
1240 files changed, 14506 insertions, 6518 deletions
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index c1ad17cd3..5ddae8368 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -368,6 +368,28 @@ is not newer than dependency
${TEST_LINK_DEPENDS}
")
endif()
+
+ set(linkdep3 ${BuildDepends_BINARY_DIR}/Project/linkdep3${CMAKE_EXECUTABLE_SUFFIX})
+ if(${linkdep3} IS_NEWER_THAN ${TEST_LINK_DEPENDS})
+ message("$<LINK_LANGUAGE> in LINK_DEPENDS worked")
+ else()
+ message(SEND_ERROR "$<LINK_LANGUAGE> in LINK_DEPENDS failed. Executable
+ ${linkdep3}
+is not newer than dependency
+ ${TEST_LINK_DEPENDS}
+")
+ endif()
+
+ set(linkdep4 ${BuildDepends_BINARY_DIR}/Project/linkdep4${CMAKE_EXECUTABLE_SUFFIX})
+ if(${linkdep4} IS_NEWER_THAN ${TEST_LINK_DEPENDS})
+ message("$<LINK_LANGUAGE> in INTERFACE_LINK_DEPENDS worked")
+ else()
+ message(SEND_ERROR "$<LINK_LANGUAGE> in INTERFACE_LINK_DEPENDS failed. Executable
+ ${linkdep4}
+is not newer than dependency
+ ${TEST_LINK_DEPENDS}
+")
+ endif()
endif()
if(EXISTS "${link_depends_no_shared_check_txt}")
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index 833880098..83583c98c 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -118,6 +118,14 @@ if(TEST_LINK_DEPENDS)
set_property(TARGET foo_interface PROPERTY INTERFACE_LINK_DEPENDS $<1:${TEST_LINK_DEPENDS}>)
add_executable(linkdep2 linkdep.cxx)
target_link_libraries(linkdep2 PRIVATE foo_interface)
+
+ add_executable(linkdep3 linkdep.cxx)
+ set_property(TARGET linkdep3 PROPERTY LINK_DEPENDS $<$<LINK_LANGUAGE:CXX>:${TEST_LINK_DEPENDS}>)
+
+ add_library(foo_interface2 INTERFACE)
+ set_property(TARGET foo_interface2 PROPERTY INTERFACE_LINK_DEPENDS $<$<LINK_LANGUAGE:CXX>:${TEST_LINK_DEPENDS}>)
+ add_executable(linkdep4 linkdep.cxx)
+ target_link_libraries(linkdep4 PRIVATE foo_interface2)
endif()
add_library(link_depends_no_shared_lib SHARED link_depends_no_shared_lib.c
diff --git a/Tests/CMakeLib/testArgumentParser.cxx b/Tests/CMakeLib/testArgumentParser.cxx
index 20f98c2a2..965690c37 100644
--- a/Tests/CMakeLib/testArgumentParser.cxx
+++ b/Tests/CMakeLib/testArgumentParser.cxx
@@ -7,8 +7,7 @@
#include <vector>
#include <cm/string_view>
-
-#include "cm_static_string_view.hxx"
+#include <cmext/string_view>
#include "cmArgumentParser.h"
diff --git a/Tests/CMakeLib/testCTestBinPacker.cxx b/Tests/CMakeLib/testCTestBinPacker.cxx
index 6f09af20e..abdbefb23 100644
--- a/Tests/CMakeLib/testCTestBinPacker.cxx
+++ b/Tests/CMakeLib/testCTestBinPacker.cxx
@@ -1,4 +1,4 @@
-#include <cstddef>
+#include <cstddef> // IWYU pragma: keep
#include <iostream>
#include <map>
#include <string>
diff --git a/Tests/CMakeLib/testGccDepfileReader.cxx b/Tests/CMakeLib/testGccDepfileReader.cxx
index 924d87b08..e79f047fd 100644
--- a/Tests/CMakeLib/testGccDepfileReader.cxx
+++ b/Tests/CMakeLib/testGccDepfileReader.cxx
@@ -1,4 +1,4 @@
-#include <cstddef>
+#include <cstddef> // IWYU pragma: keep
#include <iostream>
#include <memory>
#include <string>
diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx
index 1fd3f38b8..ad800cf06 100644
--- a/Tests/CMakeLib/testString.cxx
+++ b/Tests/CMakeLib/testString.cxx
@@ -1,7 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include <cstddef>
+#include <cstddef> // IWYU pragma: keep
#include <cstring>
#include <iostream>
#include <iterator>
@@ -12,8 +12,7 @@
#include <utility>
#include <cm/string_view>
-
-#include "cm_static_string_view.hxx"
+#include <cmext/string_view>
#include "cmString.hxx"
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index 71a17647e..61a77cf7b 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -8,7 +8,7 @@
#include <cm/memory>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmGetPipes.h"
#include "cmUVHandlePtr.h"
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index cb05ace15..0607f449f 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -3,7 +3,7 @@
#include <thread>
#include <utility>
-#include "cm_uv.h"
+#include <cm3p/uv.h>
#include "cmUVHandlePtr.h"
diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx
index cd9c9d4fa..b86ed76ea 100644
--- a/Tests/CMakeLib/testUVStreambuf.cxx
+++ b/Tests/CMakeLib/testUVStreambuf.cxx
@@ -3,10 +3,9 @@
#include <string>
#include <vector>
+#include <cm3p/uv.h>
#include <stdint.h>
-#include "cm_uv.h"
-
#include "cmGetPipes.h"
#include "cmUVHandlePtr.h"
#include "cmUVStreambuf.h"
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index aff7383e5..db6dbf379 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -349,7 +349,6 @@ if(BUILD_TESTING)
# add a bunch of standard build-and-test style tests
ADD_TEST_MACRO(CommandLineTest CommandLineTest)
ADD_TEST_MACRO(FindPackageTest FindPackageTest)
- ADD_TEST_MACRO(FindModulesExecuteAll FindModulesExecuteAll)
ADD_TEST_MACRO(StringFileTest StringFileTest)
ADD_TEST_MACRO(TryCompile TryCompile)
ADD_TEST_MACRO(SystemInformation SystemInformation)
@@ -363,7 +362,10 @@ if(BUILD_TESTING)
add_test_macro(VSResourceNinjaForceRSP VSResourceNinjaForceRSP)
endif ()
endif()
- ADD_TEST_MACRO(MSManifest MSManifest)
+ if(_isMultiConfig)
+ set(MSManifest_CTEST_OPTIONS -C $<CONFIGURATION>)
+ endif()
+ ADD_TEST_MACRO(MSManifest ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>)
ADD_TEST_MACRO(Simple Simple)
ADD_TEST_MACRO(PreOrder PreOrder)
ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
@@ -447,6 +449,8 @@ if(BUILD_TESTING)
-DCMake_TEST_CUDA:BOOL=${CMake_TEST_CUDA}
)
ADD_TEST_MACRO(ExportImport ExportImport)
+ set_property(TEST ExportImport APPEND
+ PROPERTY LABELS "CUDA")
ADD_TEST_MACRO(Unset Unset)
ADD_TEST_MACRO(PolicyScope PolicyScope)
ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
@@ -787,13 +791,8 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endif()
endmacro()
if(CMake_BUILD_NIGHTLY_RELEASES)
- ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWin32
- win32_release.cmake)
- ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWin64
- win64_release.cmake)
ADD_NIGHTLY_BUILD_TEST(CMakeNightlyOSX
osx_release.cmake)
- set_property(TEST CMakeNightlyWin64 PROPERTY DEPENDS CMakeNightlyWin32)
endif()
# add tests with more complex invocations
@@ -980,6 +979,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-options
--test-command ${CMAKE_CMAKE_COMMAND}
"-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
+ "-Dno_verify:BOOL=${CMake_TEST_WIX_NO_VERIFY}"
"-Dconfig=\${CTEST_CONFIGURATION_TYPE}"
-P "${CMake_SOURCE_DIR}/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake")
@@ -1411,6 +1411,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
foreach(_mod IN ITEMS
ALSA
Boost
+ BLAS
BZip2
CURL
Cups
@@ -1430,12 +1431,14 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
ICU
JPEG
JsonCpp
+ LAPACK
LibArchive
LibLZMA
LibRHash
Libinput
LibUV
LibXml2
+ LibXslt
LTTngUST
ODBC
OpenACC
@@ -1471,7 +1474,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endif()
if(CMake_TEST_FindPython OR CMake_TEST_FindPython_NumPy
- OR CMake_TEST_FindPython_Conda OR CMake_TEST_FindPython_IronPython)
+ OR CMake_TEST_FindPython_Conda OR CMake_TEST_FindPython_IronPython OR CMake_TEST_FindPython_PyPy)
add_subdirectory(FindPython)
endif()
@@ -1479,6 +1482,10 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
add_subdirectory(UseSWIG)
endif()
+ if(CMake_TEST_FindRuby)
+ add_subdirectory(FindRuby)
+ endif()
+
add_subdirectory(FindThreads)
# Matlab module
@@ -1606,7 +1613,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
DEPENDS ExternalProjectUpdateSetup )
# do each of the tutorial steps
- function(add_tutorial_test step_name use_mymath)
+ function(add_tutorial_test step_name use_mymath tutorial_arg pass_regex)
set(tutorial_test_name Tutorial${step_name})
set(tutorial_build_dir "${CMake_BINARY_DIR}/Tests/Tutorial/${step_name}")
if (use_mymath)
@@ -1624,19 +1631,28 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Tutorial
--build-options ${tutorial_build_options}
- --test-command Tutorial 25.0)
+ --test-command Tutorial ${tutorial_arg})
+ set_tests_properties(${tutorial_test_name} PROPERTIES
+ PASS_REGULAR_EXPRESSION ${pass_regex})
+
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/${tutorial_build_dir}_Build")
endfunction()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
foreach(STP RANGE 2 12)
- add_tutorial_test(Step${STP} TRUE)
+ if (STP EQUAL 6)
+ set(pass_regex ".*using log and exp")
+ else()
+ set(pass_regex "The square root of 25 is 5")
+ endif()
+ add_tutorial_test(Step${STP} TRUE 25 ${pass_regex})
endforeach()
- add_tutorial_test(Complete TRUE)
+ set(pass_regex "The square root of 25 is 5")
+ add_tutorial_test(Complete TRUE 25 ${pass_regex})
foreach(STP RANGE 3 12)
- add_tutorial_test(Step${STP} FALSE)
+ add_tutorial_test(Step${STP} FALSE 25 ${pass_regex})
endforeach()
- add_tutorial_test(Complete FALSE)
+ add_tutorial_test(Complete FALSE 25 ${pass_regex})
endif()
add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
@@ -1881,6 +1897,8 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endif()
set(MSVCRuntimeLibrary_BUILD_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
ADD_TEST_MACRO(MSVCRuntimeLibrary)
+ set_property(TEST MSVCRuntimeLibrary APPEND
+ PROPERTY LABELS "CUDA")
if(CMAKE_Fortran_COMPILER)
ADD_TEST_MACRO(MSVCRuntimeLibrary.Fortran)
endif()
@@ -2676,9 +2694,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
-S "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake" -VV
--output-log "${CMake_BINARY_DIR}/Tests/CTestCoverageCollectGCOV/testOut.log"
)
- set_tests_properties(CTestCoverageCollectGCOV PROPERTIES
- PASS_REGULAR_EXPRESSION
- "PASSED with correct output.*Testing/CoverageInfo/main.cpp.gcov")
set_property(TEST CTestCoverageCollectGCOV PROPERTY ENVIRONMENT CTEST_PARALLEL_LEVEL=)
configure_file(
@@ -3465,6 +3480,8 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project IncludeDirectories
+ --build-options
+ -DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES}
--test-command IncludeDirectories)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories")
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index a53e4418b..49a4041b2 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -86,7 +86,7 @@ foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG
endforeach()
foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2
- HDF5 JPEG LibArchive OPENSCENEGRAPH RUBY SWIG Protobuf)
+ HDF5 JPEG LibArchive OPENSCENEGRAPH Ruby RUBY SWIG Protobuf)
check_version_string(${VTEST} ${VTEST}_VERSION)
endforeach()
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in
index f517e64a6..785f41da1 100644
--- a/Tests/CMakeTests/ListTest.cmake.in
+++ b/Tests/CMakeTests/ListTest.cmake.in
@@ -85,6 +85,9 @@ set(result ken bill andy brad)
list(SORT result)
TEST("SORT result" "andy;bill;brad;ken")
+list(SORT result COMPARE NATURAL)
+TEST("SORT result COMPARE NATURAL" "andy;bill;brad;ken")
+
set(result andy bill brad ken)
list(REVERSE result)
TEST("REVERSE result" "ken;brad;bill;andy")
@@ -104,6 +107,26 @@ TEST("REVERSE empty result" "")
list(SORT result)
TEST("SORT empty result" "")
+list(SORT result COMPARE NATURAL)
+TEST("SORT result COMPARE NATURAL" "")
+
+set(result 1.1 10.0 11.0 12.0 12.1 2.0 2.1 3.0 3.1 3.2 8.0 9.0)
+
+list(SORT result COMPARE NATURAL)
+TEST("SORT result COMPARE NATURAL" "1.1;2.0;2.1;3.0;3.1;3.2;8.0;9.0;10.0;11.0;12.0;12.1")
+
+list(SORT result)
+TEST("SORT result" "1.1;10.0;11.0;12.0;12.1;2.0;2.1;3.0;3.1;3.2;8.0;9.0")
+
+list(SORT result COMPARE NATURAL ORDER DESCENDING)
+TEST("SORT result COMPARE NATURAL ORDER DESCENDING" "12.1;12.0;11.0;10.0;9.0;8.0;3.2;3.1;3.0;2.1;2.0;1.1")
+
+set(result b-1.1 a-10.0 c-2.0 d 1 00 0)
+
+list(SORT result COMPARE NATURAL)
+TEST("SORT result COMPARE NATURAL" "00;0;1;a-10.0;b-1.1;c-2.0;d")
+
+
# these trigger top-level condition
foreach(cmd IN ITEMS Append Find Get Insert Length Reverse Remove_At Remove_Duplicates Remove_Item Sort)
set(${cmd}-No-Arguments-RESULT 1)
diff --git a/Tests/CPackComponents/Issue 7470.html b/Tests/CPackComponents/Issue 7470.html
index c2a16881a..59fbee7e3 100644
--- a/Tests/CPackComponents/Issue 7470.html
+++ b/Tests/CPackComponents/Issue 7470.html
@@ -3,7 +3,7 @@
The install rule for this file demonstrates the problem described in<br/>
CMake issue #7470:<br/>
<br/>
-<a href="https://gitlab.kitware.com/cmake/cmake/issues/7470">
-https://gitlab.kitware.com/cmake/cmake/issues/7470</a><br/>
+<a href="https://gitlab.kitware.com/cmake/cmake/-/issues/7470">
+https://gitlab.kitware.com/cmake/cmake/-/issues/7470</a><br/>
</body>
</html>
diff --git a/Tests/CPackNSISGenerator/CMakeLists.txt b/Tests/CPackNSISGenerator/CMakeLists.txt
index b8b2ed60b..8ed4d59cc 100644
--- a/Tests/CPackNSISGenerator/CMakeLists.txt
+++ b/Tests/CPackNSISGenerator/CMakeLists.txt
@@ -16,5 +16,6 @@ set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}\\\\install.ico")
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)
include(CPack)
diff --git a/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake b/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake
index 01b37c54a..bfbcf9cba 100644
--- a/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake
+++ b/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake
@@ -44,3 +44,11 @@ message(STATUS "Found the bitmap at index ${output_index}")
if("${output_index}" EQUAL "-1")
message(FATAL_ERROR "MUI_HEADERIMAGE_BITMAP not found in the project")
endif()
+
+file(STRINGS "${project_file}" line REGEX "^ManifestDPIAware true")
+string(FIND "${line}" "true" output_index)
+if("${output_index}" EQUAL "-1")
+ message(FATAL_ERROR "ManifestDPIAware true not found in the project")
+else()
+ message(STATUS "Found DPI-aware")
+endif()
diff --git a/Tests/CPackWiXGenerator/CMakeLists.txt b/Tests/CPackWiXGenerator/CMakeLists.txt
index 73eaf4fe9..940e849ff 100644
--- a/Tests/CPackWiXGenerator/CMakeLists.txt
+++ b/Tests/CPackWiXGenerator/CMakeLists.txt
@@ -49,6 +49,9 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
set(CPACK_WIX_UPGRADE_GUID "BF20CE5E-7F7C-401D-8F7C-AB45E8D170E6")
set(CPACK_WIX_UNINSTALL "1")
+# Support non-interactive sessions (like CI).
+set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-sval")
+
set(CPACK_PACKAGE_EXECUTABLES
"my-libapp" "CPack WiX Test"
"my-other-app" "Second CPack WiX Test"
diff --git a/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake b/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake
index ca9fd9049..c549e61c3 100644
--- a/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake
+++ b/Tests/CPackWiXGenerator/RunCPackVerifyResult.cmake
@@ -74,4 +74,6 @@ endforeach()
# error SMOK1076 : ICE61: This product should remove only older
# versions of itself. The Maximum version is not less
# than the current product. (1.0.0 1.0.0)
-run_wix_command(smoke -nologo -wx -sw1076 "${installer_file}")
+if (NOT no_verify)
+ run_wix_command(smoke -nologo -wx -sw1076 "${installer_file}")
+endif ()
diff --git a/Tests/CPackWiXGenerator/myotherapp.cpp b/Tests/CPackWiXGenerator/myotherapp.cpp
index 0eefc1c8c..5047a34e3 100644
--- a/Tests/CPackWiXGenerator/myotherapp.cpp
+++ b/Tests/CPackWiXGenerator/myotherapp.cpp
@@ -1,3 +1,3 @@
int main()
{
-} \ No newline at end of file
+}
diff --git a/Tests/CSharpOnly/CMakeLists.txt b/Tests/CSharpOnly/CMakeLists.txt
index 82049c78d..42cbe2e60 100644
--- a/Tests/CSharpOnly/CMakeLists.txt
+++ b/Tests/CSharpOnly/CMakeLists.txt
@@ -2,7 +2,9 @@
project (CSharpOnly CSharp)
# C# does not make any difference between STATIC and SHARED libs
-add_library(lib1 STATIC lib1.cs)
+add_library(lib1 STATIC lib1.cs nested/lib1.cs)
+#without the source group this test will fail to compile
+source_group(nested FILES nested/lib1.cs)
add_library(lib2 SHARED lib2.cs)
add_executable(CSharpOnly csharponly.cs)
diff --git a/Tests/CSharpOnly/csharponly.cs b/Tests/CSharpOnly/csharponly.cs
index ad4641ab6..3890c823c 100644
--- a/Tests/CSharpOnly/csharponly.cs
+++ b/Tests/CSharpOnly/csharponly.cs
@@ -5,10 +5,8 @@ namespace CSharpOnly
public static void Main(string[] args)
{
int val = Lib1.getResult();
-
Lib2 l = new Lib2();
- val = l.myVal;
-
+ val = val + l.myVal + nested.Lib1.getResult();
return;
}
}
diff --git a/Tests/CSharpOnly/nested/lib1.cs b/Tests/CSharpOnly/nested/lib1.cs
new file mode 100644
index 000000000..c2fde4b28
--- /dev/null
+++ b/Tests/CSharpOnly/nested/lib1.cs
@@ -0,0 +1,13 @@
+namespace CSharpOnly
+{
+ namespace nested
+ {
+ public class Lib1
+ {
+ public static int getResult()
+ {
+ return 23;
+ }
+ }
+ }
+}
diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in
index 2c98876b3..181888875 100644
--- a/Tests/CTestCoverageCollectGCOV/test.cmake.in
+++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in
@@ -3,13 +3,15 @@ set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/Te
set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestCoverageCollectGCOV/TestProject")
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
-
ctest_start(Experimental)
ctest_configure()
ctest_build()
ctest_test()
+#------------------------------------------------------------------------------#
+# Common setup for all tests.
+#------------------------------------------------------------------------------#
+
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
"/foo/something"
"/3rdparty/"
@@ -17,15 +19,118 @@ list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
"/CMakeFiles/"
)
list(APPEND CTEST_EXTRA_COVERAGE_GLOB "*.cpp")
-
include(CTestCoverageCollectGCOV)
+set(expected_out
+ CMakeFiles/myexecutable.dir/Labels.json
+ Testing/CoverageInfo/data.json
+ Testing/CoverageInfo/extra.cpp.gcov
+ Testing/CoverageInfo/main.cpp.gcov
+ uncovered/extra/uncovered1.cpp
+ uncovered/uncovered2.cpp
+)
+
+#------------------------------------------------------------------------------#
+# Test 1: with standard arguments
+#------------------------------------------------------------------------------#
+
+set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tbz)
+ctest_coverage_collect_gcov(
+ TARBALL "${tar_file}"
+ SOURCE "${CTEST_SOURCE_DIRECTORY}"
+ BUILD "${CTEST_BINARY_DIRECTORY}"
+ GCOV_COMMAND "${CMAKE_COMMAND}"
+ GCOV_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake")
+file(REMOVE_RECURSE "${CTEST_BINARY_DIRECTORY}/uncovered")
+
+execute_process(COMMAND
+ ${CMAKE_COMMAND} -E tar tf ${tar_file}
+ OUTPUT_VARIABLE out
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+string(REPLACE "\n" ";" out "${out}")
+list(SORT out)
+
+if("${out}" STREQUAL "${expected_out}")
+ message("PASSED with correct output: ${out}")
+else()
+ message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}")
+endif()
+
+#------------------------------------------------------------------------------#
+# Test 2: with optional argument: TARBALL_COMPRESSION "GZIP"
+#------------------------------------------------------------------------------#
+
+set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tgz)
+ctest_coverage_collect_gcov(
+ TARBALL "${tar_file}"
+ TARBALL_COMPRESSION "GZIP"
+ SOURCE "${CTEST_SOURCE_DIRECTORY}"
+ BUILD "${CTEST_BINARY_DIRECTORY}"
+ GCOV_COMMAND "${CMAKE_COMMAND}"
+ GCOV_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake")
+file(REMOVE_RECURSE "${CTEST_BINARY_DIRECTORY}/uncovered")
+
+execute_process(COMMAND
+ ${CMAKE_COMMAND} -E tar tf ${tar_file}
+ OUTPUT_VARIABLE out
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+string(REPLACE "\n" ";" out "${out}")
+list(SORT out)
+
+if("${out}" STREQUAL "${expected_out}")
+ message("PASSED with correct output: ${out}")
+else()
+ message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}")
+endif()
+
+#------------------------------------------------------------------------------#
+# Test 3: with optional argument: TARBALL_COMPRESSION "FROM_EXT"
+#------------------------------------------------------------------------------#
+
+set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.txz)
+ctest_coverage_collect_gcov(
+ TARBALL "${tar_file}"
+ TARBALL_COMPRESSION "FROM_EXT"
+ SOURCE "${CTEST_SOURCE_DIRECTORY}"
+ BUILD "${CTEST_BINARY_DIRECTORY}"
+ GCOV_COMMAND "${CMAKE_COMMAND}"
+ GCOV_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake")
+file(REMOVE_RECURSE "${CTEST_BINARY_DIRECTORY}/uncovered")
+
+execute_process(COMMAND
+ ${CMAKE_COMMAND} -E tar tf ${tar_file}
+ OUTPUT_VARIABLE out
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+string(REPLACE "\n" ";" out "${out}")
+list(SORT out)
+
+if("${out}" STREQUAL "${expected_out}")
+ message("PASSED with correct output: ${out}")
+else()
+ message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}")
+endif()
+
+#------------------------------------------------------------------------------#
+# Test 4: with optional argument: TARBALL_COMPRESSION "FALSE"
+#------------------------------------------------------------------------------#
+
set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.tar)
ctest_coverage_collect_gcov(
TARBALL "${tar_file}"
+ TARBALL_COMPRESSION "FALSE"
SOURCE "${CTEST_SOURCE_DIRECTORY}"
BUILD "${CTEST_BINARY_DIRECTORY}"
GCOV_COMMAND "${CMAKE_COMMAND}"
GCOV_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake")
+file(REMOVE_RECURSE "${CTEST_BINARY_DIRECTORY}/uncovered")
execute_process(COMMAND
${CMAKE_COMMAND} -E tar tf ${tar_file}
@@ -37,15 +142,36 @@ execute_process(COMMAND
string(REPLACE "\n" ";" out "${out}")
list(SORT out)
-set(expected_out
- CMakeFiles/myexecutable.dir/Labels.json
- Testing/CoverageInfo/data.json
- Testing/CoverageInfo/extra.cpp.gcov
- Testing/CoverageInfo/main.cpp.gcov
- uncovered/extra/uncovered1.cpp
- uncovered/uncovered2.cpp
+if("${out}" STREQUAL "${expected_out}")
+ message("PASSED with correct output: ${out}")
+else()
+ message(FATAL_ERROR "FAILED: expected:\n${expected_out}\nGot:\n${out}")
+endif()
+
+#------------------------------------------------------------------------------#
+# Test 5: with optional argument: TARBALL_COMPRESSION "ZSTD"
+#------------------------------------------------------------------------------#
+
+set(tar_file ${CTEST_BINARY_DIRECTORY}/gcov.zstd)
+ctest_coverage_collect_gcov(
+ TARBALL "${tar_file}"
+ TARBALL_COMPRESSION "ZSTD"
+ SOURCE "${CTEST_SOURCE_DIRECTORY}"
+ BUILD "${CTEST_BINARY_DIRECTORY}"
+ GCOV_COMMAND "${CMAKE_COMMAND}"
+ GCOV_OPTIONS -P "@CMake_SOURCE_DIR@/Tests/CTestCoverageCollectGCOV/fakegcov.cmake")
+file(REMOVE_RECURSE "${CTEST_BINARY_DIRECTORY}/uncovered")
+
+execute_process(COMMAND
+ ${CMAKE_COMMAND} -E tar tf ${tar_file}
+ OUTPUT_VARIABLE out
+ WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
+ OUTPUT_STRIP_TRAILING_WHITESPACE
)
+string(REPLACE "\n" ";" out "${out}")
+list(SORT out)
+
if("${out}" STREQUAL "${expected_out}")
message("PASSED with correct output: ${out}")
else()
diff --git a/Tests/CTestLimitDashJ/CMakeLists.txt b/Tests/CTestLimitDashJ/CMakeLists.txt
index 92d743f81..5208d2d91 100644
--- a/Tests/CTestLimitDashJ/CMakeLists.txt
+++ b/Tests/CTestLimitDashJ/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8)
project(CTestLimitDashJ NONE)
-# This file demonstrates https://gitlab.kitware.com/cmake/cmake/issues/12904
+# This file demonstrates https://gitlab.kitware.com/cmake/cmake/-/issues/12904
# when configured with CMake 2.8.10.2 and earlier, and when running
# "ctest -j 4" in the resulting build tree. This example is hard-coded
# to assume -j 4 just to reproduce the issue easily. Adjust the
diff --git a/Tests/CheckFortran.cmake b/Tests/CheckFortran.cmake
index 16a8ed2c6..33e1bfbbb 100644
--- a/Tests/CheckFortran.cmake
+++ b/Tests/CheckFortran.cmake
@@ -11,6 +11,7 @@ if(NOT DEFINED CMAKE_Fortran_COMPILER)
project(CheckFortran Fortran)
file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
\"set(CMAKE_Fortran_COMPILER \\\"\${CMAKE_Fortran_COMPILER}\\\")\\n\"
+ \"set(CMAKE_Fortran_COMPILER_ID \\\"\${CMAKE_Fortran_COMPILER_ID}\\\")\\n\"
\"set(CMAKE_Fortran_FLAGS \\\"\${CMAKE_Fortran_FLAGS}\\\")\\n\"
\"set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 \\\"\${CMAKE_Fortran_COMPILER_SUPPORTS_F90}\\\")\\n\"
)
@@ -45,6 +46,8 @@ file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
message(STATUS "${_desc} - ${CMAKE_Fortran_COMPILER}")
set(CMAKE_Fortran_COMPILER "${CMAKE_Fortran_COMPILER}" CACHE FILEPATH "Fortran compiler")
mark_as_advanced(CMAKE_Fortran_COMPILER)
+ set(CMAKE_Fortran_COMPILER_ID "${CMAKE_Fortran_COMPILER_ID}" CACHE STRING "Fortran compiler Id")
+ mark_as_advanced(CMAKE_Fortran_COMPILER_ID)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}" CACHE STRING "Fortran flags")
mark_as_advanced(CMAKE_Fortran_FLAGS)
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 "${CMAKE_Fortran_COMPILER_SUPPORTS_F90}" CACHE BOOL "Fortran compiler supports F90")
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index f5dd2765c..6e69e8b4e 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -1,6 +1,17 @@
cmake_minimum_required(VERSION 3.0)
+get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if(NOT _isMultiConfig AND NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build")
+endif()
project(ConfigSources CXX)
+# Source file(s) named with the configuration(s).
+file(GENERATE
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp"
+ CONTENT "void config_$<CONFIG>() {}\n"
+ )
+
+# Per-config sources via INTERFACE_SOURCES.
add_library(iface INTERFACE)
target_sources(iface INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp"
@@ -12,10 +23,56 @@ target_compile_definitions(iface INTERFACE
"$<$<CONFIG:Debug>:CFG_DEBUG>"
"$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
)
-
add_executable(ConfigSources
$<$<CONFIG:Debug>:main_debug.cpp>
$<$<NOT:$<CONFIG:Debug>>:main_other.cpp>
$<$<CONFIG:NotAConfig>:does_not_exist.cpp>
+ ${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp
)
target_link_libraries(ConfigSources iface)
+
+# Per-config sources via LINK_LIBRARIES.
+add_library(iface_debug INTERFACE)
+target_sources(iface_debug INTERFACE
+ "${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/iface_debug_src.cpp"
+ )
+add_library(iface_other INTERFACE)
+target_sources(iface_other INTERFACE
+ "${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp"
+ "${CMAKE_CURRENT_SOURCE_DIR}/iface_other_src.cpp"
+ )
+add_executable(ConfigSourcesLink main.cpp)
+target_compile_definitions(ConfigSourcesLink PRIVATE
+ "$<$<CONFIG:Debug>:CFG_DEBUG>"
+ "$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
+ )
+target_link_libraries(ConfigSourcesLink PRIVATE
+ "$<$<CONFIG:Debug>:iface_debug>"
+ "$<$<NOT:$<CONFIG:Debug>>:iface_other>"
+ "$<$<CONFIG:NotAConfig>:iface_does_not_exist>"
+ )
+
+# Per-config sources via INTERFACE_LINK_LIBRARIES.
+add_library(ConfigSourcesIface INTERFACE)
+target_link_libraries(ConfigSourcesIface INTERFACE
+ "$<$<CONFIG:Debug>:iface_debug>"
+ "$<$<NOT:$<CONFIG:Debug>>:iface_other>"
+ "$<$<CONFIG:NotAConfig>:iface_does_not_exist>"
+ )
+add_executable(ConfigSourcesLinkIface main.cpp)
+target_compile_definitions(ConfigSourcesLinkIface PRIVATE
+ "$<$<CONFIG:Debug>:CFG_DEBUG>"
+ "$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
+ )
+target_link_libraries(ConfigSourcesLinkIface ConfigSourcesIface)
+
+# A target with sources in only one configuration that is not the
+# first in CMAKE_CONFIGURATION_TYPES.
+if(CMAKE_CONFIGURATION_TYPES MATCHES ";([^;]+)")
+ set(one_config "${CMAKE_MATCH_1}")
+else()
+ set(one_config "${CMAKE_BUILD_TYPE}")
+endif()
+add_library(OneConfigOnly OBJECT "$<$<CONFIG:${one_config}>:${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp>")
+set_property(TARGET OneConfigOnly PROPERTY LINKER_LANGUAGE CXX)
diff --git a/Tests/ConfigSources/main.cpp b/Tests/ConfigSources/main.cpp
new file mode 100644
index 000000000..c1cd3b241
--- /dev/null
+++ b/Tests/ConfigSources/main.cpp
@@ -0,0 +1,9 @@
+#if !defined(CFG_DEBUG) && !defined(CFG_OTHER)
+# error "Neither CFG_DEBUG or CFG_OTHER is defined."
+#endif
+#ifdef CFG_DEBUG
+# include "main_debug.cpp"
+#endif
+#ifdef CFG_OTHER
+# include "main_other.cpp"
+#endif
diff --git a/Tests/Contracts/VTK/Dashboard.cmake.in b/Tests/Contracts/VTK/Dashboard.cmake.in
index c3d10f4bf..ae760bce9 100644
--- a/Tests/Contracts/VTK/Dashboard.cmake.in
+++ b/Tests/Contracts/VTK/Dashboard.cmake.in
@@ -24,8 +24,8 @@ set(CTEST_BUILD_COMMAND "@CMAKE_MAKE_PROGRAM@ -j9 -i")
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
- BUILD_EXAMPLES:BOOL=ON
- BUILD_TESTING:BOOL=ON
+ VTK_BUILD_EXAMPLES:BOOL=ON
+ VTK_BUILD_TESTING:STRING=WANT
VTK_WRAP_PYTHON:BOOL=ON
ExternalData_OBJECT_STORES:FILEPATH=@base_dir@/ExternalData
")
diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt
index 58b9b03c9..35ceb333c 100644
--- a/Tests/Cuda/CMakeLists.txt
+++ b/Tests/Cuda/CMakeLists.txt
@@ -1,25 +1,35 @@
+macro (add_cuda_test_macro name)
+ add_test_macro("${name}" ${ARGN})
+ set_property(TEST "${name}" APPEND
+ PROPERTY LABELS "CUDA")
+endmacro ()
-ADD_TEST_MACRO(Cuda.Complex CudaComplex)
-ADD_TEST_MACRO(Cuda.ConsumeCompileFeatures CudaConsumeCompileFeatures)
-ADD_TEST_MACRO(Cuda.CXXStandardSetTwice CXXStandardSetTwice)
-ADD_TEST_MACRO(Cuda.ObjectLibrary CudaObjectLibrary)
-ADD_TEST_MACRO(Cuda.MixedStandardLevels1 MixedStandardLevels1)
-ADD_TEST_MACRO(Cuda.MixedStandardLevels2 MixedStandardLevels2)
-ADD_TEST_MACRO(Cuda.MixedStandardLevels3 MixedStandardLevels3)
-ADD_TEST_MACRO(Cuda.MixedStandardLevels4 MixedStandardLevels4)
-ADD_TEST_MACRO(Cuda.MixedStandardLevels5 MixedStandardLevels5)
-ADD_TEST_MACRO(Cuda.NotEnabled CudaNotEnabled)
-ADD_TEST_MACRO(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
-ADD_TEST_MACRO(Cuda.Toolkit Toolkit)
-ADD_TEST_MACRO(Cuda.IncludePathNoToolkit IncludePathNoToolkit)
-ADD_TEST_MACRO(Cuda.ProperDeviceLibraries ProperDeviceLibraries)
-ADD_TEST_MACRO(Cuda.ProperLinkFlags ProperLinkFlags)
-ADD_TEST_MACRO(Cuda.SharedRuntimePlusToolkit SharedRuntimePlusToolkit)
+add_cuda_test_macro(Cuda.ConsumeCompileFeatures CudaConsumeCompileFeatures)
+add_cuda_test_macro(Cuda.CXXStandardSetTwice CXXStandardSetTwice)
+add_cuda_test_macro(Cuda.ObjectLibrary CudaObjectLibrary)
+add_cuda_test_macro(Cuda.MixedStandardLevels1 MixedStandardLevels1)
+add_cuda_test_macro(Cuda.MixedStandardLevels2 MixedStandardLevels2)
+add_cuda_test_macro(Cuda.MixedStandardLevels3 MixedStandardLevels3)
+add_cuda_test_macro(Cuda.MixedStandardLevels4 MixedStandardLevels4)
+add_cuda_test_macro(Cuda.MixedStandardLevels5 MixedStandardLevels5)
+add_cuda_test_macro(Cuda.NotEnabled CudaNotEnabled)
+add_cuda_test_macro(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
+add_cuda_test_macro(Cuda.Toolkit Toolkit)
+add_cuda_test_macro(Cuda.IncludePathNoToolkit IncludePathNoToolkit)
+add_cuda_test_macro(Cuda.SharedRuntimePlusToolkit SharedRuntimePlusToolkit)
+
+# Separable compilation is currently only supported on NVCC. Disable tests
+# using it for other compilers.
+if(CMake_TEST_CUDA AND NOT CMake_TEST_CUDA STREQUAL "Clang")
+ add_cuda_test_macro(Cuda.Complex CudaComplex)
+ add_cuda_test_macro(Cuda.ProperDeviceLibraries ProperDeviceLibraries)
+ add_cuda_test_macro(Cuda.ProperLinkFlags ProperLinkFlags)
+endif()
# The CUDA only ships the shared version of the toolkit libraries
# on windows
if(NOT WIN32)
- ADD_TEST_MACRO(Cuda.StaticRuntimePlusToolkit StaticRuntimePlusToolkit)
+ add_cuda_test_macro(Cuda.StaticRuntimePlusToolkit StaticRuntimePlusToolkit)
endif()
-ADD_TEST_MACRO(Cuda.WithC CudaWithC)
+add_cuda_test_macro(Cuda.WithC CudaWithC)
diff --git a/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt
index 1941c4952..f4ad83a30 100644
--- a/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt
+++ b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt
@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(CXXStandardSetTwice CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(CXXStandardSetTwice main.cu)
target_compile_features(CXXStandardSetTwice PUBLIC cxx_std_11)
diff --git a/Tests/Cuda/Complex/CMakeLists.txt b/Tests/Cuda/Complex/CMakeLists.txt
index 08d1e16aa..265bd85c1 100644
--- a/Tests/Cuda/Complex/CMakeLists.txt
+++ b/Tests/Cuda/Complex/CMakeLists.txt
@@ -15,7 +15,7 @@ project (Complex CXX CUDA)
#and also building cpp targets that need cuda implicit libraries
#verify that we can pass explicit cuda arch flags
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+set(CMAKE_CUDA_ARCHITECTURES 30)
set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
diff --git a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
index b03e51e3e..e40ffa6da 100644
--- a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
@@ -1,10 +1,9 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels1 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels1 main.cu lib.cpp)
diff --git a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt
index 12dd3285f..7af8081fa 100644
--- a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt
@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels2 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CXX_STANDARD 17) #this can decay
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels2 main.cu lib.cpp)
target_compile_features(MixedStandardLevels2 PUBLIC cuda_std_11)
diff --git a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt
index 2b611be8e..2c420030a 100644
--- a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels3 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels3 main.cu lib.cpp)
target_compile_features(MixedStandardLevels3 PUBLIC cuda_std_03 cxx_std_14)
diff --git a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt
index faf68692f..230230d0d 100644
--- a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt
@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels4 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CUDA_STANDARD 03)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels4 main.cu lib.cpp)
target_compile_features(MixedStandardLevels4 PUBLIC cxx_std_14)
diff --git a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt
index 7209f6085..5f5ee0637 100644
--- a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt
+++ b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt
@@ -1,9 +1,8 @@
cmake_minimum_required(VERSION 3.7)
project(MixedStandardLevels5 CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-
set(CMAKE_CXX_STANDARD 98)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(MixedStandardLevels5 main.cu lib.cpp)
diff --git a/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt b/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt
index cb47b09b4..fe28c3edc 100644
--- a/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt
+++ b/Tests/Cuda/ProperDeviceLibraries/CMakeLists.txt
@@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.13)
project(ProperDeviceLibraries CXX CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_35,code=compute_35 -gencode arch=compute_35,code=sm_35")
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 35)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
diff --git a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt
index b6e0e394b..d38da6d14 100644
--- a/Tests/Cuda/ProperLinkFlags/CMakeLists.txt
+++ b/Tests/Cuda/ProperLinkFlags/CMakeLists.txt
@@ -9,11 +9,17 @@ project (ProperLinkFlags CUDA CXX)
#Specify a set of valid CUDA flags and an invalid set of CXX flags ( for CUDA )
#to make sure we don't use the CXX flags when linking CUDA executables
-string(APPEND CMAKE_CUDA_FLAGS " -arch=sm_35 --use_fast_math")
+if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
+ string(APPEND CMAKE_CUDA_FLAGS "--use_fast_math")
+elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
+ string(APPEND CMAKE_CUDA_FLAGS "-ffast-math")
+endif()
+
set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 35)
add_executable(ProperLinkFlags file1.cu main.cxx)
set_target_properties( ProperLinkFlags
diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt
index 86b465219..00125e3b9 100644
--- a/Tests/Cuda/Toolkit/CMakeLists.txt
+++ b/Tests/Cuda/Toolkit/CMakeLists.txt
@@ -14,15 +14,29 @@ message(STATUS "CUDAToolkit_INCLUDE_DIRS: ${CUDAToolkit_INCLUDE_DIRS}")
message(STATUS "CUDAToolkit_LIBRARY_DIR: ${CUDAToolkit_LIBRARY_DIR}")
message(STATUS "CUDAToolkit_NVCC_EXECUTABLE ${CUDAToolkit_NVCC_EXECUTABLE}")
-# Verify that all the CUDA:: targets exist even when the CUDA language isn't enabled
+set(cuda_libs cudart cuda_driver cublas cufft cufftw curand cusolver cusparse)
+if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.1)
+ list(APPEND cuda_libs cublasLt)
+endif()
+if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11)
+ list(APPEND cuda_libs nvgraph)
+endif()
-foreach (cuda_lib cudart cuda_driver cublas cufft cufftw curand cusolver cusparse nvgraph)
+# Verify that all the CUDA:: targets exist even when the CUDA language isn't enabled
+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 "The CUDA::${cuda_lib} target was expected but couldn't be found")
+ message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found")
endif()
endforeach()
-foreach (cuda_lib nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppicom nppisu)
+set(npp_libs nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppisu)
+if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11)
+ list(APPEND npp_libs nppicom)
+endif()
+foreach (cuda_lib IN LISTS npp_libs)
if(NOT TARGET CUDA::${cuda_lib})
message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found")
endif()
diff --git a/Tests/Cuda/WithC/CMakeLists.txt b/Tests/Cuda/WithC/CMakeLists.txt
index 69aa3f992..049cbce1f 100644
--- a/Tests/Cuda/WithC/CMakeLists.txt
+++ b/Tests/Cuda/WithC/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7)
project(WithC CUDA C)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_executable(CudaWithC main.c cuda.cu)
diff --git a/Tests/CudaOnly/Architecture/CMakeLists.txt b/Tests/CudaOnly/Architecture/CMakeLists.txt
new file mode 100644
index 000000000..03e972fca
--- /dev/null
+++ b/Tests/CudaOnly/Architecture/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.18)
+project(Architecture CUDA)
+
+add_executable(Architecture main.cu)
+set_property(TARGET Architecture PROPERTY CUDA_ARCHITECTURES 52)
+
+# Make sure CMake doesn't pass architectures if CUDA_ARCHITECTURES is OFF.
+if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
+ set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=sm_52")
+elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
+ set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --cuda-gpu-arch=sm_52")
+endif()
+
+add_executable(ArchitectureOff main.cu)
+set_property(TARGET ArchitectureOff PROPERTY CUDA_ARCHITECTURES OFF)
diff --git a/Tests/CudaOnly/Architecture/main.cu b/Tests/CudaOnly/Architecture/main.cu
new file mode 100644
index 000000000..8c817d5a0
--- /dev/null
+++ b/Tests/CudaOnly/Architecture/main.cu
@@ -0,0 +1,9 @@
+#ifdef __CUDA_ARCH__
+# if __CUDA_ARCH__ != 520
+# error "Passed architecture 52, but got something else."
+# endif
+#endif
+
+int main()
+{
+}
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 3e3e44c7b..7376a73d7 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -1,37 +1,54 @@
+macro (add_cuda_test_macro name)
+ add_test_macro("${name}" ${ARGN})
+ set_property(TEST "${name}" APPEND
+ PROPERTY LABELS "CUDA")
+endmacro ()
-ADD_TEST_MACRO(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine)
-ADD_TEST_MACRO(CudaOnly.EnableStandard CudaOnlyEnableStandard)
-ADD_TEST_MACRO(CudaOnly.ExportPTX CudaOnlyExportPTX)
-ADD_TEST_MACRO(CudaOnly.GPUDebugFlag CudaOnlyGPUDebugFlag)
-ADD_TEST_MACRO(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
-ADD_TEST_MACRO(CudaOnly.SeparateCompilation CudaOnlySeparateCompilation)
-ADD_TEST_MACRO(CudaOnly.SharedRuntimePlusToolkit CudaOnlySharedRuntimePlusToolkit)
-ADD_TEST_MACRO(CudaOnly.SharedRuntimeViaCUDAFlags CudaOnlySharedRuntimeViaCUDAFlags)
-ADD_TEST_MACRO(CudaOnly.Standard98 CudaOnlyStandard98)
-ADD_TEST_MACRO(CudaOnly.Toolkit CudaOnlyToolkit)
-ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs)
+add_cuda_test_macro(CudaOnly.Architecture Architecture)
+add_cuda_test_macro(CudaOnly.CompileFlags CudaOnlyCompileFlags)
+add_cuda_test_macro(CudaOnly.EnableStandard CudaOnlyEnableStandard)
+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.WithDefs CudaOnlyWithDefs)
+
+if(CMake_TEST_CUDA AND NOT CMake_TEST_CUDA STREQUAL "Clang")
+ add_cuda_test_macro(CudaOnly.SharedRuntimeViaCUDAFlags CudaOnlySharedRuntimeViaCUDAFlags)
+
+ # Separable compilation is currently only supported on NVCC. Disable tests
+ # using it for other compilers.
+ add_cuda_test_macro(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine)
+ add_cuda_test_macro(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
+ add_cuda_test_macro(CudaOnly.SeparateCompilation CudaOnlySeparateCompilation)
+
+ add_test(NAME CudaOnly.DontResolveDeviceSymbols COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/DontResolveDeviceSymbols/"
+ "${CMAKE_CURRENT_BINARY_DIR}/DontResolveDeviceSymbols/"
+ ${build_generator_args}
+ --build-project DontResolveDeviceSymbols
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ set_property(TEST "CudaOnly.DontResolveDeviceSymbols" APPEND
+ PROPERTY LABELS "CUDA")
+
+ # Only NVCC defines __CUDACC_DEBUG__ when compiling in debug mode.
+ add_cuda_test_macro(CudaOnly.GPUDebugFlag CudaOnlyGPUDebugFlag)
+endif()
# The CUDA only ships the shared version of the toolkit libraries
# on windows
if(NOT WIN32)
- ADD_TEST_MACRO(Cuda.StaticRuntimePlusToolkit StaticRuntimePlusToolkit)
+ add_cuda_test_macro(CudaOnly.StaticRuntimePlusToolkit CudaOnlyStaticRuntimePlusToolkit)
endif()
if(MSVC)
- ADD_TEST_MACRO(CudaOnly.PDB CudaOnlyPDB)
+ add_cuda_test_macro(CudaOnly.PDB CudaOnlyPDB)
endif()
-add_test(NAME CudaOnly.DontResolveDeviceSymbols COMMAND
- ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
- --build-and-test
- "${CMAKE_CURRENT_SOURCE_DIR}/DontResolveDeviceSymbols/"
- "${CMAKE_CURRENT_BINARY_DIR}/DontResolveDeviceSymbols/"
- ${build_generator_args}
- --build-project DontResolveDeviceSymbols
- --build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
- )
-
add_test(NAME CudaOnly.RuntimeControls COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
@@ -43,3 +60,5 @@ add_test(NAME CudaOnly.RuntimeControls COMMAND
--build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+set_property(TEST "CudaOnly.RuntimeControls" APPEND
+ PROPERTY LABELS "CUDA")
diff --git a/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt b/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt
index 5e6f7abc6..e10a34873 100644
--- a/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt
+++ b/Tests/CudaOnly/CircularLinkLine/CMakeLists.txt
@@ -5,9 +5,9 @@ project (CircularLinkLine CUDA)
# Verify that we de-duplicate the device link line
# Verify that a de-duplicated link line still works with circular static libraries
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30]")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30)
add_library(CUDACircularDeviceLinking1 STATIC file1.cu)
add_library(CUDACircularDeviceLinking2 STATIC file2.cu)
diff --git a/Tests/CudaOnly/CompileFlags/CMakeLists.txt b/Tests/CudaOnly/CompileFlags/CMakeLists.txt
new file mode 100644
index 000000000..5e8a8e40f
--- /dev/null
+++ b/Tests/CudaOnly/CompileFlags/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.17)
+project(CompileFlags CUDA)
+
+add_executable(CudaOnlyCompileFlags main.cu)
+
+# Try passing CUDA architecture flags explicitly.
+if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
+ target_compile_options(CudaOnlyCompileFlags PRIVATE
+ -gencode arch=compute_50,code=compute_50
+ )
+else()
+ set_property(TARGET CudaOnlyCompileFlags PROPERTY CUDA_ARCHITECTURES 50-real)
+endif()
+
+target_compile_options(CudaOnlyCompileFlags PRIVATE -DALWAYS_DEFINE)
diff --git a/Tests/CudaOnly/CompileFlags/main.cu b/Tests/CudaOnly/CompileFlags/main.cu
new file mode 100644
index 000000000..999c0562a
--- /dev/null
+++ b/Tests/CudaOnly/CompileFlags/main.cu
@@ -0,0 +1,13 @@
+#ifdef __CUDA_ARCH__
+# if __CUDA_ARCH__ != 500
+# error "Passed architecture 50, but got something else."
+# endif
+#endif
+
+#ifndef ALWAYS_DEFINE
+# error "ALWAYS_DEFINE not defined!"
+#endif
+
+int main()
+{
+}
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
index 6e3697fe5..126566035 100644
--- a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
@@ -24,9 +24,9 @@ endif()
# Don't resolve the device symbols in the static library
# Don't resolve the device symbols in the executable library
# Verify that we can't use those device symbols from anything
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30 50)
set(CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
add_library(CUDANoDeviceResolve SHARED file1.cu)
diff --git a/Tests/CudaOnly/ExportPTX/CMakeLists.txt b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
index ff6e77c33..ee5f54d02 100644
--- a/Tests/CudaOnly/ExportPTX/CMakeLists.txt
+++ b/Tests/CudaOnly/ExportPTX/CMakeLists.txt
@@ -34,16 +34,15 @@ static std::string ptx_paths = "$<TARGET_OBJECTS:CudaPTX>";
# need to also pass the --name option
set(output_file ${CMAKE_CURRENT_BINARY_DIR}/embedded_objs.h)
-get_filename_component(cuda_compiler_bin "${CMAKE_CUDA_COMPILER}" DIRECTORY)
+find_package(CUDAToolkit REQUIRED)
find_program(bin_to_c
NAMES bin2c
- PATHS ${cuda_compiler_bin}
+ PATHS ${CUDAToolkit_BIN_DIR}
)
if(NOT bin_to_c)
message(FATAL_ERROR
"bin2c not found:\n"
- " CMAKE_CUDA_COMPILER='${CMAKE_CUDA_COMPILER}'\n"
- " cuda_compiler_bin='${cuda_compiler_bin}'\n"
+ " CUDAToolkit_BIN_DIR='${CUDAToolkit_BIN_DIR}'\n"
)
endif()
diff --git a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
index fbef15f9e..6675655cf 100644
--- a/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
+++ b/Tests/CudaOnly/GPUDebugFlag/CMakeLists.txt
@@ -2,18 +2,19 @@
cmake_minimum_required(VERSION 3.7)
project (GPUDebugFlag CUDA)
-#Goal for this example:
-#verify that -G enables gpu debug flags
-string(APPEND CMAKE_CUDA_FLAGS " -gencode=arch=compute_30,code=compute_30")
-string(APPEND CMAKE_CUDA_FLAGS " -G")
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30)
+
+# Goal for this example:
+# Verify that enabling device debug works.
+string(APPEND CMAKE_CUDA_FLAGS " -G")
add_executable(CudaOnlyGPUDebugFlag main.cu)
+#CUDA's __CUDACC_DEBUG__ define was added in NVCC 9.0
+#so if we are below 9.0.0 we will manually add the define so that the test
+#passes
if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 9.0.0)
- #CUDA's __CUDACC_DEBUG__ define was added in 9.0
- #so if we are below 9.0.0 we will manually add the define so that the test
- #passes
target_compile_definitions(CudaOnlyGPUDebugFlag PRIVATE "__CUDACC_DEBUG__")
endif()
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
index 57aa0b9e8..bd94ec813 100644
--- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
@@ -21,7 +21,7 @@ endif()
# confirming that the first static library is on the device link line
# 3. Verify that we can't use those device symbols from anything that links
# to the static library
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[sm_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
+set(CMAKE_CUDA_ARCHITECTURES 30 50)
add_library(CUDAResolveDeviceDepsA STATIC file1.cu)
add_library(CUDAResolveDeviceDepsB STATIC file2.cu)
diff --git a/Tests/CudaOnly/RuntimeControls/CMakeLists.txt b/Tests/CudaOnly/RuntimeControls/CMakeLists.txt
index 8b58fecfa..0da57390b 100644
--- a/Tests/CudaOnly/RuntimeControls/CMakeLists.txt
+++ b/Tests/CudaOnly/RuntimeControls/CMakeLists.txt
@@ -15,9 +15,8 @@ else()
endif()
endif()
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30]")
-
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_ARCHITECTURES 30)
set(CMAKE_CUDA_RUNTIME_LIBRARY static)
if(NOT "x${CMAKE_CUDA_SIMULATE_ID}" STREQUAL "xMSVC")
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
index c1bd64aac..586be81ff 100644
--- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
+++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
@@ -9,9 +9,7 @@ project (SeparateCompilation CUDA)
#and executables.
#We complicate the matter by also testing that multiple static libraries
#all containing cuda separable compilation code links properly
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=\\\"compute_30,sm_30,sm_35\\\"")
-string(APPEND CMAKE_CUDA_FLAGS " --generate-code=arch=compute_50,code=[compute_50,sm_50,sm_52]")
-
+set(CMAKE_CUDA_ARCHITECTURES 30 35 50 52)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
add_library(CUDASeparateLibA STATIC file1.cu file2.cu file3.cu)
target_compile_features(CUDASeparateLibA PRIVATE cuda_std_11)
diff --git a/Tests/CudaOnly/Standard98/CMakeLists.txt b/Tests/CudaOnly/Standard98/CMakeLists.txt
index ef9a68536..3ba036095 100644
--- a/Tests/CudaOnly/Standard98/CMakeLists.txt
+++ b/Tests/CudaOnly/Standard98/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.7)
project(CudaOnlyStandard98 CUDA)
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+set(CMAKE_CUDA_ARCHITECTURES 30)
# Support setting CUDA Standard to 98 which internally gets transformed to
# CUDA03
diff --git a/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt b/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt
index 97ac229b5..708a352c6 100644
--- a/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt
+++ b/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt
@@ -27,3 +27,9 @@ set_target_properties(MixedToolkit PROPERTIES CUDA_RUNTIME_LIBRARY Static)
add_executable(CudaOnlyStaticRuntimePlusToolkit main.cu)
target_link_libraries(CudaOnlyStaticRuntimePlusToolkit PRIVATE SharedToolkit StaticToolkit MixedToolkit)
+
+if(UNIX)
+ # Help the shared cuda runtime find libcurand and libnppif when they are not located
+ # in a default system searched location
+ set_property(TARGET CudaOnlyStaticRuntimePlusToolkit PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt
index 0d5d574a5..bb06ba8d3 100644
--- a/Tests/CudaOnly/Toolkit/CMakeLists.txt
+++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt
@@ -11,8 +11,17 @@ message(STATUS "CUDAToolkit_INCLUDE_DIRS: ${CUDAToolkit_INCLUDE_DIRS}")
message(STATUS "CUDAToolkit_LIBRARY_DIR: ${CUDAToolkit_LIBRARY_DIR}")
message(STATUS "CUDAToolkit_NVCC_EXECUTABLE ${CUDAToolkit_NVCC_EXECUTABLE}")
+
+set(cuda_libs cudart cuda_driver cublas cufft cufftw curand cusolver cusparse)
+if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 10.1)
+ list(APPEND cuda_libs cublasLt)
+endif()
+if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11)
+ list(APPEND cuda_libs nvgraph)
+endif()
+
# Verify that all the CUDA:: targets and variables exist
-foreach (cuda_lib cudart cuda_driver cublas cufft cufftw curand cusolver cusparse nvgraph)
+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()
@@ -21,7 +30,11 @@ foreach (cuda_lib cudart cuda_driver cublas cufft cufftw curand cusolver cuspars
endif()
endforeach()
-foreach (cuda_lib nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppicom nppisu)
+set(npp_libs nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppisu)
+if(CUDAToolkit_VERSION_MAJOR VERSION_LESS 11)
+ list(APPEND npp_libs nppicom)
+endif()
+foreach (cuda_lib )
if(NOT CUDA_${cuda_lib}_LIBRARY)
message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
endif()
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index ba9bf0481..0ed81d89d 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -3,17 +3,7 @@ cmake_minimum_required(VERSION 3.7)
project (WithDefs CUDA)
#verify that we can pass explicit cuda arch flags
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
-if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 9)
- set(debug_compile_flags --generate-code arch=compute_32,code=sm_32)
-else()
- set(debug_compile_flags --generate-code arch=compute_20,code=sm_20)
-endif()
-if(CMAKE_CUDA_SIMULATE_ID STREQUAL "MSVC")
- list(APPEND debug_compile_flags -Xcompiler=-WX)
-else()
- list(APPEND debug_compile_flags -Xcompiler=-Werror)
-endif()
+set(CMAKE_CUDA_ARCHITECTURES 30)
set(release_compile_defs DEFREL)
#Goal for this example:
@@ -28,8 +18,7 @@ target_compile_options(CudaOnlyWithDefs
PRIVATE
-DFLAG_COMPILE_LANG_$<COMPILE_LANGUAGE>
-DFLAG_LANG_IS_CUDA=$<COMPILE_LANGUAGE:CUDA>
- --compiler-options=-DHOST_DEFINE
- $<$<CONFIG:DEBUG>:$<BUILD_INTERFACE:${debug_compile_flags}>>
+ $<$<CUDA_COMPILER_ID:NVIDIA>:--compiler-options=-DHOST_DEFINE> # Host-only defines are possible only on NVCC.
)
target_compile_definitions(CudaOnlyWithDefs
diff --git a/Tests/CudaOnly/WithDefs/main.notcu b/Tests/CudaOnly/WithDefs/main.notcu
index a5f4ed652..9119eba11 100644
--- a/Tests/CudaOnly/WithDefs/main.notcu
+++ b/Tests/CudaOnly/WithDefs/main.notcu
@@ -7,8 +7,10 @@
# error "INC_CUDA not defined!"
#endif
-#ifndef HOST_DEFINE
-# error "HOST_DEFINE not defined!"
+#ifdef __NVCC__
+# ifndef HOST_DEFINE
+# error "HOST_DEFINE not defined!"
+# endif
#endif
#ifndef PACKED_DEFINE
diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt
index e62f3c797..8207dd166 100644
--- a/Tests/CxxOnly/CMakeLists.txt
+++ b/Tests/CxxOnly/CMakeLists.txt
@@ -5,7 +5,7 @@ set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix")
if(WIN32)
set(EXTRA_SRCS test.CPP)
endif()
-add_library(testcxx1.my STATIC libcxx1.cxx ${EXTRA_SRCS})
+add_library(testcxx1.my STATIC libcxx1.cxx test.C ${EXTRA_SRCS})
add_library(testcxx2 SHARED libcxx2.cxx)
add_executable (CxxOnly cxxonly.cxx)
target_link_libraries(CxxOnly testcxx1.my testcxx2)
diff --git a/Tests/CxxOnly/cxxonly.cxx b/Tests/CxxOnly/cxxonly.cxx
index 0911a075a..8bd16379c 100644
--- a/Tests/CxxOnly/cxxonly.cxx
+++ b/Tests/CxxOnly/cxxonly.cxx
@@ -1,5 +1,6 @@
#include "libcxx1.h"
#include "libcxx2.h"
+extern int testC;
#ifdef _MSC_VER
extern int testCPP;
#endif
@@ -8,6 +9,7 @@ extern int testCPP;
int main()
{
+ testC = 1;
#ifdef _MSC_VER
testCPP = 1;
#endif
diff --git a/Tests/CxxOnly/test.C b/Tests/CxxOnly/test.C
new file mode 100644
index 000000000..e87e6c0cb
--- /dev/null
+++ b/Tests/CxxOnly/test.C
@@ -0,0 +1 @@
+int testC;
diff --git a/Tests/ExternalProjectUpdate/CMakeLists.txt b/Tests/ExternalProjectUpdate/CMakeLists.txt
index dbf26c8d0..9dddae207 100644
--- a/Tests/ExternalProjectUpdate/CMakeLists.txt
+++ b/Tests/ExternalProjectUpdate/CMakeLists.txt
@@ -78,6 +78,8 @@ if(do_git_tests)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
GIT_TAG ${TEST_GIT_TAG}
+ GIT_CONFIG "user.email=testauthor@cmake.org"
+ "user.name=testauthor"
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
diff --git a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
index 8ea44529b..ddc513f04 100644
--- a/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
+++ b/Tests/ExternalProjectUpdate/ExternalProjectUpdateTest.cmake
@@ -2,7 +2,7 @@
# resulting checked out version is resulting_sha and rebuild.
# This check's the correct behavior of the ExternalProject UPDATE_COMMAND.
# Also verify that a fetch only occurs when fetch_expected is 1.
-macro(check_a_tag desired_tag resulting_sha fetch_expected)
+macro(check_a_tag desired_tag resulting_sha fetch_expected update_strategy)
message( STATUS "Checking ExternalProjectUpdate to tag: ${desired_tag}" )
# Remove the FETCH_HEAD file, so we can check if it gets replaced with a 'git
@@ -10,11 +10,16 @@ macro(check_a_tag desired_tag resulting_sha fetch_expected)
set( FETCH_HEAD_file ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT/.git/FETCH_HEAD )
file( REMOVE ${FETCH_HEAD_file} )
+ # Give ourselves a marker in the output. It is difficult to tell where we
+ # are up to without this
+ message(STATUS "===> check_a_tag ${desired_tag} ${resulting_sha} ${fetch_expected} ${update_strategy}")
+
# Configure
execute_process(COMMAND ${CMAKE_COMMAND}
-G ${CMAKE_GENERATOR} -T "${CMAKE_GENERATOR_TOOLSET}"
-A "${CMAKE_GENERATOR_PLATFORM}"
-DTEST_GIT_TAG:STRING=${desired_tag}
+ -DCMAKE_EP_GIT_REMOTE_UPDATE_STRATEGY:STRING=${update_strategy}
${ExternalProjectUpdate_SOURCE_DIR}
WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}
RESULT_VARIABLE error_code
@@ -176,16 +181,55 @@ if(GIT_EXECUTABLE)
endif()
endif()
+# When re-running tests locally, this ensures we always start afresh
+file(REMOVE_RECURSE ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals)
+
if(do_git_tests)
- check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
- check_a_tag(tag1 d1970730310fe8bc07e73f15dc570071f9f9654a 1)
+ check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 REBASE)
+ check_a_tag(tag1 d1970730310fe8bc07e73f15dc570071f9f9654a 1 REBASE)
# With the Git UPDATE_COMMAND performance patch, this will not required a
# 'git fetch'
- check_a_tag(tag1 d1970730310fe8bc07e73f15dc570071f9f9654a 0)
- check_a_tag(tag2 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
- check_a_tag(d19707303 d1970730310fe8bc07e73f15dc570071f9f9654a 1)
- check_a_tag(d19707303 d1970730310fe8bc07e73f15dc570071f9f9654a 0)
- check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
+ 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)
# This is a remote symbolic ref, so it will always trigger a 'git fetch'
- check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1)
+ check_a_tag(origin/master 5842b503ba4113976d9bb28d57b5aee1ad2736b7 1 REBASE)
+
+ foreach(strategy IN ITEMS CHECKOUT REBASE_CHECKOUT)
+ # Move local master back, then apply a change that will cause a conflict
+ # during rebase
+ execute_process(COMMAND ${GIT_EXECUTABLE} checkout master
+ WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT
+ RESULT_VARIABLE error_code
+ )
+ if(error_code)
+ message(FATAL_ERROR "Could not reset local master back to tag1.")
+ endif()
+ execute_process(COMMAND ${GIT_EXECUTABLE} reset --hard tag1
+ WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT
+ RESULT_VARIABLE error_code
+ )
+ if(error_code)
+ message(FATAL_ERROR "Could not reset local master back to tag1.")
+ endif()
+
+ set(cmlFile ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT/CMakeLists.txt)
+ file(READ ${cmlFile} contents)
+ string(REPLACE "find TutorialConfig.h" "find TutorialConfig.h (conflict here)"
+ conflictingContent "${contents}"
+ )
+ file(WRITE ${cmlFile} "${conflictingContent}")
+ execute_process(COMMAND ${GIT_EXECUTABLE} commit -a -m "This should cause a conflict"
+ WORKING_DIRECTORY ${ExternalProjectUpdate_BINARY_DIR}/CMakeExternals/Source/TutorialStep1-GIT
+ RESULT_VARIABLE error_code
+ )
+ if(error_code)
+ 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})
+ endforeach()
+
endif()
diff --git a/Tests/FindBLAS/CMakeLists.txt b/Tests/FindBLAS/CMakeLists.txt
new file mode 100644
index 000000000..667195dd9
--- /dev/null
+++ b/Tests/FindBLAS/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindBLAS.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindBLAS/Test"
+ "${CMake_BINARY_DIR}/Tests/FindBLAS/Test"
+ ${build_generator_args}
+ --build-project TestFindBLAS
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindBLAS/Test/CMakeLists.txt b/Tests/FindBLAS/Test/CMakeLists.txt
new file mode 100644
index 000000000..59418f34a
--- /dev/null
+++ b/Tests/FindBLAS/Test/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindBLAS C)
+include(CTest)
+
+find_package(BLAS REQUIRED)
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt BLAS::BLAS)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_link_libraries(test_var PRIVATE ${BLAS_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindBLAS/Test/main.c b/Tests/FindBLAS/Test/main.c
new file mode 100644
index 000000000..7360deec6
--- /dev/null
+++ b/Tests/FindBLAS/Test/main.c
@@ -0,0 +1,14 @@
+#include <assert.h>
+#include <string.h>
+
+// declare what parts of the blas C-API we need
+void cblas_dswap(const int N, double* X, const int incX, double* Y,
+ const int incY);
+
+int main()
+{
+ double x[4] = { 1, 2, 3, 4 };
+ double y[4] = { 8, 7, 7, 6 };
+ cblas_dswap(4, x, 1, y, 1);
+ return 0;
+}
diff --git a/Tests/FindDoxygen/SimpleTest/CMakeLists.txt b/Tests/FindDoxygen/SimpleTest/CMakeLists.txt
index 332ceccdb..deec4fd89 100644
--- a/Tests/FindDoxygen/SimpleTest/CMakeLists.txt
+++ b/Tests/FindDoxygen/SimpleTest/CMakeLists.txt
@@ -22,6 +22,7 @@ else()
message(FATAL_ERROR "Import target Doxygen::doxygen not defined")
endif()
+set(DOXYGEN_OUTPUT_DIRECTORY noArgs)
doxygen_add_docs(docsNoArgs)
if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsNoArgs")
message(FATAL_ERROR "Missing generated file: Doxyfile.docsNoArgs")
@@ -30,6 +31,7 @@ if(NOT TARGET docsNoArgs)
message(FATAL_ERROR "Target docsNoArgs not created")
endif()
+set(DOXYGEN_OUTPUT_DIRECTORY withArgs)
configure_file(spaces_in_name.cpp.in "spaces in name.cpp" COPYONLY)
doxygen_add_docs(docsWithArgs
"${CMAKE_CURRENT_BINARY_DIR}/spaces in name.cpp"
diff --git a/Tests/FindDoxygen/StampFile/CMakeLists.txt b/Tests/FindDoxygen/StampFile/CMakeLists.txt
index 2d0654058..ed2bfbb39 100644
--- a/Tests/FindDoxygen/StampFile/CMakeLists.txt
+++ b/Tests/FindDoxygen/StampFile/CMakeLists.txt
@@ -3,22 +3,41 @@ project(TestFindDoxygen VERSION 1.0 LANGUAGES NONE)
find_package(Doxygen REQUIRED)
+set(DOXYGEN_OUTPUT_DIRECTORY noFiles)
doxygen_add_docs(docsWithoutFilesWithStamp USE_STAMP_FILE)
if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsWithoutFilesWithStamp")
- message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithoutFilesWithStamp")
+ message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithoutFilesWithStamp")
endif()
if(NOT TARGET docsWithoutFilesWithStamp)
- message(FATAL_ERROR "Target docsWithoutFilesWithStamp not created")
+ message(FATAL_ERROR "Target docsWithoutFilesWithStamp not created")
endif()
+set(DOXYGEN_OUTPUT_DIRECTORY withFiles)
doxygen_add_docs(docsWithFilesWithStamp main.cpp main2.cpp USE_STAMP_FILE)
if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsWithFilesWithStamp")
- message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithFilesWithStamp")
+ message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithFilesWithStamp")
endif()
if(NOT TARGET docsWithFilesWithStamp)
- message(FATAL_ERROR "Target docsWithFilesWithStamp not created")
+ message(FATAL_ERROR "Target docsWithFilesWithStamp not created")
endif()
+# Confirm that doxygen_add_docs() doesn't cause a fatal error if given a
+# source file that is generated at build time
+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/genDox.cpp)
+add_custom_command(OUTPUT genDox.cpp
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main2.cpp genDox.cpp
+ DEPENDS main2.cpp
+)
+set(DOXYGEN_OUTPUT_DIRECTORY withGenFiles)
+doxygen_add_docs(docsWithGenFilesWithStamp
+ main.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/genDox.cpp
+ USE_STAMP_FILE
+)
add_custom_target(allDocTargets)
-add_dependencies(allDocTargets docsWithoutFilesWithStamp docsWithFilesWithStamp)
+add_dependencies(allDocTargets
+ docsWithoutFilesWithStamp
+ docsWithFilesWithStamp
+ docsWithGenFilesWithStamp
+)
diff --git a/Tests/FindLAPACK/CMakeLists.txt b/Tests/FindLAPACK/CMakeLists.txt
new file mode 100644
index 000000000..2081d5924
--- /dev/null
+++ b/Tests/FindLAPACK/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindLAPACK.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindLAPACK/Test"
+ "${CMake_BINARY_DIR}/Tests/FindLAPACK/Test"
+ ${build_generator_args}
+ --build-project TestFindLAPACK
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindLAPACK/Test/CMakeLists.txt b/Tests/FindLAPACK/Test/CMakeLists.txt
new file mode 100644
index 000000000..8afa36a12
--- /dev/null
+++ b/Tests/FindLAPACK/Test/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindLAPACK C)
+include(CTest)
+
+find_package(LAPACK REQUIRED)
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt LAPACK::LAPACK)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_link_libraries(test_var PRIVATE ${LAPACK_LIBRARIES})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindLAPACK/Test/main.c b/Tests/FindLAPACK/Test/main.c
new file mode 100644
index 000000000..5873e7b47
--- /dev/null
+++ b/Tests/FindLAPACK/Test/main.c
@@ -0,0 +1,20 @@
+#include <assert.h>
+#include <string.h>
+
+// declare what parts of the lapack C-API we need
+void dgesv_(int*, int*, double*, int*, int*, double*, int*, int*);
+
+int main()
+{
+ double A[8] = {
+ 0, 1, 2, 3, 4, 5, 6, 7,
+ };
+ double B[2] = { 0, 5 };
+ int ipiv[2] = { 0, 0 };
+ int info = 0;
+
+ int dim = 2;
+ int numCols = 1;
+ dgesv_(&dim, &numCols, A, &dim, ipiv, B, &dim, &info);
+ return 0;
+}
diff --git a/Tests/FindLibXslt/CMakeLists.txt b/Tests/FindLibXslt/CMakeLists.txt
new file mode 100644
index 000000000..8a550b2ef
--- /dev/null
+++ b/Tests/FindLibXslt/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindLibXslt.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindLibXslt/Test"
+ "${CMake_BINARY_DIR}/Tests/FindLibXslt/Test"
+ ${build_generator_args}
+ --build-project TestFindLibXslt
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+)
diff --git a/Tests/FindLibXslt/Test/CMakeLists.txt b/Tests/FindLibXslt/Test/CMakeLists.txt
new file mode 100644
index 000000000..e93266138
--- /dev/null
+++ b/Tests/FindLibXslt/Test/CMakeLists.txt
@@ -0,0 +1,45 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindLibXslt C)
+include(CTest)
+
+find_package(Iconv)
+find_package(LibXml2 REQUIRED)
+find_package(LibXslt REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_LibXslt_VERSION="${LIBXSLT_VERSION_STRING}")
+
+add_executable(libxslt_tgt libxslt.c)
+if(Iconv_FOUND)
+ target_link_libraries(libxslt_tgt Iconv::Iconv)
+endif()
+target_link_libraries(libxslt_tgt LibXml2::LibXml2 LibXslt::LibXslt)
+add_test(NAME libxslt_tgt COMMAND libxslt_tgt)
+
+add_executable(libxslt_var libxslt.c)
+if(Iconv_FOUND)
+ target_include_directories(libxslt_var PRIVATE ${Iconv_INCLUDE_DIRS})
+ target_link_libraries(libxslt_var PRIVATE ${Iconv_LIBRARIES})
+endif()
+target_include_directories(libxslt_var PRIVATE ${LIBXML2_INCLUDE_DIRS} ${LIBXSLT_INCLUDE_DIR})
+target_link_libraries(libxslt_var PRIVATE ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES})
+add_test(NAME libxslt_var COMMAND libxslt_var)
+
+add_executable(libexslt_tgt libexslt.c)
+if(Iconv_FOUND)
+ target_link_libraries(libexslt_tgt Iconv::Iconv)
+endif()
+target_link_libraries(libexslt_tgt LibXml2::LibXml2 LibXslt::LibXslt LibXslt::LibExslt)
+add_test(NAME libexslt_tgt COMMAND libexslt_tgt)
+
+add_executable(libexslt_var libexslt.c)
+if(Iconv_FOUND)
+ target_include_directories(libexslt_var PRIVATE ${Iconv_INCLUDE_DIRS})
+ target_link_libraries(libexslt_var PRIVATE ${Iconv_LIBRARIES})
+endif()
+target_include_directories(libexslt_var PRIVATE ${LIBXML2_INCLUDE_DIRS} ${LIBXSLT_INCLUDE_DIR} ${LIBXSLT_EXSLT_INCLUDE_DIR})
+target_link_libraries(libexslt_var PRIVATE ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${LIBXSLT_EXSLT_LIBRARIES})
+add_test(NAME libexslt_var COMMAND libexslt_var)
+
+add_test(NAME xsltproc_tgt COMMAND LibXslt::xsltproc --version)
+
+add_test(NAME xsltproc_var COMMAND ${LIBXSLT_XSLTPROC_EXECUTABLE} --version)
diff --git a/Tests/FindLibXslt/Test/libexslt.c b/Tests/FindLibXslt/Test/libexslt.c
new file mode 100644
index 000000000..ea6eb3dfe
--- /dev/null
+++ b/Tests/FindLibXslt/Test/libexslt.c
@@ -0,0 +1,16 @@
+#include <libexslt/exslt.h>
+#include <libxslt/xslt.h>
+#include <libxslt/xsltInternals.h>
+
+int main()
+{
+ xsltInit();
+
+ xsltStylesheet* style = xsltNewStylesheet();
+ exsltRegisterAll();
+ xsltFreeStylesheet(style);
+
+ xsltCleanupGlobals();
+
+ return 0;
+}
diff --git a/Tests/FindLibXslt/Test/libxslt.c b/Tests/FindLibXslt/Test/libxslt.c
new file mode 100644
index 000000000..5b3d7661c
--- /dev/null
+++ b/Tests/FindLibXslt/Test/libxslt.c
@@ -0,0 +1,24 @@
+#include <libxslt/xslt.h>
+#include <libxslt/xsltInternals.h>
+#include <libxslt/xsltconfig.h>
+#include <stdio.h>
+#include <string.h>
+
+int main()
+{
+ xsltInit();
+
+ xsltStylesheet* style = xsltNewStylesheet();
+ xsltFreeStylesheet(style);
+
+ if (0 != strcmp(CMAKE_EXPECTED_LibXslt_VERSION, LIBXSLT_DOTTED_VERSION)) {
+ printf("CMAKE_EXPECTED_LibXslt_VERSION: '%s'\n",
+ CMAKE_EXPECTED_LibXslt_VERSION);
+ printf("LIBXSLT_DOTTED_VERSION: '%s'\n", LIBXSLT_DOTTED_VERSION);
+ return 1;
+ }
+
+ xsltCleanupGlobals();
+
+ return 0;
+}
diff --git a/Tests/FindModulesExecuteAll/CMakeLists.txt b/Tests/FindModulesExecuteAll/CMakeLists.txt
deleted file mode 100644
index 4893bb335..000000000
--- a/Tests/FindModulesExecuteAll/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# This file includes all FindXXX.cmake modules, so they are all executed.
-# As it is it doesn't test a lot.
-# It makes sure that the modules don't contain basic syntax errors.
-# It also makes sure that modules don't fail with an error if something
-# wasn't found but REQUIRED was not given.
-#
-# I guess more things could be added, like checking whether variables are
-# defined after running the modules (e.g. FOO_FOUND etc.).
-cmake_minimum_required(VERSION 2.8.4) # new enough for CMP0017
-project(FindModulesExecuteAll)
-
-file(GLOB all_modules "${CMAKE_CURRENT_SOURCE_DIR}/../../Modules/Find*cmake")
-
-foreach(module ${all_modules})
- message(STATUS "module: ${module}")
- include("${module}")
-
- # get the "basename" of the package, so the existence of variables like
- # FOO_FOUND could be tested later on, Alex
- string(REGEX REPLACE ".+Find([^\\.]+)\\.cmake" "\\1" packageName "${module}")
- string(TOUPPER "${packageName}" packageNameUpper)
-
-# disabled for now, since too many modules break:
-# if(NOT DEFINED ${packageNameUpper}_FOUND)
-# message(SEND_ERROR "${packageNameUpper}_FOUND not defined !")
-# endif()
-
-endforeach()
-
-add_executable(FindModulesExecuteAll main.c)
diff --git a/Tests/FindModulesExecuteAll/main.c b/Tests/FindModulesExecuteAll/main.c
deleted file mode 100644
index f8b643afb..000000000
--- a/Tests/FindModulesExecuteAll/main.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int main()
-{
- return 0;
-}
diff --git a/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt
new file mode 100644
index 000000000..524be9205
--- /dev/null
+++ b/Tests/FindPython/ArtifactsInteractive/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestArtifactsInteractive LANGUAGES C)
+
+set (components Interpreter Development)
+if (CMake_TEST_FindPython_NumPy)
+ list (APPEND components NumPy)
+endif()
+
+find_package(Python3 REQUIRED COMPONENTS ${components})
+
+if (Python3_ARTIFACTS_INTERACTIVE)
+ if (NOT DEFINED CACHE{Python3_EXECUTABLE}
+ OR NOT DEFINED CACHE{Python3_LIBRARY} OR NOT DEFINED CACHE{Python3_INCLUDE_DIR}
+ OR (CMake_TEST_FindPython_NumPy AND NOT DEFINED CACHE{Python3_NumPy_INCLUDE_DIR}))
+ message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=ON Failed.")
+ endif()
+else()
+ if (DEFINED CACHE{Python3_EXECUTABLE}
+ OR DEFINED CACHE{Python3_LIBRARY} OR DEFINED CACHE{Python3_INCLUDE_DIR}
+ OR (CMake_TEST_FindPython_NumPy AND DEFINED CACHE{Python3_NumPy_INCLUDE_DIR}))
+ message (FATAL_ERROR "Python3_ARTIFACTS_INTERACTIVE=OFF Failed.")
+ endif()
+endif()
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 9b8983227..fdfa36ebd 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -20,6 +20,17 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ add_test(NAME FindPython.Python2.Development.Module COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python2Module"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python2Module"
+ ${build_generator_args}
+ --build-project TestPython2Module
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
add_test(NAME FindPython.Python2Fail COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
@@ -54,6 +65,17 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ add_test(NAME FindPython.Python3.Development.Module COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Python3Module"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Python3Module"
+ ${build_generator_args}
+ --build-project TestPython3Module
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
add_test(NAME FindPython.Python3Fail COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
@@ -277,6 +299,35 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ add_test(NAME FindPython.ArtifactsInteractive.ON COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
+ "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.ON"
+ ${build_generator_args}
+ --build-project TestArtifactsScope
+ --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
+ "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
+ "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+ "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
+ "-DPython3_ARTIFACTS_INTERACTIVE=ON"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.ArtifactsInteractive.OFF COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/ArtifactsInteractive"
+ "${CMake_BINARY_DIR}/Tests/FindPython/ArtifactsInteractive.OFF"
+ ${build_generator_args}
+ --build-project TestArtifactsScope
+ --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
+ "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
+ "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+ "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
+ "-DPython3_ARTIFACTS_INTERACTIVE=OFF"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
add_test(NAME FindPython.CustomFailureMessage COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
--build-and-test
@@ -340,7 +391,6 @@ if(CMake_TEST_FindPython_NumPy)
${build_generator_args}
--build-project TestNumPyOnly
--build-options ${build_options}
- --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
endif()
@@ -357,6 +407,29 @@ if(CMake_TEST_FindPython_Conda)
)
endif()
+if (CMake_TEST_FindPython AND CMake_TEST_FindPython_IronPython)
+ add_test(NAME FindPython.Implementation.CPython COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.CPython"
+ ${build_generator_args}
+ --build-project TestImplementationCPython
+ --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATIONS=CPython
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.Implementation.IronPython COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/Implementation"
+ "${CMake_BINARY_DIR}/Tests/FindPython/Implementation.IronPython"
+ ${build_generator_args}
+ --build-project TestImplementationIronPython
+ --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_REQUESTED_IMPLEMENTATION=IronPython
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+endif()
+
if(CMake_TEST_FindPython_IronPython)
add_test(NAME FindPython.IronPython2.LOCATION COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
@@ -420,3 +493,108 @@ if(CMake_TEST_FindPython_IronPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
endif()
+
+if(CMake_TEST_FindPython_PyPy)
+ add_test(NAME FindPython.PyPy2.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.LOCATION"
+ ${build_generator_args}
+ --build-project TestPyPy2
+ --build-options ${build_options} -DPython2_FIND_STRATEGY=LOCATION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.PyPy2.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy2"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy2.VERSION"
+ ${build_generator_args}
+ --build-project TestPyPy2
+ --build-options ${build_options} -DPython2_FIND_STRATEGY=VERSION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+ add_test(NAME FindPython.PyPy3.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.LOCATION"
+ ${build_generator_args}
+ --build-project TestPyPy3
+ --build-options ${build_options} -DPython3_FIND_STRATEGY=LOCATION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.PyPy3.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy3"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy3.VERSION"
+ ${build_generator_args}
+ --build-project TestPyPy3
+ --build-options ${build_options} -DPython3_FIND_STRATEGY=VERSION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+ add_test(NAME FindPython.PyPy.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.LOCATION"
+ ${build_generator_args}
+ --build-project TestPyPy
+ --build-options ${build_options} -DPython_FIND_STRATEGY=LOCATION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.PyPy.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.VERSION"
+ ${build_generator_args}
+ --build-project TestPyPy
+ --build-options ${build_options} -DPython_FIND_STRATEGY=VERSION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.PyPy.V2.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.LOCATION"
+ ${build_generator_args}
+ --build-project TestPyPy
+ --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=LOCATION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.PyPy.V2.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V2.VERSION"
+ ${build_generator_args}
+ --build-project TestPyPy
+ --build-options ${build_options} -DPython_REQUESTED_VERSION=2 -DPython_FIND_STRATEGY=VERSION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.PyPy.V3.LOCATION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.LOCATION"
+ ${build_generator_args}
+ --build-project TestPyPy
+ --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=LOCATION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.PyPy.V3.VERSION COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/PyPy"
+ "${CMake_BINARY_DIR}/Tests/FindPython/PyPy.V3.VERSION"
+ ${build_generator_args}
+ --build-project TestPyPy
+ --build-options ${build_options} -DPython_REQUESTED_VERSION=3 -DPython_FIND_STRATEGY=VERSION
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+endif()
diff --git a/Tests/FindPython/Implementation/CMakeLists.txt b/Tests/FindPython/Implementation/CMakeLists.txt
new file mode 100644
index 000000000..d64fa1edd
--- /dev/null
+++ b/Tests/FindPython/Implementation/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestImplementation${Python_REQUESTED_IMPLEMENTATION} C)
+
+
+set (Python${Python_REQUESTED_VERSION}_FIND_IMPLEMENTATIONS ${Python_REQUESTED_IMPLEMENTATION})
+
+find_package(Python${Python_REQUESTED_VERSION} COMPONENTS Interpreter)
+if (NOT Python${Python_REQUESTED_VERSION}_FOUND OR NOT Python${Python_REQUESTED_VERSION}_Interpreter_FOUND)
+ message (FATAL_ERROR "Fail to found Python${Python_REQUESTED_VERSION}")
+endif()
+
+if (Python_REQUESTED_IMPLEMENTATION STREQUAL "IronPython"
+ AND NOT Python${Python_REQUESTED_VERSION}_INTERPRETER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python${Python_REQUESTED_VERSION}_INTERPRETER_ID})")
+endif()
+if (Python_REQUESTED_IMPLEMENTATION STREQUAL "CPython"
+ AND Python${Python_REQUESTED_VERSION}_INTERPRETER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python${Python_REQUESTED_VERSION}_INTERPRETER_ID})")
+endif()
+
+
+set (Python_FIND_IMPLEMENTATIONS ${Python_REQUESTED_IMPLEMENTATION})
+
+find_package(Python ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter)
+if (NOT Python_FOUND OR NOT Python_Interpreter_FOUND)
+ message (FATAL_ERROR "Fail to found Python ${Python_REQUESTED_VERSION}")
+endif()
+
+if (Python_REQUESTED_IMPLEMENTATION STREQUAL "IronPython"
+ AND NOT Python_INTERPRETER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
+endif()
+if (Python_REQUESTED_IMPLEMENTATION STREQUAL "CPython"
+ AND Python_INTERPRETER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
+endif()
diff --git a/Tests/FindPython/IronPython/CMakeLists.txt b/Tests/FindPython/IronPython/CMakeLists.txt
index c96a3e031..3493c29bb 100644
--- a/Tests/FindPython/IronPython/CMakeLists.txt
+++ b/Tests/FindPython/IronPython/CMakeLists.txt
@@ -2,11 +2,20 @@ cmake_minimum_required(VERSION 3.1)
project(TestIronPython C)
-find_package(Python ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter Compiler)
+set (Python_FIND_IMPLEMENTATIONS IronPython)
+
+find_package(Python ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Compiler)
if (NOT Python_FOUND)
message (FATAL_ERROR "Fail to found Python ${Python_REQUESTED_VERSION}")
endif()
+if (NOT Python_Interpreter_FOUND)
+ message (FATAL_ERROR "Fail to found Python Interpreter")
+endif()
+if (NOT Python_INTERPRETER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
+endif()
+
if (NOT Python_Compiler_FOUND)
message (FATAL_ERROR "Fail to found Python Compiler")
endif()
diff --git a/Tests/FindPython/IronPython2/CMakeLists.txt b/Tests/FindPython/IronPython2/CMakeLists.txt
index 43ec309f5..1db798cc2 100644
--- a/Tests/FindPython/IronPython2/CMakeLists.txt
+++ b/Tests/FindPython/IronPython2/CMakeLists.txt
@@ -2,11 +2,20 @@ cmake_minimum_required(VERSION 3.1)
project(TestIronPython2 C)
-find_package(Python2 REQUIRED COMPONENTS Interpreter Compiler)
+set (Python2_FIND_IMPLEMENTATIONS "IronPython")
+
+find_package(Python2 COMPONENTS Interpreter Compiler)
if (NOT Python2_FOUND)
message (FATAL_ERROR "Fail to found Python 2")
endif()
+if (NOT Python2_Interpreter_FOUND)
+ message (FATAL_ERROR "Fail to found Python 2 Interpreter")
+endif()
+if (NOT Python2_INTERPRETER_ID STREQUAL "IronPython")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python2_INTERPRETER_ID})")
+endif()
+
if (NOT Python2_Compiler_FOUND)
message (FATAL_ERROR "Fail to found Python 2 Compiler")
endif()
diff --git a/Tests/FindPython/PyPy/CMakeLists.txt b/Tests/FindPython/PyPy/CMakeLists.txt
new file mode 100644
index 000000000..b4ade8c92
--- /dev/null
+++ b/Tests/FindPython/PyPy/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestPyPy C)
+
+set (Python_FIND_IMPLEMENTATIONS PyPy)
+
+find_package(Python ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Development)
+if (NOT Python_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy ${Python_REQUESTED_VERSION}")
+endif()
+
+if (NOT Python_Interpreter_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy Interpreter")
+endif()
+if (NOT Python_INTERPRETER_ID STREQUAL "PyPy")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
+endif()
+
+if (NOT Python_Development.Module_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy ${Python_REQUESTED_VERSION} Development.Module")
+endif()
+if (NOT Python_Development.Embed_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy ${Python_REQUESTED_VERSION} Development.Embed")
+endif()
+if (NOT Python_Development_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy ${Python_REQUESTED_VERSION} Development")
+endif()
+
+if(NOT TARGET Python::Interpreter)
+ message(SEND_ERROR "Python::Interpreter not found")
+endif()
+if(NOT TARGET Python::Module)
+ message(SEND_ERROR "Python::Module not found")
+endif()
+if(NOT TARGET Python::Python)
+ message(SEND_ERROR "Python::Python not found")
+endif()
diff --git a/Tests/FindPython/PyPy2/CMakeLists.txt b/Tests/FindPython/PyPy2/CMakeLists.txt
new file mode 100644
index 000000000..2f0ddc9fe
--- /dev/null
+++ b/Tests/FindPython/PyPy2/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestPyPy2 C)
+
+set (Python2_FIND_IMPLEMENTATIONS "PyPy")
+
+find_package(Python2 COMPONENTS Interpreter Development)
+if (NOT Python2_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 2")
+endif()
+
+if (NOT Python2_Interpreter_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 2 Interpreter")
+endif()
+if (NOT Python2_INTERPRETER_ID STREQUAL "PyPy")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python2_INTERPRETER_ID})")
+endif()
+
+if (NOT Python2_Development.Module_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 2 Development.Module")
+endif()
+if (NOT Python2_Development.Embed_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 2 Development.Embed")
+endif()
+if (NOT Python2_Development_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 2 Development")
+endif()
+
+if(NOT TARGET Python2::Interpreter)
+ message(SEND_ERROR "Python2::Interpreter not found")
+endif()
+if(NOT TARGET Python2::Module)
+ message(SEND_ERROR "Python2::Module not found")
+endif()
+if(NOT TARGET Python2::Python)
+ message(SEND_ERROR "Python2::Python not found")
+endif()
diff --git a/Tests/FindPython/PyPy3/CMakeLists.txt b/Tests/FindPython/PyPy3/CMakeLists.txt
new file mode 100644
index 000000000..5562d5731
--- /dev/null
+++ b/Tests/FindPython/PyPy3/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestPyPy3 C)
+
+set (Python3_FIND_IMPLEMENTATIONS "PyPy")
+
+find_package(Python3 COMPONENTS Interpreter Development)
+if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 3")
+endif()
+
+if (NOT Python3_Interpreter_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 3 Interpreter")
+endif()
+if (NOT Python3_INTERPRETER_ID STREQUAL "PyPy")
+ message (FATAL_ERROR "Erroneous interpreter ID (${Python3_INTERPRETER_ID})")
+endif()
+
+if (NOT Python3_Development.Module_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 3 Development.Module")
+endif()
+if (NOT Python3_Development.Embed_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 3 Development.Embed")
+endif()
+if (NOT Python3_Development_FOUND)
+ message (FATAL_ERROR "Fail to found Python PyPy 3 Development")
+endif()
+
+if(NOT TARGET Python3::Interpreter)
+ message(SEND_ERROR "Python3::Interpreter not found")
+endif()
+if(NOT TARGET Python3::Module)
+ message(SEND_ERROR "Python3::Module not found")
+endif()
+if(NOT TARGET Python3::Python)
+ message(SEND_ERROR "Python3::Python not found")
+endif()
diff --git a/Tests/FindPython/Python/CMakeLists.txt b/Tests/FindPython/Python/CMakeLists.txt
index 3ee38e30b..e8828a2c1 100644
--- a/Tests/FindPython/Python/CMakeLists.txt
+++ b/Tests/FindPython/Python/CMakeLists.txt
@@ -8,6 +8,12 @@ find_package(Python ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter
if (NOT Python_FOUND)
message (FATAL_ERROR "Fail to found Python ${Python_REQUESTED_VERSION}")
endif()
+if (NOT Python_Development.Module_FOUND)
+ message (FATAL_ERROR "Fail to found Python ${Python_REQUESTED_VERSION}, COMPONENT 'Development.Module'")
+endif()
+if (NOT Python_Development.Embed_FOUND)
+ message (FATAL_ERROR "Fail to found Python ${Python_REQUESTED_VERSION}, COMPOENENT 'Development.Embed'")
+endif()
if(NOT TARGET Python::Interpreter)
message(SEND_ERROR "Python::Interpreter not found")
diff --git a/Tests/FindPython/Python2/CMakeLists.txt b/Tests/FindPython/Python2/CMakeLists.txt
index cf77ca240..609d80f3f 100644
--- a/Tests/FindPython/Python2/CMakeLists.txt
+++ b/Tests/FindPython/Python2/CMakeLists.txt
@@ -13,6 +13,15 @@ find_package(Python2 REQUIRED COMPONENTS Interpreter Development)
if (NOT Python2_FOUND)
message (FATAL_ERROR "Fail to found Python 2")
endif()
+if (NOT Python2_Development_FOUND)
+ message (FATAL_ERROR "Fail to found Python 2 'Development' component")
+endif()
+if (NOT Python2_Development.Module_FOUND)
+ message (FATAL_ERROR "Fail to found Python 2 'Development.Module' component")
+endif()
+if (NOT Python2_Development.Embed_FOUND)
+ message (FATAL_ERROR "Fail to found Python 2 'Development.Embed' component")
+endif()
if(NOT TARGET Python2::Interpreter)
message(SEND_ERROR "Python2::Interpreter not found")
diff --git a/Tests/FindPython/Python2Embedded/CMakeLists.txt b/Tests/FindPython/Python2Embedded/CMakeLists.txt
index 0115deaa3..1cf6034d5 100644
--- a/Tests/FindPython/Python2Embedded/CMakeLists.txt
+++ b/Tests/FindPython/Python2Embedded/CMakeLists.txt
@@ -4,10 +4,23 @@ project(TestPython2Embedded C)
include(CTest)
-find_package(Python2 REQUIRED COMPONENTS Development)
+find_package(Python2 REQUIRED COMPONENTS Development.Embed)
if (NOT Python2_FOUND)
message (FATAL_ERROR "Fail to found Python 2")
endif()
+if (Python2_Development_FOUND)
+ message (FATAL_ERROR "Python 2, COMPONENT 'Development' unexpectedly found")
+endif()
+if (Python2_Development.Module_FOUND)
+ message (FATAL_ERROR "Python 2, COMPONENT 'Development.Module' unexpectedly found")
+endif()
+if (NOT Python2_Development.Embed_FOUND)
+ message (FATAL_ERROR "Python 2, COMPONENT 'Development.Embed' not found")
+endif()
+
+if(TARGET Python2::Module)
+ message(SEND_ERROR "Python2::Module unexpectedly found")
+endif()
if(NOT TARGET Python2::Python)
message(SEND_ERROR "Python2::Python not found")
diff --git a/Tests/FindPython/Python2Module/CMakeLists.txt b/Tests/FindPython/Python2Module/CMakeLists.txt
new file mode 100644
index 000000000..0bc3390ce
--- /dev/null
+++ b/Tests/FindPython/Python2Module/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestPython2Module C)
+
+include(CTest)
+
+find_package(Python2 REQUIRED COMPONENTS Interpreter Development.Module)
+if (NOT Python2_FOUND)
+ message (FATAL_ERROR "Fail to found Python 2")
+endif()
+if (Python2_Development_FOUND)
+ message (FATAL_ERROR "Python 2, COMPONENT 'Development' unexpectedly found")
+endif()
+if (Python2_Development.Embed_FOUND)
+ message (FATAL_ERROR "Python 2, COMPONENT 'Development.Embed' unexpectedly found")
+endif()
+if (NOT Python2_Development.Module_FOUND)
+ message (FATAL_ERROR "Python 2, COMPONENT 'Development.Module' not found")
+endif()
+
+if(NOT TARGET Python2::Interpreter)
+ message(SEND_ERROR "Python2::Interpreter not found")
+endif()
+
+if(TARGET Python2::Python)
+ message(SEND_ERROR "Python2::Python unexpectedly found")
+endif()
+if(NOT TARGET Python2::Module)
+ message(SEND_ERROR "Python2::Module not found")
+endif()
+
+Python2_add_library (spam2 MODULE ../spam.c)
+target_compile_definitions (spam2 PRIVATE PYTHON2)
+
+add_test (NAME python2_spam2
+ COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam2>"
+ "${Python2_EXECUTABLE}" -c "import spam2; spam2.system(\"cd\")")
diff --git a/Tests/FindPython/Python3/CMakeLists.txt b/Tests/FindPython/Python3/CMakeLists.txt
index 6691a48a2..d6e5fdb2f 100644
--- a/Tests/FindPython/Python3/CMakeLists.txt
+++ b/Tests/FindPython/Python3/CMakeLists.txt
@@ -13,16 +13,25 @@ find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
if (NOT Python3_FOUND)
message (FATAL_ERROR "Fail to found Python 3")
endif()
+if (NOT Python3_Development_FOUND)
+ message (FATAL_ERROR "Fail to found Python 3 'Development' component")
+endif()
+if (NOT Python3_Development.Module_FOUND)
+ message (FATAL_ERROR "Fail to found Python 3 'Development.Module' component")
+endif()
+if (NOT Python3_Development.Embed_FOUND)
+ message (FATAL_ERROR "Fail to found Python 3 'Development.Embed' component")
+endif()
if(NOT TARGET Python3::Interpreter)
- message(SEND_ERROR "Python2::Interpreter not found")
+ message(SEND_ERROR "Python3::Interpreter not found")
endif()
if(NOT TARGET Python3::Python)
- message(SEND_ERROR "Python2::Python not found")
+ message(SEND_ERROR "Python3::Python not found")
endif()
if(NOT TARGET Python3::Module)
- message(SEND_ERROR "Python2::Module not found")
+ message(SEND_ERROR "Python3::Module not found")
endif()
Python3_add_library (spam3 MODULE ../spam.c)
diff --git a/Tests/FindPython/Python3Embedded/CMakeLists.txt b/Tests/FindPython/Python3Embedded/CMakeLists.txt
index 4eb7ebc14..184c0b453 100644
--- a/Tests/FindPython/Python3Embedded/CMakeLists.txt
+++ b/Tests/FindPython/Python3Embedded/CMakeLists.txt
@@ -4,10 +4,23 @@ project(TestPython3Embedded C)
include(CTest)
-find_package(Python3 REQUIRED COMPONENTS Development)
+find_package(Python3 REQUIRED COMPONENTS Development.Embed)
if (NOT Python3_FOUND)
message (FATAL_ERROR "Fail to found Python 3")
endif()
+if (Python3_Development_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development' unexpectedly found")
+endif()
+if (Python3_Development.Module_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.Module' unexpectedly found")
+endif()
+if (NOT Python3_Development.Embed_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.Embed' not found")
+endif()
+
+if(TARGET Python3::Module)
+ message(SEND_ERROR "Python3::Module unexpectedly found")
+endif()
if(NOT TARGET Python3::Python)
message(SEND_ERROR "Python3::Python not found")
diff --git a/Tests/FindPython/Python3Module/CMakeLists.txt b/Tests/FindPython/Python3Module/CMakeLists.txt
new file mode 100644
index 000000000..676f4c89d
--- /dev/null
+++ b/Tests/FindPython/Python3Module/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestPython3Module C)
+
+include(CTest)
+
+find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
+if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Fail to found Python 3")
+endif()
+if (Python3_Development_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development' unexpectedly found")
+endif()
+if (Python3_Development.Embed_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.Embed' unexpectedly found")
+endif()
+if (NOT Python3_Development.Module_FOUND)
+ message (FATAL_ERROR "Python 3, COMPONENT 'Development.Module' not found")
+endif()
+
+if(NOT TARGET Python3::Interpreter)
+ message(SEND_ERROR "Python3::Interpreter not found")
+endif()
+
+if(TARGET Python3::Python)
+ message(SEND_ERROR "Python3::Python unexpectedly found")
+endif()
+if(NOT TARGET Python3::Module)
+ message(SEND_ERROR "Python3::Module not found")
+endif()
+
+Python3_add_library (spam3 MODULE ../spam.c)
+target_compile_definitions (spam3 PRIVATE PYTHON3)
+
+add_test (NAME python3_spam3
+ COMMAND "${CMAKE_COMMAND}" -E env "PYTHONPATH=$<TARGET_FILE_DIR:spam3>"
+ "${Python3_EXECUTABLE}" -c "import spam3; spam3.system(\"cd\")")
diff --git a/Tests/FindRuby/CMakeLists.txt b/Tests/FindRuby/CMakeLists.txt
new file mode 100644
index 000000000..3f4807c53
--- /dev/null
+++ b/Tests/FindRuby/CMakeLists.txt
@@ -0,0 +1,57 @@
+if(CMake_TEST_FindRuby)
+
+ # Looks for ruby >=1.9.9, which is true on any Ubuntu (that installs it) or macOS (> 10.9)
+ add_test(NAME FindRuby.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindRuby/Test"
+ "${CMake_BINARY_DIR}/Tests/FindRuby/Test"
+ ${build_generator_args}
+ --build-project TestRuby
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+ # Looks for ruby >= 50.1.0, which should logically fail
+ add_test(NAME FindRuby.Fail COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindRuby/Fail"
+ "${CMake_BINARY_DIR}/Tests/FindRuby/Fail"
+ ${build_generator_args}
+ --build-project TestRubyFail
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ set_tests_properties(FindRuby.Fail PROPERTIES
+ PASS_REGULAR_EXPRESSION "Could NOT find Ruby.*(Required is at least version \"[0-9]+\\.[0-9]+\\.[0-9]+\")")
+
+ # Looks for 1.9.9 EXACTLY, which unlike the "FindRuby" test above will fail on every machine
+ # since this version doesn't exist (ruby goes from 1.9.3 to 2.0.0)
+ add_test(NAME FindRuby.FailExact COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindRuby/FailExact"
+ "${CMake_BINARY_DIR}/Tests/FindRuby/FailExact"
+ ${build_generator_args}
+ --build-project TestRubyFailExact
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ set_tests_properties(FindRuby.FailExact PROPERTIES
+ PASS_REGULAR_EXPRESSION "Could NOT find Ruby: Found unsuitable version \".*\", but required is.*exact version \"[0-9]+\\.[0-9]+\\.[0-9]+\" \\(found .*\\)")
+
+ # RVM specific test
+ if(CMake_TEST_FindRuby_RVM)
+ add_test(NAME FindRuby.Rvm COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindRuby/Rvm"
+ "${CMake_BINARY_DIR}/Tests/FindRuby/Rvm"
+ ${build_generator_args}
+ --build-project TestRVM
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ endif()
+endif()
diff --git a/Tests/FindRuby/Fail/CMakeLists.txt b/Tests/FindRuby/Fail/CMakeLists.txt
new file mode 100644
index 000000000..9185ba5bd
--- /dev/null
+++ b/Tests/FindRuby/Fail/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.17)
+project(TestRubyFail LANGUAGES NONE)
+
+# Should always fail since there is NO ruby 50.1.0 yet.
+find_package(Ruby 50.1.0 REQUIRED)
diff --git a/Tests/FindRuby/FailExact/CMakeLists.txt b/Tests/FindRuby/FailExact/CMakeLists.txt
new file mode 100644
index 000000000..1ebc0aecc
--- /dev/null
+++ b/Tests/FindRuby/FailExact/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.17)
+project(TestRubyFailExact LANGUAGES NONE)
+
+# Should always fail since there is NO ruby 1.9.9 (goes from 1.9.3 to 2.0.0)
+find_package(Ruby 1.9.9 EXACT REQUIRED)
+if (NOT Ruby_FOUND)
+ message (FATAL_ERROR "Failed to find Ruby 1.9.9")
+endif()
diff --git a/Tests/FindRuby/Rvm/CMakeLists.txt b/Tests/FindRuby/Rvm/CMakeLists.txt
new file mode 100644
index 000000000..545fc9480
--- /dev/null
+++ b/Tests/FindRuby/Rvm/CMakeLists.txt
@@ -0,0 +1,75 @@
+cmake_minimum_required(VERSION 3.17)
+project(TestRVM LANGUAGES NONE)
+
+include(CTest)
+
+# To run this test, you need to have at least one RVM ruby installed
+# and to ensure that the env variable 'MY_RUBY_HOME' is set to a valid RVM ruby when you run the test
+# (which is the case if you have done `rvm use x.y.z`, but could be manually set too)
+
+# Properly using rvm would require sourcing a shell script, eg `source "$HOME/.rvm/scripts/rvm"`
+# Instead, I'll just rely on the env variable MY_RUBY_HOME
+set(MY_RUBY_HOME "$ENV{MY_RUBY_HOME}")
+if(NOT MY_RUBY_HOME)
+ message(FATAL_ERROR "Env variable MY_RUBY_HOME should be set to a valid RVM ruby location, or you should call `rvm use x.y.z` before")
+endif()
+execute_process (COMMAND "${MY_RUBY_HOME}/bin/ruby" -e "puts RUBY_VERSION"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE RVM_RUBY_VERSION
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+if (result)
+ message (FATAL_ERROR "Unable to detect RVM ruby version from `${MY_RUBY_HOME}/bin/ruby`: ${RVM_RUBY_VERSION}")
+endif()
+
+execute_process(COMMAND "${CMAKE_COMMAND}" -E env --unset=MY_RUBY_HOME --unset=PATH
+ "which" "ruby"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE SYSTEM_RUBY
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+if (SYSTEM_RUBY MATCHES "^${MY_RUBY_HOME}/.+")
+ message(FATAL_ERROR "Unable to find system ruby, found ${SYSTEM_RUBY} which is part of MY_RUBY_HOME=${MY_RUBY_HOME}")
+endif()
+
+# Check version of the system ruby executable.
+execute_process (COMMAND "${SYSTEM_RUBY}" -e "puts RUBY_VERSION"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE SYSTEM_RUBY_VERSION
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+if (result)
+ message (FATAL_ERROR "Unable to detect system ruby version from '${SYSTEM_RUBY}': ${SYSTEM_RUBY_VERSION}")
+endif()
+
+if(SYSTEM_RUBY_VERSION VERSION_EQUAL RVM_RUBY_VERSION)
+ message(FATAL_ERROR "Your RVM Ruby Version and your System ruby version are the same (${RVM_RUBY_VERSION}).")
+endif()
+
+message("Found System Ruby (${SYSTEM_RUBY_VERSION}): ${SYSTEM_RUBY}")
+message("Found RVM Ruby (${RVM_RUBY_VERSION}): ${MY_RUBY_HOME}/bin/ruby")
+
+add_test(NAME FindRuby.RvmDefault
+ COMMAND "${CMAKE_COMMAND}" -E env "MY_RUBY_HOME=${MY_RUBY_HOME}"
+ "${CMAKE_COMMAND}" "-DRUBY_HOME=${MY_RUBY_HOME}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/RvmDefault.cmake")
+
+add_test(NAME FindRuby.RvmOnly
+ COMMAND "${CMAKE_COMMAND}" -E env --unset=PATH
+ "MY_RUBY_HOME=${MY_RUBY_HOME}"
+ "${CMAKE_COMMAND}" "-DRUBY_HOME=${MY_RUBY_HOME}"
+ "-DRVM_RUBY_VERSION=${RVM_RUBY_VERSION}" "-DSYSTEM_RUBY_VERSION=${SYSTEM_RUBY_VERSION}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/RvmOnly.cmake")
+add_test(NAME FindRuby.UnsetRvmOnly
+ COMMAND "${CMAKE_COMMAND}" -E env --unset=MY_RUBY_HOME "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
+ "${CMAKE_COMMAND}" "-DRVM_RUBY_VERSION=${RVM_RUBY_VERSION}" "-DSYSTEM_RUBY_VERSION=${SYSTEM_RUBY_VERSION}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/RvmOnly.cmake")
+
+add_test(NAME FindRuby.RvmStandard
+ COMMAND "${CMAKE_COMMAND}" -E env "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
+ "MY_RUBY_HOME=${MY_RUBY_HOME}"
+ "${CMAKE_COMMAND}" "-DRUBY_HOME=${MY_RUBY_HOME}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/RvmStandard.cmake")
diff --git a/Tests/FindRuby/Rvm/RvmDefault.cmake b/Tests/FindRuby/Rvm/RvmDefault.cmake
new file mode 100644
index 000000000..a66b911dd
--- /dev/null
+++ b/Tests/FindRuby/Rvm/RvmDefault.cmake
@@ -0,0 +1,17 @@
+set(CMAKE_FIND_LIBRARY_PREFIXES "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES "")
+
+find_package (Ruby 2.1.1 REQUIRED)
+if (NOT RUBY_EXECUTABLE MATCHES "^${RUBY_HOME}/.+")
+ message (FATAL_ERROR "Failed to use RVM environment: ${RUBY_EXECUTABLE}, ${RUBY_HOME}")
+endif()
+
+find_package (Ruby 2.1 REQUIRED)
+if (NOT RUBY_EXECUTABLE MATCHES "^${RUBY_HOME}/.+")
+ message (FATAL_ERROR "Failed to use RVM environment: ${RUBY_EXECUTABLE}, ${RUBY_HOME}")
+endif()
+
+find_package (Ruby REQUIRED)
+if (NOT RUBY_EXECUTABLE MATCHES "^${RUBY_HOME}/.+")
+ message (FATAL_ERROR "Failed to use RVM environment: ${RUBY_EXECUTABLE}, ${RUBY_HOME}")
+endif()
diff --git a/Tests/FindRuby/Rvm/RvmOnly.cmake b/Tests/FindRuby/Rvm/RvmOnly.cmake
new file mode 100644
index 000000000..3851a7ccd
--- /dev/null
+++ b/Tests/FindRuby/Rvm/RvmOnly.cmake
@@ -0,0 +1,41 @@
+set(CMAKE_FIND_LIBRARY_PREFIXES "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES "")
+
+set(Ruby_FIND_VIRTUALENV ONLY)
+
+# Test: FindRuby.RvmOnly
+if (RUBY_HOME)
+ # => Trying to find exactly system ruby using ONLY virtual environment should fail
+ find_package (Ruby ${SYSTEM_RUBY_VERSION} EXACT QUIET)
+ if(Ruby_FOUND)
+ message (FATAL_ERROR "Ruby unexpectedly found.")
+ endif()
+ # And should work to find the rvm version
+ find_package (Ruby ${RVM_RUBY_VERSION} EXACT QUIET)
+ if(Ruby_FOUND)
+ message (FATAL_ERROR "Ruby unexpectedly found.")
+ endif()
+endif()
+
+
+# Test: FindRuby.UnsetRvmOnly
+if (NOT RUBY_HOME)
+
+ # If ENV{MY_RUBY_HOME} isn't defined, it should default back to "STANDARD"
+ # At which point:
+
+ # It shouldn't find the RVM ruby
+ find_package (Ruby ${RVM_RUBY_VERSION} EXACT QUIET)
+ if(Ruby_FOUND)
+ message(FATAL_ERROR "Found RVM ruby when expecting system")
+ endif()
+
+ # it should find the system ruby
+ find_package (Ruby ${SYSTEM_RUBY_VERSION} EXACT QUIET)
+ if(NOT Ruby_FOUND)
+ message (FATAL_ERROR "Ruby not found.")
+ endif()
+ if (Ruby_FOUND MATCHES "^${RUBY_HOME}/.+")
+ message(FATAL_ERROR "Failed to find system ruby")
+ endif()
+endif()
diff --git a/Tests/FindRuby/Rvm/RvmStandard.cmake b/Tests/FindRuby/Rvm/RvmStandard.cmake
new file mode 100644
index 000000000..26befdb7b
--- /dev/null
+++ b/Tests/FindRuby/Rvm/RvmStandard.cmake
@@ -0,0 +1,9 @@
+set(CMAKE_FIND_LIBRARY_PREFIXES "")
+set(CMAKE_FIND_LIBRARY_SUFFIXES "")
+
+set (Ruby_FIND_VIRTUALENV STANDARD)
+find_package (Ruby REQUIRED)
+
+if (RUBY_EXECUTABLE MATCHES "^${RUBY_HOME}/.+")
+ message (FATAL_ERROR "RVM ruby unexpectedly found at ${RUBY_EXECUTABLE}, matches ${RUBY_HOME}")
+endif()
diff --git a/Tests/FindRuby/Test/CMakeLists.txt b/Tests/FindRuby/Test/CMakeLists.txt
new file mode 100644
index 000000000..dcf3ec36a
--- /dev/null
+++ b/Tests/FindRuby/Test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.17)
+project(TestRuby LANGUAGES C)
+include(CTest)
+
+find_package(Ruby 1.9.9 REQUIRED)
+if (NOT Ruby_FOUND)
+ message (FATAL_ERROR "Failed to find Ruby >=1.9.9")
+endif()
+
+add_executable(ruby_version ruby_version.c)
+target_include_directories(ruby_version PRIVATE ${Ruby_INCLUDE_DIRS})
+target_link_libraries(ruby_version PRIVATE ${Ruby_LIBRARIES})
+
+add_test(NAME ruby_version COMMAND ruby_version)
diff --git a/Tests/FindRuby/Test/ruby_version.c b/Tests/FindRuby/Test/ruby_version.c
new file mode 100644
index 000000000..880043684
--- /dev/null
+++ b/Tests/FindRuby/Test/ruby_version.c
@@ -0,0 +1,7 @@
+#include "ruby.h"
+
+int main(void)
+{
+ ruby_show_version();
+ return 0;
+}
diff --git a/Tests/FindX11/Test/CMakeLists.txt b/Tests/FindX11/Test/CMakeLists.txt
index 769271f4b..b2adfb2bc 100644
--- a/Tests/FindX11/Test/CMakeLists.txt
+++ b/Tests/FindX11/Test/CMakeLists.txt
@@ -29,6 +29,10 @@ test_x11_component(x11_components SM)
set(X11_X11_FOUND ${X11_FOUND})
test_x11_component(x11_components X11)
test_x11_component(x11_components Xau)
+test_x11_component(x11_components xcb)
+test_x11_component(x11_components X11_xcb)
+test_x11_component(x11_components xcb_icccm)
+test_x11_component(x11_components xcb_xkb)
test_x11_component(x11_components Xcomposite)
test_x11_component(x11_components Xdamage)
test_x11_component(x11_components Xdmcp)
@@ -41,6 +45,8 @@ test_x11_component(x11_components Xfixes)
test_x11_component(x11_components_ignore Xft)
test_x11_component(x11_components Xi)
test_x11_component(x11_components Xinerama)
+test_x11_component(x11_components xkbcommon)
+test_x11_component(x11_components xkbcommon_X11)
test_x11_component(x11_components Xkb)
test_x11_component(x11_components xkbfile)
test_x11_component(x11_components Xmu)
@@ -61,6 +67,9 @@ target_link_libraries(test_var PRIVATE ${X11_LIBRARIES})
# Not included in X11_LIBRARIES.
foreach(lib
Xau
+ xcb
+ X11_xcb
+ xcb_icccm
Xcomposite
Xdamage
Xdmcp
@@ -69,6 +78,8 @@ foreach(lib
Xfixes
Xi
Xinerama
+ xkbcommon
+ xkbcommon_X11
Xkb
xkbfile
Xmu
diff --git a/Tests/FortranModules/CMakeLists.txt b/Tests/FortranModules/CMakeLists.txt
index d056b4379..b7a6f6832 100644
--- a/Tests/FortranModules/CMakeLists.txt
+++ b/Tests/FortranModules/CMakeLists.txt
@@ -21,7 +21,7 @@ end module parent
submodule ( parent ) child
contains
module procedure id
- f = x
+ id = x
end procedure id
end submodule child
program main
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index d945375df..d24df2df8 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -51,40 +51,36 @@ add_custom_target(checksayhello ALL
)
add_dependencies(checksayhello sayhello)
-# Exclude this test on IBM XL for now because the check strangely
-# fails with 'ld: 0706-029 Use a number with the -H flag'.
-if(NOT CMAKE_Fortran_COMPILER_ID STREQUAL XL)
- set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log)
- file(REMOVE "${err_log}")
- include(CheckFortranSourceCompiles)
- unset(HAVE_PRINT CACHE)
- CHECK_Fortran_SOURCE_COMPILES([[
+set(err_log ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log)
+file(REMOVE "${err_log}")
+include(CheckFortranSourceCompiles)
+unset(HAVE_PRINT CACHE)
+CHECK_Fortran_SOURCE_COMPILES([[
PROGRAM TEST_HAVE_PRINT
PRINT *, 'Hello'
END
]] HAVE_PRINT)
- if(NOT HAVE_PRINT)
- if(EXISTS "${err_log}")
- file(READ "${err_log}" err)
- endif()
- string(REPLACE "\n" "\n " err " ${err}")
- message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n"
- "${err}")
+if(NOT HAVE_PRINT)
+ if(EXISTS "${err_log}")
+ file(READ "${err_log}" err)
endif()
+ string(REPLACE "\n" "\n " err " ${err}")
+ message(SEND_ERROR "CHECK_Fortran_SOURCE_COMPILES for HAVE_PRINT failed:\n"
+ "${err}")
+endif()
- unset(Fortran_BOGUS_FLAG CACHE)
- include(CheckFortranCompilerFlag)
- CHECK_Fortran_COMPILER_FLAG(-_this_is_not_a_flag_ Fortran_BOGUS_FLAG)
- if (Fortran_BOGUS_FLAG)
- message(SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed")
- endif()
+unset(Fortran_BOGUS_FLAG CACHE)
+include(CheckFortranCompilerFlag)
+CHECK_Fortran_COMPILER_FLAG(-_this_is_not_a_flag_ Fortran_BOGUS_FLAG)
+if (Fortran_BOGUS_FLAG)
+ message(SEND_ERROR "CHECK_Fortran_COMPILER_FLAG() succeeded, but should have failed")
+endif()
- unset(Fortran_RUN_FLAG CACHE)
- include(CheckFortranSourceRuns)
- check_fortran_source_runs("program a; end program" Fortran_RUN_FLAG SRC_EXT F90)
- if(NOT Fortran_RUN_FLAG)
- message(SEND_ERROR "CHECK_Fortran_SOURCE_RUNS() failed")
- endif()
+unset(Fortran_RUN_FLAG CACHE)
+include(CheckFortranSourceRuns)
+check_fortran_source_runs("program a; end program" Fortran_RUN_FLAG SRC_EXT F90)
+if(NOT Fortran_RUN_FLAG)
+ message(SEND_ERROR "CHECK_Fortran_SOURCE_RUNS() failed")
endif()
# Test generation of preprocessed sources.
@@ -120,3 +116,46 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
set_property(TARGET IntelIfDef PROPERTY Fortran_FORMAT FIXED)
target_compile_definitions(IntelIfDef PRIVATE SOME_DEF)
endif()
+
+# Skip these tests if compiler/version doesn't have preprocessing flags
+if((CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.4)
+ OR (CMAKE_Fortran_COMPILER_ID STREQUAL "XL" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 15.1.6))
+ set(test_pp_flags 0)
+else()
+ set(test_pp_flags 1)
+endif()
+
+if(test_pp_flags)
+ # Test that we can always preprocess a target
+ add_executable(preprocess_target preprocess2.f)
+ set_property(TARGET preprocess_target PROPERTY Fortran_PREPROCESS ON)
+
+ # Test that we can preprocess a single source file
+ add_executable(preprocess_source preprocess3.f)
+ set_property(SOURCE preprocess3.f PROPERTY Fortran_PREPROCESS ON)
+endif()
+
+# Test that neither the compiler nor CMake performs unnecessary preprocessing.
+add_library(no_preprocess_target_lower STATIC no_preprocess_target_lower.f)
+target_compile_options(no_preprocess_target_lower PRIVATE -DINTEGER=nonsense)
+set_property(TARGET no_preprocess_target_lower PROPERTY Fortran_PREPROCESS OFF)
+add_library(no_preprocess_source_lower STATIC no_preprocess_source_lower.f)
+target_compile_options(no_preprocess_source_lower PRIVATE -DINTEGER=nonsense)
+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)")
+ 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")
+ target_sources(no_preprocess_target PRIVATE no_preprocess_target_fpp.fpp)
+ target_sources(no_preprocess_source PRIVATE no_preprocess_source_fpp.fpp)
+ endif()
+ set_property(TARGET no_preprocess_target PROPERTY Fortran_PREPROCESS OFF)
+ set_property(SOURCE no_preprocess_source_upper.F no_preprocess_source_fpp.fpp PROPERTY Fortran_PREPROCESS OFF)
+endif()
diff --git a/Tests/FortranOnly/no_preprocess_source_fpp.fpp b/Tests/FortranOnly/no_preprocess_source_fpp.fpp
new file mode 100644
index 000000000..8e4890262
--- /dev/null
+++ b/Tests/FortranOnly/no_preprocess_source_fpp.fpp
@@ -0,0 +1,3 @@
+ SUBROUTINE NOPREPROCESS_SOURCE_FPP
+ INTEGER F
+ END
diff --git a/Tests/FortranOnly/no_preprocess_source_lower.f b/Tests/FortranOnly/no_preprocess_source_lower.f
new file mode 100644
index 000000000..3b08782bd
--- /dev/null
+++ b/Tests/FortranOnly/no_preprocess_source_lower.f
@@ -0,0 +1,3 @@
+ SUBROUTINE NOPREPROCESS_SOURCE_LOWER
+ INTEGER F
+ END
diff --git a/Tests/FortranOnly/no_preprocess_source_upper.F b/Tests/FortranOnly/no_preprocess_source_upper.F
new file mode 100644
index 000000000..02485c905
--- /dev/null
+++ b/Tests/FortranOnly/no_preprocess_source_upper.F
@@ -0,0 +1,3 @@
+ SUBROUTINE NOPREPROCESS_SOURCE_UPPER
+ INTEGER F
+ END
diff --git a/Tests/FortranOnly/no_preprocess_target_fpp.fpp b/Tests/FortranOnly/no_preprocess_target_fpp.fpp
new file mode 100644
index 000000000..f9e6e3b0a
--- /dev/null
+++ b/Tests/FortranOnly/no_preprocess_target_fpp.fpp
@@ -0,0 +1,3 @@
+ SUBROUTINE NOPREPROCESS_TARGET_FPP
+ INTEGER F
+ END
diff --git a/Tests/FortranOnly/no_preprocess_target_lower.f b/Tests/FortranOnly/no_preprocess_target_lower.f
new file mode 100644
index 000000000..ea23a706c
--- /dev/null
+++ b/Tests/FortranOnly/no_preprocess_target_lower.f
@@ -0,0 +1,3 @@
+ SUBROUTINE NOPREPROCESS_TARGET_LOWER
+ INTEGER F
+ END
diff --git a/Tests/FortranOnly/no_preprocess_target_upper.F b/Tests/FortranOnly/no_preprocess_target_upper.F
new file mode 100644
index 000000000..34ee04d9c
--- /dev/null
+++ b/Tests/FortranOnly/no_preprocess_target_upper.F
@@ -0,0 +1,3 @@
+ SUBROUTINE NOPREPROCESS_TARGET_UPPER
+ INTEGER F
+ END
diff --git a/Tests/FortranOnly/preprocess2.f b/Tests/FortranOnly/preprocess2.f
new file mode 100644
index 000000000..6595d62cb
--- /dev/null
+++ b/Tests/FortranOnly/preprocess2.f
@@ -0,0 +1,4 @@
+#define int INTEGER
+ PROGRAM PREPRO
+ int f
+ END
diff --git a/Tests/FortranOnly/preprocess3.f b/Tests/FortranOnly/preprocess3.f
new file mode 100644
index 000000000..6595d62cb
--- /dev/null
+++ b/Tests/FortranOnly/preprocess3.f
@@ -0,0 +1,4 @@
+#define int INTEGER
+ PROGRAM PREPRO
+ int f
+ END
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index fa3309f03..eb08676e0 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -65,6 +65,39 @@ else()
PROPERTIES COMPILE_FLAGS "-ITarProp")
endif()
+# Test escaping of special characters in include directory paths.
+set(special_chars "~@%&{}()!'")
+if(NOT CMAKE_GENERATOR STREQUAL "Watcom WMake")
+ # Watcom seems to have no way to encode these characters.
+ string(APPEND special_chars "#=[]")
+endif()
+if(NOT (MINGW AND CMAKE_GENERATOR MATCHES "(Unix|MSYS) Makefiles"))
+ # FIXME: Dependencies work but command-line generation does not handle '$'.
+ string(APPEND special_chars "$")
+endif()
+if(NOT CMAKE_GENERATOR MATCHES "(Borland|NMake) Makefiles")
+ # NMake and Borland seem to have no way to encode a single '^'.
+ string(APPEND special_chars "^")
+endif()
+if(NOT CMAKE_GENERATOR MATCHES "Visual Studio 9 2008|Watcom WMake")
+ # The vcproj format separates values with ','.
+ string(APPEND special_chars ",")
+endif()
+if(NOT WIN32 AND NOT CYGWIN)
+ string(APPEND special_chars "*?<>")
+endif()
+set(special_dir "${CMAKE_CURRENT_BINARY_DIR}/special-${special_chars}-include")
+file(WRITE "${special_dir}/SpecialDir.h" "#define SPECIAL_DIR_H\n")
+target_include_directories(IncludeDirectories PRIVATE "${special_dir}")
+target_compile_definitions(IncludeDirectories PRIVATE INCLUDE_SPECIAL_DIR)
+
+if(MAKE_SUPPORTS_SPACES)
+ set(special_space_dir "${CMAKE_CURRENT_BINARY_DIR}/special-space ${special_chars}-include")
+ file(WRITE "${special_space_dir}/SpecialSpaceDir.h" "#define SPECIAL_SPACE_DIR_H\n")
+ target_include_directories(IncludeDirectories PRIVATE "${special_space_dir}")
+ target_compile_definitions(IncludeDirectories PRIVATE INCLUDE_SPECIAL_SPACE_DIR)
+endif()
+
add_library(ordertest ordertest.cpp)
target_include_directories(ordertest SYSTEM PUBLIC SystemIncludeDirectories/systemlib)
target_include_directories(ordertest PUBLIC SystemIncludeDirectories/userlib)
diff --git a/Tests/IncludeDirectories/main.cpp b/Tests/IncludeDirectories/main.cpp
index a59d27c39..6dc88e297 100644
--- a/Tests/IncludeDirectories/main.cpp
+++ b/Tests/IncludeDirectories/main.cpp
@@ -3,6 +3,20 @@
#include "SrcProp.h"
#include "TarProp.h"
+#ifdef INCLUDE_SPECIAL_DIR
+# include "SpecialDir.h"
+# ifndef SPECIAL_DIR_H
+# error "SPECIAL_DIR_H not defined"
+# endif
+#endif
+
+#ifdef INCLUDE_SPECIAL_SPACE_DIR
+# include "SpecialSpaceDir.h"
+# ifndef SPECIAL_SPACE_DIR_H
+# error "SPECIAL_SPACE_DIR_H not defined"
+# endif
+#endif
+
int main(int argc, char** argv)
{
return 0;
diff --git a/Tests/MSManifest/CMakeLists.txt b/Tests/MSManifest/CMakeLists.txt
index 300cfa6bb..631c59806 100644
--- a/Tests/MSManifest/CMakeLists.txt
+++ b/Tests/MSManifest/CMakeLists.txt
@@ -1,5 +1,8 @@
cmake_minimum_required(VERSION 3.3)
project(MSManifest C)
+include(CTest)
+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(Subdir)
+add_subdirectory(Subdir2)
diff --git a/Tests/MSManifest/Subdir/CMakeLists.txt b/Tests/MSManifest/Subdir/CMakeLists.txt
index 11272bb9f..8664572c6 100644
--- a/Tests/MSManifest/Subdir/CMakeLists.txt
+++ b/Tests/MSManifest/Subdir/CMakeLists.txt
@@ -2,10 +2,9 @@ configure_file(test.manifest.in test.manifest)
add_executable(MSManifest main.c ${CMAKE_CURRENT_BINARY_DIR}/test.manifest)
if(MSVC AND NOT MSVC_VERSION LESS 1400)
- add_custom_command(TARGET MSManifest POST_BUILD VERBATIM
- COMMAND ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:MSManifest>
- -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
- )
+ add_test(NAME MSManifest.Single COMMAND
+ ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:MSManifest>
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake)
add_executable(MSManifestNone main.c)
set_property(TARGET MSManifestNone PROPERTY LINK_FLAGS "/MANIFEST:NO")
endif()
diff --git a/Tests/MSManifest/Subdir2/CMakeLists.txt b/Tests/MSManifest/Subdir2/CMakeLists.txt
new file mode 100644
index 000000000..19d8de73a
--- /dev/null
+++ b/Tests/MSManifest/Subdir2/CMakeLists.txt
@@ -0,0 +1,13 @@
+configure_file(test_manifest1.in test_manifest1.manifest)
+configure_file(test_manifest2.in test_manifest2.manifest)
+configure_file(test_manifest3.in test_manifest3.manifest)
+add_executable(MSMultipleManifest main.c
+ ${CMAKE_CURRENT_BINARY_DIR}/test_manifest1.manifest
+ ${CMAKE_CURRENT_BINARY_DIR}/test_manifest2.manifest
+ ${CMAKE_CURRENT_BINARY_DIR}/test_manifest3.manifest)
+
+if(MSVC AND NOT MSVC_VERSION LESS 1400)
+ add_test(NAME MSManifest.Multiple COMMAND
+ ${CMAKE_COMMAND} -Dexe=$<TARGET_FILE:MSMultipleManifest>
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake)
+endif()
diff --git a/Tests/MSManifest/Subdir2/check.cmake b/Tests/MSManifest/Subdir2/check.cmake
new file mode 100644
index 000000000..4a1705bef
--- /dev/null
+++ b/Tests/MSManifest/Subdir2/check.cmake
@@ -0,0 +1,22 @@
+file(STRINGS "${exe}" manifest_content1 REGEX "name=\"Kitware.CMake.MSMultipleManifest\"")
+if(manifest_content1)
+ message(STATUS "Expected manifest content found:\n ${manifest_content1}")
+else()
+ message(FATAL_ERROR "Expected manifest content not found in\n ${exe}")
+endif()
+
+# Verify Second Manifest Content is inside Executable.
+file(STRINGS "${exe}" manifest_content2 REGEX "8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a")
+if(manifest_content2)
+ message(STATUS "Expected manifest content found:\n ${manifest_content2}")
+else()
+ message(FATAL_ERROR "Expected manifest content not found in\n ${exe}")
+endif()
+
+# Verify Third Manifest Content is inside Executable.
+file(STRINGS "${exe}" manifest_content3 REGEX "<dpiAware>true</dpiAware>")
+if(manifest_content3)
+ message(STATUS "Expected manifest content found:\n ${manifest_content3}")
+else()
+ message(FATAL_ERROR "Expected manifest content not found in\n ${exe}")
+endif()
diff --git a/Tests/MSManifest/Subdir2/main.c b/Tests/MSManifest/Subdir2/main.c
new file mode 100644
index 000000000..8488f4e58
--- /dev/null
+++ b/Tests/MSManifest/Subdir2/main.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/MSManifest/Subdir2/test_manifest1.in b/Tests/MSManifest/Subdir2/test_manifest1.in
new file mode 100644
index 000000000..f36eead16
--- /dev/null
+++ b/Tests/MSManifest/Subdir2/test_manifest1.in
@@ -0,0 +1,5 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <assemblyIdentity type="win32" version="1.0.0.0"
+ name="Kitware.CMake.MSMultipleManifest"/>
+ <description>CMake Multiple Manifest Test Application</description>
+</assembly>
diff --git a/Tests/MSManifest/Subdir2/test_manifest2.in b/Tests/MSManifest/Subdir2/test_manifest2.in
new file mode 100644
index 000000000..ec96f115a
--- /dev/null
+++ b/Tests/MSManifest/Subdir2/test_manifest2.in
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"></supportedOS>
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"></supportedOS>
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
+ </application>
+ </compatibility>
+</assembly>
diff --git a/Tests/MSManifest/Subdir2/test_manifest3.in b/Tests/MSManifest/Subdir2/test_manifest3.in
new file mode 100644
index 000000000..0770e11ec
--- /dev/null
+++ b/Tests/MSManifest/Subdir2/test_manifest3.in
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
+ <asmv3:application>
+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+ <dpiAware>true</dpiAware>
+ <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
+ </asmv3:windowsSettings>
+ </asmv3:application>
+</assembly>
diff --git a/Tests/ObjectLibrary/CMakeLists.txt b/Tests/ObjectLibrary/CMakeLists.txt
index 7897ab99b..fca5f410f 100644
--- a/Tests/ObjectLibrary/CMakeLists.txt
+++ b/Tests/ObjectLibrary/CMakeLists.txt
@@ -73,3 +73,5 @@ add_executable(UseABstaticObjs $<TARGET_OBJECTS:UseABstatic>)
target_link_libraries(UseABstaticObjs ABstatic)
add_subdirectory(ExportLanguages)
+
+add_subdirectory(Transitive)
diff --git a/Tests/ObjectLibrary/Transitive/CMakeLists.txt b/Tests/ObjectLibrary/Transitive/CMakeLists.txt
new file mode 100644
index 000000000..d616cdadf
--- /dev/null
+++ b/Tests/ObjectLibrary/Transitive/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_policy(SET CMP0022 NEW)
+add_library(FooStatic STATIC FooStatic.c)
+
+add_library(FooObject1 OBJECT FooObject.c)
+target_link_libraries(FooObject1 PRIVATE FooStatic)
+add_executable(Transitive1 Transitive.c)
+target_link_libraries(Transitive1 PRIVATE FooObject1)
+
+add_library(FooObject2 OBJECT FooObject.c)
+target_link_libraries(FooObject2 INTERFACE FooStatic)
+add_executable(Transitive2 Transitive.c)
+target_link_libraries(Transitive2 PRIVATE FooObject2)
diff --git a/Tests/ObjectLibrary/Transitive/FooObject.c b/Tests/ObjectLibrary/Transitive/FooObject.c
new file mode 100644
index 000000000..54c1f299a
--- /dev/null
+++ b/Tests/ObjectLibrary/Transitive/FooObject.c
@@ -0,0 +1,4 @@
+int FooObject(void)
+{
+ return 0;
+}
diff --git a/Tests/ObjectLibrary/Transitive/FooStatic.c b/Tests/ObjectLibrary/Transitive/FooStatic.c
new file mode 100644
index 000000000..84649c7c3
--- /dev/null
+++ b/Tests/ObjectLibrary/Transitive/FooStatic.c
@@ -0,0 +1,4 @@
+int FooStatic(void)
+{
+ return 0;
+}
diff --git a/Tests/ObjectLibrary/Transitive/Transitive.c b/Tests/ObjectLibrary/Transitive/Transitive.c
new file mode 100644
index 000000000..43089b8c2
--- /dev/null
+++ b/Tests/ObjectLibrary/Transitive/Transitive.c
@@ -0,0 +1,7 @@
+extern int FooObject(void);
+extern int FooStatic(void);
+
+int main(void)
+{
+ return FooObject() + FooStatic();
+}
diff --git a/Tests/Preprocess/preprocess.c b/Tests/Preprocess/preprocess.c
index 958c77ebc..b3117da5f 100644
--- a/Tests/Preprocess/preprocess.c
+++ b/Tests/Preprocess/preprocess.c
@@ -15,21 +15,21 @@ int check_defines_C(void)
result = 0;
}
if (strcmp(TARGET_STRING, STRING_VALUE) != 0) {
- fprintf(stderr, "TARGET_STRING has wrong value in C [%s]\n",
- TARGET_STRING);
+ fprintf(stderr, "TARGET_STRING has wrong value in C [%s] vs [%s]\n",
+ TARGET_STRING, STRING_VALUE);
result = 0;
}
{
int x = 2;
int y = 3;
if ((FILE_EXPR) != (EXPR)) {
- fprintf(stderr, "FILE_EXPR did not work in C [%s]\n",
- TO_STRING(FILE_EXPR));
+ fprintf(stderr, "FILE_EXPR did not work in C [%s] vs [%s]\n",
+ TO_STRING(FILE_EXPR), TO_STRING(EXPR));
result = 0;
}
if ((TARGET_EXPR) != (EXPR)) {
- fprintf(stderr, "TARGET_EXPR did not work in C [%s]\n",
- TO_STRING(FILE_EXPR));
+ fprintf(stderr, "TARGET_EXPR did not work in C [%s] vs [%s]\n",
+ TO_STRING(TARGET_EXPR), TO_STRING(EXPR));
result = 0;
}
}
diff --git a/Tests/Preprocess/preprocess.cxx b/Tests/Preprocess/preprocess.cxx
index 34a69c6c6..f2fffef72 100644
--- a/Tests/Preprocess/preprocess.cxx
+++ b/Tests/Preprocess/preprocess.cxx
@@ -12,25 +12,26 @@ int check_defines_CXX()
{
int result = 1;
if (strcmp(FILE_STRING, STRING_VALUE) != 0) {
- fprintf(stderr, "FILE_STRING has wrong value in CXX [%s]\n", FILE_STRING);
+ fprintf(stderr, "FILE_STRING has wrong value in CXX [%s] vs [%s]\n",
+ FILE_STRING, STRING_VALUE);
result = 0;
}
if (strcmp(TARGET_STRING, STRING_VALUE) != 0) {
- fprintf(stderr, "TARGET_STRING has wrong value in CXX [%s]\n",
- TARGET_STRING);
+ fprintf(stderr, "TARGET_STRING has wrong value in CXX [%s] vs [%s]\n",
+ TARGET_STRING, STRING_VALUE);
result = 0;
}
{
int x = 2;
int y = 3;
if ((FILE_EXPR) != (EXPR)) {
- fprintf(stderr, "FILE_EXPR did not work in CXX [%s]\n",
- TO_STRING(FILE_EXPR));
+ fprintf(stderr, "FILE_EXPR did not work in CXX [%s] vs [%s]\n",
+ TO_STRING(FILE_EXPR), TO_STRING(EXPR));
result = 0;
}
if ((TARGET_EXPR) != (EXPR)) {
- fprintf(stderr, "TARGET_EXPR did not work in CXX [%s]\n",
- TO_STRING(FILE_EXPR));
+ fprintf(stderr, "TARGET_EXPR did not work in CXX [%s] vs [%s]\n",
+ TO_STRING(TARGET_EXPR), TO_STRING(EXPR));
result = 0;
}
}
diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt
index a26306122..162a1780b 100644
--- a/Tests/Properties/CMakeLists.txt
+++ b/Tests/Properties/CMakeLists.txt
@@ -144,4 +144,182 @@ set_property(CACHE SOME_ENTRY PROPERTY ADVANCED "${expect_ADVANCED}")
set_property(CACHE SOME_ENTRY PROPERTY STRINGS "${expect_STRINGS}")
check_cache_props()
+function(generate_file_for_set_property_test i target_name)
+ set(src_path "${CMAKE_CURRENT_BINARY_DIR}/src${i}.cpp")
+ file(CONFIGURE OUTPUT "${src_path}" CONTENT
+ "#ifndef def${i}\n\
+ #error Expected def${i}\n\
+ #endif\n\
+ #ifdef _WIN32\n\
+ __declspec(dllexport)\n\
+ #endif\n\
+ void dummy_symbol${i}() {}\n"
+ NEWLINE_STYLE UNIX)
+ target_sources(${target_name} PRIVATE "${src_path}")
+endfunction()
+
+add_library(maindirtest SHARED)
+
+# Generate file to be used with both DIRECTORY and TARGET_DIRECTORY options in
+# set_source_files_properties and set_property().
+generate_file_for_set_property_test(32 maindirtest)
+generate_file_for_set_property_test(33 maindirtest)
+
add_subdirectory(SubDir2)
+
+set(src_prefix "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/")
+
+# Set property + target directory
+set_property(SOURCE "${src_prefix}/src1.cpp"
+ TARGET_DIRECTORY set_prop_lib_1
+ PROPERTY COMPILE_DEFINITIONS def1)
+
+# Append property + target directory
+set_property(SOURCE "${src_prefix}/src2.cpp"
+ TARGET_DIRECTORY set_prop_lib_1
+ APPEND PROPERTY COMPILE_DEFINITIONS def2)
+
+# Set property + relative directory path
+set_property(SOURCE "${src_prefix}/src3.cpp"
+ DIRECTORY SubDir2
+ PROPERTY COMPILE_DEFINITIONS def3)
+
+# Set property + absolute directory path
+set_property(SOURCE "${src_prefix}/src4.cpp"
+ DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SubDir2"
+ PROPERTY COMPILE_DEFINITIONS def4)
+
+# Append property + relative directory path
+set_property(SOURCE "${src_prefix}/src5.cpp"
+ DIRECTORY SubDir2
+ APPEND PROPERTY COMPILE_DEFINITIONS def5)
+
+# Append property + absolute directory path
+set_property(SOURCE "${src_prefix}/src6.cpp"
+ DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SubDir2"
+ APPEND PROPERTY COMPILE_DEFINITIONS def6)
+
+
+# Target directory
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src10.cpp"
+ TARGET_DIRECTORY set_prop_lib_1
+ PROPERTIES COMPILE_DEFINITIONS def10)
+
+# Relative directory path
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src11.cpp"
+ DIRECTORY SubDir2
+ PROPERTIES COMPILE_DEFINITIONS def11)
+
+# Absolute directory path
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src12.cpp"
+ DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SubDir2"
+ PROPERTIES COMPILE_DEFINITIONS def12)
+
+
+# Multiple files + absolute directory path
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src20.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src21.cpp"
+ DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SubDir2"
+ PROPERTIES COMPILE_DEFINITIONS "def20;def21")
+
+# Multiple files + multiple target directories
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src22.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src23.cpp"
+ TARGET_DIRECTORY set_prop_lib_2 set_prop_lib_3
+ PROPERTIES COMPILE_DEFINITIONS "def22;def23")
+
+
+# Multiple files in multiple relative directories
+generate_file_for_set_property_test(30 maindirtest)
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/src30.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src31.cpp"
+ DIRECTORY . SubDir2
+ PROPERTIES COMPILE_DEFINITIONS "def30;def31")
+
+# Check that specifying files without any properties doesn't crash.
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/src30.cpp"
+ "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src31.cpp")
+
+
+# Check that specifying both DIRECTORY and TARGET_DIRECTORY works.
+set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/src32.cpp"
+ DIRECTORY .
+ TARGET_DIRECTORY set_prop_lib_3
+ PROPERTIES COMPILE_DEFINITIONS "def32")
+
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/src33.cpp"
+ DIRECTORY SubDir2
+ TARGET_DIRECTORY maindirtest
+ PROPERTY COMPILE_DEFINITIONS "def33")
+
+
+function(check_get_property_value expected)
+ if(NOT actual STREQUAL expected)
+ message(SEND_ERROR "Error: get_property returned unexpected value\n"
+ "actual: ${actual}\n"
+ "expected: ${expected}")
+ endif()
+endfunction()
+
+# Check that source file directory scopes are deduplicated.
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/src32.cpp"
+ DIRECTORY SubDir2 SubDir2 SubDir2
+ TARGET_DIRECTORY set_prop_lib_3 set_prop_lib_3 set_prop_lib_3
+ APPEND
+ PROPERTY NON_DUPLICATED_CUSTOM_PROP 1
+)
+
+get_property(actual
+ SOURCE "${CMAKE_CURRENT_BINARY_DIR}/src32.cpp"
+ DIRECTORY SubDir2
+ PROPERTY NON_DUPLICATED_CUSTOM_PROP)
+check_get_property_value("1")
+
+get_source_file_property(actual "${CMAKE_CURRENT_BINARY_DIR}/src32.cpp"
+ TARGET_DIRECTORY set_prop_lib_3
+ NON_DUPLICATED_CUSTOM_PROP)
+check_get_property_value("1")
+
+# Get property + target directory
+get_property(actual
+ SOURCE "${src_prefix}/src1.cpp"
+ TARGET_DIRECTORY set_prop_lib_1
+ PROPERTY COMPILE_DEFINITIONS)
+check_get_property_value("def1")
+
+# Get property + relative directory path
+get_property(actual
+ SOURCE "${src_prefix}/src3.cpp"
+ DIRECTORY SubDir2
+ PROPERTY COMPILE_DEFINITIONS)
+check_get_property_value("def3")
+
+# Get property + absolute directory path
+get_property(actual
+ SOURCE "${src_prefix}/src4.cpp"
+ DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SubDir2"
+ PROPERTY COMPILE_DEFINITIONS)
+check_get_property_value("def4")
+
+
+# Get property + target directory
+unset(actual)
+get_source_file_property(actual
+ "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src10.cpp"
+ TARGET_DIRECTORY set_prop_lib_1
+ COMPILE_DEFINITIONS)
+check_get_property_value("def10")
+
+# Get property + relative directory path
+get_source_file_property(actual
+ "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src11.cpp"
+ DIRECTORY SubDir2
+ COMPILE_DEFINITIONS)
+check_get_property_value("def11")
+
+# Get property + absolute directory path
+get_source_file_property(actual
+ "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/src12.cpp"
+ DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SubDir2"
+ COMPILE_DEFINITIONS)
+check_get_property_value("def12")
diff --git a/Tests/Properties/SubDir2/CMakeLists.txt b/Tests/Properties/SubDir2/CMakeLists.txt
index 377dc830e..88e55311b 100644
--- a/Tests/Properties/SubDir2/CMakeLists.txt
+++ b/Tests/Properties/SubDir2/CMakeLists.txt
@@ -3,3 +3,32 @@ set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/../subdirtest.cxx"
PROPERTIES COMPILE_DEFINITIONS SUBDIR_TEST)
add_executable(subdirtest "${CMAKE_CURRENT_SOURCE_DIR}/../subdirtest.cxx")
+
+# For set_property
+add_library(set_prop_lib_1 SHARED)
+foreach(i RANGE 1 6)
+ generate_file_for_set_property_test(${i} set_prop_lib_1)
+endforeach()
+
+# For set_source_files_properties
+foreach(i RANGE 10 12)
+ generate_file_for_set_property_test(${i} set_prop_lib_1)
+endforeach()
+
+# For set_source_files_properties + multiple files + absolute directory path
+add_library(set_prop_lib_2 SHARED)
+foreach(i RANGE 20 21)
+ generate_file_for_set_property_test(${i} set_prop_lib_1)
+endforeach()
+
+# For set_source_files_properties + multiple files + multiple target directories
+add_library(set_prop_lib_3 SHARED)
+generate_file_for_set_property_test(22 set_prop_lib_2)
+generate_file_for_set_property_test(23 set_prop_lib_3)
+
+# For set_source_files_properties + multiple files in multiple directories
+generate_file_for_set_property_test(31 set_prop_lib_3)
+
+# For specifying both DIRECTORY and TARGET_DIRECTORY
+target_sources(set_prop_lib_3 PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../src32.cpp")
+target_sources(set_prop_lib_3 PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/../src33.cpp")
diff --git a/Tests/QtAutogen/Complex/codeeditor.cpp b/Tests/QtAutogen/Complex/codeeditor.cpp
index bb6f405ad..80d6a5509 100644
--- a/Tests/QtAutogen/Complex/codeeditor.cpp
+++ b/Tests/QtAutogen/Complex/codeeditor.cpp
@@ -40,7 +40,10 @@
#include "codeeditor.h"
-#include <QtGui>
+#include <QPainter>
+#include <QSize>
+#include <QTextBlock>
+#include <QWidget>
CodeEditor::CodeEditor(QWidget* parent)
: QPlainTextEdit(parent)
diff --git a/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt b/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
index 8b11b465d..1627b394f 100644
--- a/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
+++ b/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
@@ -61,7 +61,6 @@ macro(buildMocInclude sourceDir binaryDir)
"${sourceDir}"
MocInclude
CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
- "-DCMAKE_AUTOMOC_PATH_PREFIX=ON"
"-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
"-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
OUTPUT_VARIABLE output
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt b/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt
deleted file mode 100644
index 26776595d..000000000
--- a/Tests/QtAutogen/RerunMocOnAddFile/CMakeLists.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-# This test checks whether adding a source file to the project triggers an AUTOMOC re-run.
-
-cmake_minimum_required(VERSION 3.10)
-project(RerunMocOnAddFile)
-include("../AutogenCoreTest.cmake")
-
-# Create an executable to generate a clean target
-set(main_source "${CMAKE_CURRENT_BINARY_DIR}/generated_main.cpp")
-file(WRITE "${main_source}" "int main() {}")
-add_executable(exe "${main_source}")
-
-# Utility variables
-set(timeformat "%Y.%j.%H.%M%S")
-set(testProjectTemplateDir "${CMAKE_CURRENT_SOURCE_DIR}/MocOnAddFile")
-set(testProjectSrc "${CMAKE_CURRENT_BINARY_DIR}/MocOnAddFile")
-set(testProjectBinDir "${CMAKE_CURRENT_BINARY_DIR}/MocOnAddFile-build")
-
-# Utility macros
-macro(sleep)
- message(STATUS "Sleeping for a few seconds.")
- execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
-endmacro()
-
-macro(acquire_timestamp When)
- file(TIMESTAMP "${mocBasicBin}" time${When} "${timeformat}")
-endmacro()
-
-macro(rebuild buildName)
- message(STATUS "Starting build ${buildName}.")
- execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${testProjectBinDir}" RESULT_VARIABLE result)
- if (result)
- message(FATAL_ERROR "Build ${buildName} failed.")
- else()
- message(STATUS "Build ${buildName} finished.")
- endif()
-endmacro()
-
-macro(require_change)
- if (timeAfter VERSION_GREATER timeBefore)
- message(STATUS "As expected the file ${mocBasicBin} changed.")
- else()
- message(SEND_ERROR "Unexpectedly the file ${mocBasicBin} did not change!\nTimestamp pre: ${timeBefore}\nTimestamp aft: ${timeAfter}\n")
- endif()
-endmacro()
-
-macro(require_change_not)
- if (timeAfter VERSION_GREATER timeBefore)
- message(SEND_ERROR "Unexpectedly the file ${mocBasicBin} changed!\nTimestamp pre: ${timeBefore}\nTimestamp aft: ${timeAfter}\n")
- else()
- message(STATUS "As expected the file ${mocBasicBin} did not change.")
- endif()
-endmacro()
-
-# Create the test project from the template
-unset(additional_project_sources)
-unset(main_cpp_includes)
-configure_file("${testProjectTemplateDir}/CMakeLists.txt.in" "${testProjectSrc}/CMakeLists.txt")
-configure_file("${testProjectTemplateDir}/main.cpp.in" "${testProjectSrc}/main.cpp")
-
-# Initial build
-try_compile(MOC_RERUN
- "${testProjectBinDir}"
- "${testProjectSrc}"
- MocOnAddFile
- CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
- "-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
- "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
- OUTPUT_VARIABLE output
-)
-if (NOT MOC_RERUN)
- message(FATAL_ERROR "Initial build of mocOnAddFile failed. Output: ${output}")
-endif()
-
-# Sleep to ensure new timestamps
-sleep()
-
-# Add a QObject class (defined in header) to the project and build
-set(additional_project_sources myobject.cpp)
-set(main_cpp_includes "#include \"myobject.h\"")
-configure_file("${testProjectTemplateDir}/CMakeLists.txt.in" "${testProjectSrc}/CMakeLists.txt"
- @ONLY)
-configure_file("${testProjectTemplateDir}/main.cpp.in" "${testProjectSrc}/main.cpp" @ONLY)
-configure_file("${testProjectTemplateDir}/myobject.h" "${testProjectSrc}/myobject.h" COPYONLY)
-configure_file("${testProjectTemplateDir}/myobject.cpp" "${testProjectSrc}/myobject.cpp" COPYONLY)
-rebuild(2)
-
-# Sleep to ensure new timestamps
-sleep()
-
-# Add a QObject class (defined in source) to the project and build
-set(additional_project_sources myobject.cpp anotherobject.cpp)
-configure_file("${testProjectTemplateDir}/CMakeLists.txt.in" "${testProjectSrc}/CMakeLists.txt"
- @ONLY)
-configure_file("${testProjectTemplateDir}/anotherobject.cpp" "${testProjectSrc}/anotherobject.cpp"
- COPYONLY)
-rebuild(3)
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in
deleted file mode 100644
index 9e5e21c30..000000000
--- a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/CMakeLists.txt.in
+++ /dev/null
@@ -1,9 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-project(MocOnAddFile)
-include("@CMAKE_CURRENT_LIST_DIR@/../AutogenCoreTest.cmake")
-
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-
-add_executable(mocOnAddFile main.cpp @additional_project_sources@)
-target_link_libraries(mocOnAddFile ${QT_QTCORE_TARGET})
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp
deleted file mode 100644
index 45c5af681..000000000
--- a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/anotherobject.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#include <qobject.h>
-
-class AnotherObject : public QObject
-{
- Q_OBJECT
-public:
- AnotherObject() {}
-};
-
-AnotherObject* createAnotherObject()
-{
- return new AnotherObject();
-}
-
-#include "anotherobject.moc"
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/main.cpp.in b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/main.cpp.in
deleted file mode 100644
index f62027acb..000000000
--- a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/main.cpp.in
+++ /dev/null
@@ -1,6 +0,0 @@
-@main_cpp_includes@
-
-int main(int argc, char *argv[])
-{
- return 0;
-}
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.cpp b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.cpp
deleted file mode 100644
index 7a1530058..000000000
--- a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "myobject.h"
-
-MyObject::MyObject(QObject* parent)
- : QObject(parent)
-{
-}
diff --git a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.h b/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.h
deleted file mode 100644
index e373ee89c..000000000
--- a/Tests/QtAutogen/RerunMocOnAddFile/MocOnAddFile/myobject.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef MYOBJECT_H
-#define MYOBJECT_H
-
-#include <qobject.h>
-
-class MyObject : public QObject
-{
- Q_OBJECT
-public:
- MyObject(QObject* parent = 0);
-};
-
-#endif
diff --git a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
index e1951f1d0..a7fb2d7f7 100644
--- a/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt
@@ -104,7 +104,7 @@ require_change_not(B)
require_change(C)
require_change(D)
# There's a bug in Ninja on Windows:
-# https://gitlab.kitware.com/cmake/cmake/issues/16776
+# https://gitlab.kitware.com/cmake/cmake/-/issues/16776
if(NOT ("${CMAKE_GENERATOR}" MATCHES "Ninja"))
require_change(E)
endif()
@@ -128,7 +128,7 @@ require_change_not(B)
require_change(C)
require_change(D)
# There's a bug in Ninja on Windows
-# https://gitlab.kitware.com/cmake/cmake/issues/16776
+# https://gitlab.kitware.com/cmake/cmake/-/issues/16776
if(NOT ("${CMAKE_GENERATOR}" MATCHES "Ninja"))
require_change(E)
endif()
diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake
index 97efa720f..a19a9aeec 100644
--- a/Tests/QtAutogen/Tests.cmake
+++ b/Tests/QtAutogen/Tests.cmake
@@ -20,7 +20,6 @@ ADD_AUTOGEN_TEST(RccOffMocLibrary)
ADD_AUTOGEN_TEST(RccOnly rccOnly)
ADD_AUTOGEN_TEST(RccSkipSource)
ADD_AUTOGEN_TEST(RerunMocBasic)
-ADD_AUTOGEN_TEST(RerunMocOnAddFile)
ADD_AUTOGEN_TEST(RerunRccConfigChange)
ADD_AUTOGEN_TEST(RerunRccDepends)
ADD_AUTOGEN_TEST(SameName sameName)
diff --git a/Tests/RunCMake/AndroidTestUtilities/check.cmake b/Tests/RunCMake/AndroidTestUtilities/check.cmake
index ccd4d74dd..c24a3cd6f 100644
--- a/Tests/RunCMake/AndroidTestUtilities/check.cmake
+++ b/Tests/RunCMake/AndroidTestUtilities/check.cmake
@@ -13,7 +13,7 @@ function(compare_build_to_expected)
endfunction()
function(check_for_setup_test)
- file(STRINGS "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" output_var REGEX "add_test\\(setup_test.*")
+ file(STRINGS "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" output_var REGEX "add_test\\(\"setup_test\".*")
if(NOT output_var)
set(RunCMake_TEST_FAILED "Could not find the test: setup_test" PARENT_SCOPE)
endif()
diff --git a/Tests/RunCMake/AutoExportDll/AutoExport.cmake b/Tests/RunCMake/AutoExportDll/AutoExport.cmake
index a5500052b..85eff7ead 100644
--- a/Tests/RunCMake/AutoExportDll/AutoExport.cmake
+++ b/Tests/RunCMake/AutoExportDll/AutoExport.cmake
@@ -5,6 +5,10 @@ add_subdirectory(sub)
add_library(objlib OBJECT objlib.c)
set_property(TARGET objlib PROPERTY POSITION_INDEPENDENT_CODE 1)
add_library(autoexport SHARED hello.cxx world.cxx foo.c $<TARGET_OBJECTS:objlib>)
+add_library(autoexport3 SHARED cppCLI.cxx)
+if(MSVC AND NOT MSVC_VERSION VERSION_LESS 1600)
+ set_property(TARGET autoexport3 PROPERTY COMMON_LANGUAGE_RUNTIME "")
+endif()
add_executable(say say.cxx)
if(MSVC)
@@ -18,4 +22,4 @@ if(MSVC)
target_compile_definitions(say PRIVATE HAS_JUSTNOP)
endif()
endif()
-target_link_libraries(say autoexport autoexport2)
+target_link_libraries(say autoexport autoexport2 autoexport3)
diff --git a/Tests/RunCMake/AutoExportDll/cppCLI.cxx b/Tests/RunCMake/AutoExportDll/cppCLI.cxx
new file mode 100644
index 000000000..816bb6e89
--- /dev/null
+++ b/Tests/RunCMake/AutoExportDll/cppCLI.cxx
@@ -0,0 +1,22 @@
+#include <stdio.h>
+
+#ifdef __cplusplus_cli
+# include <msclr\marshal_cppstd.h>
+
+void cliFunction()
+{
+ System::String ^ result = "cliFunction";
+ result = result->Trim();
+ printf(msclr::interop::marshal_as<std::string>(result).c_str());
+}
+#else
+void cliFunction()
+{
+ printf("cliFunction (but /cli was not passed to the compiler)");
+}
+#endif
+
+void nonCliFunction()
+{
+ printf("nonCliFunction");
+}
diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx
index 654b5e03d..8fc768a36 100644
--- a/Tests/RunCMake/AutoExportDll/say.cxx
+++ b/Tests/RunCMake/AutoExportDll/say.cxx
@@ -17,9 +17,11 @@ void justnop();
}
// test c++ functions
-// forward declare hello and world
+// forward declare hello, world, cliFunction and nonCliFunction
void hello();
void world();
+void cliFunction();
+void nonCliFunction();
// test exports for executable target
extern "C" {
@@ -44,6 +46,10 @@ int main()
bar();
objlib();
printf("\n");
+ cliFunction();
+ printf("\n");
+ nonCliFunction();
+ printf("\n");
#ifdef HAS_JUSTNOP
justnop();
#endif
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt b/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt
new file mode 100644
index 000000000..c4326ae94
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt
@@ -0,0 +1,4 @@
+-- The ASM compiler identification is GNU
+-- Found assembler: [^
+]*/as(\.exe)?
+-- CMAKE_ASM_COMPILER_ID_VENDOR_MATCH='GNU assembler'
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.cmake
new file mode 100644
index 000000000..0c7249a0c
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GNU-AS.cmake
@@ -0,0 +1,14 @@
+enable_language(ASM)
+
+# Validate undocumented implementation detail.
+message(STATUS "CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH='${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_MATCH}'")
+
+add_library(gnu_as STATIC gnu_as.s)
+target_include_directories(gnu_as PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+target_compile_definitions(gnu_as PRIVATE "TEST_DEF=Hello")
+
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
+set(check_pairs
+ \"$<TARGET_FILE:gnu_as>|${CMAKE_CURRENT_BINARY_DIR}/gnu_as.inc\"
+ )
+")
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake
new file mode 100644
index 000000000..15a5e96ba
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GNU-AS.step1.cmake
@@ -0,0 +1 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/gnu_as.inc" "")
diff --git a/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake b/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake
new file mode 100644
index 000000000..15a5e96ba
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/GNU-AS.step2.cmake
@@ -0,0 +1 @@
+file(WRITE "${RunCMake_TEST_BINARY_DIR}/gnu_as.inc" "")
diff --git a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
index e4d71776a..7a68c4bd8 100644
--- a/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
+++ b/Tests/RunCMake/BuildDepends/RunCMakeTest.cmake
@@ -108,3 +108,8 @@ endfunction()
if(RunCMake_GENERATOR STREQUAL "Xcode")
run_ReGeneration(regenerate-project)
endif()
+
+if(CMake_TEST_BuildDepends_GNU_AS)
+ set(ENV{ASM} "${CMake_TEST_BuildDepends_GNU_AS}")
+ run_BuildDepends(GNU-AS)
+endif()
diff --git a/Tests/RunCMake/BuildDepends/gnu_as.s b/Tests/RunCMake/BuildDepends/gnu_as.s
new file mode 100644
index 000000000..a2e7dfb0d
--- /dev/null
+++ b/Tests/RunCMake/BuildDepends/gnu_as.s
@@ -0,0 +1 @@
+.include "gnu_as.inc"
diff --git a/Tests/RunCMake/CMP0104/CMP0104-Common.cmake b/Tests/RunCMake/CMP0104/CMP0104-Common.cmake
new file mode 100644
index 000000000..b3568f113
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/CMP0104-Common.cmake
@@ -0,0 +1,2 @@
+enable_language(CUDA)
+add_library(cuda main.cu)
diff --git a/Tests/RunCMake/CMP0104/CMP0104-NEW.cmake b/Tests/RunCMake/CMP0104/CMP0104-NEW.cmake
new file mode 100644
index 000000000..732ab77cb
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/CMP0104-NEW.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0104 NEW)
+include(CMP0104-Common.cmake)
+
+if(NOT CMAKE_CUDA_ARCHITECTURES)
+ message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES is empty with CMP0104 enabled.")
+endif()
diff --git a/Tests/RunCMake/CMP0104/CMP0104-OFF.cmake b/Tests/RunCMake/CMP0104/CMP0104-OFF.cmake
new file mode 100644
index 000000000..f3b668232
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/CMP0104-OFF.cmake
@@ -0,0 +1,3 @@
+include(CMP0104-Common.cmake)
+
+set_property(TARGET cuda PROPERTY CUDA_ARCHITECTURES OFF)
diff --git a/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake b/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake
new file mode 100644
index 000000000..415eecc5c
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake
@@ -0,0 +1,12 @@
+cmake_policy(SET CMP0104 OLD)
+include(CMP0104-Common.cmake)
+
+if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA")
+ if(CMAKE_CUDA_ARCHITECTURES)
+ message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES isn't empty for NVIDIA with CMP0104 OLD.")
+ endif()
+else(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Unknown")
+ if(NOT CMAKE_CUDA_ARCHITECTURES)
+ message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES isn't non-empty for non-NVIDIA with CMP0104 OLD.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/CMP0104/CMP0104-WARN-stderr.txt b/Tests/RunCMake/CMP0104/CMP0104-WARN-stderr.txt
new file mode 100644
index 000000000..2c9b7d768
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/CMP0104-WARN-stderr.txt
@@ -0,0 +1,8 @@
+CMake Warning \(dev\) in CMakeLists.txt:
+ Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
+ empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104"
+ for policy details. Use the cmake_policy command to set the policy and
+ suppress this warning.
+
+ CUDA_ARCHITECTURES is empty for target "cuda".
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0104/CMP0104-WARN.cmake b/Tests/RunCMake/CMP0104/CMP0104-WARN.cmake
new file mode 100644
index 000000000..2b4a8f5fb
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/CMP0104-WARN.cmake
@@ -0,0 +1,2 @@
+include(CMP0104-Common.cmake)
+set_property(TARGET cuda PROPERTY CUDA_ARCHITECTURES)
diff --git a/Tests/RunCMake/CMP0104/CMakeLists.txt b/Tests/RunCMake/CMP0104/CMakeLists.txt
new file mode 100644
index 000000000..2632ffa91
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0104/RunCMakeTest.cmake b/Tests/RunCMake/CMP0104/RunCMakeTest.cmake
new file mode 100644
index 000000000..b26f72a1e
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/RunCMakeTest.cmake
@@ -0,0 +1,6 @@
+include(RunCMake)
+
+run_cmake(CMP0104-OLD)
+run_cmake(CMP0104-NEW)
+run_cmake(CMP0104-OFF)
+run_cmake(CMP0104-WARN)
diff --git a/Tests/RunCMake/CMP0104/main.cu b/Tests/RunCMake/CMP0104/main.cu
new file mode 100644
index 000000000..5047a34e3
--- /dev/null
+++ b/Tests/RunCMake/CMP0104/main.cu
@@ -0,0 +1,3 @@
+int main()
+{
+}
diff --git a/Tests/RunCMake/CMP0106/CMP0106-Common.cmake b/Tests/RunCMake/CMP0106/CMP0106-Common.cmake
new file mode 100644
index 000000000..a1f7908f3
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-Common.cmake
@@ -0,0 +1,10 @@
+include(Documentation OPTIONAL RESULT_VARIABLE found)
+if (NOT should_find AND found)
+ message(FATAL_ERROR
+ "The Documentation module should not have been found, but it was.")
+endif ()
+if (should_find AND NOT found)
+ message(FATAL_ERROR
+ "The Documentation module should have been found, but it was not.")
+endif ()
+include(${CMAKE_ROOT}/Modules/Documentation.cmake)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-result.txt b/Tests/RunCMake/CMP0106/CMP0106-NEW-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-result.txt
+++ b/Tests/RunCMake/CMP0106/CMP0106-NEW-result.txt
diff --git a/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt
new file mode 100644
index 000000000..7ad774e96
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-NEW-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at .*/Modules/Documentation.cmake:15 \(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
+ CMP0106.
+Call Stack \(most recent call first\):
+ CMP0106-Common.cmake:10 \(include\)
+ CMP0106-NEW.cmake:4 \(include\)
+ CMakeLists.txt:7 \(include\)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-NEW.cmake b/Tests/RunCMake/CMP0106/CMP0106-NEW.cmake
new file mode 100644
index 000000000..e7d5bd120
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-NEW.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0106 NEW)
+
+set(should_find OFF)
+include(CMP0106-Common.cmake)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-OLD.cmake b/Tests/RunCMake/CMP0106/CMP0106-OLD.cmake
new file mode 100644
index 000000000..730e8467f
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-OLD.cmake
@@ -0,0 +1,9 @@
+cmake_policy(SET CMP0106 OLD)
+
+set(should_find ON)
+include(CMP0106-Common.cmake)
+if (NOT DEFINED BUILD_DOCUMENTATION)
+ message(FATAL_ERROR
+ "Cache variables seem to have not been made with a `OLD` policy "
+ "setting.")
+endif ()
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView-stderr.txt
new file mode 100644
index 000000000..b61889b38
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView-stderr.txt
@@ -0,0 +1,8 @@
+CMake Warning \(dev\) at CMP0106-Common.cmake:1 \(include\):
+ 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.
+
+Call Stack \(most recent call first\):
+ subdir/CMakeLists.txt:2 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView.cmake b/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView.cmake
new file mode 100644
index 000000000..309abcc51
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-ParaView.cmake
@@ -0,0 +1,2 @@
+set(should_find ON)
+add_subdirectory(subdir)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK-stderr.txt
new file mode 100644
index 000000000..f8a754eb2
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK-stderr.txt
@@ -0,0 +1,9 @@
+CMake Warning \(dev\) at CMP0106-Common.cmake:1 \(include\):
+ 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.
+
+Call Stack \(most recent call first\):
+ CMP0106-WARN-VTK.cmake:2 \(include\)
+ CMakeLists.txt:7 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK.cmake b/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK.cmake
new file mode 100644
index 000000000..99f6c396c
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-VTK.cmake
@@ -0,0 +1,2 @@
+set(should_find ON)
+include(CMP0106-Common.cmake)
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt b/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt
new file mode 100644
index 000000000..d0d48d0b1
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN-stderr.txt
@@ -0,0 +1,37 @@
+CMake Warning \(dev\) at CMP0106-Common.cmake:1 \(include\):
+ 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.
+
+Call Stack \(most recent call first\):
+ CMP0106-WARN.cmake:2 \(include\)
+ 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\):
+ 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.
+
+ 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.
+Call Stack \(most recent call first\):
+ CMP0106-Common.cmake:1 \(include\)
+ CMP0106-WARN.cmake:2 \(include\)
+ 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\):
+ 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.
+
+ 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.
+Call Stack \(most recent call first\):
+ CMP0106-Common.cmake:10 \(include\)
+ CMP0106-WARN.cmake:2 \(include\)
+ CMakeLists.txt:7 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0106/CMP0106-WARN.cmake b/Tests/RunCMake/CMP0106/CMP0106-WARN.cmake
new file mode 100644
index 000000000..99f6c396c
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMP0106-WARN.cmake
@@ -0,0 +1,2 @@
+set(should_find ON)
+include(CMP0106-Common.cmake)
diff --git a/Tests/RunCMake/CMP0106/CMakeLists.txt b/Tests/RunCMake/CMP0106/CMakeLists.txt
new file mode 100644
index 000000000..eafa64235
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.1)
+if (RunCMake_TEST STREQUAL "CMP0106-WARN-VTK")
+ project(VTK NONE)
+else ()
+ project(${RunCMake_TEST} NONE)
+endif ()
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0106/RunCMakeTest.cmake b/Tests/RunCMake/CMP0106/RunCMakeTest.cmake
new file mode 100644
index 000000000..acec05426
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/RunCMakeTest.cmake
@@ -0,0 +1,7 @@
+include(RunCMake)
+
+run_cmake(CMP0106-OLD)
+run_cmake(CMP0106-NEW)
+run_cmake(CMP0106-WARN)
+run_cmake(CMP0106-WARN-VTK)
+run_cmake(CMP0106-WARN-ParaView)
diff --git a/Tests/RunCMake/CMP0106/subdir/CMakeLists.txt b/Tests/RunCMake/CMP0106/subdir/CMakeLists.txt
new file mode 100644
index 000000000..ed1dd055d
--- /dev/null
+++ b/Tests/RunCMake/CMP0106/subdir/CMakeLists.txt
@@ -0,0 +1,2 @@
+project(VTK NONE)
+include(${CMAKE_CURRENT_SOURCE_DIR}/../CMP0106-Common.cmake)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 0b2ef6aa2..36409d813 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -81,7 +81,9 @@ endif()
# Test MSVC for older host CMake versions, and test
# WIN32/CMAKE_C_COMPILER_ID to fix check on Intel for Windows.
if(MSVC OR (WIN32 AND CMAKE_C_COMPILER_ID MATCHES "MSVC|Intel"))
- set(GeneratorExpression_ARGS -DLINKER_SUPPORTS_PDB=1)
+ set(LINKER_SUPPORTS_PDB 1)
+else()
+ set(LINKER_SUPPORTS_PDB 0)
endif()
add_RunCMake_test(CMP0019)
@@ -116,6 +118,12 @@ endif()
add_RunCMake_test(CMP0069)
add_RunCMake_test(CMP0081)
add_RunCMake_test(CMP0102)
+if(CMake_TEST_CUDA)
+ add_RunCMake_test(CMP0104)
+ set_property(TEST RunCMake.CMP0104 APPEND
+ PROPERTY LABELS "CUDA")
+endif()
+add_RunCMake_test(CMP0106)
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
@@ -134,9 +142,6 @@ if(CMAKE_GENERATOR MATCHES "Ninja")
if(CMAKE_Fortran_COMPILER)
list(APPEND Ninja_ARGS -DTEST_Fortran=1)
endif()
- if(CMake_TEST_Qt5 AND Qt5Core_FOUND)
- list(APPEND Ninja_ARGS -DCMake_TEST_Qt5=1 -DCMAKE_TEST_Qt5Core_Version=${Qt5Core_VERSION})
- endif()
add_RunCMake_test(Ninja)
set(NinjaMultiConfig_ARGS
-DCYGWIN=${CYGWIN}
@@ -148,6 +153,8 @@ if(CMAKE_GENERATOR MATCHES "Ninja")
list(APPEND NinjaMultiConfig_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
endif()
add_RunCMake_test(NinjaMultiConfig)
+ set_property(TEST RunCMake.NinjaMultiConfig APPEND
+ PROPERTY LABELS "CUDA")
endif()
add_RunCMake_test(CTest)
@@ -172,7 +179,20 @@ 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(BuildDepends)
+if(NOT DEFINED CMake_TEST_BuildDepends_GNU_AS
+ AND CMAKE_C_COMPILER_ID STREQUAL "GNU"
+ AND CMAKE_GENERATOR MATCHES "^Ninja"
+ )
+ execute_process(COMMAND "${CMAKE_C_COMPILER}" -print-prog-name=as
+ RESULT_VARIABLE _gnu_res
+ OUTPUT_VARIABLE _gnu_as OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
+ if(_gnu_res EQUAL 0 AND _gnu_as)
+ set(CMake_TEST_BuildDepends_GNU_AS "${_gnu_as}")
+ endif()
+endif()
+add_RunCMake_test(BuildDepends
+ -DCMake_TEST_BuildDepends_GNU_AS=${CMake_TEST_BuildDepends_GNU_AS}
+ )
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
endif()
@@ -183,19 +203,32 @@ endif()
add_RunCMake_test(CompilerNotFound)
add_RunCMake_test(Configure -DMSVC_IDE=${MSVC_IDE})
add_RunCMake_test(DisallowedCommands)
+if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
+ add_RunCMake_test(ExportCompileCommands)
+endif()
add_RunCMake_test(ExternalData)
add_RunCMake_test(FeatureSummary)
add_RunCMake_test(FPHSA)
-add_RunCMake_test(FileAPI -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
+add_RunCMake_test(FileAPI -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
+ -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID})
add_RunCMake_test(FindBoost)
add_RunCMake_test(FindLua)
add_RunCMake_test(FindOpenGL)
if(CMake_TEST_UseSWIG)
+ add_RunCMake_test(FindSWIG)
add_RunCMake_test(UseSWIG -DCMake_TEST_FindPython=${CMake_TEST_FindPython})
endif()
if(NOT CMAKE_C_COMPILER_ID MATCHES "Watcom")
add_RunCMake_test(GenerateExportHeader)
endif()
+add_RunCMake_test(GenEx-COMPILE_LANGUAGE)
+add_RunCMake_test(GenEx-COMPILE_LANG_AND_ID)
+add_RunCMake_test(GenEx-LINK_LANGUAGE)
+add_RunCMake_test(GenEx-LINK_LANG_AND_ID)
+add_RunCMake_test(GenEx-HOST_LINK)
+add_RunCMake_test(GenEx-DEVICE_LINK)
+add_RunCMake_test(GenEx-TARGET_FILE -DLINKER_SUPPORTS_PDB=${LINKER_SUPPORTS_PDB})
+add_RunCMake_test(GenEx-GENEX_EVAL)
add_RunCMake_test(GeneratorExpression)
add_RunCMake_test(GeneratorInstance)
add_RunCMake_test(GeneratorPlatform)
@@ -254,6 +287,7 @@ add_RunCMake_test(add_dependencies)
add_RunCMake_test(add_executable)
add_RunCMake_test(add_library)
add_RunCMake_test(add_subdirectory)
+add_RunCMake_test(add_test)
add_RunCMake_test(build_command)
add_executable(exit_code exit_code.c)
set(execute_process_ARGS -DEXIT_CODE_EXE=$<TARGET_FILE:exit_code>)
@@ -262,6 +296,7 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
endif()
add_RunCMake_test(execute_process)
add_RunCMake_test(export)
+add_RunCMake_test(cmake_language)
add_RunCMake_test(cmake_minimum_required)
add_RunCMake_test(cmake_parse_arguments)
add_RunCMake_test(continue)
@@ -282,7 +317,7 @@ add_RunCMake_test(ctest_upload)
add_RunCMake_test(ctest_fixtures)
add_RunCMake_test(file)
add_RunCMake_test(find_file)
-add_RunCMake_test(find_library)
+add_RunCMake_test(find_library -DCYGWIN=${CYGWIN})
add_RunCMake_test(find_package)
add_RunCMake_test(find_path)
add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
@@ -335,6 +370,7 @@ function(add_RunCMake_test_try_compile)
CMAKE_CXX_COMPILER_VERSION
CMAKE_CXX_STANDARD_DEFAULT
CMake_TEST_CUDA
+ CMake_TEST_FILESYSTEM_1S
CMAKE_OBJC_STANDARD_DEFAULT
CMAKE_OBJCXX_STANDARD_DEFAULT
)
@@ -343,6 +379,8 @@ function(add_RunCMake_test_try_compile)
endif()
endforeach()
add_RunCMake_test(try_compile)
+ set_property(TEST RunCMake.try_compile APPEND
+ PROPERTY LABELS "CUDA")
endfunction()
add_RunCMake_test_try_compile()
@@ -395,9 +433,13 @@ endif()
if(TARGET ctresalloc)
add_RunCMake_test(CTestResourceAllocation -DCTRESALLOC_COMMAND=$<TARGET_FILE:ctresalloc>)
else()
- message(WARNING "Could not find or build ctresalloc")
+ message(STATUS "Could not find ctresalloc")
endif()
+if(NOT WIN32)
+ add_RunCMake_test(SymlinkTrees)
+endif ()
+
find_package(Qt4 QUIET)
find_package(Qt5Core QUIET)
if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0)
@@ -450,12 +492,20 @@ if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
add_RunCMake_test(Framework)
endif()
+add_RunCMake_test(File_Archive)
+add_RunCMake_test(File_Configure)
add_RunCMake_test(File_Generate)
add_RunCMake_test(ExportWithoutLanguage)
add_RunCMake_test(target_link_directories)
add_RunCMake_test(target_link_libraries)
+add_RunCMake_test(target_link_libraries-ALIAS)
+add_RunCMake_test(target_link_libraries-LINK_LANGUAGE)
+add_RunCMake_test(target_link_libraries-LINK_LANG_AND_ID)
add_RunCMake_test(add_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
-add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
+add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
+set_property(TEST RunCMake.target_link_options APPEND
+ PROPERTY LABELS "CUDA")
add_RunCMake_test(target_compile_definitions)
add_RunCMake_test(target_compile_features)
@@ -464,6 +514,12 @@ add_RunCMake_test(target_include_directories)
add_RunCMake_test(target_sources)
add_RunCMake_test(CheckModules)
add_RunCMake_test(CheckIPOSupported)
+if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin)"
+ AND (CMAKE_C_COMPILER_ID MATCHES "Clang|GNU" OR CMAKE_Fortran_COMPILER_ID MATCHES "GNU"))
+ add_RunCMake_test(CheckLinkerFlag -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMAKE_Fortran_COMPILER_ID=${CMAKE_Fortran_COMPILER_ID})
+endif()
+
add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
add_RunCMake_test(CommandLineTar)
@@ -473,11 +529,15 @@ else()
set(NO_NAMELINK 0)
endif()
-add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN}
-DCMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN=${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN}
-DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
-DCMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG=${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}
-DCMAKE_EXECUTABLE_FORMAT=${CMAKE_EXECUTABLE_FORMAT}
+ )
+
+add_RunCMake_test(file-GET_RUNTIME_DEPENDENCIES
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMake_INSTALL_NAME_TOOL_BUG=${CMake_INSTALL_NAME_TOOL_BUG}
)
@@ -559,6 +619,8 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_OBJC=1)
endif()
add_RunCMake_test(CompilerLauncher)
+ set_property(TEST RunCMake.CompilerLauncher APPEND
+ PROPERTY LABELS "CUDA")
add_RunCMake_test(ctest_labels_for_subprojects)
endif()
@@ -652,5 +714,5 @@ endif()
add_RunCMake_test("CTestCommandExpandLists")
-add_RunCMake_test(PrecompileHeaders)
+add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
add_RunCMake_test("UnityBuild")
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 3be1fd056..064b4dca6 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -20,6 +20,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_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/tests/INSTALL_SCRIPTS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake
index d7d82f27d..1a1e98373 100644
--- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/VerifyResult.cmake
@@ -25,5 +25,5 @@ function(checkScripts_ FILE COMPARE_LIST)
endforeach()
endfunction()
-checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\"")
-checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\"")
+checkScripts_("${FOUND_FILE_1}" "echo \"pre install foo\";echo \"post install foo\";echo \"pre uninstall foo\";echo \"post uninstall foo\";echo \"pre trans foo\";echo \"post trans foo\"")
+checkScripts_("${FOUND_FILE_2}" "echo \"pre install\";echo \"post install\";echo \"pre uninstall\";echo \"post uninstall\";echo \"pre trans\";echo \"post trans\"")
diff --git a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake
index fb1b8de68..c200fa502 100644
--- a/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake
+++ b/Tests/RunCMake/CPack/tests/INSTALL_SCRIPTS/test.cmake
@@ -7,6 +7,10 @@ if(GENERATOR_TYPE STREQUAL "RPM")
"${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh")
set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh")
+ set(CPACK_RPM_PRE_TRANS_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/pre_trans.sh")
+ set(CPACK_RPM_POST_TRANS_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/post_trans.sh")
set(CPACK_RPM_foo_PRE_INSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh")
@@ -16,6 +20,10 @@ if(GENERATOR_TYPE STREQUAL "RPM")
"${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh")
set(CPACK_RPM_foo_POST_UNINSTALL_SCRIPT_FILE
"${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh")
+ set(CPACK_RPM_foo_PRE_TRANS_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh")
+ set(CPACK_RPM_foo_POST_TRANS_SCRIPT_FILE
+ "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh")
endif()
set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
@@ -29,6 +37,10 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall.sh"
"echo \"pre uninstall\"\n")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall.sh"
"echo \"post uninstall\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_trans.sh"
+ "echo \"pre trans\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_trans.sh"
+ "echo \"post trans\"\n")
# specific
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_install_foo.sh"
@@ -39,6 +51,10 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_uninstall_foo.sh"
"echo \"pre uninstall foo\"\n")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_uninstall_foo.sh"
"echo \"post uninstall foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pre_trans_foo.sh"
+ "echo \"pre trans foo\"\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/post_trans_foo.sh"
+ "echo \"post trans foo\"\n")
install(FILES CMakeLists.txt DESTINATION foo COMPONENT foo)
install(FILES CMakeLists.txt DESTINATION bar COMPONENT bar)
diff --git a/Tests/RunCMake/CPack/tests/THREADED/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/THREADED/ExpectedFiles.cmake
new file mode 100644
index 000000000..d1a3a5fb2
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/THREADED/ExpectedFiles.cmake
@@ -0,0 +1,2 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
diff --git a/Tests/RunCMake/CPack/tests/THREADED/test.cmake b/Tests/RunCMake/CPack/tests/THREADED/test.cmake
new file mode 100644
index 000000000..78fc9e93e
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/THREADED/test.cmake
@@ -0,0 +1,7 @@
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
+
+set(CPACK_ARCHIVE_THREADS 2)
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(CPACK_COMPONENTS_ALL test)
+endif()
diff --git a/Tests/RunCMake/CPack/tests/THREADED_ALL/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/THREADED_ALL/ExpectedFiles.cmake
new file mode 100644
index 000000000..d1a3a5fb2
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/THREADED_ALL/ExpectedFiles.cmake
@@ -0,0 +1,2 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
diff --git a/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake b/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake
new file mode 100644
index 000000000..34051b85b
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/THREADED_ALL/test.cmake
@@ -0,0 +1,7 @@
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
+
+set(CPACK_ARCHIVE_THREADS 0)
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(CPACK_COMPONENTS_ALL test)
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/MemCheckSan.cmake b/Tests/RunCMake/CTestCommandLine/MemCheckSan.cmake
new file mode 100644
index 000000000..192c30c6e
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/MemCheckSan.cmake
@@ -0,0 +1,7 @@
+set(MEMORYCHECK_COMMAND "")
+include(CTest)
+add_test(
+ NAME TestSan
+ COMMAND ${CMAKE_COMMAND}
+ -P ${CMAKE_CURRENT_LIST_DIR}/../ctest_memcheck/test${MEMORYCHECK_TYPE}.cmake
+ )
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 9b9ae65b0..e05ad791c 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -242,6 +242,20 @@ function(run_TestOutputSize)
endfunction()
run_TestOutputSize()
+# Test --stop-on-failure
+function(run_stop_on_failure)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/stop-on-failure)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E false)
+add_test(test2 \"${CMAKE_COMMAND}\" -E echo \"not running\")
+")
+ run_cmake_command(stop-on-failure ${CMAKE_CTEST_COMMAND} --stop-on-failure)
+endfunction()
+run_stop_on_failure()
+
function(run_TestAffinity)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestAffinity)
set(RunCMake_TEST_NO_CLEAN 1)
@@ -345,3 +359,24 @@ run_NoTests()
# Check the configuration type variable is passed
run_ctest(check-configuration-type)
+
+function(run_MemCheckSan case opts)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/MemCheckSan${case}-build)
+ set(RunCMake_TEST_OPTIONS
+ "-DMEMORYCHECK_TYPE=${case}Sanitizer"
+ "-DMEMORYCHECK_SANITIZER_OPTIONS=${opts}"
+ )
+ run_cmake(MemCheckSan)
+ unset(RunCMake_TEST_OPTIONS)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake-stdout-file "../ctest_memcheck/Dummy${case}Sanitizer-stdout.txt")
+ run_cmake_command(MemCheckSan${case}-ctest
+ ${CMAKE_CTEST_COMMAND} -C Debug -M Experimental -T MemCheck -V
+ )
+endfunction()
+run_MemCheckSan(Address "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode=55")
+run_MemCheckSan(Leak "simulate_sanitizer=1:report_bugs=1:history_size=5:exitcode=55")
+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")
diff --git a/Tests/RunCMake/CTestCommandLine/stop-on-failure-result.txt b/Tests/RunCMake/CTestCommandLine/stop-on-failure-result.txt
new file mode 100644
index 000000000..45a4fb75d
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/stop-on-failure-result.txt
@@ -0,0 +1 @@
+8
diff --git a/Tests/RunCMake/CTestCommandLine/stop-on-failure-stderr.txt b/Tests/RunCMake/CTestCommandLine/stop-on-failure-stderr.txt
new file mode 100644
index 000000000..ba4235def
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/stop-on-failure-stderr.txt
@@ -0,0 +1 @@
+Errors while running CTest
diff --git a/Tests/RunCMake/CTestCommandLine/stop-on-failure-stdout.txt b/Tests/RunCMake/CTestCommandLine/stop-on-failure-stdout.txt
new file mode 100644
index 000000000..12c77d000
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/stop-on-failure-stdout.txt
@@ -0,0 +1,10 @@
+^Test project .*/Tests/RunCMake/CTestCommandLine/stop-on-failure
+ Start 1: test1
+1/2 Test #1: test1 ............................\*\*\*Failed +[0-9.]+ sec
++
+0% tests passed, 1 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec
++
+The following tests FAILED:
+[ ]+1 - test1 \(Failed\)$
diff --git a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
index 858478647..f5f069920 100644
--- a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
@@ -38,6 +38,13 @@ function(run_ctresalloc_verify name tests)
run_cmake_command(${name} "${CTRESALLOC_COMMAND}" verify "${RunCMake_SOURCE_DIR}/${name}.log" "${CMAKE_CURRENT_LIST_DIR}/resspec.json" "${tests}")
endfunction()
+function(read_testing_file filename variable)
+ file(READ "${RunCMake_TEST_BINARY_DIR}/Testing/TAG" _tag)
+ string(REGEX REPLACE "^([^\n]*)\n.*$" "\\1" _date "${_tag}")
+ file(READ "${RunCMake_TEST_BINARY_DIR}/Testing/${_date}/${filename}" _contents)
+ set("${variable}" "${_contents}" PARENT_SCOPE)
+endfunction()
+
unset(ENV{CTEST_RESOURCE_GROUP_COUNT})
set(RunCMake_TEST_NO_CLEAN 1)
file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/ctresalloc-write-proc-good1-build")
@@ -140,9 +147,14 @@ run_ctresalloc_verify(ctresalloc-verify-noend "test1")
# Now test the resource allocation feature of CTest
###############################################################################
-function(run_ctest_resource name parallel random)
- run_ctest("${name}-ctest-s-res" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
- run_ctest("${name}-ctest-s-nores" "-DCTEST_RESOURCE_ALLOC_ENABLED=0" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+function(run_ctest_resource name parallel random extra)
+ run_ctest("${name}-ctest-s-res" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTEST_RESOURCE_SPEC_SOURCE=ARG" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+ run_ctest("${name}-ctest-s-nores" "-DCTEST_RESOURCE_ALLOC_ENABLED=0" "-DCTEST_RESOURCE_SPEC_SOURCE=NONE" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+ if(extra)
+ run_ctest("${name}-ctest-s-res-variable" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTEST_RESOURCE_SPEC_SOURCE=VARIABLE" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+ run_ctest("${name}-ctest-s-res-cache" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTEST_RESOURCE_SPEC_SOURCE=CACHE" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+ run_ctest("${name}-ctest-s-res-cmdline" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTEST_RESOURCE_SPEC_SOURCE=CMDLINE" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}" --resource-spec-file "${RunCMake_SOURCE_DIR}/resspec.json")
+ endif()
endfunction()
function(verify_ctest_resources)
@@ -155,15 +167,15 @@ function(verify_ctest_resources)
endif()
endfunction()
-run_ctest_resource(lotsoftests 10 1)
-run_ctest_resource(checkfree1 2 0)
-run_ctest_resource(checkfree2 1 0)
-run_ctest_resource(notenough1 1 0)
-run_ctest_resource(notenough2 1 0)
-run_ctest_resource(notenough3 1 0)
-run_ctest_resource(combine 1 0)
-run_ctest_resource(ensure_parallel 2 0)
+run_ctest_resource(lotsoftests 10 1 0)
+run_ctest_resource(checkfree1 2 0 1)
+run_ctest_resource(checkfree2 1 0 0)
+run_ctest_resource(notenough1 1 0 1)
+run_ctest_resource(notenough2 1 0 0)
+run_ctest_resource(notenough3 1 0 0)
+run_ctest_resource(combine 1 0 0)
+run_ctest_resource(ensure_parallel 2 0 0)
set(ENV{CTEST_RESOURCE_GROUP_COUNT} 2)
-run_ctest_resource(process_count 1 0)
+run_ctest_resource(process_count 1 0 0)
unset(ENV{CTEST_RESOURCE_GROUP_COUNT})
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cache-check.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cache-check.cmake
new file mode 100644
index 000000000..ceda72ea8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cache-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cmdline-check.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cmdline-check.cmake
new file mode 100644
index 000000000..ceda72ea8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-cmdline-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-variable-check.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-variable-check.cmake
new file mode 100644
index 000000000..ceda72ea8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-variable-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx b/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
index 80db05eb6..daf8a2d80 100644
--- a/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
@@ -1,6 +1,6 @@
#include <cassert>
#include <chrono>
-#include <cstddef>
+#include <cstddef> // IWYU pragma: keep
#include <cstdlib>
#include <iostream>
#include <map>
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-check.cmake
new file mode 100644
index 000000000..321e9a2f8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-stderr.txt
new file mode 100644
index 000000000..521a34b19
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache-stderr.txt
@@ -0,0 +1,14 @@
+^Insufficient resources for test Test1:
+
+ Test requested resources of type 'fluxcapacitors' in the following amounts:
+ 200 slots
+ but only the following units were available:
+ 'outatime': 121 slots
+
+Resource spec file:
+
+ [^
+]*/Tests/RunCMake/CTestResourceAllocation/resspec.json
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cache/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-check.cmake
new file mode 100644
index 000000000..321e9a2f8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-stderr.txt
new file mode 100644
index 000000000..c6f9cfc5f
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline-stderr.txt
@@ -0,0 +1,14 @@
+^Insufficient resources for test Test1:
+
+ Test requested resources of type 'fluxcapacitors' in the following amounts:
+ 200 slots
+ but only the following units were available:
+ 'outatime': 121 slots
+
+Resource spec file:
+
+ [^
+]*/Tests/RunCMake/CTestResourceAllocation/resspec.json
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-cmdline/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-check.cmake
new file mode 100644
index 000000000..321e9a2f8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-stderr.txt
new file mode 100644
index 000000000..dcf13e0a1
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable-stderr.txt
@@ -0,0 +1,14 @@
+^Insufficient resources for test Test1:
+
+ Test requested resources of type 'fluxcapacitors' in the following amounts:
+ 200 slots
+ but only the following units were available:
+ 'outatime': 121 slots
+
+Resource spec file:
+
+ [^
+]*/Tests/RunCMake/CTestResourceAllocation/resspec.json
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-variable/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-nores-check.cmake b/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-nores-check.cmake
new file mode 100644
index 000000000..c6e72bd2e
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-nores-check.cmake
@@ -0,0 +1,4 @@
+read_testing_file("Test.xml" _test_contents)
+if(NOT _test_contents MATCHES "#CTEST_RESOURCE_GROUP_COUNT=")
+ string(APPEND RunCMake_TEST_FAILED "Could not find unset variable CTEST_RESOURCE_GROUP_COUNT in test measurements\n")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake
index ceda72ea8..585c36bd4 100644
--- a/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake
@@ -1 +1,9 @@
verify_ctest_resources()
+
+read_testing_file("Test.xml" _test_contents)
+if(NOT _test_contents MATCHES "\nCTEST_RESOURCE_GROUP_0=widgets")
+ string(APPEND RunCMake_TEST_FAILED "Could not find variable CTEST_RESOURCE_GROUP_0 in test measurements\n")
+endif()
+if(NOT _test_contents MATCHES "\nCTEST_RESOURCE_GROUP_0_WIDGETS=id:")
+ string(APPEND RunCMake_TEST_FAILED "Could not find variable CTEST_RESOURCE_GROUP_0_WIDGETS in test measurements\n")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/test.cmake.in b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in
index 4b426f161..9ad9ac813 100644
--- a/Tests/RunCMake/CTestResourceAllocation/test.cmake.in
+++ b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in
@@ -8,15 +8,26 @@ set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
-ctest_start(Experimental QUIET)
-ctest_configure(OPTIONS
+set(config_options
"-DCTEST_RESOURCE_ALLOC_ENABLED=${CTEST_RESOURCE_ALLOC_ENABLED};-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}"
)
-ctest_build()
-if(CTEST_RESOURCE_ALLOC_ENABLED)
+if(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "CMDLINE")
+ list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json")
+elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "ARG")
set(resspec RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/resspec.json")
+ set(CTEST_RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/noexist.json")
+ list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json")
+elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "VARIABLE")
+ set(CTEST_RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/resspec.json")
+ list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/noexist.json")
+elseif(CTEST_RESOURCE_SPEC_SOURCE STREQUAL "CACHE")
+ list(APPEND config_options "-DCTEST_RESOURCE_SPEC_FILE=@RunCMake_SOURCE_DIR@/resspec.json")
endif()
+
+ctest_start(Experimental QUIET)
+ctest_configure(OPTIONS "${config_options}")
+ctest_build()
ctest_test(${resspec} RETURN_VALUE retval PARALLEL_LEVEL ${CTEST_PARALLEL} SCHEDULE_RANDOM ${CTEST_RANDOM})
if(retval)
message(FATAL_ERROR "Tests did not pass")
diff --git a/Tests/RunCMake/CheckLinkerFlag/CMakeLists.txt b/Tests/RunCMake/CheckLinkerFlag/CMakeLists.txt
new file mode 100644
index 000000000..0421e2803
--- /dev/null
+++ b/Tests/RunCMake/CheckLinkerFlag/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.13)
+
+project(${RunCMake_TEST} LANGUAGES NONE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckCLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckCLinkerFlag.cmake
new file mode 100644
index 000000000..c8e87a474
--- /dev/null
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckCLinkerFlag.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_LANGUAGE C)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckLinkerFlag.cmake")
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckCXXLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckCXXLinkerFlag.cmake
new file mode 100644
index 000000000..4e299b989
--- /dev/null
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckCXXLinkerFlag.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_LANGUAGE CXX)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckLinkerFlag.cmake")
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckFortranLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckFortranLinkerFlag.cmake
new file mode 100644
index 000000000..bca288ea0
--- /dev/null
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckFortranLinkerFlag.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_LANGUAGE Fortran)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckLinkerFlag.cmake")
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlag.cmake
new file mode 100644
index 000000000..c3bd4658f
--- /dev/null
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckLinkerFlag.cmake
@@ -0,0 +1,14 @@
+
+enable_language (${CHECK_LANGUAGE})
+
+include(CheckLinkerFlag)
+
+check_linker_flag(${CHECK_LANGUAGE} "LINKER:-L,/dir" VALID_LINKER_FLAG)
+if(NOT VALID_LINKER_FLAG)
+ message(SEND_ERROR "Test fail for valid linker flag.")
+endif()
+
+check_linker_flag(${CHECK_LANGUAGE} "LINKER:-D" INVALID_LINKER_FLAG)
+if(INVALID_LINKER_FLAG)
+ message(SEND_ERROR "Test fail for invalid linker flag.")
+endif()
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckOBJCLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckOBJCLinkerFlag.cmake
new file mode 100644
index 000000000..fa1d18e38
--- /dev/null
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckOBJCLinkerFlag.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_LANGUAGE OBJC)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckLinkerFlag.cmake")
diff --git a/Tests/RunCMake/CheckLinkerFlag/CheckOBJCXXLinkerFlag.cmake b/Tests/RunCMake/CheckLinkerFlag/CheckOBJCXXLinkerFlag.cmake
new file mode 100644
index 000000000..414efb8cc
--- /dev/null
+++ b/Tests/RunCMake/CheckLinkerFlag/CheckOBJCXXLinkerFlag.cmake
@@ -0,0 +1,3 @@
+
+set (CHECK_LANGUAGE OBJCXX)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckLinkerFlag.cmake")
diff --git a/Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake b/Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake
new file mode 100644
index 000000000..224a2a3d0
--- /dev/null
+++ b/Tests/RunCMake/CheckLinkerFlag/RunCMakeTest.cmake
@@ -0,0 +1,14 @@
+include(RunCMake)
+
+if (CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
+ run_cmake(CheckCLinkerFlag)
+ run_cmake(CheckCXXLinkerFlag)
+ if (APPLE)
+ run_cmake(CheckOBJCLinkerFlag)
+ run_cmake(CheckOBJCXXLinkerFlag)
+ endif()
+endif()
+
+if (CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
+ run_cmake(CheckFortranLinkerFlag)
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
index b4b170ef2..03286f1f7 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":0}]},{"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":1}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":true,"version":{.*}}$
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-result.txt b/Tests/RunCMake/CommandLine/E_cat_directory-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-result.txt
+++ b/Tests/RunCMake/CommandLine/E_cat_directory-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_cat_directory-stderr.txt b/Tests/RunCMake/CommandLine/E_cat_directory-stderr.txt
new file mode 100644
index 000000000..c4d0d4826
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_cat_directory-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: .* is a directory
diff --git a/Tests/RunCMake/CommandLine/E_cat_good_cat-stdout.txt b/Tests/RunCMake/CommandLine/E_cat_good_cat-stdout.txt
new file mode 100644
index 000000000..aae90e6f0
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_cat_good_cat-stdout.txt
@@ -0,0 +1,3 @@
+first file to append
+second file to append
+àéùç - 한국어
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-result.txt b/Tests/RunCMake/CommandLine/E_cat_non_existing_file-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-result.txt
+++ b/Tests/RunCMake/CommandLine/E_cat_non_existing_file-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_cat_non_existing_file-stderr.txt b/Tests/RunCMake/CommandLine/E_cat_non_existing_file-stderr.txt
new file mode 100644
index 000000000..0d8fc4bcb
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_cat_non_existing_file-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: .*: no such file or directory \(ignoring\)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-result.txt b/Tests/RunCMake/CommandLine/E_cat_non_readable_file-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-result.txt
+++ b/Tests/RunCMake/CommandLine/E_cat_non_readable_file-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_cat_non_readable_file-stderr.txt b/Tests/RunCMake/CommandLine/E_cat_non_readable_file-stderr.txt
new file mode 100644
index 000000000..97ec822e2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_cat_non_readable_file-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: .*: permission denied \(ignoring\)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-result.txt b/Tests/RunCMake/CommandLine/E_cat_option_not_handled-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-result.txt
+++ b/Tests/RunCMake/CommandLine/E_cat_option_not_handled-result.txt
diff --git a/Tests/RunCMake/CommandLine/E_cat_option_not_handled-stderr.txt b/Tests/RunCMake/CommandLine/E_cat_option_not_handled-stderr.txt
new file mode 100644
index 000000000..92f7acfa5
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_cat_option_not_handled-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: -f: option not handled
diff --git a/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake b/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake
new file mode 100644
index 000000000..29faae3a1
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/P_arbitrary_args.cmake
@@ -0,0 +1,3 @@
+if(NOT ("${CMAKE_ARGV3}" STREQUAL "--" AND "${CMAKE_ARGV4}" STREQUAL "-DFOO"))
+ message(FATAL_ERROR "`-DFOO` shouldn't trigger an error after `--`")
+endif()
diff --git a/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake b/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake
new file mode 100644
index 000000000..2e8eac1f6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/ProfilingTest-check.cmake
@@ -0,0 +1,31 @@
+if (NOT EXISTS ${ProfilingTestOutput})
+ set(RunCMake_TEST_FAILED "Expected ${ProfilingTestOutput} to exists")
+endif()
+
+file(READ "${ProfilingTestOutput}" JSON_HEADER LIMIT 2)
+if (NOT JSON_HEADER MATCHES "^\\[{")
+ set(RunCMake_TEST_FAILED "Expected valid JSON start")
+ return()
+endif()
+
+file(SIZE "${ProfilingTestOutput}" OUTPUT_SIZE)
+math(EXPR END_OFFSET "${OUTPUT_SIZE} -2 ")
+
+file(READ "${ProfilingTestOutput}" JSON_TRAILER OFFSET ${END_OFFSET})
+if (NOT JSON_TRAILER MATCHES "^}]$")
+ set(RunCMake_TEST_FAILED "Expected valid JSON end")
+ return()
+endif()
+
+file(STRINGS ${ProfilingTestOutput} upperCaseCommand
+ REGEX [["name"[ ]*:[ ]*"__TESTING_COMMAND_CASE"]])
+if (NOT "${upperCaseCommand}" STREQUAL "")
+ set(RunCMake_TEST_FAILED "Command name not stored in lowercase")
+endif()
+file(STRINGS ${ProfilingTestOutput} lowerCaseCommand
+ REGEX [["name"[ ]*:[ ]*"__testing_command_case"]])
+list(LENGTH lowerCaseCommand numInvocations)
+if (NOT numInvocations EQUAL 1)
+ set(RunCMake_TEST_FAILED
+ "Unexpected number of lowercase command names: ${numInvocations}")
+endif()
diff --git a/Tests/RunCMake/CommandLine/ProfilingTest.cmake b/Tests/RunCMake/CommandLine/ProfilingTest.cmake
new file mode 100644
index 000000000..4cf0c3070
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/ProfilingTest.cmake
@@ -0,0 +1,5 @@
+function(__testing_command_case)
+endfunction()
+
+# This must not appear in the profiling output as uppercase
+__TESTING_COMMAND_CASE()
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index 893072134..973391d64 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -46,6 +46,7 @@ run_cmake_command(G_no-arg ${CMAKE_COMMAND} -B DummyBuildDir -G)
run_cmake_command(G_bad-arg ${CMAKE_COMMAND} -B DummyBuildDir -G NoSuchGenerator)
run_cmake_command(P_no-arg ${CMAKE_COMMAND} -P)
run_cmake_command(P_no-file ${CMAKE_COMMAND} -P nosuchscriptfile.cmake)
+run_cmake_command(P_arbitrary_args ${CMAKE_COMMAND} -P "${RunCMake_SOURCE_DIR}/P_arbitrary_args.cmake" -- -DFOO)
run_cmake_command(build-no-dir
${CMAKE_COMMAND} --build)
@@ -459,6 +460,44 @@ if(NOT WIN32 AND NOT CYGWIN)
endif()
unset(out)
+# cat tests
+set(out ${RunCMake_BINARY_DIR}/cat_tests)
+file(REMOVE_RECURSE "${out}")
+file(MAKE_DIRECTORY ${out})
+run_cmake_command(E_cat_non_existing_file
+ ${CMAKE_COMMAND} -E cat ${out}/non-existing-file.txt)
+
+if(UNIX)
+ # test non readable file only if not root
+ execute_process(
+ COMMAND id -u $ENV{USER}
+ OUTPUT_VARIABLE uid
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(NOT "${uid}" STREQUAL "0")
+ # Create non readable file
+ set(inside_folder "${out}/in")
+ file(MAKE_DIRECTORY ${inside_folder})
+ file(WRITE "${inside_folder}/non_readable_file.txt" "first file to append\n")
+ file(COPY "${inside_folder}/non_readable_file.txt" DESTINATION "${out}" FILE_PERMISSIONS OWNER_WRITE)
+ run_cmake_command(E_cat_non_readable_file
+ ${CMAKE_COMMAND} -E cat "${out}/non_readable_file.txt")
+ endif()
+endif()
+
+run_cmake_command(E_cat_option_not_handled
+ ${CMAKE_COMMAND} -E cat -f)
+
+run_cmake_command(E_cat_directory
+ ${CMAKE_COMMAND} -E cat ${out})
+
+file(WRITE "${out}/first_file.txt" "first file to append\n")
+file(WRITE "${out}/second_file.txt" "second file to append\n")
+file(WRITE "${out}/unicode_file.txt" "àéùç - 한국어") # Korean in Korean
+run_cmake_command(E_cat_good_cat
+ ${CMAKE_COMMAND} -E cat "${out}/first_file.txt" "${out}/second_file.txt" "${out}/unicode_file.txt")
+unset(out)
+
run_cmake_command(E_env-no-command0 ${CMAKE_COMMAND} -E env)
run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1)
run_cmake_command(E_env-bad-arg1 ${CMAKE_COMMAND} -E env -bad-arg1)
@@ -696,3 +735,25 @@ function(run_llvm_rc)
unset(LLVMRC_RESULT)
endfunction()
run_llvm_rc()
+
+set(RunCMake_TEST_OPTIONS --profiling-output=/no/such/file.txt --profiling-format=google-trace)
+run_cmake(profiling-all-params)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS --profiling-output=/no/such/file.txt --profiling-format=invalid-format)
+run_cmake(profiling-invalid-format)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS --profiling-output=/no/such/file.txt)
+run_cmake(profiling-missing-format)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS --profiling-format=google-trace)
+run_cmake(profiling-missing-output)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/profiling-test")
+set(ProfilingTestOutput ${RunCMake_TEST_BINARY_DIR}/output.json)
+set(RunCMake_TEST_OPTIONS --profiling-format=google-trace --profiling-output=${ProfilingTestOutput})
+run_cmake(ProfilingTest)
+unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h b/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
index bf56ec694..2d3917895 100644
--- a/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
+++ b/Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h
Binary files differ
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-result.txt b/Tests/RunCMake/CommandLine/profiling-all-params-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-result.txt
+++ b/Tests/RunCMake/CommandLine/profiling-all-params-result.txt
diff --git a/Tests/RunCMake/CommandLine/profiling-all-params-stderr.txt b/Tests/RunCMake/CommandLine/profiling-all-params-stderr.txt
new file mode 100644
index 000000000..6b5c37384
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/profiling-all-params-stderr.txt
@@ -0,0 +1 @@
+^.*Could not start profiling: Unable to open: /no/such/file.txt$
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-result.txt b/Tests/RunCMake/CommandLine/profiling-invalid-format-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-result.txt
+++ b/Tests/RunCMake/CommandLine/profiling-invalid-format-result.txt
diff --git a/Tests/RunCMake/CommandLine/profiling-invalid-format-stderr.txt b/Tests/RunCMake/CommandLine/profiling-invalid-format-stderr.txt
new file mode 100644
index 000000000..459bc3a7b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/profiling-invalid-format-stderr.txt
@@ -0,0 +1 @@
+^.*Invalid format specified for --profiling-format$
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-result.txt b/Tests/RunCMake/CommandLine/profiling-missing-format-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-result.txt
+++ b/Tests/RunCMake/CommandLine/profiling-missing-format-result.txt
diff --git a/Tests/RunCMake/CommandLine/profiling-missing-format-stderr.txt b/Tests/RunCMake/CommandLine/profiling-missing-format-stderr.txt
new file mode 100644
index 000000000..459bc3a7b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/profiling-missing-format-stderr.txt
@@ -0,0 +1 @@
+^.*Invalid format specified for --profiling-format$
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target-result.txt b/Tests/RunCMake/CommandLine/profiling-missing-output-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target-result.txt
+++ b/Tests/RunCMake/CommandLine/profiling-missing-output-result.txt
diff --git a/Tests/RunCMake/CommandLine/profiling-missing-output-stderr.txt b/Tests/RunCMake/CommandLine/profiling-missing-output-stderr.txt
new file mode 100644
index 000000000..9ab0c8f3e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/profiling-missing-output-stderr.txt
@@ -0,0 +1 @@
+^.*--profiling-format specified but no --profiling-output!$
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake
index 6f7fc8682..ca25b2a26 100644
--- a/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0104 NEW)
enable_language(CUDA)
set(CMAKE_VERBOSE_MAKEFILE TRUE)
add_executable(main main.cu)
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
index 588b77b37..3cbbc070e 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
@@ -7,22 +7,22 @@ endif()
set(error_details "There is a problem with generated test file: ${testfile}")
-if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulator [^\n]+pseudo_emulator[^\n]+\n")
+if(testfile_contents MATCHES "add_test[(][\"]DoesNotUseEmulator[\"] [^\n]+pseudo_emulator[^\n]+\n")
message(SEND_ERROR "Used emulator when it should not be used. ${error_details}")
endif()
-if(NOT testfile_contents MATCHES "add_test[(]UsesEmulator [^\n]+pseudo_emulator[^\n]+\n")
+if(NOT testfile_contents MATCHES "add_test[(][\"]UsesEmulator[\"] [^\n]+pseudo_emulator[^\n]+\n")
message(SEND_ERROR "Did not use emulator when it should be used. ${error_details}")
endif()
-if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulatorWithGenex [^\n]+pseudo_emulator[^\n]+\n")
+if(testfile_contents MATCHES "add_test[(][\"]DoesNotUseEmulatorWithGenex[\"] [^\n]+pseudo_emulator[^\n]+\n")
message(SEND_ERROR "Used emulator when it should not be used. ${error_details}")
endif()
-if(NOT testfile_contents MATCHES "add_test[(]UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex [^\n]+pseudo_emulator[^\n]+\n")
+if(NOT testfile_contents MATCHES "add_test[(][\"]UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex[\"] [^\n]+pseudo_emulator[^\n]+\n")
message(SEND_ERROR "Did not use emulator when it should be used. ${error_details}")
endif()
-if(testfile_contents MATCHES "add_test[(]DoesNotUseEmulatorWithExecTargetFromSubdirAddedWithGenex [^\n]+pseudo_emulator[^\n]+\n")
+if(testfile_contents MATCHES "add_test[(][\"]DoesNotUseEmulatorWithExecTargetFromSubdirAddedWithGenex[\"] [^\n]+pseudo_emulator[^\n]+\n")
message(SEND_ERROR "Used emulator when it should not be used. ${error_details}")
endif()
diff --git a/Tests/RunCMake/ExportCompileCommands/BeforeProject-check.cmake b/Tests/RunCMake/ExportCompileCommands/BeforeProject-check.cmake
new file mode 100644
index 000000000..87058e2fd
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/BeforeProject-check.cmake
@@ -0,0 +1,4 @@
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+ set(RunCMake_TEST_FAILED "compile_commands.json not generated")
+ return()
+endif()
diff --git a/Tests/RunCMake/ExportCompileCommands/BeforeProject.cmake b/Tests/RunCMake/ExportCompileCommands/BeforeProject.cmake
new file mode 100644
index 000000000..b8cbdefca
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/BeforeProject.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+add_library(empty STATIC empty.c)
+message(STATUS "CMAKE_EXPORT_COMPILE_COMMANDS='${CMAKE_EXPORT_COMPILE_COMMANDS}'")
diff --git a/Tests/RunCMake/ExportCompileCommands/BeforeProjectBEFORE.cmake b/Tests/RunCMake/ExportCompileCommands/BeforeProjectBEFORE.cmake
new file mode 100644
index 000000000..87f9c8793
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/BeforeProjectBEFORE.cmake
@@ -0,0 +1 @@
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
diff --git a/Tests/RunCMake/ExportCompileCommands/CMakeLists.txt b/Tests/RunCMake/ExportCompileCommands/CMakeLists.txt
new file mode 100644
index 000000000..b7117bd63
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.17)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake b/Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake
new file mode 100644
index 000000000..b540a0450
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake_with_options(BeforeProject -DCMAKE_PROJECT_INCLUDE_BEFORE=BeforeProjectBEFORE.cmake)
diff --git a/Tests/RunCMake/ExportCompileCommands/empty.c b/Tests/RunCMake/ExportCompileCommands/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ExportCompileCommands/empty.c
diff --git a/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt
index 22e13bf9a..5fa75e809 100644
--- a/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt
+++ b/Tests/RunCMake/ExternalProject/Add_StepDependencies_iface_step-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error at .*/Modules/ExternalProject.cmake:[0-9]+ \(message\):
- Target "MyProj-IFace" was not generated by ExternalProject_Add_StepTargets.
+ External project "MyProj" does not have a step "IFace".
Call Stack \(most recent call first\):
Add_StepDependencies_iface_step.cmake:[0-9]+ \(ExternalProject_Add_StepDependencies\)
CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt b/Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt
index 4cb051dbb..928d88a9c 100644
--- a/Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt
+++ b/Tests/RunCMake/ExternalProject/NO_DEPENDS-stderr.txt
@@ -2,7 +2,7 @@ CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+. \(message\):
Using NO_DEPENDS for "configure" step might break parallel builds
Call Stack \(most recent call first\):
.*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_StepTargets\)
- .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_Step\)
+ .*/Modules/ExternalProject.cmake:[0-9]+:EVAL:2 \(ExternalProject_Add_Step\)
.*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_configure_command\)
NO_DEPENDS.cmake:[0-9]+ \(ExternalProject_Add\)
CMakeLists.txt:[0-9]+ \(include\)
@@ -12,7 +12,7 @@ CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+. \(message\):
Using NO_DEPENDS for "build" step might break parallel builds
Call Stack \(most recent call first\):
.*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_StepTargets\)
- .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_Step\)
+ .*/Modules/ExternalProject.cmake:[0-9]+:EVAL:2 \(ExternalProject_Add_Step\)
.*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_build_command\)
NO_DEPENDS.cmake:[0-9]+ \(ExternalProject_Add\)
CMakeLists.txt:[0-9]+ \(include\)
@@ -22,7 +22,7 @@ CMake Warning \(dev\) at .*/Modules/ExternalProject.cmake:[0-9]+. \(message\):
Using NO_DEPENDS for "install" step might break parallel builds
Call Stack \(most recent call first\):
.*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_StepTargets\)
- .*/Modules/ExternalProject.cmake:[0-9]+ \(ExternalProject_Add_Step\)
+ .*/Modules/ExternalProject.cmake:[0-9]+:EVAL:2 \(ExternalProject_Add_Step\)
.*/Modules/ExternalProject.cmake:[0-9]+ \(_ep_add_install_command\)
NO_DEPENDS.cmake:[0-9]+ \(ExternalProject_Add\)
CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/ExternalProject/PreserveEmptyArgs-build-stdout.txt b/Tests/RunCMake/ExternalProject/PreserveEmptyArgs-build-stdout.txt
new file mode 100644
index 000000000..0e21b8ff4
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/PreserveEmptyArgs-build-stdout.txt
@@ -0,0 +1,21 @@
+.*-- Number of arguments for download: 6
+.*-- download argument 4: ''
+.*-- download argument 5: 'after'
+.*-- Number of arguments for update: 6
+.*-- update argument 4: ''
+.*-- update argument 5: 'after'
+.*-- Number of arguments for patch: 6
+.*-- patch argument 4: ''
+.*-- patch argument 5: 'after'
+.*-- Number of arguments for configure: 6
+.*-- configure argument 4: ''
+.*-- configure argument 5: 'after'
+.*-- Number of arguments for build: 6
+.*-- build argument 4: ''
+.*-- build argument 5: 'after'
+.*-- Number of arguments for install: 6
+.*-- install argument 4: ''
+.*-- install argument 5: 'after'
+.*-- Number of arguments for test: 6
+.*-- test argument 4: ''
+.*-- test argument 5: 'after'
diff --git a/Tests/RunCMake/ExternalProject/PreserveEmptyArgs.cmake b/Tests/RunCMake/ExternalProject/PreserveEmptyArgs.cmake
new file mode 100644
index 000000000..ded1000f6
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/PreserveEmptyArgs.cmake
@@ -0,0 +1,13 @@
+include(ExternalProject)
+
+set(script "${CMAKE_CURRENT_LIST_DIR}/countArgs.cmake")
+ExternalProject_Add(
+ blankChecker
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -P "${script}" download "" after
+ UPDATE_COMMAND ${CMAKE_COMMAND} -P "${script}" update "" after
+ PATCH_COMMAND ${CMAKE_COMMAND} -P "${script}" patch "" after
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -P "${script}" configure "" after
+ BUILD_COMMAND ${CMAKE_COMMAND} -P "${script}" build "" after
+ INSTALL_COMMAND ${CMAKE_COMMAND} -P "${script}" install "" after
+ TEST_COMMAND ${CMAKE_COMMAND} -P "${script}" test "" after
+)
diff --git a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
index caaf0d2fd..0d1da26b5 100644
--- a/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ExternalProject/RunCMakeTest.cmake
@@ -29,6 +29,10 @@ endfunction()
__ep_test_with_build(MultiCommand)
+set(RunCMake_TEST_OUTPUT_MERGE 1)
+__ep_test_with_build(PreserveEmptyArgs)
+set(RunCMake_TEST_OUTPUT_MERGE 0)
+
# Output is not predictable enough to be able to verify it reliably
# when using the various different Visual Studio generators
if(NOT RunCMake_GENERATOR MATCHES "Visual Studio")
diff --git a/Tests/RunCMake/ExternalProject/countArgs.cmake b/Tests/RunCMake/ExternalProject/countArgs.cmake
new file mode 100644
index 000000000..ee6429a8e
--- /dev/null
+++ b/Tests/RunCMake/ExternalProject/countArgs.cmake
@@ -0,0 +1,5 @@
+message(STATUS "Number of arguments for ${CMAKE_ARGV3}: ${CMAKE_ARGC}")
+math(EXPR last "${CMAKE_ARGC} - 1")
+foreach(n RANGE 4 ${last})
+ message(STATUS "${CMAKE_ARGV3} argument ${n}: '${CMAKE_ARGV${n}}'")
+endforeach()
diff --git a/Tests/RunCMake/FPHSA/FindUseComponents.cmake b/Tests/RunCMake/FPHSA/FindUseComponents.cmake
new file mode 100644
index 000000000..4168f1d48
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindUseComponents.cmake
@@ -0,0 +1,15 @@
+# pseudo find_module
+
+if (UseComponents_REQUIRE_VARS)
+ set(FOOBAR TRUE)
+ set(REQUIRED_VARS REQUIRED_VARS FOOBAR)
+endif()
+
+set (UseComponents_Comp1_FOUND TRUE)
+set (UseComponents_Comp2_FOUND TRUE)
+set (UseComponents_Comp3_FOUND FALSE)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(UseComponents ${REQUIRED_VARS}
+ VERSION_VAR Pseudo_VERSION
+ HANDLE_COMPONENTS)
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
index 286915db0..8e390908a 100644
--- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
@@ -47,3 +47,11 @@ run_cmake(custom_message_1)
set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DCONFIG_MODE=TRUE")
run_cmake(custom_message_2)
run_cmake(custom_message_3)
+
+# check handling of components
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DUseComponents_VERSION=1.2.3.4")
+run_cmake(required_components)
+run_cmake(required_and_optional_components)
+run_cmake(all_optional_components)
+list(APPEND RunCMake_TEST_OPTIONS "-DUseComponents_REQUIRE_VARS=TRUE")
+run_cmake(required_components_with_vars)
diff --git a/Tests/RunCMake/FPHSA/all_optional_components.cmake b/Tests/RunCMake/FPHSA/all_optional_components.cmake
new file mode 100644
index 000000000..f4d8b5ee6
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/all_optional_components.cmake
@@ -0,0 +1,14 @@
+find_package(UseComponents OPTIONAL_COMPONENTS Comp1 Comp2 Comp3)
+
+if (NOT UseComponents_FOUND)
+ message (FATAL_ERROR "package UseComponents Not Found.")
+endif()
+if (NOT UseComponents_Comp1_FOUND)
+ message (FATAL_ERROR "package UseComponents, component Comp1 not found.")
+endif()
+if (NOT UseComponents_Comp2_FOUND)
+ message (FATAL_ERROR "package UseComponents, component Comp2 not found.")
+endif()
+if (UseComponents_Comp3_FOUND)
+ message (FATAL_ERROR "package UseComponents, component Comp2 unexpectedly found.")
+endif()
diff --git a/Tests/RunCMake/FPHSA/required_and_optional_components.cmake b/Tests/RunCMake/FPHSA/required_and_optional_components.cmake
new file mode 100644
index 000000000..836dcac9d
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/required_and_optional_components.cmake
@@ -0,0 +1,14 @@
+find_package(UseComponents COMPONENTS Comp1 Comp2 OPTIONAL_COMPONENTS Comp3)
+
+if (NOT UseComponents_FOUND)
+ message (FATAL_ERROR "package UseComponents Not Found.")
+endif()
+if (NOT UseComponents_Comp1_FOUND)
+ message (FATAL_ERROR "package UseComponents, component Comp1 not found.")
+endif()
+if (NOT UseComponents_Comp2_FOUND)
+ message (FATAL_ERROR "package UseComponents, component Comp2 not found.")
+endif()
+if (UseComponents_Comp3_FOUND)
+ message (FATAL_ERROR "package UseComponents, component Comp2 unexpectedly found.")
+endif()
diff --git a/Tests/RunCMake/FPHSA/required_components.cmake b/Tests/RunCMake/FPHSA/required_components.cmake
new file mode 100644
index 000000000..0dd8e9c49
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/required_components.cmake
@@ -0,0 +1,11 @@
+find_package(UseComponents COMPONENTS Comp1 Comp2)
+
+if (NOT UseComponents_FOUND)
+ message (FATAL_ERROR "package UseComponents Not Found.")
+endif()
+if (NOT UseComponents_Comp1_FOUND)
+ message (FATAL_ERROR "package UseComponents, component Comp1 Not Found.")
+endif()
+if (NOT UseComponents_Comp2_FOUND)
+ message (FATAL_ERROR "package UseComponents, component Comp2 Not Found.")
+endif()
diff --git a/Tests/RunCMake/FPHSA/required_components_with_vars.cmake b/Tests/RunCMake/FPHSA/required_components_with_vars.cmake
new file mode 100644
index 000000000..842ef1557
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/required_components_with_vars.cmake
@@ -0,0 +1 @@
+include ("required_components.cmake")
diff --git a/Tests/RunCMake/FetchContent/DownloadFile.cmake b/Tests/RunCMake/FetchContent/DownloadFile.cmake
new file mode 100644
index 000000000..741b6d369
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/DownloadFile.cmake
@@ -0,0 +1,9 @@
+include(FetchContent)
+
+FetchContent_Declare(
+ t1
+ URL ${CMAKE_CURRENT_LIST_DIR}/dummyFile.txt
+ DOWNLOAD_NO_EXTRACT YES
+)
+
+FetchContent_Populate(t1)
diff --git a/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt b/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt
index 6e6c73062..711de6b3b 100644
--- a/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt
+++ b/Tests/RunCMake/FetchContent/MakeAvailable-stdout.txt
@@ -1,2 +1,3 @@
Confirmation project has been added
+.*Confirmation subproject has been added
.*Confirmation script has been called
diff --git a/Tests/RunCMake/FetchContent/MakeAvailable.cmake b/Tests/RunCMake/FetchContent/MakeAvailable.cmake
index a93f1f70d..d7fc55c51 100644
--- a/Tests/RunCMake/FetchContent/MakeAvailable.cmake
+++ b/Tests/RunCMake/FetchContent/MakeAvailable.cmake
@@ -8,13 +8,22 @@ FetchContent_Declare(
WithoutProject
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/WithoutProject
)
+FetchContent_Declare(
+ ProjectSubdir
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/WithoutProject
+ SOURCE_SUBDIR ProjectSubdir
+)
# Order is important and will be verified by test output
-FetchContent_MakeAvailable(WithProject WithoutProject)
+FetchContent_MakeAvailable(WithProject WithoutProject ProjectSubdir)
get_property(addedWith GLOBAL PROPERTY FetchWithProject SET)
if(NOT addedWith)
- message(SEND_ERROR "Subdir with CMakeLists.txt not added")
+ message(SEND_ERROR "Project with top level CMakeLists.txt not added")
+endif()
+get_property(addedSubdir GLOBAL PROPERTY FetchWithSubProject SET)
+if(NOT addedSubdir)
+ message(SEND_ERROR "Project with CMakeLists.txt in subdir not added")
endif()
include(${withoutproject_SOURCE_DIR}/confirmMessage.cmake)
diff --git a/Tests/RunCMake/FetchContent/PreserveEmptyArgs-stdout.txt b/Tests/RunCMake/FetchContent/PreserveEmptyArgs-stdout.txt
new file mode 100644
index 000000000..a72d914c6
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/PreserveEmptyArgs-stdout.txt
@@ -0,0 +1,4 @@
+.*-- Number of arguments: 6
+.*-- Argument 3: 'before'
+.*-- Argument 4: ''
+.*-- Argument 5: 'after'
diff --git a/Tests/RunCMake/FetchContent/PreserveEmptyArgs.cmake b/Tests/RunCMake/FetchContent/PreserveEmptyArgs.cmake
new file mode 100644
index 000000000..4f354482f
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/PreserveEmptyArgs.cmake
@@ -0,0 +1,13 @@
+include(FetchContent)
+
+# Need to see the download command output
+set(FETCHCONTENT_QUIET OFF)
+
+FetchContent_Declare(
+ t1
+ DOWNLOAD_COMMAND ${CMAKE_COMMAND} -P
+ ${CMAKE_CURRENT_LIST_DIR}/countArgs.cmake
+ before "" after
+)
+
+FetchContent_Populate(t1)
diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
index e28ae96dd..f3ed3e2d6 100644
--- a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
@@ -6,6 +6,7 @@ run_cmake(MissingDetails)
run_cmake(DirectIgnoresDetails)
run_cmake(FirstDetailsWin)
run_cmake(DownloadTwice)
+run_cmake(DownloadFile)
run_cmake(SameGenerator)
run_cmake(VarDefinitions)
run_cmake(GetProperties)
@@ -15,6 +16,10 @@ run_cmake(MakeAvailable)
run_cmake(MakeAvailableTwice)
run_cmake(MakeAvailableUndeclared)
+set(RunCMake_TEST_OUTPUT_MERGE 1)
+run_cmake(PreserveEmptyArgs)
+set(RunCMake_TEST_OUTPUT_MERGE 0)
+
# We need to pass through CMAKE_GENERATOR and CMAKE_MAKE_PROGRAM
# to ensure the test can run on machines where the build tool
# isn't on the PATH. Some build slaves explicitly test with such
diff --git a/Tests/RunCMake/FetchContent/WithoutProject/ProjectSubdir/CMakeLists.txt b/Tests/RunCMake/FetchContent/WithoutProject/ProjectSubdir/CMakeLists.txt
new file mode 100644
index 000000000..216eeb11e
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/WithoutProject/ProjectSubdir/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.13)
+project(ProjectSubdir LANGUAGES NONE)
+
+set_property(GLOBAL PROPERTY FetchWithSubProject YES)
+message(STATUS "Confirmation subproject has been added")
diff --git a/Tests/RunCMake/FetchContent/countArgs.cmake b/Tests/RunCMake/FetchContent/countArgs.cmake
new file mode 100644
index 000000000..7542af4a3
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/countArgs.cmake
@@ -0,0 +1,5 @@
+message(STATUS "Number of arguments: ${CMAKE_ARGC}")
+math(EXPR last "${CMAKE_ARGC} - 1")
+foreach(n RANGE 3 ${last})
+ message(STATUS "Argument ${n}: '${CMAKE_ARGV${n}}'")
+endforeach()
diff --git a/Tests/RunCMake/FetchContent/dummyFile.txt b/Tests/RunCMake/FetchContent/dummyFile.txt
new file mode 100644
index 000000000..0a12ce15d
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/dummyFile.txt
@@ -0,0 +1 @@
+# This file is used to verify fetching a single file directly
diff --git a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
index 8cdc00cb9..4449ff1b9 100644
--- a/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FileAPI/RunCMakeTest.cmake
@@ -23,7 +23,7 @@ function(check_python case)
endif()
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}"
+ COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/${case}-check.py" "${index}" "${CMAKE_CXX_COMPILER_ID}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index de6253f97..a3dd9ffc3 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -1,12 +1,18 @@
from check_index import *
+import json
import sys
import os
+def read_codemodel_json_data(filename):
+ abs_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), "codemodel-v2-data", filename)
+ with open(abs_filename, "r") as f:
+ return json.load(f)
+
def check_objects(o, g):
assert is_list(o)
assert len(o) == 1
- check_index_object(o[0], "codemodel", 2, 0, check_object_codemodel(g))
+ check_index_object(o[0], "codemodel", 2, 1, check_object_codemodel(g))
def check_backtrace(t, b, backtrace):
btg = t["backtraceGraph"]
@@ -398,6 +404,23 @@ def check_target(c):
missing_exception=lambda e: "Include path: %s" % e["path"],
extra_exception=lambda a: "Include path: %s" % a["path"])
+ if "precompileHeaders" in expected:
+ expected_keys.append("precompileHeaders")
+
+ def check_precompile_header(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["backtrace", "header"]
+ check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: matches(a["header"], e["header"]),
+ actual["precompileHeaders"], expected["precompileHeaders"],
+ check=check_precompile_header,
+ check_exception=lambda a, e: "Precompile header: %s" % a["header"],
+ missing_exception=lambda e: "Precompile header: %s" % e["header"],
+ extra_exception=lambda a: "Precompile header: %s" % a["header"])
+
if expected["defines"] is not None:
expected_keys.append("defines")
@@ -471,154 +494,15 @@ def check_project(c):
def gen_check_directories(c, g):
expected = [
- {
- "source": "^\\.$",
- "build": "^\\.$",
- "parentSource": None,
- "childSources": [
- "^alias$",
- "^custom$",
- "^cxx$",
- "^imported$",
- "^object$",
- "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "^dir$",
- ],
- "targetIds": [
- "^ALL_BUILD::@6890427a1f51a3e7e1df$",
- "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "^c_exe::@6890427a1f51a3e7e1df$",
- "^c_lib::@6890427a1f51a3e7e1df$",
- "^c_shared_exe::@6890427a1f51a3e7e1df$",
- "^c_shared_lib::@6890427a1f51a3e7e1df$",
- "^c_static_exe::@6890427a1f51a3e7e1df$",
- "^c_static_lib::@6890427a1f51a3e7e1df$",
- "^interface_exe::@6890427a1f51a3e7e1df$",
- ],
- "projectName": "codemodel-v2",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": True,
- },
- {
- "source": "^alias$",
- "build": "^alias$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@53632cba2752272bb008$",
- "^ZERO_CHECK::@53632cba2752272bb008$",
- "^c_alias_exe::@53632cba2752272bb008$",
- "^cxx_alias_exe::@53632cba2752272bb008$",
- ],
- "projectName": "Alias",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^custom$",
- "build": "^custom$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@c11385ffed57b860da63$",
- "^ZERO_CHECK::@c11385ffed57b860da63$",
- "^custom_exe::@c11385ffed57b860da63$",
- "^custom_tgt::@c11385ffed57b860da63$",
- ],
- "projectName": "Custom",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^cxx$",
- "build": "^cxx$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@a56b12a3f5c0529fb296$",
- "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "^cxx_exe::@a56b12a3f5c0529fb296$",
- "^cxx_lib::@a56b12a3f5c0529fb296$",
- "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
- "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
- "^cxx_static_exe::@a56b12a3f5c0529fb296$",
- "^cxx_static_lib::@a56b12a3f5c0529fb296$",
- ],
- "projectName": "Cxx",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^imported$",
- "build": "^imported$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
- "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "^link_imported_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
- ],
- "projectName": "Imported",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^object$",
- "build": "^object$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
- "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "^c_object_exe::@5ed5358f70faf8d8af7a$",
- "^c_object_lib::@5ed5358f70faf8d8af7a$",
- "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
- "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
- ],
- "projectName": "Object",
- "minimumCMakeVersion": "3.13",
- "hasInstallRule": True,
- },
- {
- "source": "^dir$",
- "build": "^dir$",
- "parentSource": "^\\.$",
- "childSources": [
- "^dir/dir$",
- ],
- "targetIds": None,
- "projectName": "codemodel-v2",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^dir/dir$",
- "build": "^dir/dir$",
- "parentSource": "^dir$",
- "childSources": None,
- "targetIds": None,
- "projectName": "codemodel-v2",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
- {
- "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
- "parentSource": "^\\.$",
- "childSources": None,
- "targetIds": [
- "^ALL_BUILD::@[0-9a-f]+$",
- "^ZERO_CHECK::@[0-9a-f]+$",
- "^generated_exe::@[0-9a-f]+$",
- ],
- "projectName": "External",
- "minimumCMakeVersion": "3.12",
- "hasInstallRule": None,
- },
+ read_codemodel_json_data("directories/top.json"),
+ read_codemodel_json_data("directories/alias.json"),
+ read_codemodel_json_data("directories/custom.json"),
+ read_codemodel_json_data("directories/cxx.json"),
+ read_codemodel_json_data("directories/imported.json"),
+ read_codemodel_json_data("directories/object.json"),
+ read_codemodel_json_data("directories/dir.json"),
+ read_codemodel_json_data("directories/dir_dir.json"),
+ read_codemodel_json_data("directories/external.json"),
]
if matches(g["name"], "^Visual Studio "):
@@ -646,4430 +530,68 @@ def check_directories(c, g):
def gen_check_targets(c, g, inSource):
expected = [
- {
- "name": "ALL_BUILD",
- "id": "^ALL_BUILD::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- {
- "id": "^interface_exe::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- {
- "id": "^c_lib::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- {
- "id": "^c_exe::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- {
- "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- {
- "id": "^c_shared_exe::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- {
- "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- {
- "id": "^c_static_exe::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- {
- "id": "^c_alias_exe::@53632cba2752272bb008$",
- "backtrace": None,
- },
- {
- "id": "^cxx_alias_exe::@53632cba2752272bb008$",
- "backtrace": None,
- },
- {
- "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- {
- "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- {
- "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- {
- "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^custom_exe::@c11385ffed57b860da63$",
- "backtrace": None,
- },
- {
- "id": "^generated_exe::@[0-9a-f]+$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ZERO_CHECK",
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": None,
- },
- {
- "name": "interface_exe",
- "id": "^interface_exe::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^include_test\\.cmake$",
- "line": 3,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^include_test\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": [
- {
- "define": "interface_exe_EXPORTS",
- "backtrace": None,
- },
- ],
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^include_test\\.cmake$",
- "line": 3,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^include_test\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^my_interface_exe\\.myexe$",
- "artifacts": [
- {
- "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.myexe$",
- "_dllExtra": False,
- },
- {
- "path": "^lib/my_interface_exe\\.imp$",
- "_aixExtra": True,
- "_dllExtra": False,
- },
- {
- "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$",
- "_dllExtra": True,
- },
- {
- "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "c_lib",
- "id": "^c_lib::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "STATIC_LIBRARY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 5,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 5,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^(lib)?c_lib\\.(a|lib)$",
- "artifacts": [
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib)$",
- "_dllExtra": False,
- },
- ],
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": None,
- "archive": {
- "lto": None,
- },
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "c_exe",
- "id": "^c_exe::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 6,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 6,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^c_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^c_lib::@6890427a1f51a3e7e1df$",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 7,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "c_shared_lib",
- "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "SHARED_LIBRARY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 9,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": [
- {
- "define": "c_shared_lib_EXPORTS",
- "backtrace": None,
- },
- ],
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 9,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$",
- "artifacts": [
- {
- "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$",
- "_dllExtra": False,
- },
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib)$",
- "_dllExtra": True,
- },
- {
- "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": {
- "language": "C",
- "lto": True,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "c_shared_exe",
- "id": "^c_shared_exe::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 10,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 10,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^c_shared_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": {
- "language": "C",
- "lto": True,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 11,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "c_static_lib",
- "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "STATIC_LIBRARY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 13,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 13,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^(lib)?c_static_lib\\.(a|lib)$",
- "artifacts": [
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib)$",
- "_dllExtra": False,
- },
- ],
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": None,
- "archive": {
- "lto": True,
- },
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "c_static_exe",
- "id": "^c_static_exe::@6890427a1f51a3e7e1df$",
- "directorySource": "^\\.$",
- "projectName": "codemodel-v2",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 14,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 14,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^c_static_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^\\.$",
- "source": "^\\.$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 15,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ALL_BUILD",
- "id": "^ALL_BUILD::@a56b12a3f5c0529fb296$",
- "directorySource": "^cxx$",
- "projectName": "Cxx",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^cxx$",
- "source": "^cxx$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- {
- "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ZERO_CHECK",
- "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "directorySource": "^cxx$",
- "projectName": "Cxx",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^cxx$",
- "source": "^cxx$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": None,
- },
- {
- "name": "cxx_lib",
- "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
- "directorySource": "^cxx$",
- "projectName": "Cxx",
- "type": "STATIC_LIBRARY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 4,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 4,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^(lib)?cxx_lib\\.(a|lib)$",
- "artifacts": [
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib)$",
- "_dllExtra": False,
- },
- ],
- "build": "^cxx$",
- "source": "^cxx$",
- "install": None,
- "link": None,
- "archive": {
- "lto": None,
- },
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "cxx_exe",
- "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
- "directorySource": "^cxx$",
- "projectName": "Cxx",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": [
- {
- "fragment" : "TargetCompileOptions",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 17,
- "command": "target_compile_options",
- "hasParent": True,
- },
- {
- "file" : "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- }
- ],
- },
- ],
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": "bin",
- "nameOnDisk": "^cxx_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^cxx$",
- "source": "^cxx$",
- "install": {
- "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
- "destinations": [
- {
- "path": "bin",
- "backtrace": [
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": 37,
- "command": "install",
- "hasParent": True,
- },
- {
- "file": "^codemodel-v2\\.cmake$",
- "line": None,
- "command": None,
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": 3,
- "command": "include",
- "hasParent": True,
- },
- {
- "file": "^CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- },
- "link": {
- "language": "CXX",
- "lto": None,
- "commandFragments": [
- {
- "fragment" : "TargetLinkOptions",
- "role" : "flags",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 18,
- "command": "target_link_options",
- "hasParent": True,
- },
- {
- "file" : "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "fragment" : ".*TargetLinkDir\\\"?$",
- "role" : "libraryPath",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 19,
- "command": "target_link_directories",
- "hasParent": True,
- },
- {
- "file" : "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "fragment" : ".*cxx_lib.*",
- "role" : "libraries",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 6,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file" : "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 6,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "cxx_shared_lib",
- "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
- "directorySource": "^cxx$",
- "projectName": "Cxx",
- "type": "SHARED_LIBRARY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 9,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": [
- {
- "define": "cxx_shared_lib_EXPORTS",
- "backtrace": None,
- },
- ],
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 9,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$",
- "artifacts": [
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$",
- "_dllExtra": False,
- },
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib)$",
- "_dllExtra": True,
- },
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^cxx$",
- "source": "^cxx$",
- "install": None,
- "link": {
- "language": "CXX",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "cxx_shared_exe",
- "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
- "directorySource": "^cxx$",
- "projectName": "Cxx",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 10,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 10,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^cxx_shared_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^cxx$",
- "source": "^cxx$",
- "install": None,
- "link": {
- "language": "CXX",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 11,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "cxx_static_lib",
- "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
- "directorySource": "^cxx$",
- "projectName": "Cxx",
- "type": "STATIC_LIBRARY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 13,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 13,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib)$",
- "artifacts": [
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib)$",
- "_dllExtra": False,
- },
- ],
- "build": "^cxx$",
- "source": "^cxx$",
- "install": None,
- "link": None,
- "archive": {
- "lto": None,
- },
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "cxx_static_exe",
- "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
- "directorySource": "^cxx$",
- "projectName": "Cxx",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 14,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 14,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^cxx_static_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^cxx$",
- "source": "^cxx$",
- "install": None,
- "link": {
- "language": "CXX",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
- "backtrace": [
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": 15,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^cxx/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ALL_BUILD",
- "id": "^ALL_BUILD::@53632cba2752272bb008$",
- "directorySource": "^alias$",
- "projectName": "Alias",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^alias$",
- "source": "^alias$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@53632cba2752272bb008$",
- "backtrace": None,
- },
- {
- "id": "^c_alias_exe::@53632cba2752272bb008$",
- "backtrace": None,
- },
- {
- "id": "^cxx_alias_exe::@53632cba2752272bb008$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ZERO_CHECK",
- "id": "^ZERO_CHECK::@53632cba2752272bb008$",
- "directorySource": "^alias$",
- "projectName": "Alias",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^alias$",
- "source": "^alias$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": None,
- },
- {
- "name": "c_alias_exe",
- "id": "^c_alias_exe::@53632cba2752272bb008$",
- "directorySource": "^alias$",
- "projectName": "Alias",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^c_alias_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^alias$",
- "source": "^alias$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^c_lib::@6890427a1f51a3e7e1df$",
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": 6,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@53632cba2752272bb008$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "cxx_alias_exe",
- "id": "^cxx_alias_exe::@53632cba2752272bb008$",
- "directorySource": "^alias$",
- "projectName": "Alias",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": 9,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": 9,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^cxx_alias_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^alias$",
- "source": "^alias$",
- "install": None,
- "link": {
- "language": "CXX",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
- "backtrace": [
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": 10,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^alias/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@53632cba2752272bb008$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ALL_BUILD",
- "id": "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
- "directorySource": "^object$",
- "projectName": "Object",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^object$",
- "source": "^object$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- {
- "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- {
- "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- {
- "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- {
- "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ZERO_CHECK",
- "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "directorySource": "^object$",
- "projectName": "Object",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^object$",
- "source": "^object$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": None,
- },
- {
- "name": "c_object_lib",
- "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
- "directorySource": "^object$",
- "projectName": "Object",
- "type": "OBJECT_LIBRARY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": [
- {
- "path": "^object/.*/empty(\\.c)?\\.o(bj)?$",
- "_dllExtra": False,
- },
- ],
- "build": "^object$",
- "source": "^object$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "c_object_exe",
- "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
- "directorySource": "^object$",
- "projectName": "Object",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 6,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$",
- "isGenerated": True,
- "sourceGroupName": "Object Libraries",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 7,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- {
- "name": "Object Libraries",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 6,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^c_object_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^object$",
- "source": "^object$",
- "install": {
- "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
- "destinations": [
- {
- "path": "bin",
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 13,
- "command": "install",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- },
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
- # FIXME: Add a backtrace here when it becomes available.
- # You'll know when it's available, because this test will
- # fail.
- "backtrace": None,
- },
- {
- "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "cxx_object_lib",
- "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
- "directorySource": "^object$",
- "projectName": "Object",
- "type": "OBJECT_LIBRARY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 9,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 9,
- "command": "add_library",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": [
- {
- "path": "^object/.*/empty(\\.cxx)?\\.o(bj)?$",
- "_dllExtra": False,
- },
- ],
- "build": "^object$",
- "source": "^object$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "cxx_object_exe",
- "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
- "directorySource": "^object$",
- "projectName": "Object",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.cxx$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 10,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$",
- "isGenerated": True,
- "sourceGroupName": "Object Libraries",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 11,
- "command": "target_link_libraries",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- },
- {
- "name": "Object Libraries",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "CXX",
- "sourcePaths": [
- "^empty\\.cxx$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 10,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^cxx_object_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^object$",
- "source": "^object$",
- "install": {
- "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
- "destinations": [
- {
- "path": "bin",
- "backtrace": [
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": 13,
- "command": "install",
- "hasParent": True,
- },
- {
- "file": "^object/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- },
- "link": {
- "language": "CXX",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
- # FIXME: Add a backtrace here when it becomes available.
- # You'll know when it's available, because this test will
- # fail.
- "backtrace": None,
- },
- {
- "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ALL_BUILD",
- "id": "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
- "directorySource": "^imported$",
- "projectName": "Imported",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^imported$",
- "source": "^imported$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- {
- "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ZERO_CHECK",
- "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "directorySource": "^imported$",
- "projectName": "Imported",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^imported$",
- "source": "^imported$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": None,
- },
- {
- "name": "link_imported_exe",
- "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
- "directorySource": "^imported$",
- "projectName": "Imported",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^link_imported_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^imported$",
- "source": "^imported$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "link_imported_shared_exe",
- "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
- "directorySource": "^imported$",
- "projectName": "Imported",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 9,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 9,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^link_imported_shared_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^imported$",
- "source": "^imported$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "link_imported_static_exe",
- "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
- "directorySource": "^imported$",
- "projectName": "Imported",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 13,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 13,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^link_imported_static_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^imported$",
- "source": "^imported$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "link_imported_object_exe",
- "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
- "directorySource": "^imported$",
- "projectName": "Imported",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 18,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 18,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^link_imported_object_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^imported$",
- "source": "^imported$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "link_imported_interface_exe",
- "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
- "directorySource": "^imported$",
- "projectName": "Imported",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 23,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": 23,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^imported/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^link_imported_interface_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^imported$",
- "source": "^imported$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ALL_BUILD",
- "id": "^ALL_BUILD::@c11385ffed57b860da63$",
- "directorySource": "^custom$",
- "projectName": "Custom",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^custom$",
- "source": "^custom$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
- "backtrace": None,
- },
- {
- "id": "^custom_exe::@c11385ffed57b860da63$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ZERO_CHECK",
- "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
- "directorySource": "^custom$",
- "projectName": "Custom",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^custom$",
- "source": "^custom$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": None,
- },
- {
- "name": "custom_tgt",
- "id": "^custom_tgt::@c11385ffed57b860da63$",
- "directorySource": "^custom$",
- "projectName": "Custom",
- "type": "UTILITY",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": 3,
- "command": "add_custom_target",
- "hasParent": True,
- },
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": 3,
- "command": "add_custom_target",
- "hasParent": True,
- },
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^custom$",
- "source": "^custom$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "custom_exe",
- "id": "^custom_exe::@c11385ffed57b860da63$",
- "directorySource": "^custom$",
- "projectName": "Custom",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": 4,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^empty\\.c$",
- ],
- "includes": None,
- "defines": None,
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": 4,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^custom_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^custom$",
- "source": "^custom$",
- "install": None,
- "link": {
- "language": "C",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^custom_tgt::@c11385ffed57b860da63$",
- "backtrace": [
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_dependencies",
- "hasParent": True,
- },
- {
- "file": "^custom/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ALL_BUILD",
- "id": "^ALL_BUILD::@[0-9a-f]+$",
- "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "projectName": "External",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
- "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@[0-9a-f]+$",
- "backtrace": None,
- },
- {
- "id": "^generated_exe::@[0-9a-f]+$",
- "backtrace": None,
- },
- ],
- },
- {
- "name": "ZERO_CHECK",
- "id": "^ZERO_CHECK::@[0-9a-f]+$",
- "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "projectName": "External",
- "type": "UTILITY",
- "isGeneratorProvided": True,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$",
- "isGenerated": True,
- "sourceGroupName": "",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$",
- "isGenerated": True,
- "sourceGroupName": "CMake Rules",
- "compileGroupLanguage": None,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$",
- ],
- },
- {
- "name": "CMake Rules",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$",
- ],
- },
- ],
- "compileGroups": None,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": None,
- "artifacts": None,
- "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
- "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "install": None,
- "link": None,
- "archive": None,
- "dependencies": None,
- },
- {
- "name": "generated_exe",
- "id": "^generated_exe::@[0-9a-f]+$",
- "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "projectName": "External",
- "type": "EXECUTABLE",
- "isGeneratorProvided": None,
- "sources": [
- {
- "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$",
- "isGenerated": None,
- "sourceGroupName": "Source Files",
- "compileGroupLanguage": "C",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$",
- "isGenerated": True,
- "sourceGroupName": "Generated Source Files",
- "compileGroupLanguage": "CXX",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 6,
- "command": "target_sources",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "sourceGroups": [
- {
- "name": "Source Files",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$",
- ],
- },
- {
- "name": "Generated Source Files",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$",
- ],
- },
- ],
- "compileGroups": [
- {
- "language": "C",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$",
- ],
- "includes": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
- "isSystem": None,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 10,
- "command": "set_property",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "isSystem": True,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 11,
- "command": "target_include_directories",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "defines": [
- {
- "define": "EMPTY_C=1",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 9,
- "command": "set_property",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "define": "SRC_DUMMY",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 9,
- "command": "set_property",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "define": "GENERATED_EXE=1",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 12,
- "command": "target_compile_definitions",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "define": "TGT_DUMMY",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 12,
- "command": "target_compile_definitions",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "compileCommandFragments": [
- {
- "fragment" : "SRC_COMPILE_OPTIONS_DUMMY",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 13,
- "command": "set_source_files_properties",
- "hasParent": True,
- },
- {
- "file" : "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- }
- ],
- },
- {
- "language": "CXX",
- "sourcePaths": [
- "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$",
- ],
- "includes": [
- {
- "path": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "isSystem": True,
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 11,
- "command": "target_include_directories",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "defines": [
- {
- "define": "GENERATED_EXE=1",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 12,
- "command": "target_compile_definitions",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- {
- "define": "TGT_DUMMY",
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 12,
- "command": "target_compile_definitions",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- },
- ],
- "compileCommandFragments": None,
- },
- ],
- "backtrace": [
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": 5,
- "command": "add_executable",
- "hasParent": True,
- },
- {
- "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
- "line": None,
- "command": None,
- "hasParent": False,
- },
- ],
- "folder": None,
- "nameOnDisk": "^generated_exe(\\.exe)?$",
- "artifacts": [
- {
- "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe(\\.exe)?$",
- "_dllExtra": False,
- },
- {
- "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe\\.pdb$",
- "_dllExtra": True,
- },
- ],
- "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
- "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
- "install": None,
- "link": {
- "language": "CXX",
- "lto": None,
- "commandFragments": None,
- },
- "archive": None,
- "dependencies": [
- {
- "id": "^ZERO_CHECK::@[0-9a-f]+$",
- "backtrace": None,
- },
- ],
- },
+ read_codemodel_json_data("targets/all_build_top.json"),
+ read_codemodel_json_data("targets/zero_check_top.json"),
+ read_codemodel_json_data("targets/interface_exe.json"),
+ read_codemodel_json_data("targets/c_lib.json"),
+ read_codemodel_json_data("targets/c_exe.json"),
+ read_codemodel_json_data("targets/c_shared_lib.json"),
+ read_codemodel_json_data("targets/c_shared_exe.json"),
+ read_codemodel_json_data("targets/c_static_lib.json"),
+ read_codemodel_json_data("targets/c_static_exe.json"),
+
+ read_codemodel_json_data("targets/all_build_cxx.json"),
+ read_codemodel_json_data("targets/zero_check_cxx.json"),
+ read_codemodel_json_data("targets/cxx_lib.json"),
+ read_codemodel_json_data("targets/cxx_exe.json"),
+ read_codemodel_json_data("targets/cxx_shared_lib.json"),
+ read_codemodel_json_data("targets/cxx_shared_exe.json"),
+ read_codemodel_json_data("targets/cxx_static_lib.json"),
+ read_codemodel_json_data("targets/cxx_static_exe.json"),
+
+ read_codemodel_json_data("targets/all_build_alias.json"),
+ read_codemodel_json_data("targets/zero_check_alias.json"),
+ read_codemodel_json_data("targets/c_alias_exe.json"),
+ read_codemodel_json_data("targets/cxx_alias_exe.json"),
+
+ read_codemodel_json_data("targets/all_build_object.json"),
+ read_codemodel_json_data("targets/zero_check_object.json"),
+ read_codemodel_json_data("targets/c_object_lib.json"),
+ read_codemodel_json_data("targets/c_object_exe.json"),
+ read_codemodel_json_data("targets/cxx_object_lib.json"),
+ read_codemodel_json_data("targets/cxx_object_exe.json"),
+
+ read_codemodel_json_data("targets/all_build_imported.json"),
+ read_codemodel_json_data("targets/zero_check_imported.json"),
+ read_codemodel_json_data("targets/link_imported_exe.json"),
+ read_codemodel_json_data("targets/link_imported_shared_exe.json"),
+ read_codemodel_json_data("targets/link_imported_static_exe.json"),
+ read_codemodel_json_data("targets/link_imported_object_exe.json"),
+ read_codemodel_json_data("targets/link_imported_interface_exe.json"),
+
+ read_codemodel_json_data("targets/all_build_custom.json"),
+ read_codemodel_json_data("targets/zero_check_custom.json"),
+ read_codemodel_json_data("targets/custom_tgt.json"),
+ read_codemodel_json_data("targets/custom_exe.json"),
+ read_codemodel_json_data("targets/all_build_external.json"),
+ read_codemodel_json_data("targets/zero_check_external.json"),
+ read_codemodel_json_data("targets/generated_exe.json"),
]
+ if cxx_compiler_id in ['Clang', 'AppleClang', 'GNU', 'Intel', 'MSVC', 'Embarcadero'] and g["name"] != "Xcode":
+ for e in expected:
+ if e["name"] == "cxx_exe":
+ if matches(g["name"], "^(Visual Studio |Ninja Multi-Config)"):
+ precompile_header_data = read_codemodel_json_data("targets/cxx_exe_precompileheader_multigen.json")
+ else:
+ if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
+ precompile_header_data = read_codemodel_json_data("targets/cxx_exe_precompileheader_2arch.json")
+ else:
+ precompile_header_data = read_codemodel_json_data("targets/cxx_exe_precompileheader.json")
+ e["compileGroups"] = precompile_header_data["compileGroups"]
+ e["sources"] = precompile_header_data["sources"]
+ e["sourceGroups"] = precompile_header_data["sourceGroups"]
+
if not os.path.exists(os.path.join(reply_dir, "..", "..", "..", "..", "ipo_enabled.txt")):
for e in expected:
try:
@@ -5164,126 +686,13 @@ def check_targets(c, g, inSource):
def gen_check_projects(c, g):
expected = [
- {
- "name": "codemodel-v2",
- "parentName": None,
- "childNames": [
- "Alias",
- "Custom",
- "Cxx",
- "Imported",
- "Object",
- "External",
- ],
- "directorySources": [
- "^\\.$",
- "^dir$",
- "^dir/dir$",
- ],
- "targetIds": [
- "^ALL_BUILD::@6890427a1f51a3e7e1df$",
- "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
- "^interface_exe::@6890427a1f51a3e7e1df$",
- "^c_lib::@6890427a1f51a3e7e1df$",
- "^c_exe::@6890427a1f51a3e7e1df$",
- "^c_shared_lib::@6890427a1f51a3e7e1df$",
- "^c_shared_exe::@6890427a1f51a3e7e1df$",
- "^c_static_lib::@6890427a1f51a3e7e1df$",
- "^c_static_exe::@6890427a1f51a3e7e1df$",
- ],
- },
- {
- "name": "Cxx",
- "parentName": "codemodel-v2",
- "childNames": None,
- "directorySources": [
- "^cxx$",
- ],
- "targetIds": [
- "^ALL_BUILD::@a56b12a3f5c0529fb296$",
- "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
- "^cxx_lib::@a56b12a3f5c0529fb296$",
- "^cxx_exe::@a56b12a3f5c0529fb296$",
- "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
- "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
- "^cxx_static_lib::@a56b12a3f5c0529fb296$",
- "^cxx_static_exe::@a56b12a3f5c0529fb296$",
- ],
- },
- {
- "name": "Alias",
- "parentName": "codemodel-v2",
- "childNames": None,
- "directorySources": [
- "^alias$",
- ],
- "targetIds": [
- "^ALL_BUILD::@53632cba2752272bb008$",
- "^ZERO_CHECK::@53632cba2752272bb008$",
- "^c_alias_exe::@53632cba2752272bb008$",
- "^cxx_alias_exe::@53632cba2752272bb008$",
- ],
- },
- {
- "name": "Object",
- "parentName": "codemodel-v2",
- "childNames": None,
- "directorySources": [
- "^object$",
- ],
- "targetIds": [
- "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
- "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
- "^c_object_lib::@5ed5358f70faf8d8af7a$",
- "^c_object_exe::@5ed5358f70faf8d8af7a$",
- "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
- "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
- ],
- },
- {
- "name": "Imported",
- "parentName": "codemodel-v2",
- "childNames": None,
- "directorySources": [
- "^imported$",
- ],
- "targetIds": [
- "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
- "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
- "^link_imported_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
- "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
- ],
- },
- {
- "name": "Custom",
- "parentName": "codemodel-v2",
- "childNames": None,
- "directorySources": [
- "^custom$",
- ],
- "targetIds": [
- "^ALL_BUILD::@c11385ffed57b860da63$",
- "^ZERO_CHECK::@c11385ffed57b860da63$",
- "^custom_tgt::@c11385ffed57b860da63$",
- "^custom_exe::@c11385ffed57b860da63$",
- ],
- },
- {
- "name": "External",
- "parentName": "codemodel-v2",
- "childNames": None,
- "directorySources": [
- "^.*/Tests/RunCMake/FileAPIExternalSource$",
- ],
- "targetIds": [
- "^ALL_BUILD::@[0-9a-f]+$",
- "^ZERO_CHECK::@[0-9a-f]+$",
- "^generated_exe::@[0-9a-f]+$",
- ],
- },
+ read_codemodel_json_data("projects/codemodel-v2.json"),
+ read_codemodel_json_data("projects/cxx.json"),
+ read_codemodel_json_data("projects/alias.json"),
+ read_codemodel_json_data("projects/object.json"),
+ read_codemodel_json_data("projects/imported.json"),
+ read_codemodel_json_data("projects/custom.json"),
+ read_codemodel_json_data("projects/external.json"),
]
if matches(g["name"], "^Visual Studio "):
@@ -5337,6 +746,7 @@ def check_object_codemodel(g):
check_object_codemodel_configuration(c, g, inSource)
return _check
+cxx_compiler_id = sys.argv[2]
assert is_dict(index)
assert sorted(index.keys()) == ["cmake", "objects", "reply"]
check_objects(index["objects"], index["cmake"]["generator"])
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json
new file mode 100644
index 000000000..9f0c48a01
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/alias.json
@@ -0,0 +1,15 @@
+{
+ "source": "^alias$",
+ "build": "^alias$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@53632cba2752272bb008$",
+ "^ZERO_CHECK::@53632cba2752272bb008$",
+ "^c_alias_exe::@53632cba2752272bb008$",
+ "^cxx_alias_exe::@53632cba2752272bb008$"
+ ],
+ "projectName": "Alias",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json
new file mode 100644
index 000000000..afd41f328
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/custom.json
@@ -0,0 +1,15 @@
+{
+ "source": "^custom$",
+ "build": "^custom$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@c11385ffed57b860da63$",
+ "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "^custom_exe::@c11385ffed57b860da63$",
+ "^custom_tgt::@c11385ffed57b860da63$"
+ ],
+ "projectName": "Custom",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
new file mode 100644
index 000000000..ebe717aea
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
@@ -0,0 +1,19 @@
+{
+ "source": "^cxx$",
+ "build": "^cxx$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@a56b12a3f5c0529fb296$",
+ "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_static_lib::@a56b12a3f5c0529fb296$"
+ ],
+ "projectName": "Cxx",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json
new file mode 100644
index 000000000..afbd43a3e
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir.json
@@ -0,0 +1,12 @@
+{
+ "source": "^dir$",
+ "build": "^dir$",
+ "parentSource": "^\\.$",
+ "childSources": [
+ "^dir/dir$"
+ ],
+ "targetIds": null,
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json
new file mode 100644
index 000000000..3737ad5fe
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/dir_dir.json
@@ -0,0 +1,10 @@
+{
+ "source": "^dir/dir$",
+ "build": "^dir/dir$",
+ "parentSource": "^dir$",
+ "childSources": null,
+ "targetIds": null,
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json
new file mode 100644
index 000000000..521e3c70d
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/external.json
@@ -0,0 +1,14 @@
+{
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@[0-9a-f]+$",
+ "^ZERO_CHECK::@[0-9a-f]+$",
+ "^generated_exe::@[0-9a-f]+$"
+ ],
+ "projectName": "External",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json
new file mode 100644
index 000000000..a41b79b51
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/imported.json
@@ -0,0 +1,18 @@
+{
+ "source": "^imported$",
+ "build": "^imported$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
+ "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_static_exe::@ba7eb709d0b48779c6c8$"
+ ],
+ "projectName": "Imported",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json
new file mode 100644
index 000000000..1e647ad1b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/object.json
@@ -0,0 +1,17 @@
+{
+ "source": "^object$",
+ "build": "^object$",
+ "parentSource": "^\\.$",
+ "childSources": null,
+ "targetIds": [
+ "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
+ "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_lib::@5ed5358f70faf8d8af7a$"
+ ],
+ "projectName": "Object",
+ "minimumCMakeVersion": "3.13",
+ "hasInstallRule": true
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
new file mode 100644
index 000000000..c14495349
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/top.json
@@ -0,0 +1,28 @@
+{
+ "source": "^\\.$",
+ "build": "^\\.$",
+ "parentSource": null,
+ "childSources": [
+ "^alias$",
+ "^custom$",
+ "^cxx$",
+ "^imported$",
+ "^object$",
+ "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "^dir$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@6890427a1f51a3e7e1df$",
+ "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "^c_exe::@6890427a1f51a3e7e1df$",
+ "^c_lib::@6890427a1f51a3e7e1df$",
+ "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "^c_static_exe::@6890427a1f51a3e7e1df$",
+ "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "^interface_exe::@6890427a1f51a3e7e1df$"
+ ],
+ "projectName": "codemodel-v2",
+ "minimumCMakeVersion": "3.12",
+ "hasInstallRule": true
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json
new file mode 100644
index 000000000..8ede60f0d
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/alias.json
@@ -0,0 +1,14 @@
+{
+ "name": "Alias",
+ "parentName": "codemodel-v2",
+ "childNames": null,
+ "directorySources": [
+ "^alias$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@53632cba2752272bb008$",
+ "^ZERO_CHECK::@53632cba2752272bb008$",
+ "^c_alias_exe::@53632cba2752272bb008$",
+ "^cxx_alias_exe::@53632cba2752272bb008$"
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
new file mode 100644
index 000000000..f3aac63db
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/codemodel-v2.json
@@ -0,0 +1,28 @@
+{
+ "name": "codemodel-v2",
+ "parentName": null,
+ "childNames": [
+ "Alias",
+ "Custom",
+ "Cxx",
+ "Imported",
+ "Object",
+ "External"
+ ],
+ "directorySources": [
+ "^\\.$",
+ "^dir$",
+ "^dir/dir$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@6890427a1f51a3e7e1df$",
+ "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "^interface_exe::@6890427a1f51a3e7e1df$",
+ "^c_lib::@6890427a1f51a3e7e1df$",
+ "^c_exe::@6890427a1f51a3e7e1df$",
+ "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "^c_static_exe::@6890427a1f51a3e7e1df$"
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json
new file mode 100644
index 000000000..0aeb727c7
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/custom.json
@@ -0,0 +1,14 @@
+{
+ "name": "Custom",
+ "parentName": "codemodel-v2",
+ "childNames": null,
+ "directorySources": [
+ "^custom$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@c11385ffed57b860da63$",
+ "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "^custom_tgt::@c11385ffed57b860da63$",
+ "^custom_exe::@c11385ffed57b860da63$"
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json
new file mode 100644
index 000000000..296ae6c25
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json
@@ -0,0 +1,18 @@
+{
+ "name": "Cxx",
+ "parentName": "codemodel-v2",
+ "childNames": null,
+ "directorySources": [
+ "^cxx$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@a56b12a3f5c0529fb296$",
+ "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "^cxx_static_exe::@a56b12a3f5c0529fb296$"
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json
new file mode 100644
index 000000000..3c9afff11
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/external.json
@@ -0,0 +1,13 @@
+{
+ "name": "External",
+ "parentName": "codemodel-v2",
+ "childNames": null,
+ "directorySources": [
+ "^.*/Tests/RunCMake/FileAPIExternalSource$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@[0-9a-f]+$",
+ "^ZERO_CHECK::@[0-9a-f]+$",
+ "^generated_exe::@[0-9a-f]+$"
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json
new file mode 100644
index 000000000..dc40b72d9
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/imported.json
@@ -0,0 +1,17 @@
+{
+ "name": "Imported",
+ "parentName": "codemodel-v2",
+ "childNames": null,
+ "directorySources": [
+ "^imported$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
+ "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$"
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json
new file mode 100644
index 000000000..219f4eb28
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/object.json
@@ -0,0 +1,16 @@
+{
+ "name": "Object",
+ "parentName": "codemodel-v2",
+ "childNames": null,
+ "directorySources": [
+ "^object$"
+ ],
+ "targetIds": [
+ "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
+ "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "^cxx_object_exe::@5ed5358f70faf8d8af7a$"
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json
new file mode 100644
index 000000000..eabf739bc
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_alias.json
@@ -0,0 +1,83 @@
+{
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@53632cba2752272bb008$",
+ "directorySource": "^alias$",
+ "projectName": "Alias",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ALL_BUILD\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^alias$",
+ "source": "^alias$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@53632cba2752272bb008$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_alias_exe::@53632cba2752272bb008$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_alias_exe::@53632cba2752272bb008$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json
new file mode 100644
index 000000000..a5ff68672
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_custom.json
@@ -0,0 +1,79 @@
+{
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@c11385ffed57b860da63$",
+ "directorySource": "^custom$",
+ "projectName": "Custom",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ALL_BUILD\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^custom$",
+ "source": "^custom$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "backtrace": null
+ },
+ {
+ "id": "^custom_exe::@c11385ffed57b860da63$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
new file mode 100644
index 000000000..92a794444
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
@@ -0,0 +1,99 @@
+{
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ALL_BUILD\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json
new file mode 100644
index 000000000..017335c98
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_external.json
@@ -0,0 +1,79 @@
+{
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@[0-9a-f]+$",
+ "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "projectName": "External",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ALL_BUILD\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@[0-9a-f]+$",
+ "backtrace": null
+ },
+ {
+ "id": "^generated_exe::@[0-9a-f]+$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json
new file mode 100644
index 000000000..2de5b1523
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_imported.json
@@ -0,0 +1,95 @@
+{
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ALL_BUILD\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json
new file mode 100644
index 000000000..9d8899a51
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_object.json
@@ -0,0 +1,91 @@
+{
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ALL_BUILD\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^object$",
+ "source": "^object$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
new file mode 100644
index 000000000..b4def78c5
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
@@ -0,0 +1,179 @@
+{
+ "name": "ALL_BUILD",
+ "id": "^ALL_BUILD::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ALL_BUILD\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ },
+ {
+ "id": "^interface_exe::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_exe::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_static_exe::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_alias_exe::@53632cba2752272bb008$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_alias_exe::@53632cba2752272bb008$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ },
+ {
+ "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ },
+ {
+ "id": "^custom_exe::@c11385ffed57b860da63$",
+ "backtrace": null
+ },
+ {
+ "id": "^generated_exe::@[0-9a-f]+$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json
new file mode 100644
index 000000000..ac7c94de1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_alias_exe.json
@@ -0,0 +1,107 @@
+{
+ "name": "c_alias_exe",
+ "id": "^c_alias_exe::@53632cba2752272bb008$",
+ "directorySource": "^alias$",
+ "projectName": "Alias",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^c_alias_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_alias_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^alias$",
+ "source": "^alias$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^c_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@53632cba2752272bb008$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json
new file mode 100644
index 000000000..7af74c41d
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_exe.json
@@ -0,0 +1,143 @@
+{
+ "name": "c_exe",
+ "id": "^c_exe::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^c_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^c_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 7,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json
new file mode 100644
index 000000000..0ca1962c0
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_lib.json
@@ -0,0 +1,108 @@
+{
+ "name": "c_lib",
+ "id": "^c_lib::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 5,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 5,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^(lib)?c_lib\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_lib\\.(a|lib)$",
+ "_dllExtra": false
+ }
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": null,
+ "archive": {
+ "lto": null
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json
new file mode 100644
index 000000000..3c9ace3b1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_exe.json
@@ -0,0 +1,154 @@
+{
+ "name": "c_object_exe",
+ "id": "^c_object_exe::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$",
+ "isGenerated": true,
+ "sourceGroupName": "Object Libraries",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 7,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ },
+ {
+ "name": "Object Libraries",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.c)?\\.o(bj)?$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^c_object_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_object_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^object$",
+ "source": "^object$",
+ "install": {
+ "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
+ "destinations": [
+ {
+ "path": "bin",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 7,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json
new file mode 100644
index 000000000..e3a20df3a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_object_lib.json
@@ -0,0 +1,82 @@
+{
+ "name": "c_object_lib",
+ "id": "^c_object_lib::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "OBJECT_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": [
+ {
+ "path": "^object/.*/empty(\\.c)?\\.o(bj)?$",
+ "_dllExtra": false
+ }
+ ],
+ "build": "^object$",
+ "source": "^object$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json
new file mode 100644
index 000000000..0d4018aa4
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_exe.json
@@ -0,0 +1,143 @@
+{
+ "name": "c_shared_exe",
+ "id": "^c_shared_exe::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^c_shared_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_shared_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": true,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 11,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
new file mode 100644
index 000000000..176a8575b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_shared_lib.json
@@ -0,0 +1,123 @@
+{
+ "name": "c_shared_lib",
+ "id": "^c_shared_lib::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "SHARED_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": [
+ {
+ "define": "c_shared_lib_EXPORTS",
+ "backtrace": null
+ }
+ ],
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$",
+ "artifacts": [
+ {
+ "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.(so|dylib|dll)$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_shared_lib\\.(dll\\.a|lib)$",
+ "_dllExtra": true
+ },
+ {
+ "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?c_shared_lib\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": true,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json
new file mode 100644
index 000000000..5542277a1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_exe.json
@@ -0,0 +1,143 @@
+{
+ "name": "c_static_exe",
+ "id": "^c_static_exe::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 14,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 14,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^c_static_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?c_static_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 15,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json
new file mode 100644
index 000000000..4b6389729
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/c_static_lib.json
@@ -0,0 +1,108 @@
+{
+ "name": "c_static_lib",
+ "id": "^c_static_lib::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 13,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 13,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^(lib)?c_static_lib\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?c_static_lib\\.(a|lib)$",
+ "_dllExtra": false
+ }
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": null,
+ "archive": {
+ "lto": true
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json
new file mode 100644
index 000000000..ab301e9a3
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_exe.json
@@ -0,0 +1,107 @@
+{
+ "name": "custom_exe",
+ "id": "^custom_exe::@c11385ffed57b860da63$",
+ "directorySource": "^custom$",
+ "projectName": "Custom",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 4,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 4,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^custom_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^custom/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?custom_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^custom$",
+ "source": "^custom$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^custom_tgt::@c11385ffed57b860da63$",
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_dependencies",
+ "hasParent": true
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json
new file mode 100644
index 000000000..a7106fc83
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/custom_tgt.json
@@ -0,0 +1,87 @@
+{
+ "name": "custom_tgt",
+ "id": "^custom_tgt::@c11385ffed57b860da63$",
+ "directorySource": "^custom$",
+ "projectName": "Custom",
+ "type": "UTILITY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "add_custom_target",
+ "hasParent": true
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/custom_tgt$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/(custom/)?CMakeFiles/([0-9a-f]+/)?custom_tgt\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "add_custom_target",
+ "hasParent": true
+ },
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^custom$",
+ "source": "^custom$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json
new file mode 100644
index 000000000..837f252f1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_alias_exe.json
@@ -0,0 +1,107 @@
+{
+ "name": "cxx_alias_exe",
+ "id": "^cxx_alias_exe::@53632cba2752272bb008$",
+ "directorySource": "^alias$",
+ "projectName": "Alias",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_alias_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^alias/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_alias_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^alias$",
+ "source": "^alias$",
+ "install": null,
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@53632cba2752272bb008$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
new file mode 100644
index 000000000..e7ab55ba3
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe.json
@@ -0,0 +1,232 @@
+{
+ "name": "cxx_exe",
+ "id": "^cxx_exe::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "precompileHeaders": [
+ {
+ "header": ".*empty\\.h$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 21,
+ "command": "target_precompile_headers",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment" : "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": true
+ },
+ {
+ "file" : "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": "bin",
+ "nameOnDisk": "^cxx_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": {
+ "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
+ "destinations": [
+ {
+ "path": "bin",
+ "backtrace": [
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 37,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": [
+ {
+ "fragment" : "TargetLinkOptions",
+ "role" : "flags",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 18,
+ "command": "target_link_options",
+ "hasParent": true
+ },
+ {
+ "file" : "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "fragment" : ".*TargetLinkDir\\\"?$",
+ "role" : "libraryPath",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 19,
+ "command": "target_link_directories",
+ "hasParent": true
+ },
+ {
+ "file" : "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "fragment" : ".*cxx_lib.*",
+ "role" : "libraries",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file" : "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json
new file mode 100644
index 000000000..5a0f770b7
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader.json
@@ -0,0 +1,161 @@
+{
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "precompileHeaders": [
+ {
+ "header": ".*empty\\.h$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 21,
+ "command": "target_precompile_headers",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment": "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "precompileHeaders": [
+ {
+ "header": ".*empty\\.h$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 21,
+ "command": "target_precompile_headers",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment": "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "sources": [
+ {
+ "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": ".*/cmake_pch(_[^.]+)?\\.hxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Precompile Header File",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
+ "^empty\\.cxx$"
+ ]
+ },
+ {
+ "name": "Precompile Header File",
+ "sourcePaths": [
+ ".*/cmake_pch(_[^.]+)?\\.hxx$"
+ ]
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json
new file mode 100644
index 000000000..9455748f9
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_2arch.json
@@ -0,0 +1,237 @@
+{
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "precompileHeaders": [
+ {
+ "header": ".*empty\\.h$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 21,
+ "command": "target_precompile_headers",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment": "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "precompileHeaders": [
+ {
+ "header": ".*empty\\.h$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 21,
+ "command": "target_precompile_headers",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment": "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "precompileHeaders": [
+ {
+ "header": ".*empty\\.h$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 21,
+ "command": "target_precompile_headers",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment": "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "sources": [
+ {
+ "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": ".*/cmake_pch(_[^.]+)?\\.hxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Precompile Header File",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": ".*/cmake_pch(_[^.]+)?\\.hxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Precompile Header File",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
+ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
+ "^empty\\.cxx$"
+ ]
+ },
+ {
+ "name": "Precompile Header File",
+ "sourcePaths": [
+ ".*/cmake_pch(_[^.]+)?\\.hxx$",
+ ".*/cmake_pch(_[^.]+)?\\.hxx$"
+ ]
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json
new file mode 100644
index 000000000..9f6ffcce8
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_precompileheader_multigen.json
@@ -0,0 +1,206 @@
+{
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "precompileHeaders": [
+ {
+ "header": ".*empty\\.h$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 21,
+ "command": "target_precompile_headers",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment": "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "precompileHeaders": [
+ {
+ "header": ".*empty\\.h$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 21,
+ "command": "target_precompile_headers",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment": "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "sources": [
+ {
+ "path": ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": ".*/Debug/cmake_pch(_[^.]+)?\\.hxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Precompile Header File",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": ".*/Release/cmake_pch(_[^.]+)?\\.hxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Precompile Header File",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": ".*/MinSizeRel/cmake_pch(_[^.]+)?\\.hxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Precompile Header File",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": ".*/RelWithDebInfo/cmake_pch(_[^.]+)?\\.hxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Precompile Header File",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ ".*cmake_pch(_[^.]+)?(\\.hxx)?\\.cxx$",
+ "^empty\\.cxx$"
+ ]
+ },
+ {
+ "name": "Precompile Header File",
+ "sourcePaths": [
+ ".*/Debug/cmake_pch(_[^.]+)?\\.hxx$",
+ ".*/Release/cmake_pch(_[^.]+)?\\.hxx$",
+ ".*/MinSizeRel/cmake_pch(_[^.]+)?\\.hxx$",
+ ".*/RelWithDebInfo/cmake_pch(_[^.]+)?\\.hxx$"
+ ]
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json
new file mode 100644
index 000000000..94ac08118
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_lib.json
@@ -0,0 +1,84 @@
+{
+ "name": "cxx_lib",
+ "id": "^cxx_lib::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 4,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 4,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^(lib)?cxx_lib\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_lib\\.(a|lib)$",
+ "_dllExtra": false
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": null,
+ "archive": {
+ "lto": null
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json
new file mode 100644
index 000000000..119c91d42
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_exe.json
@@ -0,0 +1,154 @@
+{
+ "name": "cxx_object_exe",
+ "id": "^cxx_object_exe::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$",
+ "isGenerated": true,
+ "sourceGroupName": "Object Libraries",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ },
+ {
+ "name": "Object Libraries",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/.*/empty(\\.cxx)?\\.o(bj)?$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_object_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^object/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_object_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^object$",
+ "source": "^object$",
+ "install": {
+ "prefix": "^(/usr/local|[A-Za-z]:.*/codemodel-v2)$",
+ "destinations": [
+ {
+ "path": "bin",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "install",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json
new file mode 100644
index 000000000..8e99f7d6a
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_object_lib.json
@@ -0,0 +1,82 @@
+{
+ "name": "cxx_object_lib",
+ "id": "^cxx_object_lib::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "OBJECT_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": [
+ {
+ "path": "^object/.*/empty(\\.cxx)?\\.o(bj)?$",
+ "_dllExtra": false
+ }
+ ],
+ "build": "^object$",
+ "source": "^object$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json
new file mode 100644
index 000000000..4421c8ff1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_exe.json
@@ -0,0 +1,107 @@
+{
+ "name": "cxx_shared_exe",
+ "id": "^cxx_shared_exe::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_shared_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_shared_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
new file mode 100644
index 000000000..171a4f5c1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_shared_lib.json
@@ -0,0 +1,99 @@
+{
+ "name": "cxx_shared_lib",
+ "id": "^cxx_shared_lib::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "SHARED_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": [
+ {
+ "define": "cxx_shared_lib_EXPORTS",
+ "backtrace": null
+ }
+ ],
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.(so|dylib|dll)$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_shared_lib\\.(dll\\.a|lib)$",
+ "_dllExtra": true
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib|cyg)?cxx_shared_lib\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json
new file mode 100644
index 000000000..52c42dec8
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_exe.json
@@ -0,0 +1,107 @@
+{
+ "name": "cxx_static_exe",
+ "id": "^cxx_static_exe::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 14,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 14,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_static_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_static_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 15,
+ "command": "target_link_libraries",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json
new file mode 100644
index 000000000..98298bea1
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_static_lib.json
@@ -0,0 +1,84 @@
+{
+ "name": "cxx_static_lib",
+ "id": "^cxx_static_lib::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "STATIC_LIBRARY",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "add_library",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^(lib)?cxx_static_lib\\.(a|lib)$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?cxx_static_lib\\.(a|lib)$",
+ "_dllExtra": false
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": null,
+ "archive": {
+ "lto": null
+ },
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json
new file mode 100644
index 000000000..d41bbb21c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/generated_exe.json
@@ -0,0 +1,303 @@
+{
+ "name": "generated_exe",
+ "id": "^generated_exe::@[0-9a-f]+$",
+ "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "projectName": "External",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$",
+ "isGenerated": true,
+ "sourceGroupName": "Generated Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "target_sources",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$"
+ ]
+ },
+ {
+ "name": "Generated Source Files",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPIExternalSource/empty\\.c$"
+ ],
+ "includes": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "isSystem": null,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "set_property",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "isSystem": true,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_include_directories",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "defines": [
+ {
+ "define": "EMPTY_C=1",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "set_property",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "define": "SRC_DUMMY",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "set_property",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "define": "GENERATED_EXE=1",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 12,
+ "command": "target_compile_definitions",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "define": "TGT_DUMMY",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 12,
+ "command": "target_compile_definitions",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": [
+ {
+ "fragment" : "SRC_COMPILE_OPTIONS_DUMMY",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "set_source_files_properties",
+ "hasParent": true
+ },
+ {
+ "file" : "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/generated\\.cxx$"
+ ],
+ "includes": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "isSystem": true,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 11,
+ "command": "target_include_directories",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "defines": [
+ {
+ "define": "GENERATED_EXE=1",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 12,
+ "command": "target_compile_definitions",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "define": "TGT_DUMMY",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 12,
+ "command": "target_compile_definitions",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^generated_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?generated_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "install": null,
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@[0-9a-f]+$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json
new file mode 100644
index 000000000..fe0524c69
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/interface_exe.json
@@ -0,0 +1,152 @@
+{
+ "name": "interface_exe",
+ "id": "^interface_exe::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^include_test\\.cmake$",
+ "line": 3,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^include_test\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": [
+ {
+ "define": "interface_exe_EXPORTS",
+ "backtrace": null
+ }
+ ],
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^include_test\\.cmake$",
+ "line": 3,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^include_test\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^codemodel-v2\\.cmake$",
+ "line": null,
+ "command": null,
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": 3,
+ "command": "include",
+ "hasParent": true
+ },
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^my_interface_exe\\.myexe$",
+ "artifacts": [
+ {
+ "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.myexe$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^lib/my_interface_exe\\.imp$",
+ "_aixExtra": true,
+ "_dllExtra": false
+ },
+ {
+ "path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$",
+ "_dllExtra": true
+ },
+ {
+ "path": "^bin/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?my_interface_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json
new file mode 100644
index 000000000..312f4c5ab
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_exe.json
@@ -0,0 +1,90 @@
+{
+ "name": "link_imported_exe",
+ "id": "^link_imported_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 5,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^link_imported_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json
new file mode 100644
index 000000000..7d0e6df6d
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_interface_exe.json
@@ -0,0 +1,90 @@
+{
+ "name": "link_imported_interface_exe",
+ "id": "^link_imported_interface_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 23,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 23,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^link_imported_interface_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_interface_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json
new file mode 100644
index 000000000..4aec5249b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_object_exe.json
@@ -0,0 +1,90 @@
+{
+ "name": "link_imported_object_exe",
+ "id": "^link_imported_object_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 18,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 18,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^link_imported_object_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_object_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json
new file mode 100644
index 000000000..f5846ec9d
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_shared_exe.json
@@ -0,0 +1,90 @@
+{
+ "name": "link_imported_shared_exe",
+ "id": "^link_imported_shared_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^link_imported_shared_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_shared_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json
new file mode 100644
index 000000000..29a16958f
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/link_imported_static_exe.json
@@ -0,0 +1,90 @@
+{
+ "name": "link_imported_static_exe",
+ "id": "^link_imported_static_exe::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "sources": [
+ {
+ "path": "^empty\\.c$",
+ "isGenerated": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "C",
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "C",
+ "sourcePaths": [
+ "^empty\\.c$"
+ ],
+ "includes": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^link_imported_static_exe(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^imported/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?link_imported_static_exe\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": null,
+ "link": {
+ "language": "C",
+ "lto": null,
+ "commandFragments": null
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json
new file mode 100644
index 000000000..941c1721f
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_alias.json
@@ -0,0 +1,70 @@
+{
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@53632cba2752272bb008$",
+ "directorySource": "^alias$",
+ "projectName": "Alias",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/alias/CMakeFiles/ZERO_CHECK\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^alias/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^alias$",
+ "source": "^alias$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json
new file mode 100644
index 000000000..98c6dd9ec
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_custom.json
@@ -0,0 +1,70 @@
+{
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@c11385ffed57b860da63$",
+ "directorySource": "^custom$",
+ "projectName": "Custom",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/custom/CMakeFiles/ZERO_CHECK\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^custom/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^custom$",
+ "source": "^custom$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json
new file mode 100644
index 000000000..b72ff827d
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_cxx.json
@@ -0,0 +1,70 @@
+{
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/cxx/CMakeFiles/ZERO_CHECK\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json
new file mode 100644
index 000000000..9e7380624
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_external.json
@@ -0,0 +1,70 @@
+{
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@[0-9a-f]+$",
+ "directorySource": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "projectName": "External",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild/CMakeFiles/ZERO_CHECK\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
+ "source": "^.*/Tests/RunCMake/FileAPIExternalSource$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json
new file mode 100644
index 000000000..7534c8415
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_imported.json
@@ -0,0 +1,70 @@
+{
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@ba7eb709d0b48779c6c8$",
+ "directorySource": "^imported$",
+ "projectName": "Imported",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/imported/CMakeFiles/ZERO_CHECK\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^imported/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^imported$",
+ "source": "^imported$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json
new file mode 100644
index 000000000..bcd7616b5
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_object.json
@@ -0,0 +1,70 @@
+{
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@5ed5358f70faf8d8af7a$",
+ "directorySource": "^object$",
+ "projectName": "Object",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/object/CMakeFiles/ZERO_CHECK\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^object/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^object$",
+ "source": "^object$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": null
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json
new file mode 100644
index 000000000..b3030bda7
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/zero_check_top.json
@@ -0,0 +1,70 @@
+{
+ "name": "ZERO_CHECK",
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "directorySource": "^\\.$",
+ "projectName": "codemodel-v2",
+ "type": "UTILITY",
+ "isGeneratorProvided": true,
+ "sources": [
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$",
+ "isGenerated": true,
+ "sourceGroupName": "",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ },
+ {
+ "path": "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$",
+ "isGenerated": true,
+ "sourceGroupName": "CMake Rules",
+ "compileGroupLanguage": null,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK$"
+ ]
+ },
+ {
+ "name": "CMake Rules",
+ "sourcePaths": [
+ "^.*/Tests/RunCMake/FileAPI/codemodel-v2-build/CMakeFiles/ZERO_CHECK\\.rule$"
+ ]
+ }
+ ],
+ "compileGroups": null,
+ "backtrace": [
+ {
+ "file": "^CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": null,
+ "artifacts": null,
+ "build": "^\\.$",
+ "source": "^\\.$",
+ "install": null,
+ "link": null,
+ "archive": null,
+ "dependencies": null
+}
diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
index b0564f5dd..fa51195fe 100644
--- a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
+++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
@@ -17,3 +17,5 @@ target_link_libraries(cxx_static_exe PRIVATE cxx_static_lib)
target_compile_options(cxx_exe PUBLIC TargetCompileOptions)
target_link_options(cxx_exe PUBLIC TargetLinkOptions)
target_link_directories(cxx_exe PUBLIC "${CMAKE_BINARY_DIR}/TargetLinkDir")
+
+target_precompile_headers(cxx_exe PUBLIC ../empty.h)
diff --git a/Tests/RunCMake/FileAPI/empty.h b/Tests/RunCMake/FileAPI/empty.h
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/empty.h
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable-result.txt b/Tests/RunCMake/File_Archive/7zip-with-bad-compression-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable-result.txt
+++ b/Tests/RunCMake/File_Archive/7zip-with-bad-compression-result.txt
diff --git a/Tests/RunCMake/File_Archive/7zip-with-bad-compression-stderr.txt b/Tests/RunCMake/File_Archive/7zip-with-bad-compression-stderr.txt
new file mode 100644
index 000000000..f6bd1ab14
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/7zip-with-bad-compression-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at roundtrip.cmake:38 \(file\):
+ file archive format 7zip does not support COMPRESSION arguments
+Call Stack \(most recent call first\):
+ 7zip-with-bad-compression.cmake:6 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Archive/7zip-with-bad-compression.cmake b/Tests/RunCMake/File_Archive/7zip-with-bad-compression.cmake
new file mode 100644
index 000000000..7461eb8b2
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/7zip-with-bad-compression.cmake
@@ -0,0 +1,6 @@
+set(OUTPUT_NAME "test.zip")
+
+set(ARCHIVE_FORMAT 7zip)
+set(COMPRESSION_TYPE XZ)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
diff --git a/Tests/RunCMake/File_Archive/7zip.cmake b/Tests/RunCMake/File_Archive/7zip.cmake
new file mode 100644
index 000000000..530e940d0
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/7zip.cmake
@@ -0,0 +1,7 @@
+set(OUTPUT_NAME "test.7z")
+
+set(ARCHIVE_FORMAT 7zip)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("377abcaf271c" LIMIT 6 HEX)
diff --git a/Tests/RunCMake/File_Archive/CMakeLists.txt b/Tests/RunCMake/File_Archive/CMakeLists.txt
new file mode 100644
index 000000000..289710955
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.0)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/File_Archive/RunCMakeTest.cmake b/Tests/RunCMake/File_Archive/RunCMakeTest.cmake
new file mode 100644
index 000000000..2bd0cd892
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/RunCMakeTest.cmake
@@ -0,0 +1,18 @@
+include(RunCMake)
+
+run_cmake(7zip)
+run_cmake(gnutar)
+run_cmake(gnutar-gz)
+run_cmake(pax)
+run_cmake(pax-xz)
+run_cmake(pax-zstd)
+run_cmake(paxr)
+run_cmake(paxr-bz2)
+run_cmake(zip)
+
+# Extracting only selected files or directories
+run_cmake(zip-filtered)
+
+run_cmake(unsupported-format)
+run_cmake(zip-with-bad-compression)
+run_cmake(7zip-with-bad-compression)
diff --git a/Tests/RunCMake/File_Archive/gnutar-gz.cmake b/Tests/RunCMake/File_Archive/gnutar-gz.cmake
new file mode 100644
index 000000000..829022b0e
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/gnutar-gz.cmake
@@ -0,0 +1,8 @@
+set(OUTPUT_NAME "test.tar.gz")
+
+set(ARCHIVE_FORMAT gnutar)
+set(COMPRESSION_TYPE GZip)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("1f8b" LIMIT 2 HEX)
diff --git a/Tests/RunCMake/File_Archive/gnutar.cmake b/Tests/RunCMake/File_Archive/gnutar.cmake
new file mode 100644
index 000000000..17425c73f
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/gnutar.cmake
@@ -0,0 +1,7 @@
+set(OUTPUT_NAME "test.tar")
+
+set(ARCHIVE_FORMAT gnutar)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("7573746172202000" OFFSET 257 LIMIT 8 HEX)
diff --git a/Tests/RunCMake/File_Archive/pax-xz.cmake b/Tests/RunCMake/File_Archive/pax-xz.cmake
new file mode 100644
index 000000000..ae485fd20
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/pax-xz.cmake
@@ -0,0 +1,8 @@
+set(OUTPUT_NAME "test.tar.xz")
+
+set(ARCHIVE_FORMAT pax)
+set(COMPRESSION_TYPE XZ)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("fd377a585a00" LIMIT 6 HEX)
diff --git a/Tests/RunCMake/File_Archive/pax-zstd.cmake b/Tests/RunCMake/File_Archive/pax-zstd.cmake
new file mode 100644
index 000000000..ba3036ead
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/pax-zstd.cmake
@@ -0,0 +1,8 @@
+set(OUTPUT_NAME "test.tar.zstd")
+
+set(ARCHIVE_FORMAT pax)
+set(COMPRESSION_TYPE Zstd)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("28b52ffd0058" LIMIT 6 HEX)
diff --git a/Tests/RunCMake/File_Archive/pax.cmake b/Tests/RunCMake/File_Archive/pax.cmake
new file mode 100644
index 000000000..46002fbbd
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/pax.cmake
@@ -0,0 +1,7 @@
+set(OUTPUT_NAME "test.tar")
+
+set(ARCHIVE_FORMAT pax)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX)
diff --git a/Tests/RunCMake/File_Archive/paxr-bz2.cmake b/Tests/RunCMake/File_Archive/paxr-bz2.cmake
new file mode 100644
index 000000000..d38f8f3c9
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/paxr-bz2.cmake
@@ -0,0 +1,8 @@
+set(OUTPUT_NAME "test.tar.bz2")
+
+set(ARCHIVE_FORMAT paxr)
+set(COMPRESSION_TYPE BZip2)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("425a68" LIMIT 3 HEX)
diff --git a/Tests/RunCMake/File_Archive/paxr.cmake b/Tests/RunCMake/File_Archive/paxr.cmake
new file mode 100644
index 000000000..ce44f0589
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/paxr.cmake
@@ -0,0 +1,7 @@
+set(OUTPUT_NAME "test.tar")
+
+set(ARCHIVE_FORMAT paxr)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("7573746172003030" OFFSET 257 LIMIT 8 HEX)
diff --git a/Tests/RunCMake/File_Archive/roundtrip.cmake b/Tests/RunCMake/File_Archive/roundtrip.cmake
new file mode 100644
index 000000000..063836791
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/roundtrip.cmake
@@ -0,0 +1,92 @@
+foreach(parameter OUTPUT_NAME ARCHIVE_FORMAT)
+ if(NOT DEFINED ${parameter})
+ message(FATAL_ERROR "missing required parameter ${parameter}")
+ endif()
+endforeach()
+
+set(COMPRESS_DIR compress_dir)
+set(FULL_COMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${COMPRESS_DIR})
+
+set(DECOMPRESS_DIR decompress_dir)
+set(FULL_DECOMPRESS_DIR ${CMAKE_CURRENT_BINARY_DIR}/${DECOMPRESS_DIR})
+
+set(FULL_OUTPUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME})
+
+set(CHECK_FILES
+ "f1.txt"
+ "d1/f1.txt"
+ "d 2/f1.txt"
+ "d + 3/f1.txt"
+ "d_4/f1.txt"
+ "d-4/f1.txt"
+ "My Special Directory/f1.txt"
+)
+
+foreach(file ${CHECK_FILES})
+ configure_file(${CMAKE_CURRENT_LIST_FILE} ${FULL_COMPRESS_DIR}/${file} COPYONLY)
+endforeach()
+
+if(UNIX)
+ execute_process(COMMAND ln -sf f1.txt ${FULL_COMPRESS_DIR}/d1/f2.txt)
+ list(APPEND CHECK_FILES "d1/f2.txt")
+endif()
+
+file(REMOVE ${FULL_OUTPUT_NAME})
+file(REMOVE_RECURSE ${FULL_DECOMPRESS_DIR})
+file(MAKE_DIRECTORY ${FULL_DECOMPRESS_DIR})
+
+file(ARCHIVE_CREATE
+ OUTPUT ${FULL_OUTPUT_NAME}
+ FORMAT "${ARCHIVE_FORMAT}"
+ COMPRESSION "${COMPRESSION_TYPE}"
+ VERBOSE
+ PATHS ${COMPRESS_DIR})
+
+file(ARCHIVE_EXTRACT
+ INPUT ${FULL_OUTPUT_NAME}
+ ${DECOMPRESSION_OPTIONS}
+ DESTINATION ${FULL_DECOMPRESS_DIR}
+ VERBOSE)
+
+if(CUSTOM_CHECK_FILES)
+ set(CHECK_FILES ${CUSTOM_CHECK_FILES})
+endif()
+
+foreach(file ${CHECK_FILES})
+ set(input ${FULL_COMPRESS_DIR}/${file})
+ set(output ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file})
+
+ if(NOT EXISTS ${input})
+ message(SEND_ERROR "Cannot find input file ${output}")
+ endif()
+
+ if(NOT EXISTS ${output})
+ message(SEND_ERROR "Cannot find output file ${output}")
+ endif()
+
+ file(MD5 ${input} input_md5)
+ file(MD5 ${output} output_md5)
+
+ if(NOT input_md5 STREQUAL output_md5)
+ message(SEND_ERROR "Files \"${input}\" and \"${output}\" are different")
+ endif()
+endforeach()
+
+foreach(file ${NOT_EXISTING_FILES_CHECK})
+ set(output ${FULL_DECOMPRESS_DIR}/${COMPRESS_DIR}/${file})
+
+ if(EXISTS ${output})
+ message(SEND_ERROR "File ${output} exists but it shouldn't")
+ endif()
+endforeach()
+
+function(check_magic EXPECTED)
+ file(READ ${FULL_OUTPUT_NAME} ACTUAL
+ ${ARGN}
+ )
+
+ if(NOT ACTUAL STREQUAL EXPECTED)
+ message(FATAL_ERROR
+ "Actual [${ACTUAL}] does not match expected [${EXPECTED}]")
+ endif()
+endfunction()
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library-result.txt b/Tests/RunCMake/File_Archive/unsupported-format-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library-result.txt
+++ b/Tests/RunCMake/File_Archive/unsupported-format-result.txt
diff --git a/Tests/RunCMake/File_Archive/unsupported-format-stderr.txt b/Tests/RunCMake/File_Archive/unsupported-format-stderr.txt
new file mode 100644
index 000000000..4328022e7
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/unsupported-format-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at roundtrip.cmake:38 \(file\):
+ file archive format rar not supported
+Call Stack \(most recent call first\):
+ unsupported-format.cmake:5 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Archive/unsupported-format.cmake b/Tests/RunCMake/File_Archive/unsupported-format.cmake
new file mode 100644
index 000000000..4b41e65f6
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/unsupported-format.cmake
@@ -0,0 +1,5 @@
+set(OUTPUT_NAME "test.rar")
+
+set(ARCHIVE_FORMAT rar)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
diff --git a/Tests/RunCMake/File_Archive/zip-filtered.cmake b/Tests/RunCMake/File_Archive/zip-filtered.cmake
new file mode 100644
index 000000000..a4aab8b2b
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/zip-filtered.cmake
@@ -0,0 +1,26 @@
+set(OUTPUT_NAME "test.zip")
+
+set(ARCHIVE_FORMAT zip)
+
+set(DECOMPRESSION_OPTIONS
+ PATTERNS
+ compress_dir/f1.txt # Decompress only file
+ compress_*/d? # and whole directory (has only one match)
+)
+
+set(CUSTOM_CHECK_FILES
+ "f1.txt"
+ "d1/f1.txt"
+)
+
+# This files shouldn't exists
+set(NOT_EXISTING_FILES_CHECK
+ "d 2/f1.txt"
+ "d + 3/f1.txt"
+ "d_4/f1.txt"
+ "d-4/f1.txt"
+)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("504b0304" LIMIT 4 HEX)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test-result.txt b/Tests/RunCMake/File_Archive/zip-with-bad-compression-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test-result.txt
+++ b/Tests/RunCMake/File_Archive/zip-with-bad-compression-result.txt
diff --git a/Tests/RunCMake/File_Archive/zip-with-bad-compression-stderr.txt b/Tests/RunCMake/File_Archive/zip-with-bad-compression-stderr.txt
new file mode 100644
index 000000000..72ad8c44e
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/zip-with-bad-compression-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at roundtrip.cmake:38 \(file\):
+ file archive format zip does not support COMPRESSION arguments
+Call Stack \(most recent call first\):
+ zip-with-bad-compression.cmake:6 \(include\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Archive/zip-with-bad-compression.cmake b/Tests/RunCMake/File_Archive/zip-with-bad-compression.cmake
new file mode 100644
index 000000000..2badd5bcc
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/zip-with-bad-compression.cmake
@@ -0,0 +1,6 @@
+set(OUTPUT_NAME "test.zip")
+
+set(ARCHIVE_FORMAT zip)
+set(COMPRESSION_TYPE BZip2)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
diff --git a/Tests/RunCMake/File_Archive/zip.cmake b/Tests/RunCMake/File_Archive/zip.cmake
new file mode 100644
index 000000000..09e84b08c
--- /dev/null
+++ b/Tests/RunCMake/File_Archive/zip.cmake
@@ -0,0 +1,7 @@
+set(OUTPUT_NAME "test.zip")
+
+set(ARCHIVE_FORMAT zip)
+
+include(${CMAKE_CURRENT_LIST_DIR}/roundtrip.cmake)
+
+check_magic("504b0304" LIMIT 4 HEX)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install-result.txt b/Tests/RunCMake/File_Configure/BadArg-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install-result.txt
+++ b/Tests/RunCMake/File_Configure/BadArg-result.txt
diff --git a/Tests/RunCMake/File_Configure/BadArg-stderr.txt b/Tests/RunCMake/File_Configure/BadArg-stderr.txt
new file mode 100644
index 000000000..5423a2822
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArg-stderr.txt
@@ -0,0 +1,4 @@
+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/BadArg.cmake b/Tests/RunCMake/File_Configure/BadArg.cmake
new file mode 100644
index 000000000..7c7fcda63
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArg.cmake
@@ -0,0 +1 @@
+file(CONFIGURE OUTPUT)
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-result.txt b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-result.txt
+++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-result.txt
diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-stderr.txt b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-stderr.txt
new file mode 100644
index 000000000..acda6541a
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at BadArgGeneratorExpressionContent.cmake:[0-9]+ \(file\):
+ file CONFIGURE called with CONTENT containing a "<". This character is not
+ allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent.cmake b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent.cmake
new file mode 100644
index 000000000..75fe9e5d1
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionContent.cmake
@@ -0,0 +1,4 @@
+file(CONFIGURE
+ OUTPUT "file.txt"
+ CONTENT "foo-$<CONFIG>"
+)
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1-result.txt b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1-result.txt
+++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-result.txt
diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-stderr.txt b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-stderr.txt
new file mode 100644
index 000000000..329d956ef
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at BadArgGeneratorExpressionOutput.cmake:[0-9]+ \(file\):
+ file CONFIGURE called with OUTPUT containing a "<". This character is not
+ allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput.cmake b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput.cmake
new file mode 100644
index 000000000..31a79a7e0
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/BadArgGeneratorExpressionOutput.cmake
@@ -0,0 +1,4 @@
+file(CONFIGURE
+ OUTPUT "file-$<CONFIG>.txt"
+ CONTENT "foo"
+)
diff --git a/Tests/RunCMake/File_Configure/CMakeLists.txt b/Tests/RunCMake/File_Configure/CMakeLists.txt
new file mode 100644
index 000000000..b7117bd63
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.17)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/File_Configure/DirOutput-stderr.txt b/Tests/RunCMake/File_Configure/DirOutput-stderr.txt
new file mode 100644
index 000000000..d051f7c20
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/DirOutput-stderr.txt
@@ -0,0 +1 @@
+^DirOutput test file$
diff --git a/Tests/RunCMake/File_Configure/DirOutput.cmake b/Tests/RunCMake/File_Configure/DirOutput.cmake
new file mode 100644
index 000000000..aa0fadfe6
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/DirOutput.cmake
@@ -0,0 +1,4 @@
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/DirOutput)
+configure_file(DirOutput.txt DirOutput)
+file(READ ${CMAKE_CURRENT_BINARY_DIR}/DirOutput/DirOutput.txt out)
+message("${out}")
diff --git a/Tests/RunCMake/File_Configure/DirOutput.txt b/Tests/RunCMake/File_Configure/DirOutput.txt
new file mode 100644
index 000000000..16388a6b5
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/DirOutput.txt
@@ -0,0 +1 @@
+DirOutput test file
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-result.txt b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-result.txt
+++ b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-result.txt
diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-stderr.txt b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-stderr.txt
new file mode 100644
index 000000000..5a8ed2c49
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at NewLineStyle-NoArg.cmake:[0-9]+ \(file\):
+ file CONFIGURE NEWLINE_STYLE must set a style: LF, CRLF, UNIX, DOS, or
+ WIN32
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-NoArg.cmake b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg.cmake
new file mode 100644
index 000000000..d6738b4d3
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/NewLineStyle-NoArg.cmake
@@ -0,0 +1,6 @@
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt)
+file(CONFIGURE
+ OUTPUT ${file_name}
+ CONTENT "Data\n"
+ NEWLINE_STYLE
+)
diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake b/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake
new file mode 100644
index 000000000..e38487366
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/NewLineStyle-ValidArg.cmake
@@ -0,0 +1,20 @@
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt)
+
+function(test_eol style in out)
+ file(CONFIGURE
+ OUTPUT ${file_name}
+ CONTENT "@in@"
+ NEWLINE_STYLE ${style}
+ )
+ file(READ ${file_name} new HEX)
+ if(NOT "${new}" STREQUAL "${out}")
+ message(FATAL_ERROR "No ${style} line endings")
+ endif()
+endfunction()
+
+test_eol(DOS "a" "610d0a")
+test_eol(WIN32 "b" "620d0a")
+test_eol(CRLF "c" "630d0a")
+
+test_eol(UNIX "d" "640a")
+test_eol(LF "e" "650a")
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt
+++ b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-result.txt
diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-stderr.txt b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-stderr.txt
new file mode 100644
index 000000000..c1bb42c30
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at NewLineStyle-WrongArg.cmake:[0-9]+ \(file\):
+ file CONFIGURE NEWLINE_STYLE sets an unknown style, only LF, CRLF, UNIX,
+ DOS, and WIN32 are supported
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg.cmake b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg.cmake
new file mode 100644
index 000000000..7d38167fb
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/NewLineStyle-WrongArg.cmake
@@ -0,0 +1,6 @@
+set(file_name ${CMAKE_CURRENT_BINARY_DIR}/NewLineStyle.txt)
+file(CONFIGURE
+ OUTPUT ${file_name}
+ CONTENT "Data\n"
+ NEWLINE_STYLE FOO
+)
diff --git a/Tests/RunCMake/File_Configure/RunCMakeTest.cmake b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake
new file mode 100644
index 000000000..0337014eb
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/RunCMakeTest.cmake
@@ -0,0 +1,10 @@
+include(RunCMake)
+
+run_cmake(BadArg)
+run_cmake(BadArgGeneratorExpressionContent)
+run_cmake(BadArgGeneratorExpressionOutput)
+run_cmake(DirOutput)
+run_cmake(NewLineStyle-NoArg)
+run_cmake(NewLineStyle-ValidArg)
+run_cmake(NewLineStyle-WrongArg)
+run_cmake(SubDir)
diff --git a/Tests/RunCMake/File_Configure/SubDir-check.cmake b/Tests/RunCMake/File_Configure/SubDir-check.cmake
new file mode 100644
index 000000000..1e825878c
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/SubDir-check.cmake
@@ -0,0 +1,4 @@
+set(expected "${RunCMake_TEST_BINARY_DIR}/SubDir/out.txt")
+if(NOT EXISTS "${expected}")
+ set(RunCMake_TEST_FAILED "Expected file not created:\n ${expected}")
+endif()
diff --git a/Tests/RunCMake/File_Configure/SubDir.cmake b/Tests/RunCMake/File_Configure/SubDir.cmake
new file mode 100644
index 000000000..fae60fa72
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/SubDir.cmake
@@ -0,0 +1 @@
+add_subdirectory(SubDir)
diff --git a/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt b/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt
new file mode 100644
index 000000000..6bd962eee
--- /dev/null
+++ b/Tests/RunCMake/File_Configure/SubDir/CMakeLists.txt
@@ -0,0 +1 @@
+file(CONFIGURE OUTPUT out.txt CONTENT "")
diff --git a/Tests/RunCMake/File_Generate/CMP0070-OLD-stderr.txt b/Tests/RunCMake/File_Generate/CMP0070-OLD-stderr.txt
new file mode 100644
index 000000000..bb578e578
--- /dev/null
+++ b/Tests/RunCMake/File_Generate/CMP0070-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0070-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0070 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/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake
index 2687efefb..bf8cd4eb7 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_APPBUNDLE_PATH.cmake
@@ -4,53 +4,13 @@ enable_language(C)
# Prepare environment and variables
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
set(CMAKE_APPBUNDLE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo")
-if(WIN32)
- set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat")
- set(ENV{CMAKE_APPBUNDLE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem")
- set(ENV{PKG_CONFIG_PATH} "C:\\baz")
-else()
- set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh")
- set(ENV{CMAKE_APPBUNDLE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem")
- set(ENV{PKG_CONFIG_PATH} "/baz")
-endif()
-
+set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh")
+set(ENV{CMAKE_APPBUNDLE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem")
+set(ENV{PKG_CONFIG_PATH} "/baz")
find_package(PkgConfig)
-
-if(NOT DEFINED CMAKE_SYSTEM_NAME
- OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
- AND NOT CMAKE_CROSSCOMPILING))
- if(EXISTS "/etc/debian_version") # is this a debian system ?
- if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
- # Cannot create directories for all the existing architectures...
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- else()
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- endif()
- else()
- # not debian, check the FIND_LIBRARY_USE_LIB32_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties
- get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
- get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
- get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
- if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- else()
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- endif()
- endif()
-else()
- if(WIN32)
- set(expected_path "C:\\baz;${CMAKE_CURRENT_SOURCE_DIR}\\pc-foo\\lib\\pkgconfig;${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar\\lib\\pkgconfig")
- else()
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- endif()
-endif()
-
+set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
pkg_check_modules(FOO "${expected_path}")
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake
index 74cda2588..37c18fc2c 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_CMAKE_FRAMEWORK_PATH.cmake
@@ -4,53 +4,13 @@ enable_language(C)
# Prepare environment and variables
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
set(CMAKE_FRAMEWORK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-foo")
-if(WIN32)
- set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}\\dummy-pkg-config.bat")
- set(ENV{CMAKE_FRAMEWORK_PATH} "${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar;X:\\this\\directory\\should\\not\\exist\\in\\the\\filesystem")
- set(ENV{PKG_CONFIG_PATH} "C:\\baz")
-else()
- set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh")
- set(ENV{CMAKE_FRAMEWORK_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem")
- set(ENV{PKG_CONFIG_PATH} "/baz")
-endif()
-
+set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/dummy-pkg-config.sh")
+set(ENV{CMAKE_FRAMEWORK_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/pc-bar:/this/directory/should/not/exist/in/the/filesystem")
+set(ENV{PKG_CONFIG_PATH} "/baz")
find_package(PkgConfig)
-
-if(NOT DEFINED CMAKE_SYSTEM_NAME
- OR (CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$"
- AND NOT CMAKE_CROSSCOMPILING))
- if(EXISTS "/etc/debian_version") # is this a debian system ?
- if(CMAKE_LIBRARY_ARCHITECTURE MATCHES "^(i386-linux-gnu|x86_64-linux-gnu)$")
- # Cannot create directories for all the existing architectures...
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- else()
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- endif()
- else()
- # not debian, check the FIND_LIBRARY_USE_LIB64_PATHS and FIND_LIBRARY_USE_LIB64_PATHS properties
- get_property(uselibx32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIBX32_PATHS)
- get_property(uselib32 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB32_PATHS)
- get_property(uselib64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
- if(uselibx32 AND CMAKE_INTERNAL_PLATFORM_ABI STREQUAL "ELF X32")
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/libx32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- elseif(uselib32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib32/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- elseif(uselib64 AND CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib64/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- else()
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- endif()
- endif()
-else()
- if(WIN32)
- set(expected_path "C:\\baz;${CMAKE_CURRENT_SOURCE_DIR}\\pc-foo\\lib\\pkgconfig;${CMAKE_CURRENT_SOURCE_DIR}\\pc-bar\\lib\\pkgconfig")
- else()
- set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
- endif()
-endif()
-
+set(expected_path "/baz:${CMAKE_CURRENT_SOURCE_DIR}/pc-foo/lib/pkgconfig:${CMAKE_CURRENT_SOURCE_DIR}/pc-bar/lib/pkgconfig")
pkg_check_modules(FOO "${expected_path}")
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks.cmake
new file mode 100644
index 000000000..fde886d56
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks.cmake
@@ -0,0 +1,13 @@
+find_package(PkgConfig)
+
+set(foobar_LDFLAGS_OTHER "-Wl,xy;-framework;bar;-Wl,other-framework;-framework;baz;-Wl,abc;-framework;gosh;-frameworkcrap;-frame;j;-framework;nix;-Wl,def")
+set(foobar_LIBRARIES "-lz;-lm")
+
+_pkgconfig_extract_frameworks("foobar")
+
+if (NOT foobar_LDFLAGS_OTHER STREQUAL "-Wl,xy;-Wl,other-framework;-Wl,abc;-frameworkcrap;-frame;j;-Wl,def")
+ message(SEND_ERROR "foobar_LDFLAGS_OTHER did not match: ${foobar_LDFLAGS_OTHER}")
+endif ()
+if (NOT foobar_LIBRARIES STREQUAL "-lz;-lm;-framework bar;-framework baz;-framework gosh;-framework nix")
+ message(SEND_ERROR "foobar_LIBRARIES did not match: ${foobar_LIBRARIES}")
+endif ()
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake
new file mode 100644
index 000000000..5501d9fc3
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_extract_frameworks_target.cmake
@@ -0,0 +1,29 @@
+# Prepare environment to reuse bletch.pc
+file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-bletch/lib/pkgconfig" PC_PATH)
+if(UNIX)
+ string(REPLACE "\\ " " " PC_PATH "${PC_PATH}")
+endif()
+set(ENV{PKG_CONFIG_PATH} "${PC_PATH}")
+
+find_package(PkgConfig REQUIRED)
+pkg_check_modules(Bletch IMPORTED_TARGET REQUIRED bletch-framework)
+
+if (Bletch_LDFLAGS_OTHER)
+ message(SEND_ERROR "Bletch_LDFLAGS_OTHER should be empty, but is '${Bletch_LDFLAGS_OTHER}'")
+endif ()
+
+if (NOT Bletch_LINK_LIBRARIES STREQUAL "-framework foo;-framework bar;bletch;-framework baz")
+ message(SEND_ERROR "Bletch_LINK_LIBRARIES has wrong value '${Bletch_LINK_LIBRARIES}'")
+endif ()
+
+foreach (prop IN ITEMS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_OPTIONS INTERFACE_COMPILE_OPTIONS)
+ get_target_property(prop_value PkgConfig::Bletch ${prop})
+ if (prop_value)
+ message(SEND_ERROR "target property ${prop} should not be set, but is '${prop_value}'")
+ endif ()
+endforeach ()
+
+get_target_property(prop_value PkgConfig::Bletch INTERFACE_LINK_LIBRARIES)
+if (NOT prop_value STREQUAL Bletch_LINK_LIBRARIES)
+ message(SEND_ERROR "target property INTERFACE_LINK_LIBRARIES has wrong value '${prop_value}'")
+endif ()
diff --git a/Tests/RunCMake/FindPkgConfig/PkgConfigDoesNotExist-stdout.txt b/Tests/RunCMake/FindPkgConfig/PkgConfigDoesNotExist-stdout.txt
new file mode 100644
index 000000000..ef5f7f608
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/PkgConfigDoesNotExist-stdout.txt
@@ -0,0 +1,6 @@
+-- Could NOT find PkgConfig \(missing: PKG_CONFIG_EXECUTABLE\) *
+ Reason given by package: The command
+ "pkg-config-does-not-exist" --version
+ failed with output.*
+-- PKG_CONFIG_FOUND='FALSE'
+-- PKG_CONFIG_EXECUTABLE=''
diff --git a/Tests/RunCMake/FindPkgConfig/PkgConfigDoesNotExist.cmake b/Tests/RunCMake/FindPkgConfig/PkgConfigDoesNotExist.cmake
new file mode 100644
index 000000000..a4fabdeb4
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/PkgConfigDoesNotExist.cmake
@@ -0,0 +1,4 @@
+set(PKG_CONFIG_EXECUTABLE "pkg-config-does-not-exist" CACHE FILEPATH "")
+find_package(PkgConfig)
+message(STATUS "PKG_CONFIG_FOUND='${PKG_CONFIG_FOUND}'")
+message(STATUS "PKG_CONFIG_EXECUTABLE='${PKG_CONFIG_EXECUTABLE}'")
diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
index 7b479f1db..dc7791513 100644
--- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
@@ -1,16 +1,15 @@
include(RunCMake)
-# Isolate test cases from caller's environment.
-set(ENV{CMAKE_PREFIX_PATH} "")
-set(ENV{CMAKE_APPBUNDLE_PATH} "")
-set(ENV{CMAKE_FRAMEWORK_PATH} "")
+run_cmake(PkgConfigDoesNotExist)
run_cmake(FindPkgConfig_NO_PKGCONFIG_PATH)
run_cmake(FindPkgConfig_PKGCONFIG_PATH)
run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_PATH)
run_cmake(FindPkgConfig_PKGCONFIG_PATH_NO_CMAKE_ENVIRONMENT_PATH)
+run_cmake(FindPkgConfig_extract_frameworks)
if(APPLE)
+ run_cmake(FindPkgConfig_extract_frameworks_target)
run_cmake(FindPkgConfig_CMAKE_FRAMEWORK_PATH)
run_cmake(FindPkgConfig_CMAKE_APPBUNDLE_PATH)
endif()
diff --git a/Tests/RunCMake/FindPkgConfig/pc-bletch/lib/pkgconfig/bletch-framework.pc b/Tests/RunCMake/FindPkgConfig/pc-bletch/lib/pkgconfig/bletch-framework.pc
new file mode 100644
index 000000000..cc680ae73
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/pc-bletch/lib/pkgconfig/bletch-framework.pc
@@ -0,0 +1,9 @@
+prefix=/opt/bletch
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: Bletch
+Description: Dummy packaget to test variable support
+Version: 1.3
+Libs: -L${libdir} -framework foo -framework bar -lbletch -framework baz
diff --git a/Tests/RunCMake/FindSWIG/CMakeLists.txt b/Tests/RunCMake/FindSWIG/CMakeLists.txt
new file mode 100644
index 000000000..d1b0d2c3e
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.10)
+project(${RunCMake_TEST} C)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake b/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake
new file mode 100644
index 000000000..5f5f7f5a4
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/RunCMakeTest.cmake
@@ -0,0 +1,4 @@
+include(RunCMake)
+
+run_cmake(components)
+run_cmake(missing-components)
diff --git a/Tests/RunCMake/FindSWIG/components-stdout.txt b/Tests/RunCMake/FindSWIG/components-stdout.txt
new file mode 100644
index 000000000..3977b087e
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/components-stdout.txt
@@ -0,0 +1,6 @@
+-- Found SWIG: [^ ]+ \(found version "[0-9.]+"\) found components: java python missing components: PERL
+-- SWIG_VERSION='[0-9.]+'
+-- SWIG_java_FOUND=TRUE
+-- SWIG_python_FOUND=TRUE
+-- SWIG_PERL_FOUND=
+-- Configuring done
diff --git a/Tests/RunCMake/FindSWIG/components.cmake b/Tests/RunCMake/FindSWIG/components.cmake
new file mode 100644
index 000000000..b79a81e16
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/components.cmake
@@ -0,0 +1,9 @@
+# Note that 'perl' will not be found because it is not lowercase.
+find_package(SWIG REQUIRED
+ COMPONENTS java
+ OPTIONAL_COMPONENTS python PERL)
+
+message(STATUS "SWIG_VERSION='${SWIG_VERSION}'")
+foreach(_lang java python PERL)
+ message(STATUS "SWIG_${_lang}_FOUND=${SWIG_${_lang}_FOUND}")
+endforeach()
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt b/Tests/RunCMake/FindSWIG/missing-components-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt
+++ b/Tests/RunCMake/FindSWIG/missing-components-result.txt
diff --git a/Tests/RunCMake/FindSWIG/missing-components-stderr.txt b/Tests/RunCMake/FindSWIG/missing-components-stderr.txt
new file mode 100644
index 000000000..c93753257
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/missing-components-stderr.txt
@@ -0,0 +1 @@
+Could NOT find SWIG \(missing: invalid\)
diff --git a/Tests/RunCMake/FindSWIG/missing-components.cmake b/Tests/RunCMake/FindSWIG/missing-components.cmake
new file mode 100644
index 000000000..1d05ae4e8
--- /dev/null
+++ b/Tests/RunCMake/FindSWIG/missing-components.cmake
@@ -0,0 +1,3 @@
+find_package(SWIG REQUIRED
+ COMPONENTS invalid
+ OPTIONAL_COMPONENTS alsoinvalid)
diff --git a/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix-build-final-check.cmake b/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix-build-final-check.cmake
new file mode 100644
index 000000000..76fe6b88f
--- /dev/null
+++ b/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix-build-final-check.cmake
@@ -0,0 +1,45 @@
+include("${RunCMake_TEST_BINARY_DIR}/FrameworkMultiConfigPostfixInfo.cmake")
+
+get_filename_component(framework_location "${framework_dir}" DIRECTORY)
+set(non_existent_debug_framework_dir "${framework_location}/${target_file_name}_debug.framework")
+set(framework_resources "${framework_dir}/Resources")
+set(plist_file "${framework_resources}/Info.plist")
+
+set(symlink_release_path "${framework_dir}/${target_file_name}")
+set(framework_release_path "${framework_dir}/Versions/A/${target_file_name}")
+
+# When using a multi config generator (like Ninja Multi-Config and Xcode),
+# the postfix will be applied to the debug framework library name and the symlink name.
+# For single config generators, the name stays the same as the the release framework.
+if(is_multi_config)
+ set(symlink_debug_path "${framework_dir}/${target_file_name}_debug")
+ set(framework_debug_path "${framework_dir}/Versions/A/${target_file_name}_debug")
+else()
+ set(symlink_debug_path "${framework_dir}/${target_file_name}")
+ set(framework_debug_path "${framework_dir}/Versions/A/${target_file_name}")
+endif()
+
+if(NOT IS_DIRECTORY ${framework_dir})
+ message(SEND_ERROR "Framework dir not found at ${framework_dir}")
+endif()
+
+if(IS_DIRECTORY ${non_existent_debug_framework_dir})
+ message(SEND_ERROR
+ "A framework dir with a debug suffix should not exist at ${non_existent_debug_framework_dir}")
+endif()
+
+if(NOT IS_SYMLINK "${symlink_release_path}")
+ message(SEND_ERROR "Release framework symlink not found at ${symlink_release_path}")
+endif()
+
+if(NOT IS_SYMLINK "${symlink_debug_path}")
+ message(SEND_ERROR "Debug framework symlink not found at ${symlink_debug_path}")
+endif()
+
+if(NOT EXISTS "${framework_release_path}")
+ message(SEND_ERROR "Release framework not found at ${framework_release_path}")
+endif()
+
+if(NOT EXISTS "${framework_debug_path}")
+ message(SEND_ERROR "Debug framework not found at ${framework_debug_path}")
+endif()
diff --git a/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix.cmake b/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix.cmake
new file mode 100644
index 000000000..51e627d6d
--- /dev/null
+++ b/Tests/RunCMake/Framework/FrameworkMultiConfigPostfix.cmake
@@ -0,0 +1,25 @@
+enable_language(C)
+
+set(CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_DEBUG "_debug")
+
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/bin)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/bin)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/lib)
+
+set(target_name "mylib")
+add_library(${target_name} SHARED foo.c)
+set_property(TARGET ${target_name} PROPERTY FRAMEWORK ON)
+get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+
+string(APPEND content
+ "set(is_multi_config \"${is_multi_config}\")\n"
+ "set(framework_dir \"$<TARGET_BUNDLE_DIR:${target_name}>\")\n"
+ "set(target_file_name ${target_name})\n")
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkMultiConfigPostfixInfo.cmake
+ CONTENT "${content}")
diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake
index 965fbf431..6ee61a30b 100644
--- a/Tests/RunCMake/Framework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake
@@ -45,3 +45,39 @@ framework_type_test(ios SHARED YES)
framework_type_test(ios STATIC YES)
framework_type_test(osx SHARED YES)
framework_type_test(osx STATIC YES)
+
+function(framework_multi_config_postfix_test)
+ set(configure_name "FrameworkMultiConfigPostfix")
+ set(build_name "${configure_name}-build-intermediate")
+ set(build_name_final "${configure_name}-build-final")
+
+ if(RunCMake_GENERATOR MATCHES "Ninja Multi-Config")
+ set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_CROSS_CONFIGS=all")
+ elseif(RunCMake_GENERATOR MATCHES "Xcode")
+ set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release")
+ else()
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_BUILD_TYPE=Debug")
+ endif()
+
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${configure_name})
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${configure_name})
+ unset(RunCMake_TEST_OPTIONS)
+
+ if(RunCMake_GENERATOR MATCHES "Ninja Multi-Config")
+ run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build . --target all:all)
+ elseif(RunCMake_GENERATOR MATCHES "Xcode")
+ run_cmake_command(${build_name} ${CMAKE_COMMAND} --build . --config Release)
+ run_cmake_command(${build_name} ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build . --config Debug)
+ else()
+ run_cmake_command(${build_name_final} ${CMAKE_COMMAND} --build .)
+ endif()
+endfunction()
+
+framework_multi_config_postfix_test()
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/CMakeLists.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/CMakeLists.txt
new file mode 100644
index 000000000..74b3ff8de
--- /dev/null
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command-stderr.txt
index c8f773a0a..c8f773a0a 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command.cmake
index c3f051ab4..c3f051ab4 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_command.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_command.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target-stderr.txt
index 7025838b1..7025838b1 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target.cmake
index b826772e2..b826772e2 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_custom_target.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_custom_target.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable-stderr.txt
index 8d05e59a0..8d05e59a0 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable.cmake
index ff965a9e7..ff965a9e7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_executable.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_executable.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library-stderr.txt
index 2ac9b76ac..2ac9b76ac 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library.cmake
index dd1b5a2d7..dd1b5a2d7 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_library.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_library.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test-stderr.txt
index fd8a731f1..fd8a731f1 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test.cmake
index deedf659e..deedf659e 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-add_test.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-add_test.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install-stderr.txt
index bef7f63b9..bef7f63b9 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install.cmake
index 92c20e32d..92c20e32d 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-install.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-install.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources-stderr.txt
index 8e7f88125..8e7f88125 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources.cmake
index a4a5abb5e..a4a5abb5e 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-target_sources.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-target_sources.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-unknown-lang.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-unknown-lang.cmake
index 00dd29070..00dd29070 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANGUAGE-unknown-lang.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/COMPILE_LANGUAGE-unknown-lang.cmake
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake
new file mode 100644
index 000000000..6691fdfca
--- /dev/null
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/RunCMakeTest.cmake
@@ -0,0 +1,10 @@
+include(RunCMake)
+
+run_cmake(COMPILE_LANGUAGE-add_custom_target)
+run_cmake(COMPILE_LANGUAGE-add_custom_command)
+run_cmake(COMPILE_LANGUAGE-install)
+run_cmake(COMPILE_LANGUAGE-target_sources)
+run_cmake(COMPILE_LANGUAGE-add_executable)
+run_cmake(COMPILE_LANGUAGE-add_library)
+run_cmake(COMPILE_LANGUAGE-add_test)
+run_cmake(COMPILE_LANGUAGE-unknown-lang)
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/empty.c b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-COMPILE_LANGUAGE/empty.c
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/CMakeLists.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/CMakeLists.txt
new file mode 100644
index 000000000..77030d63b
--- /dev/null
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.15)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt
index 2ee96ed14..2ee96ed14 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command.cmake
index 9bd5e8e7e..9bd5e8e7e 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_command.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_command.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target-stderr.txt
index 589e64b4e..589e64b4e 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target.cmake
index 398db1978..398db1978 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_custom_target.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_custom_target.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable-stderr.txt
index 3b3f38d37..3b3f38d37 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable.cmake
index 2245f5046..2245f5046 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_executable.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_executable.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library-stderr.txt
index 4cbf000ea..4cbf000ea 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library.cmake
index 044962a53..044962a53 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_library.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_library.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test-stderr.txt
index 26a5940f3..26a5940f3 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test.cmake
index b5b6c2b82..b5b6c2b82 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-add_test.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-add_test.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install-stderr.txt
index 0c4ecd091..0c4ecd091 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install.cmake
index c13eda6ec..c13eda6ec 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-install.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-install.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg-result.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg-result.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-stderr.txt b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources-stderr.txt
index 3ecbdc360..3ecbdc360 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources-stderr.txt
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources.cmake
index a2c9b03f5..a2c9b03f5 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-target_sources.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-target_sources.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-unknown-lang.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-unknown-lang.cmake
index b9e840b41..b9e840b41 100644
--- a/Tests/RunCMake/GeneratorExpression/COMPILE_LANG_AND_ID-unknown-lang.cmake
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/COMPILE_LANG_AND_ID-unknown-lang.cmake
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake
new file mode 100644
index 000000000..a0a7bb9be
--- /dev/null
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/RunCMakeTest.cmake
@@ -0,0 +1,10 @@
+include(RunCMake)
+
+run_cmake(COMPILE_LANG_AND_ID-add_custom_target)
+run_cmake(COMPILE_LANG_AND_ID-add_custom_command)
+run_cmake(COMPILE_LANG_AND_ID-install)
+run_cmake(COMPILE_LANG_AND_ID-target_sources)
+run_cmake(COMPILE_LANG_AND_ID-add_executable)
+run_cmake(COMPILE_LANG_AND_ID-add_library)
+run_cmake(COMPILE_LANG_AND_ID-add_test)
+run_cmake(COMPILE_LANG_AND_ID-unknown-lang)
diff --git a/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/empty.c b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-COMPILE_LANG_AND_ID/empty.c
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/CMakeLists.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/CMakeLists.txt
new file mode 100644
index 000000000..b646c4ac6
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/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/GeneratorExpression/TARGET_GENEX_EVAL-no-target-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-target-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command-stderr.txt
new file mode 100644
index 000000000..eb15834c5
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_custom_command.cmake:[0-9]+ \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command.cmake
new file mode 100644
index 000000000..01b378493
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_command.cmake
@@ -0,0 +1,4 @@
+add_custom_target(drive)
+add_custom_command(TARGET drive PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo $<DEVICE_LINK>
+)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target-stderr.txt
new file mode 100644
index 000000000..cdd3043a2
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_custom_target.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target.cmake
new file mode 100644
index 000000000..35728e9c0
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_custom_target.cmake
@@ -0,0 +1,3 @@
+add_custom_target(drive
+ COMMAND ${CMAKE_COMMAND} -E echo $<DEVICE_LINK>
+)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable-stderr.txt
new file mode 100644
index 000000000..56b595c74
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_executable.cmake:[0-9]+ \(add_executable\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:empty.c>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable.cmake
new file mode 100644
index 000000000..899f8f68a
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_executable.cmake
@@ -0,0 +1 @@
+add_executable(empty $<DEVICE_LINK:empty.c>)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library-stderr.txt
new file mode 100644
index 000000000..4477e00ae
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_library.cmake:[0-9]+ \(add_library\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:empty.c>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library.cmake
new file mode 100644
index 000000000..fc8547b60
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_library.cmake
@@ -0,0 +1 @@
+add_library(empty $<DEVICE_LINK:empty.c>)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test-stderr.txt
new file mode 100644
index 000000000..99561fe2c
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_test.cmake:[0-9]+ \(add_test\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test.cmake
new file mode 100644
index 000000000..87d6ba16d
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-add_test.cmake
@@ -0,0 +1,5 @@
+
+include(CTest)
+enable_testing()
+
+add_test(NAME dummy COMMAND ${CMAKE_COMMAND} -E echo $<DEVICE_LINK>)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install-stderr.txt
new file mode 100644
index 000000000..afb3090ad
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:empty>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install.cmake
new file mode 100644
index 000000000..4b6dbef28
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-install.cmake
@@ -0,0 +1,5 @@
+
+install(FILES
+ $<DEVICE_LINK:empty>
+ DESTINATION src
+)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends-stderr.txt
new file mode 100644
index 000000000..4fa0522b0
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:lib>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends.cmake
new file mode 100644
index 000000000..8129514a4
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-link_depends.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+set_property(TARGET empty PROPERTY LINK_DEPENDS $<DEVICE_LINK:lib>)
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions-stderr.txt
new file mode 100644
index 000000000..c0185e3a7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_compile_definitions.cmake:[0-9]+ \(target_compile_definitions\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:DEF>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions.cmake
new file mode 100644
index 000000000..aaa8efc1f
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_definitions.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_definitions(empty PRIVATE $<DEVICE_LINK:DEF>)
diff --git a/Tests/RunCMake/alias_targets/imported-target-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/alias_targets/imported-target-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options-stderr.txt
new file mode 100644
index 000000000..34ca4f236
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_compile_options.cmake:[0-9]+ \(target_compile_options\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:-OPT>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options.cmake
new file mode 100644
index 000000000..a9cb7fd4d
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_compile_options.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_options(empty PRIVATE $<DEVICE_LINK:-OPT>)
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories-stderr.txt
new file mode 100644
index 000000000..4d1642d78
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_include_directories.cmake:[0-9]+ \(target_include_directories\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:/DIR>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories.cmake
new file mode 100644
index 000000000..03cc413e8
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_include_directories.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_include_directories(empty PRIVATE $<DEVICE_LINK:/DIR>)
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories-stderr.txt
new file mode 100644
index 000000000..d924916a5
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_link_directories.cmake:[0-9]+ \(target_link_directories\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:/DIR>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories.cmake
new file mode 100644
index 000000000..e50d27d89
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_directories.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+target_link_directories(empty PRIVATE $<DEVICE_LINK:/DIR>)
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries-stderr.txt
new file mode 100644
index 000000000..1436fa8fe
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_link_libraries.cmake:[0-9]+ \(target_link_libraries\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:lib>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries.cmake
new file mode 100644
index 000000000..971f56206
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_link_libraries.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+target_link_libraries(empty PRIVATE $<DEVICE_LINK:lib>)
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources-result.txt
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources-stderr.txt b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources-stderr.txt
new file mode 100644
index 000000000..c9b602d84
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_sources.cmake:[0-9]+ \(target_sources\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:empty.c>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources.cmake
new file mode 100644
index 000000000..94bac9e2c
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/DEVICE_LINK-target_sources.cmake
@@ -0,0 +1,2 @@
+add_library(empty)
+target_sources(empty PRIVATE $<DEVICE_LINK:empty.c>)
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake
new file mode 100644
index 000000000..1e4460146
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/RunCMakeTest.cmake
@@ -0,0 +1,17 @@
+include(RunCMake)
+
+run_cmake(DEVICE_LINK-add_custom_target)
+run_cmake(DEVICE_LINK-add_custom_command)
+run_cmake(DEVICE_LINK-install)
+run_cmake(DEVICE_LINK-add_executable)
+run_cmake(DEVICE_LINK-add_library)
+run_cmake(DEVICE_LINK-add_test)
+run_cmake(DEVICE_LINK-target_sources)
+run_cmake(DEVICE_LINK-target_compile_definitions)
+run_cmake(DEVICE_LINK-target_compile_options)
+run_cmake(DEVICE_LINK-target_include_directories)
+run_cmake(DEVICE_LINK-target_link_libraries)
+run_cmake(DEVICE_LINK-target_link_directories)
+if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)")
+ run_cmake(DEVICE_LINK-link_depends)
+endif()
diff --git a/Tests/RunCMake/GenEx-DEVICE_LINK/empty.c b/Tests/RunCMake/GenEx-DEVICE_LINK/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-DEVICE_LINK/empty.c
diff --git a/Tests/RunCMake/GenEx-GENEX_EVAL/CMakeLists.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/CMakeLists.txt
new file mode 100644
index 000000000..44025d3bd
--- /dev/null
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-check.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-check.cmake
index df7674051..df7674051 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-check.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-check.cmake
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1-stderr.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1-stderr.txt
index 012dff658..012dff658 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1-stderr.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1.cmake
index 6596a81ab..6596a81ab 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion1.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion1.cmake
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2-stderr.txt
index ed6840057..ed6840057 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2-stderr.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2.cmake
index 773749f2c..773749f2c 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL-recursion2.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL-recursion2.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL.cmake
index 153cd176f..153cd176f 100644
--- a/Tests/RunCMake/GeneratorExpression/GENEX_EVAL.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/GENEX_EVAL.cmake
diff --git a/Tests/RunCMake/GenEx-GENEX_EVAL/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/RunCMakeTest.cmake
new file mode 100644
index 000000000..d804a5646
--- /dev/null
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/RunCMakeTest.cmake
@@ -0,0 +1,11 @@
+include(RunCMake)
+
+run_cmake(TARGET_GENEX_EVAL-no-arg)
+run_cmake(TARGET_GENEX_EVAL-no-target)
+run_cmake(TARGET_GENEX_EVAL-non-valid-target)
+run_cmake(TARGET_GENEX_EVAL-recursion1)
+run_cmake(TARGET_GENEX_EVAL-recursion2)
+run_cmake(TARGET_GENEX_EVAL)
+run_cmake(GENEX_EVAL-recursion1)
+run_cmake(GENEX_EVAL-recursion2)
+run_cmake(GENEX_EVAL)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-check.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-check.cmake
index 124a583e2..124a583e2 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-check.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-check.cmake
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg-stderr.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg-stderr.txt
index 9b0844f9f..9b0844f9f 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg-stderr.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg.cmake
index 2dc13ea5e..2dc13ea5e 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-arg.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-arg.cmake
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-target-stderr.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target-stderr.txt
index 647fd85c6..647fd85c6 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-target-stderr.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-target.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target.cmake
index df4f0eac6..df4f0eac6 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-no-target.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-no-target.cmake
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target-stderr.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target-stderr.txt
index cc44d4b9c..cc44d4b9c 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target-stderr.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target.cmake
index 8db737593..8db737593 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-non-valid-target.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-non-valid-target.cmake
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1-stderr.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1-stderr.txt
index bba22340c..bba22340c 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1-stderr.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1.cmake
index b75d21175..b75d21175 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion1.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion1.cmake
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2-result.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2-stderr.txt b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2-stderr.txt
index 73f6b77e9..73f6b77e9 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2-stderr.txt
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2.cmake
index a28dfc34d..a28dfc34d 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL-recursion2.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL-recursion2.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL.cmake b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL.cmake
index 68b371257..68b371257 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_GENEX_EVAL.cmake
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/TARGET_GENEX_EVAL.cmake
diff --git a/Tests/RunCMake/GenEx-GENEX_EVAL/empty.c b/Tests/RunCMake/GenEx-GENEX_EVAL/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-GENEX_EVAL/empty.c
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/CMakeLists.txt b/Tests/RunCMake/GenEx-HOST_LINK/CMakeLists.txt
new file mode 100644
index 000000000..b646c4ac6
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/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/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command-result.txt
index d00491fd7..d00491fd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command-result.txt
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command-stderr.txt
new file mode 100644
index 000000000..5ad41b96d
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_custom_command.cmake:[0-9]+ \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command.cmake
new file mode 100644
index 000000000..4d6e30531
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_command.cmake
@@ -0,0 +1,4 @@
+add_custom_target(drive)
+add_custom_command(TARGET drive PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo $<HOST_LINK>
+)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target-stderr.txt
new file mode 100644
index 000000000..c44202a70
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_custom_target.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target.cmake
new file mode 100644
index 000000000..eec072a96
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_custom_target.cmake
@@ -0,0 +1,3 @@
+add_custom_target(drive
+ COMMAND ${CMAKE_COMMAND} -E echo $<HOST_LINK>
+)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable-stderr.txt
new file mode 100644
index 000000000..b39551577
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_executable.cmake:[0-9]+ \(add_executable\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:empty.c>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable.cmake
new file mode 100644
index 000000000..c9f74a5c0
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_executable.cmake
@@ -0,0 +1 @@
+add_executable(empty $<HOST_LINK:empty.c>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library-stderr.txt
new file mode 100644
index 000000000..4bd27bec9
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_library.cmake:[0-9]+ \(add_library\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:empty.c>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library.cmake
new file mode 100644
index 000000000..44135af00
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_library.cmake
@@ -0,0 +1 @@
+add_library(empty $<HOST_LINK:empty.c>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test-stderr.txt
new file mode 100644
index 000000000..012ad210a
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_test.cmake:[0-9]+ \(add_test\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test.cmake
new file mode 100644
index 000000000..4b472afe4
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-add_test.cmake
@@ -0,0 +1,5 @@
+
+include(CTest)
+enable_testing()
+
+add_test(NAME dummy COMMAND ${CMAKE_COMMAND} -E echo $<HOST_LINK>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install-stderr.txt
new file mode 100644
index 000000000..c265ec418
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:empty>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install.cmake
new file mode 100644
index 000000000..b4dff680e
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-install.cmake
@@ -0,0 +1,5 @@
+
+install(FILES
+ $<HOST_LINK:empty>
+ DESTINATION src
+)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends-stderr.txt
new file mode 100644
index 000000000..24b8b82f4
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:lib>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends.cmake
new file mode 100644
index 000000000..0402f43e8
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-link_depends.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+set_property(TARGET empty PROPERTY LINK_DEPENDS $<HOST_LINK:lib>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions-stderr.txt
new file mode 100644
index 000000000..6ab3c14d8
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_compile_definitions.cmake:[0-9]+ \(target_compile_definitions\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:DEF>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions.cmake
new file mode 100644
index 000000000..f6c130d40
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_definitions.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_definitions(empty PRIVATE $<HOST_LINK:DEF>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options-stderr.txt
new file mode 100644
index 000000000..0f5bbc38c
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_compile_options.cmake:[0-9]+ \(target_compile_options\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:-OPT>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options.cmake
new file mode 100644
index 000000000..53afea19e
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_compile_options.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_options(empty PRIVATE $<HOST_LINK:-OPT>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories-stderr.txt
new file mode 100644
index 000000000..9a2634a22
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_include_directories.cmake:[0-9]+ \(target_include_directories\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:/DIR>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories.cmake
new file mode 100644
index 000000000..aff100923
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_include_directories.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_include_directories(empty PRIVATE $<HOST_LINK:/DIR>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories-stderr.txt
new file mode 100644
index 000000000..5225a5253
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_link_directories.cmake:[0-9]+ \(target_link_directories\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:/DIR>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories.cmake
new file mode 100644
index 000000000..97488eef8
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_directories.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+target_link_directories(empty PRIVATE $<HOST_LINK:/DIR>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries-stderr.txt
new file mode 100644
index 000000000..6c4441f3c
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_link_libraries.cmake:[0-9]+ \(target_link_libraries\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:lib>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries.cmake
new file mode 100644
index 000000000..d74c92d4b
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_link_libraries.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+target_link_libraries(empty PRIVATE $<HOST_LINK:lib>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources-result.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources-stderr.txt b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources-stderr.txt
new file mode 100644
index 000000000..0e2556812
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_sources.cmake:[0-9]+ \(target_sources\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:empty.c>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources.cmake b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources.cmake
new file mode 100644
index 000000000..ea7bf551d
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/HOST_LINK-target_sources.cmake
@@ -0,0 +1,2 @@
+add_library(empty)
+target_sources(empty PRIVATE $<HOST_LINK:empty.c>)
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake
new file mode 100644
index 000000000..329a7c6bc
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/RunCMakeTest.cmake
@@ -0,0 +1,17 @@
+include(RunCMake)
+
+run_cmake(HOST_LINK-add_custom_target)
+run_cmake(HOST_LINK-add_custom_command)
+run_cmake(HOST_LINK-install)
+run_cmake(HOST_LINK-add_executable)
+run_cmake(HOST_LINK-add_library)
+run_cmake(HOST_LINK-add_test)
+run_cmake(HOST_LINK-target_sources)
+run_cmake(HOST_LINK-target_compile_definitions)
+run_cmake(HOST_LINK-target_compile_options)
+run_cmake(HOST_LINK-target_include_directories)
+run_cmake(HOST_LINK-target_link_libraries)
+run_cmake(HOST_LINK-target_link_directories)
+if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)")
+ run_cmake(HOST_LINK-link_depends)
+endif()
diff --git a/Tests/RunCMake/GenEx-HOST_LINK/empty.c b/Tests/RunCMake/GenEx-HOST_LINK/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-HOST_LINK/empty.c
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/CMakeLists.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/CMakeLists.txt
new file mode 100644
index 000000000..b646c4ac6
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/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/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command-stderr.txt
new file mode 100644
index 000000000..0b0d458fd
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-add_custom_command.cmake:2 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command.cmake
new file mode 100644
index 000000000..a378c1c0d
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_command.cmake
@@ -0,0 +1,4 @@
+add_custom_target(drive)
+add_custom_command(TARGET drive PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANGUAGE>
+)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target-stderr.txt
new file mode 100644
index 000000000..92da63454
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-add_custom_target.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target.cmake
new file mode 100644
index 000000000..60b6c75f2
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_custom_target.cmake
@@ -0,0 +1,3 @@
+add_custom_target(drive
+ COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANGUAGE>
+)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable-stderr.txt
new file mode 100644
index 000000000..3bdc8e493
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-add_executable.cmake:1 \(add_executable\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable.cmake
new file mode 100644
index 000000000..2176b3923
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_executable.cmake
@@ -0,0 +1 @@
+add_executable(empty empty.$<LINK_LANGUAGE>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library-stderr.txt
new file mode 100644
index 000000000..1bacdeb4c
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-add_library.cmake:1 \(add_library\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library.cmake
new file mode 100644
index 000000000..253f82a36
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_library.cmake
@@ -0,0 +1 @@
+add_library(empty empty.$<LINK_LANGUAGE>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test-stderr.txt
new file mode 100644
index 000000000..f22efde7e
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-add_test.cmake:5 \(add_test\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test.cmake
new file mode 100644
index 000000000..4fd547d54
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-add_test.cmake
@@ -0,0 +1,5 @@
+
+include(CTest)
+enable_testing()
+
+add_test(NAME dummy COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANGUAGE>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate-stderr.txt
new file mode 100644
index 000000000..21d26de5f
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-file_generate.cmake:3 \(file\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate.cmake
new file mode 100644
index 000000000..519b883c4
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-file_generate.cmake
@@ -0,0 +1,6 @@
+enable_language(CXX C)
+
+file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/output.txt
+ CONTENT "LANG_IS_$<LINK_LANGUAGE>\n"
+)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install-stderr.txt
new file mode 100644
index 000000000..73afc3377
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+
+
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install.cmake
new file mode 100644
index 000000000..533c0b459
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-install.cmake
@@ -0,0 +1,5 @@
+
+install(FILES
+ empty.$<LINK_LANGUAGE>
+ DESTINATION src
+)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources-stderr.txt
new file mode 100644
index 000000000..d8121cce6
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-target_sources.cmake:2 \(target_sources\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources.cmake
new file mode 100644
index 000000000..c134c0197
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-target_sources.cmake
@@ -0,0 +1,2 @@
+add_library(empty)
+target_sources(empty PRIVATE empty.$<LINK_LANGUAGE>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-unknown-lang.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-unknown-lang.cmake
new file mode 100644
index 000000000..0ba472d7b
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-unknown-lang.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_link_options(empty PRIVATE $<$<LINK_LANGUAGE:CXX>:$<TARGET_EXISTS:too,many,parameters>>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1-stderr.txt
new file mode 100644
index 000000000..1e3a83b92
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-wrong-usage1.cmake:4 \(target_compile_definitions\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE:C>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1.cmake
new file mode 100644
index 000000000..90b7ce033
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage1.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_definitions(empty PRIVATE $<$<LINK_LANGUAGE:C>:DEF>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2-stderr.txt
new file mode 100644
index 000000000..7fe43101b
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-wrong-usage2.cmake:4 \(target_compile_options\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE:C>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2.cmake
new file mode 100644
index 000000000..e761897ed
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage2.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_options(empty PRIVATE $<$<LINK_LANGUAGE:C>:-OPT>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3-stderr.txt
new file mode 100644
index 000000000..cb20e996d
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANGUAGE-wrong-usage3.cmake:4 \(target_include_directories\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE:C>
+
+ \$<LINK_LANGUAGE:...> may only be used with binary targets to specify link
+ libraries, link directories, link options and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3.cmake
new file mode 100644
index 000000000..96a72a188
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage3.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_include_directories(empty PRIVATE $<$<LINK_LANGUAGE:C>:/DIR>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4-result.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4-stderr.txt
new file mode 100644
index 000000000..ee36912df
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at LINK_LANGUAGE-wrong-usage4.cmake:7 \(target_link_libraries\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE> is not supported in link libraries expression.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4.cmake
new file mode 100644
index 000000000..3ecaabbe4
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/LINK_LANGUAGE-wrong-usage4.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(libC empty.c)
+
+add_executable(empty empty.c)
+target_link_libraries(empty PRIVATE lib$<LINK_LANGUAGE>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-LINK_LANGUAGE/RunCMakeTest.cmake
new file mode 100644
index 000000000..4cf0c047d
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/RunCMakeTest.cmake
@@ -0,0 +1,15 @@
+include(RunCMake)
+
+run_cmake(LINK_LANGUAGE-add_custom_target)
+run_cmake(LINK_LANGUAGE-add_custom_command)
+run_cmake(LINK_LANGUAGE-install)
+run_cmake(LINK_LANGUAGE-target_sources)
+run_cmake(LINK_LANGUAGE-add_executable)
+run_cmake(LINK_LANGUAGE-add_library)
+run_cmake(LINK_LANGUAGE-add_test)
+run_cmake(LINK_LANGUAGE-unknown-lang)
+run_cmake(LINK_LANGUAGE-wrong-usage1)
+run_cmake(LINK_LANGUAGE-wrong-usage2)
+run_cmake(LINK_LANGUAGE-wrong-usage3)
+run_cmake(LINK_LANGUAGE-wrong-usage4)
+run_cmake(LINK_LANGUAGE-file_generate)
diff --git a/Tests/RunCMake/GenEx-LINK_LANGUAGE/empty.c b/Tests/RunCMake/GenEx-LINK_LANGUAGE/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANGUAGE/empty.c
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/CMakeLists.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/CMakeLists.txt
new file mode 100644
index 000000000..b646c4ac6
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/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/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command-stderr.txt
new file mode 100644
index 000000000..2ff62bc42
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-add_custom_command.cmake:2 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:LANG,ID>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command.cmake
new file mode 100644
index 000000000..9df923232
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_command.cmake
@@ -0,0 +1,4 @@
+add_custom_target(drive)
+add_custom_command(TARGET drive PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANG_AND_ID:LANG,ID>
+)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target-stderr.txt
new file mode 100644
index 000000000..0749c449a
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-add_custom_target.cmake:2 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:LANG,ID>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target.cmake
new file mode 100644
index 000000000..e5f76bcd1
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_custom_target.cmake
@@ -0,0 +1,4 @@
+
+add_custom_target(drive
+ COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANG_AND_ID:LANG,ID>
+)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable-stderr.txt
new file mode 100644
index 000000000..595312a72
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-add_executable.cmake:1 \(add_executable\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:C,MSVC>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable.cmake
new file mode 100644
index 000000000..4d6c67482
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_executable.cmake
@@ -0,0 +1,5 @@
+add_executable(empty main.c
+ $<$<LINK_LANG_AND_ID:C,MSVC>:empty.c>
+ $<$<LINK_LANG_AND_ID:C,GNU>:empty2.c>
+ $<$<LINK_LANG_AND_ID:C,Clang>:empty3.c>
+ )
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library-stderr.txt
new file mode 100644
index 000000000..be46e287a
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-add_library.cmake:2 \(add_library\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:C,MSVC>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library.cmake
new file mode 100644
index 000000000..a8199cf86
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_library.cmake
@@ -0,0 +1,2 @@
+
+add_library(empty empty.$<LINK_LANG_AND_ID:C,MSVC>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test-stderr.txt
new file mode 100644
index 000000000..2a29492e8
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-add_test.cmake:5 \(add_test\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:CXX,GNU>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test.cmake
new file mode 100644
index 000000000..fd700d796
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-add_test.cmake
@@ -0,0 +1,5 @@
+
+include(CTest)
+enable_testing()
+
+add_test(NAME dummy COMMAND ${CMAKE_COMMAND} -E echo $<LINK_LANG_AND_ID:CXX,GNU>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate-stderr.txt
new file mode 100644
index 000000000..e57b55c1c
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-file_generate.cmake:3 \(file\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:C,GNU>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate.cmake
new file mode 100644
index 000000000..67c1bdacd
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-file_generate.cmake
@@ -0,0 +1,6 @@
+enable_language(CXX C)
+
+file(GENERATE
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/output.txt
+ CONTENT "LANG_IS_$<$<LINK_LANG_AND_ID:C,GNU>:C>\n"
+)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install-stderr.txt
new file mode 100644
index 000000000..965f974cb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install-stderr.txt
@@ -0,0 +1,10 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:C,MSVC>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+
+
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install.cmake
new file mode 100644
index 000000000..b8f93233c
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-install.cmake
@@ -0,0 +1,5 @@
+
+install(FILES
+ empty.$<LINK_LANG_AND_ID:C,MSVC>
+ DESTINATION src
+)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources-stderr.txt
new file mode 100644
index 000000000..e86602a0f
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at LINK_LANG_AND_ID-target_sources.cmake:2 \(target_sources\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID>
+
+ \$<LINK_LANG_AND_ID> expression requires at least two parameters.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources.cmake
new file mode 100644
index 000000000..da5faf490
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-target_sources.cmake
@@ -0,0 +1,2 @@
+add_library(empty)
+target_sources(empty PRIVATE empty.$<LINK_LANG_AND_ID>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-unknown-lang.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-unknown-lang.cmake
new file mode 100644
index 000000000..99dd33760
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-unknown-lang.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_link_options(empty PRIVATE $<$<LINK_LANG_AND_ID:CXX,GNU>:$<TARGET_EXISTS:too,many,parameters>>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1-stderr.txt
new file mode 100644
index 000000000..95611c310
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-wrong-usage1.cmake:4 \(target_compile_definitions\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:C,GNU>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1.cmake
new file mode 100644
index 000000000..e58e3b449
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage1.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_definitions(empty PRIVATE $<$<LINK_LANG_AND_ID:C,GNU>:DEF>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2-stderr.txt
new file mode 100644
index 000000000..53bdcb2a5
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-wrong-usage2.cmake:4 \(target_compile_options\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:C,GNU>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2.cmake
new file mode 100644
index 000000000..998daa9b7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage2.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_options(empty PRIVATE $<$<LINK_LANG_AND_ID:C,GNU>:-OPT>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3-result.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3-stderr.txt b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3-stderr.txt
new file mode 100644
index 000000000..a34a2ea57
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINK_LANG_AND_ID-wrong-usage3.cmake:4 \(target_include_directories\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANG_AND_ID:C,GNU>
+
+ \$<LINK_LANG_AND_ID:lang,id> may only be used with binary targets to specify
+ link libraries, link directories, link options, and link depends.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3.cmake
new file mode 100644
index 000000000..054305638
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/LINK_LANG_AND_ID-wrong-usage3.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_include_directories(empty PRIVATE $<$<LINK_LANG_AND_ID:C,GNU>:/DIR>)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/RunCMakeTest.cmake
new file mode 100644
index 000000000..5bb6590a6
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/RunCMakeTest.cmake
@@ -0,0 +1,14 @@
+include(RunCMake)
+
+run_cmake(LINK_LANG_AND_ID-add_custom_target)
+run_cmake(LINK_LANG_AND_ID-add_custom_command)
+run_cmake(LINK_LANG_AND_ID-install)
+run_cmake(LINK_LANG_AND_ID-target_sources)
+run_cmake(LINK_LANG_AND_ID-add_executable)
+run_cmake(LINK_LANG_AND_ID-add_library)
+run_cmake(LINK_LANG_AND_ID-add_test)
+run_cmake(LINK_LANG_AND_ID-unknown-lang)
+run_cmake(LINK_LANG_AND_ID-wrong-usage1)
+run_cmake(LINK_LANG_AND_ID-wrong-usage2)
+run_cmake(LINK_LANG_AND_ID-wrong-usage3)
+run_cmake(LINK_LANG_AND_ID-file_generate)
diff --git a/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/empty.c b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-LINK_LANG_AND_ID/empty.c
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/CMakeLists.txt b/Tests/RunCMake/GenEx-TARGET_FILE/CMakeLists.txt
new file mode 100644
index 000000000..4b3de84d9
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt
index 854447f53..854447f53 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake
index ac2d3ce6a..ac2d3ce6a 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt
index 9b97df1a4..9b97df1a4 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR.cmake
index 17c81287c..17c81287c 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_BUNDLE_DIR.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE-stderr.txt
index d915ecbbf..d915ecbbf 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE.cmake
index c55c5d594..c55c5d594 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt
index 3b2a814a7..3b2a814a7 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake
index 489d8e620..489d8e620 100644
--- a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ImportedTarget-TARGET_PDB_FILE_BASE_NAME.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE-stderr.txt
index 831edadcf..831edadcf 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE.cmake
index 84a2b2e8b..84a2b2e8b 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-stderr.txt
index b061ce3de..b061ce3de 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake
index 811c3f70f..811c3f70f 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidCompiler-TARGET_PDB_FILE_BASE_NAME.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt
index 03c02d910..03c02d910 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake
index 63b3b1beb..63b3b1beb 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt
index f895c88b5..f895c88b5 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR.cmake
index 19f333aa1..19f333aa1 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_BUNDLE_DIR.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE-stderr.txt
index e5f21e2e3..e5f21e2e3 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE.cmake
index 84a2b2e8b..84a2b2e8b 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt
index c7d245c54..c7d245c54 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake
index 811c3f70f..811c3f70f 100644
--- a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/NonValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt
index 013c4f25b..013c4f25b 100644
--- a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion.cmake
index 006b0daad..006b0daad 100644
--- a/Tests/RunCMake/GeneratorExpression/OUTPUT_NAME-recursion.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/OUTPUT_NAME-recursion.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake
new file mode 100644
index 000000000..ccec63374
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake
@@ -0,0 +1,31 @@
+include(RunCMake)
+
+run_cmake(TARGET_FILE-recursion)
+run_cmake(OUTPUT_NAME-recursion)
+run_cmake(TARGET_FILE_PREFIX)
+run_cmake(TARGET_FILE_PREFIX-imported-target)
+run_cmake(TARGET_FILE_PREFIX-non-valid-target)
+run_cmake(TARGET_LINKER_FILE_PREFIX-non-valid-target)
+run_cmake(TARGET_FILE_SUFFIX)
+run_cmake(TARGET_FILE_SUFFIX-imported-target)
+run_cmake(TARGET_FILE_SUFFIX-non-valid-target)
+run_cmake(TARGET_LINKER_FILE_SUFFIX-non-valid-target)
+run_cmake_with_options(TARGET_FILE_BASE_NAME -DCMAKE_BUILD_TYPE:STRING=Debug)
+run_cmake_with_options(TARGET_FILE_BASE_NAME-imported-target -DCMAKE_BUILD_TYPE:STRING=Debug)
+run_cmake(TARGET_FILE_BASE_NAME-non-valid-target)
+run_cmake(TARGET_LINKER_FILE_BASE_NAME-non-valid-target)
+run_cmake(NonValidTarget-TARGET_BUNDLE_DIR)
+run_cmake(NonValidTarget-TARGET_BUNDLE_CONTENT_DIR)
+run_cmake(ImportedTarget-TARGET_BUNDLE_DIR)
+run_cmake(ImportedTarget-TARGET_BUNDLE_CONTENT_DIR)
+run_cmake(ImportedTarget-TARGET_PDB_FILE)
+run_cmake(ImportedTarget-TARGET_PDB_FILE_BASE_NAME)
+if(LINKER_SUPPORTS_PDB)
+ run_cmake(NonValidTarget-TARGET_PDB_FILE)
+ run_cmake(ValidTarget-TARGET_PDB_FILE)
+ run_cmake(NonValidTarget-TARGET_PDB_FILE_BASE_NAME)
+ run_cmake(ValidTarget-TARGET_PDB_FILE_BASE_NAME)
+else()
+ run_cmake(NonValidCompiler-TARGET_PDB_FILE)
+ run_cmake(NonValidCompiler-TARGET_PDB_FILE_BASE_NAME)
+endif()
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion-stderr.txt
index 5b15526e7..5b15526e7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion.cmake
index e780103d9..e780103d9 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE-recursion.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE-recursion.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-check.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-check.cmake
index 793edb1de..793edb1de 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-check.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-check.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-imported-target-check.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-imported-target-check.cmake
index 793edb1de..793edb1de 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-imported-target-check.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-imported-target-check.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-imported-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-imported-target.cmake
index 40f7c66f2..40f7c66f2 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-imported-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-imported-target.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target-stderr.txt
index ecb9e5d03..ecb9e5d03 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target.cmake
index 8622b7dc9..8622b7dc9 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME-non-valid-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME-non-valid-target.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME.cmake
index f88d7109a..f88d7109a 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_BASE_NAME.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_BASE_NAME.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-check.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-check.cmake
index 676ad4bc8..676ad4bc8 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-check.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-check.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target-check.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-imported-target-check.cmake
index 676ad4bc8..676ad4bc8 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target-check.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-imported-target-check.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-imported-target.cmake
index f52776e98..f52776e98 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-imported-target.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target-stderr.txt
index 81362ef04..81362ef04 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target.cmake
index d1095fa53..d1095fa53 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-non-valid-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX-non-valid-target.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX.cmake
index bef7bbf5c..bef7bbf5c 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_PREFIX.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-check.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-check.cmake
index f159370d7..f159370d7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-check.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-check.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target-check.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-imported-target-check.cmake
index f159370d7..f159370d7 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target-check.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-imported-target-check.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-imported-target.cmake
index cefeb86f1..cefeb86f1 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-imported-target.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target-stderr.txt
index 9ea09d163..9ea09d163 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target.cmake
index f7089f947..f7089f947 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-non-valid-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX-non-valid-target.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX.cmake
index 39e39fd5b..39e39fd5b 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_SUFFIX.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-stderr.txt
index 1ae2f2c86..1ae2f2c86 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target.cmake
index 776fb4bbb..776fb4bbb 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_BASE_NAME-non-valid-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_BASE_NAME-non-valid-target.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target-stderr.txt
index 7a36cefbc..7a36cefbc 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target.cmake
index 8dad4dad4..8dad4dad4 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_PREFIX-non-valid-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_PREFIX-non-valid-target.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target-stderr.txt
index cc5217a14..cc5217a14 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target-stderr.txt
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target-stderr.txt
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target.cmake
index 82c2f3a04..82c2f3a04 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_LINKER_FILE_SUFFIX-non-valid-target.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_LINKER_FILE_SUFFIX-non-valid-target.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE-check.cmake
index 2a588bcb7..2a588bcb7 100644
--- a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE-check.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE-check.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE.cmake
index a66394b42..a66394b42 100644
--- a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE_BASE_NAME-check.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE_BASE_NAME-check.cmake
index 996d2d4e6..996d2d4e6 100644
--- a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE_BASE_NAME-check.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE_BASE_NAME-check.cmake
diff --git a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake
index cc53bdf0a..cc53bdf0a 100644
--- a/Tests/RunCMake/GeneratorExpression/ValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/ValidTarget-TARGET_PDB_FILE_BASE_NAME.cmake
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/empty.c b/Tests/RunCMake/GenEx-TARGET_FILE/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/GenEx-TARGET_FILE/empty.c
diff --git a/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake b/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake
index 18c334080..b3977f1ba 100644
--- a/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GenerateExportHeader/RunCMakeTest.cmake
@@ -26,4 +26,12 @@ function(run_GEH)
endforeach()
endfunction()
+# remove these flags from the enviornment if they have been set
+# so the tests run the correct env
+set(env_cxx_flags $ENV{CXXFLAGS})
+if(env_cxx_flags)
+ string(REPLACE "-fvisibility=hidden" "" env_cxx_flags "${env_cxx_flags}")
+ string(REPLACE "-fvisibility-inlines-hidden" "" env_cxx_flags "${env_cxx_flags}")
+ set(ENV{CXXFLAGS} "${env_cxx_flags}")
+endif()
run_GEH()
diff --git a/Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp b/Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp
index ba7767986..dcaa4f2d1 100644
--- a/Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp
+++ b/Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp
@@ -32,14 +32,14 @@ void compare(const char* refName, const char* testName)
// trailing null to the string that we need to strip before testing for a
// trailing space.
if (refLine.size() && refLine[refLine.size() - 1] == 0) {
- refLine = refLine.substr(0, refLine.size() - 1);
+ refLine.resize(refLine.size() - 1);
}
if (testLine.size() && testLine[testLine.size() - 1] == 0) {
- testLine = testLine.substr(0, testLine.size() - 1);
+ testLine.resize(testLine.size() - 1);
}
// The reference files never have trailing spaces:
if (testLine.size() && testLine[testLine.size() - 1] == ' ') {
- testLine = testLine.substr(0, testLine.size() - 1);
+ testLine.resize(testLine.size() - 1);
}
if (refLine != testLine) {
std::cout << "Ref and test are not the same:\n Ref: \"" << refLine
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 68a017251..0278cf659 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -19,43 +19,12 @@ run_cmake(NonValidTarget-Fortran_COMPILER_ID)
run_cmake(NonValidTarget-C_COMPILER_VERSION)
run_cmake(NonValidTarget-CXX_COMPILER_VERSION)
run_cmake(NonValidTarget-Fortran_COMPILER_VERSION)
-run_cmake(NonValidTarget-TARGET_BUNDLE_DIR)
-run_cmake(NonValidTarget-TARGET_BUNDLE_CONTENT_DIR)
run_cmake(NonValidTarget-TARGET_PROPERTY)
run_cmake(NonValidTarget-TARGET_POLICY)
-run_cmake(COMPILE_LANGUAGE-add_custom_target)
-run_cmake(COMPILE_LANGUAGE-add_custom_command)
-run_cmake(COMPILE_LANGUAGE-install)
-run_cmake(COMPILE_LANGUAGE-target_sources)
-run_cmake(COMPILE_LANGUAGE-add_executable)
-run_cmake(COMPILE_LANGUAGE-add_library)
-run_cmake(COMPILE_LANGUAGE-add_test)
-run_cmake(COMPILE_LANGUAGE-unknown-lang)
-run_cmake(COMPILE_LANG_AND_ID-add_custom_target)
-run_cmake(COMPILE_LANG_AND_ID-add_custom_command)
-run_cmake(COMPILE_LANG_AND_ID-install)
-run_cmake(COMPILE_LANG_AND_ID-target_sources)
-run_cmake(COMPILE_LANG_AND_ID-add_executable)
-run_cmake(COMPILE_LANG_AND_ID-add_library)
-run_cmake(COMPILE_LANG_AND_ID-add_test)
-run_cmake(COMPILE_LANG_AND_ID-unknown-lang)
-run_cmake(TARGET_FILE-recursion)
-run_cmake(OUTPUT_NAME-recursion)
-run_cmake(TARGET_FILE_PREFIX)
-run_cmake(TARGET_FILE_PREFIX-imported-target)
-run_cmake(TARGET_FILE_PREFIX-non-valid-target)
-run_cmake(TARGET_LINKER_FILE_PREFIX-non-valid-target)
-run_cmake(TARGET_FILE_SUFFIX)
-run_cmake(TARGET_FILE_SUFFIX-imported-target)
-run_cmake(TARGET_FILE_SUFFIX-non-valid-target)
-run_cmake(TARGET_LINKER_FILE_SUFFIX-non-valid-target)
-run_cmake_with_options(TARGET_FILE_BASE_NAME -DCMAKE_BUILD_TYPE:STRING=Debug)
-run_cmake_with_options(TARGET_FILE_BASE_NAME-imported-target -DCMAKE_BUILD_TYPE:STRING=Debug)
-run_cmake(TARGET_FILE_BASE_NAME-non-valid-target)
-run_cmake(TARGET_LINKER_FILE_BASE_NAME-non-valid-target)
run_cmake(TARGET_PROPERTY-INCLUDE_DIRECTORIES)
run_cmake(TARGET_PROPERTY-LOCATION)
run_cmake(TARGET_PROPERTY-SOURCES)
+run_cmake(TARGET_PROPERTY-ALIAS_GLOBAL)
run_cmake(LINK_ONLY-not-linking)
run_cmake(TARGET_EXISTS-no-arg)
run_cmake(TARGET_EXISTS-empty-arg)
@@ -65,15 +34,6 @@ 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_GENEX_EVAL-no-arg)
-run_cmake(TARGET_GENEX_EVAL-no-target)
-run_cmake(TARGET_GENEX_EVAL-non-valid-target)
-run_cmake(TARGET_GENEX_EVAL-recursion1)
-run_cmake(TARGET_GENEX_EVAL-recursion2)
-run_cmake(TARGET_GENEX_EVAL)
-run_cmake(GENEX_EVAL-recursion1)
-run_cmake(GENEX_EVAL-recursion2)
-run_cmake(GENEX_EVAL)
run_cmake(REMOVE_DUPLICATES-empty)
run_cmake(REMOVE_DUPLICATES-1)
run_cmake(REMOVE_DUPLICATES-2)
@@ -84,20 +44,6 @@ run_cmake(FILTER-InvalidOperator)
run_cmake(FILTER-Exclude)
run_cmake(FILTER-Include)
-run_cmake(ImportedTarget-TARGET_BUNDLE_DIR)
-run_cmake(ImportedTarget-TARGET_BUNDLE_CONTENT_DIR)
-run_cmake(ImportedTarget-TARGET_PDB_FILE)
-run_cmake(ImportedTarget-TARGET_PDB_FILE_BASE_NAME)
-if(LINKER_SUPPORTS_PDB)
- run_cmake(NonValidTarget-TARGET_PDB_FILE)
- run_cmake(ValidTarget-TARGET_PDB_FILE)
- run_cmake(NonValidTarget-TARGET_PDB_FILE_BASE_NAME)
- run_cmake(ValidTarget-TARGET_PDB_FILE_BASE_NAME)
-else()
- run_cmake(NonValidCompiler-TARGET_PDB_FILE)
- run_cmake(NonValidCompiler-TARGET_PDB_FILE_BASE_NAME)
-endif()
-
set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0085:STRING=OLD)
run_cmake(CMP0085-OLD)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL-check.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL-check.cmake
new file mode 100644
index 000000000..0fbf83760
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL-check.cmake
@@ -0,0 +1,6 @@
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/alias_global.txt alias_global)
+
+set(expected "TRUE(lib-global):TRUE;FALSE(lib-local):FALSE;TRUE(lib):FALSE")
+if(NOT alias_global STREQUAL expected)
+ set(RunCMake_TEST_FAILED "ALIAS_GLOBAL was:\n [[${alias_global}]]\nbut expected:\n [[${expected}]]")
+endif()
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL.cmake
new file mode 100644
index 000000000..212c03402
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_PROPERTY-ALIAS_GLOBAL.cmake
@@ -0,0 +1,16 @@
+
+cmake_minimum_required(VERSION 3.17)
+
+add_library(lib-global SHARED IMPORTED GLOBAL)
+add_library(alias-lib-global ALIAS lib-global)
+
+add_library(lib-local SHARED IMPORTED)
+add_library(alias-lib-local ALIAS lib-local)
+
+add_library(lib SHARED IMPORTED)
+add_library(alias-lib ALIAS lib)
+# switch from local to global
+set_property (TARGET lib PROPERTY IMPORTED_GLOBAL TRUE)
+
+
+file(GENERATE OUTPUT alias_global.txt CONTENT "$<TARGET_PROPERTY:lib-global,IMPORTED_GLOBAL>($<TARGET_PROPERTY:alias-lib-global,ALIASED_TARGET>):$<TARGET_PROPERTY:alias-lib-global,ALIAS_GLOBAL>\n$<TARGET_PROPERTY:lib-local,IMPORTED_GLOBAL>($<TARGET_PROPERTY:alias-lib-local,ALIASED_TARGET>):$<TARGET_PROPERTY:alias-lib-local,ALIAS_GLOBAL>\n$<TARGET_PROPERTY:lib,IMPORTED_GLOBAL>($<TARGET_PROPERTY:alias-lib,ALIASED_TARGET>):$<TARGET_PROPERTY:alias-lib,ALIAS_GLOBAL>\n")
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-configuration-debug-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-configuration-debug-stdout.txt
new file mode 100644
index 000000000..1f5d1a56f
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-configuration-debug-stdout.txt
@@ -0,0 +1,5 @@
+Test project .*GoogleTest-discovery-multi-config
+[ \t]*Test #[0-9]+: configuration\.case_release \(Disabled\)
+[ \t]*Test #[0-9]+: configuration\.case_debug
++
+Total Tests: 2
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-configuration-release-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-configuration-release-stdout.txt
new file mode 100644
index 000000000..4f916645e
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-configuration-release-stdout.txt
@@ -0,0 +1,5 @@
+Test project .*GoogleTest-discovery-multi-config
+[ \t]*Test #[0-9]+: configuration\.case_release
+[ \t]*Test #[0-9]+: configuration\.case_debug \(Disabled\)
++
+Total Tests: 2
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-result.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-result.txt
index d197c913c..d197c913c 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-result.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-result.txt
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt
index 3a6572c3e..3a6572c3e 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout-stdout.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-result.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-result.txt
new file mode 100644
index 000000000..d197c913c
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-stderr.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-stderr.txt
new file mode 100644
index 000000000..f6be9398d
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-stderr.txt
@@ -0,0 +1,2 @@
+Unable to find executable: discovery_timeout_test_NOT_BUILT
+Errors while running CTest
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-stdout.txt
new file mode 100644
index 000000000..d9de3f8e5
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-test-stdout.txt
@@ -0,0 +1,18 @@
+Test project .*GoogleTest-discovery-timeout
+[ \t]*Start [0-9]+: discovery_timeout_test_NOT_BUILT
+Could not find executable discovery_timeout_test_NOT_BUILT
+Looked in the following places:
+discovery_timeout_test_NOT_BUILT
+discovery_timeout_test_NOT_BUILT(\.exe)?
+Debug/discovery_timeout_test_NOT_BUILT
+Debug/discovery_timeout_test_NOT_BUILT(\.exe)?
+Debug/discovery_timeout_test_NOT_BUILT
+Debug/discovery_timeout_test_NOT_BUILT(\.exe)?
+[^\n]+discovery_timeout_test_NOT_BUILT +\.+\*\*\*Not Run +[0-9.]+ sec
++
+0% tests passed, 1 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec
++
+The following tests FAILED:
+[^\n]+discovery_timeout_test_NOT_BUILT \(Not Run\)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stderr.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stderr.txt
new file mode 100644
index 000000000..75afe4a75
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at .*GoogleTestAddTests.cmake:[0-9]+ \(message\):
+[ \t]*Error running test executable.
++
+[ \t]*Path: '.*discovery_timeout_test(\.exe)?'
+[ \t]*Result: Process terminated due to timeout
+[ \t]*Output:
+[ \t]*timeout.
+[ \t]*case
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stdout.txt
new file mode 100644
index 000000000..d65061f6c
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stdout.txt
@@ -0,0 +1 @@
+Test project .*GoogleTest-discovery-timeout
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-skip-timeout-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-skip-timeout-stdout.txt
new file mode 100644
index 000000000..eeecb6a7c
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-skip-timeout-stdout.txt
@@ -0,0 +1,10 @@
+Test project .*
+ Start 20: skip_test.test1
+1/1 Test #20: skip_test.test1 \.+\*\*\*Skipped +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 1
+
+Total Test time \(real\) = +[0-9.]+ sec
+
+The following tests did not run:
+.*20 - skip_test\.test1 \(Skipped\)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
index 5f7753dba..7fb39194a 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-test1-stdout.txt
@@ -1,22 +1,28 @@
Test project .*
- Start 1: TEST:basic\.case_foo!1
-1/8 Test #1: TEST:basic\.case_foo!1 \.+ +Passed +[0-9.]+ sec
- Start 2: TEST:basic\.case_bar!1
-2/8 Test #2: TEST:basic\.case_bar!1 \.+ +Passed +[0-9.]+ sec
- Start 3: TEST:basic\.disabled_case!1
-3/8 Test #3: TEST:basic\.disabled_case!1 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
- Start 4: TEST:disabled\.case!1
-4/8 Test #4: TEST:disabled\.case!1 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
- Start 5: TEST:typed/short\.case!1
-5/8 Test #5: TEST:typed/short\.case!1 \.+ +Passed +[0-9.]+ sec
- Start 6: TEST:typed/float\.case!1
-6/8 Test #6: TEST:typed/float\.case!1 \.+ +Passed +[0-9.]+ sec
- Start 7: TEST:value/test\.case/1!1
-7/8 Test #7: TEST:value/test\.case/1!1 \.+ +Passed +[0-9.]+ sec
- Start 8: TEST:value/test\.case/"foo"!1
-8/8 Test #8: TEST:value/test\.case/"foo"!1 \.+ +Passed +[0-9.]+ sec
+ Start 1: TEST:basic\.case_foo!1
+ 1/11 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
+ 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
-100% tests passed, 0 tests failed out of 6
+100% tests passed, 0 tests failed out of 9
Total Test time \(real\) = +[0-9.]+ sec
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
index 960c0b9cf..58c4d108a 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-test2-stdout.txt
@@ -1,25 +1,31 @@
Test project .*
- Start 9: TEST:basic\.case_foo!2
-1/8 Test #9: TEST:basic\.case_foo!2 \.+ +Passed +[0-9.]+ sec
- Start 10: TEST:basic\.case_bar!2
-2/8 Test #10: TEST:basic\.case_bar!2 \.+ +Passed +[0-9.]+ sec
- Start 11: TEST:basic\.disabled_case!2
-3/8 Test #11: TEST:basic\.disabled_case!2 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
- Start 12: TEST:disabled\.case!2
-4/8 Test #12: TEST:disabled\.case!2 \.+\*+Not Run \(Disabled\) +[0-9.]+ sec
- Start 13: TEST:typed/short\.case!2
-5/8 Test #13: TEST:typed/short\.case!2 \.+ +Passed +[0-9.]+ sec
- Start 14: TEST:typed/float\.case!2
-6/8 Test #14: TEST:typed/float\.case!2 \.+ +Passed +[0-9.]+ sec
- Start 15: TEST:value/test\.case/1!2
-7/8 Test #15: TEST:value/test\.case/1!2 \.+ +Passed +[0-9.]+ sec
- Start 16: TEST:value/test\.case/"foo"!2
-8/8 Test #16: TEST:value/test\.case/"foo"!2 \.+ +Passed +[0-9.]+ sec
+ 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
-100% tests passed, 0 tests failed out of 6
+100% tests passed, 0 tests failed out of 9
Total Test time \(real\) = +[0-9.]+ sec
The following tests did not run:
-.*11 - TEST:basic\.disabled_case!2 \(Disabled\)
-.*12 - TEST:disabled\.case!2 \(Disabled\)
+.*14 - TEST:basic\.disabled_case!2 \(Disabled\)
+.*15 - TEST:disabled\.case!2 \(Disabled\)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest.cmake b/Tests/RunCMake/GoogleTest/GoogleTest.cmake
index 31808c670..6aa265876 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest.cmake
+++ b/Tests/RunCMake/GoogleTest/GoogleTest.cmake
@@ -1,5 +1,4 @@
-project(test_include_dirs)
-include(CTest)
+project(test_include_dirs LANGUAGES CXX)
include(GoogleTest)
enable_testing()
@@ -50,10 +49,8 @@ gtest_discover_tests(
PROPERTIES TIMEOUT 2
)
-add_executable(discovery_timeout_test timeout_test.cpp)
-target_compile_definitions(discovery_timeout_test PRIVATE discoverySleepSec=10)
+add_executable(skip_test skip_test.cpp)
+
gtest_discover_tests(
- discovery_timeout_test
- TEST_PREFIX discovery_
- DISCOVERY_TIMEOUT 2
+ skip_test
)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake
new file mode 100644
index 000000000..df784feeb
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryMultiConfig.cmake
@@ -0,0 +1,13 @@
+project(test_include_dirs LANGUAGES CXX)
+include(GoogleTest)
+
+enable_testing()
+
+add_executable(configuration_gtest configuration_gtest.cpp)
+target_compile_definitions(configuration_gtest PRIVATE $<$<CONFIG:Debug>:DEBUG=1>)
+
+gtest_discover_tests(
+ configuration_gtest
+ PROPERTIES LABELS CONFIG
+ DISCOVERY_MODE PRE_TEST
+)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake
new file mode 100644
index 000000000..20e9d657a
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTimeout.cmake
@@ -0,0 +1,13 @@
+project(test_include_dirs LANGUAGES CXX)
+include(GoogleTest)
+
+enable_testing()
+
+add_executable(discovery_timeout_test timeout_test.cpp)
+target_compile_definitions(discovery_timeout_test PRIVATE discoverySleepSec=10)
+gtest_discover_tests(
+ discovery_timeout_test
+ TEST_PREFIX discovery_
+ DISCOVERY_TIMEOUT 2
+ DISCOVERY_MODE ${DISCOVERY_MODE}
+)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML-result-check.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML-result-check.cmake
new file mode 100644
index 000000000..3bfdac35b
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTestXML-result-check.cmake
@@ -0,0 +1,4 @@
+set(RESULT_FILE "${RunCMake_TEST_BINARY_DIR}/GoogleTestXML.Foo.xml")
+if(NOT EXISTS ${RESULT_FILE})
+ set(RunCMake_TEST_FAILED "Result XML file ${RESULT_FILE} was not created")
+endif()
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake
new file mode 100644
index 000000000..29bd05e6e
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTestXML.cmake
@@ -0,0 +1,10 @@
+project(test_include_dirs LANGUAGES CXX)
+include(GoogleTest)
+
+enable_testing()
+
+add_executable(xml_output xml_output.cpp)
+gtest_discover_tests(
+ xml_output
+ XML_OUTPUT_DIR ${CMAKE_BINARY_DIR}
+)
diff --git a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
index 0fa4e2aa2..efd22bea9 100644
--- a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
@@ -1,6 +1,6 @@
include(RunCMake)
-function(run_GoogleTest)
+function(run_GoogleTest DISCOVERY_MODE)
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTest-build)
set(RunCMake_TEST_NO_CLEAN 1)
@@ -10,7 +10,7 @@ function(run_GoogleTest)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
- run_cmake(GoogleTest)
+ run_cmake_with_options(GoogleTest -DCMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE=${DISCOVERY_MODE})
run_cmake_command(GoogleTest-build
${CMAKE_COMMAND}
@@ -26,15 +26,6 @@ function(run_GoogleTest)
--target property_timeout_test
)
- set(RunCMake_TEST_OUTPUT_MERGE 1)
- run_cmake_command(GoogleTest-discovery-timeout
- ${CMAKE_COMMAND}
- --build .
- --config Debug
- --target discovery_timeout_test
- )
- set(RunCMake_TEST_OUTPUT_MERGE 0)
-
run_cmake_command(GoogleTest-test1
${CMAKE_CTEST_COMMAND}
-C Debug
@@ -69,6 +60,123 @@ function(run_GoogleTest)
-R property_timeout\\.case_with_discovery
--no-label-summary
)
+
+ run_cmake_command(GoogleTest-build
+ ${CMAKE_COMMAND}
+ --build .
+ --config Debug
+ --target skip_test
+ )
+
+ run_cmake_command(GoogleTest-skip-test
+ ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ -R skip_test
+ --no-label-summary
+ )
endfunction()
-run_GoogleTest()
+function(run_GoogleTestXML DISCOVERY_MODE)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTestXML-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake_with_options(GoogleTestXML -DCMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE=${DISCOVERY_MODE})
+
+ run_cmake_command(GoogleTestXML-discovery
+ ${CMAKE_COMMAND}
+ --build .
+ --config Debug
+ --target xml_output
+ )
+
+ run_cmake_command(GoogleTestXML-result
+ ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ -R GoogleTestXML
+ --no-label-summary
+ )
+endfunction()
+
+function(run_GoogleTest_discovery_timeout DISCOVERY_MODE)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTest-discovery-timeout)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ endif()
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake_with_options(GoogleTestDiscoveryTimeout -DDISCOVERY_MODE=${DISCOVERY_MODE})
+
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
+ run_cmake_command(GoogleTest-discovery-${DISCOVERY_MODE}-timeout-build
+ ${CMAKE_COMMAND}
+ --build .
+ --config Debug
+ --target discovery_timeout_test
+ )
+ set(RunCMake_TEST_OUTPUT_MERGE 0)
+
+ run_cmake_command(GoogleTest-discovery-${DISCOVERY_MODE}-timeout-test
+ ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ -R discovery_timeout_test
+ --no-label-sumary
+ )
+endfunction()
+
+function(run_GoogleTest_discovery_multi_config)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTest-discovery-multi-config)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(GoogleTestDiscoveryMultiConfig)
+
+ run_cmake_command(GoogleTest-build-release
+ ${CMAKE_COMMAND}
+ --build .
+ --config Release
+ --target configuration_gtest
+ )
+ run_cmake_command(GoogleTest-build-debug
+ ${CMAKE_COMMAND}
+ --build .
+ --config Debug
+ --target configuration_gtest
+ )
+ run_cmake_command(GoogleTest-configuration-release
+ ${CMAKE_CTEST_COMMAND}
+ -C Release
+ -L CONFIG
+ -N
+ )
+ run_cmake_command(GoogleTest-configuration-debug
+ ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ -L CONFIG
+ -N
+ )
+
+endfunction()
+
+foreach(DISCOVERY_MODE POST_BUILD PRE_TEST)
+ message("Testing ${DISCOVERY_MODE} discovery mode via CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE global override...")
+ run_GoogleTest(${DISCOVERY_MODE})
+ run_GoogleTestXML(${DISCOVERY_MODE})
+ message("Testing ${DISCOVERY_MODE} discovery mode via DISCOVERY_MODE option...")
+ run_GoogleTest_discovery_timeout(${DISCOVERY_MODE})
+endforeach()
+
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ message("Testing PRE_TEST discovery multi configuration...")
+ run_GoogleTest_discovery_multi_config()
+endif()
diff --git a/Tests/RunCMake/GoogleTest/configuration_gtest.cpp b/Tests/RunCMake/GoogleTest/configuration_gtest.cpp
new file mode 100644
index 000000000..3cbb134bf
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/configuration_gtest.cpp
@@ -0,0 +1,23 @@
+#include <iostream>
+#include <string>
+
+int main(int argc, char** argv)
+{
+ // Note: GoogleTest.cmake doesn't actually depend on Google Test as such;
+ // it only requires that we produces output in the expected format when
+ // invoked with --gtest_list_tests. Thus, we fake that here. This allows us
+ // to test the module without actually needing Google Test.
+ if (argc > 1 && std::string(argv[1]) == "--gtest_list_tests") {
+ std::cout << "configuration." << std::endl;
+#ifdef DEBUG
+ std::cout << " DISABLED_case_release" << std::endl;
+ std::cout << " case_debug" << std::endl;
+#else
+ std::cout << " case_release" << std::endl;
+ std::cout << " DISABLED_case_debug" << std::endl;
+#endif
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/Tests/RunCMake/GoogleTest/fake_gtest.cpp b/Tests/RunCMake/GoogleTest/fake_gtest.cpp
index f1bd7efc8..a8127bf95 100644
--- a/Tests/RunCMake/GoogleTest/fake_gtest.cpp
+++ b/Tests/RunCMake/GoogleTest/fake_gtest.cpp
@@ -21,6 +21,10 @@ int main(int argc, char** argv)
std::cout << "value/test." << std::endl;
std::cout << " case/0 # GetParam() = 1" << std::endl;
std::cout << " case/1 # GetParam() = \"foo\"" << std::endl;
+ std::cout << "param/special." << std::endl;
+ std::cout << " case/0 # GetParam() = \"semicolon;\"" << std::endl;
+ std::cout << " case/1 # GetParam() = \"backslash\\\"" << std::endl;
+ std::cout << " case/2 # GetParam() = \"${var}\"" << std::endl;
return 0;
}
diff --git a/Tests/RunCMake/GoogleTest/skip_test.cpp b/Tests/RunCMake/GoogleTest/skip_test.cpp
new file mode 100644
index 000000000..2bc9fe150
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/skip_test.cpp
@@ -0,0 +1,18 @@
+#include <iostream>
+#include <string>
+
+int main(int argc, char** argv)
+{
+ // Note: GoogleTest.cmake doesn't actually depend on Google Test as such;
+ // it only requires that we produces output in the expected format when
+ // invoked with --gtest_list_tests. Thus, we fake that here. This allows us
+ // to test the module without actually needing Google Test.
+ if (argc > 1 && std::string(argv[1]) == "--gtest_list_tests") {
+ std::cout << "skip_test." << std::endl;
+ std::cout << " test1" << std::endl;
+ return 0;
+ }
+
+ std::cout << "[ SKIPPED ] skip_test.test1" << std::endl;
+ return 0;
+}
diff --git a/Tests/RunCMake/GoogleTest/timeout_test.cpp b/Tests/RunCMake/GoogleTest/timeout_test.cpp
index b8ad055e8..550626900 100644
--- a/Tests/RunCMake/GoogleTest/timeout_test.cpp
+++ b/Tests/RunCMake/GoogleTest/timeout_test.cpp
@@ -4,9 +4,10 @@
# include <unistd.h>
#endif
-#include <iostream>
#include <string>
+#include <stdio.h>
+
void sleepFor(unsigned seconds)
{
#if defined(_WIN32)
@@ -23,8 +24,8 @@ int main(int argc, char** argv)
// invoked with --gtest_list_tests. Thus, we fake that here. This allows us
// to test the module without actually needing Google Test.
if (argc > 1 && std::string(argv[1]) == "--gtest_list_tests") {
- std::cout << "timeout." << std::endl;
- std::cout << " case" << std::endl;
+ printf("timeout.\n case\n");
+ fflush(stdout);
#ifdef discoverySleepSec
sleepFor(discoverySleepSec);
#endif
diff --git a/Tests/RunCMake/GoogleTest/xml_output.cpp b/Tests/RunCMake/GoogleTest/xml_output.cpp
new file mode 100644
index 000000000..e130231b6
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/xml_output.cpp
@@ -0,0 +1,26 @@
+#include <fstream>
+#include <iostream>
+#include <string>
+
+int main(int argc, char** argv)
+{
+ // Note: GoogleTestXML.cmake doesn't actually depend on Google Test as such;
+ // it only mimicks the output file creation using the path passed to this
+ // test without any content
+ for (int i = 0; i < argc; i++) {
+ std::string param(argv[i]);
+ if (param.find("--gtest_list_tests") != std::string::npos) {
+ // This actually defines the name of the file passed in the 2nd run
+ std::cout << "GoogleTestXML." << std::endl;
+ std::cout << " Foo" << std::endl;
+ } else if (param.find("--gtest_output=xml:") != std::string::npos) {
+ std::string::size_type split = param.find(":");
+ std::string filepath = param.substr(split + 1);
+ // The full file path is passed
+ std::ofstream ostrm(filepath.c_str(), std::ios::binary);
+ ostrm << "--gtest_output=xml: mockup file\n";
+ }
+ }
+
+ return 0;
+}
diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
index 772f31221..10cd2bce7 100644
--- a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
+++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
@@ -32,7 +32,7 @@ target_link_libraries(GraphicLibrary PRIVATE CoreLibrary)
# Test target labels with quotes in them; they should be escaped in the dot
# file.
-# See https://gitlab.kitware.com/cmake/cmake/issues/19746
+# See https://gitlab.kitware.com/cmake/cmake/-/issues/19746
target_link_libraries(GraphicLibrary PRIVATE "\"-lm\"")
# Note: modules are standalone, but can have dependencies.
diff --git a/Tests/RunCMake/Graphviz/default_options-check.cmake b/Tests/RunCMake/Graphviz/default_options-check.cmake
index 584e27608..c9a7562ae 100644
--- a/Tests/RunCMake/Graphviz/default_options-check.cmake
+++ b/Tests/RunCMake/Graphviz/default_options-check.cmake
@@ -3,11 +3,3 @@ include(RunCMake)
ensure_files_match(
${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_default_options.dot
${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
-
-ensure_files_match(
- ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication
- ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot.GraphicApplication)
-
-ensure_files_match(
- ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers
- ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot.CompilerFlags.dependers)
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication
deleted file mode 100644
index 6893fd19e..000000000
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependencies.dot.GraphicApplication
+++ /dev/null
@@ -1,22 +0,0 @@
-digraph "GraphicApplication" {
-node [
- fontsize = "12"
-];
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node2" [ label = "CoreLibrary", shape = octagon ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node0" [ label = "CompilerFlags", shape = pentagon ];
- "node2" -> "node0" // CoreLibrary -> CompilerFlags
- "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
- "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node7" [ label = "\"-lm\"", shape = septagon ];
- "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
- "node0" [ label = "CompilerFlags", shape = pentagon ];
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node2" [ label = "CoreLibrary", shape = octagon ];
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
- "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
-}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers
deleted file mode 100644
index 3352b1ad5..000000000
--- a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_target_dependers.dot.CompilerFlags.dependers
+++ /dev/null
@@ -1,26 +0,0 @@
-digraph "CompilerFlags" {
-node [
- fontsize = "12"
-];
- "node0" [ label = "CompilerFlags", shape = pentagon ];
- "node2" [ label = "CoreLibrary", shape = octagon ];
- "node2" -> "node0" // CoreLibrary -> CompilerFlags
- "node1" [ label = "ConsoleApplication", shape = egg ];
- "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
- "node5" [ label = "GraphicApplication", shape = egg ];
- "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
- "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
- "node6" -> "node0" // GraphicLibrary -> CompilerFlags
- "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
- "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
- "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
- "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
-}
diff --git a/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-result.txt b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-stderr.txt b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-stderr.txt
new file mode 100644
index 000000000..7abf76acd
--- /dev/null
+++ b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at LINKER_LANGUAGE-genex.cmake:[0-9]+ \(target_link_libraries\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:LINKER_LANGUAGE>
+
+ LINKER_LANGUAGE target property can not be used while evaluating link
+ libraries for a static library
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex.cmake
index 64f394c11..64f394c11 100644
--- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
+++ b/Tests/RunCMake/Languages/LINKER_LANGUAGE-genex.cmake
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt
deleted file mode 100644
index 03c002e7d..000000000
--- a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-CMake Error at LINK_LANGUAGE-genex.cmake:[0-9]+ \(target_link_libraries\):
- Error evaluating generator expression:
-
- \$<TARGET_PROPERTY:LINKER_LANGUAGE>
-
- LINKER_LANGUAGE target property can not be used while evaluating link
- libraries for a static library
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake b/Tests/RunCMake/Languages/RunCMakeTest.cmake
index 2a534b338..48216e963 100644
--- a/Tests/RunCMake/Languages/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake
@@ -1,7 +1,7 @@
include(RunCMake)
run_cmake(NoLangSHARED)
-run_cmake(LINK_LANGUAGE-genex)
+run_cmake(LINKER_LANGUAGE-genex)
run_cmake(link-libraries-TARGET_FILE-genex)
run_cmake(link-libraries-TARGET_FILE-genex-ok)
diff --git a/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake b/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake
deleted file mode 100644
index d69a119ac..000000000
--- a/Tests/RunCMake/Ninja/Qt5AutoMocDeps.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-enable_language(CXX)
-
-find_package(Qt5Core REQUIRED)
-
-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)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index c1f63464e..8f9c263a2 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -18,6 +18,12 @@ else()
message(FATAL_ERROR "'ninja --version' reported:\n${ninja_out}")
endif()
+if(CMAKE_HOST_WIN32)
+ run_cmake(SelectCompilerWindows)
+else()
+ run_cmake(SelectCompilerUNIX)
+endif()
+
function(run_NinjaToolMissing)
set(RunCMake_MAKE_PROGRAM ninja-tool-missing)
run_cmake(NinjaToolMissing)
@@ -132,7 +138,6 @@ ${ninja_stderr}
message(FATAL_ERROR
"top ninja build failed exited with status ${ninja_result}")
endif()
- set(ninja_stdout "${ninja_stdout}" PARENT_SCOPE)
endfunction(run_ninja)
function (run_LooseObjectDepends)
@@ -317,23 +322,3 @@ function (run_ChangeBuildType)
run_ninja("${RunCMake_TEST_BINARY_DIR}" -w dupbuild=err)
endfunction()
run_ChangeBuildType()
-
-function(run_Qt5AutoMocDeps)
- if(CMake_TEST_Qt5 AND CMAKE_TEST_Qt5Core_Version VERSION_GREATER_EQUAL 5.15.0)
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Qt5AutoMocDeps-build)
- run_cmake(Qt5AutoMocDeps)
- unset(RunCMake_TEST_OPTIONS)
- # Build the project.
- run_ninja("${RunCMake_TEST_BINARY_DIR}")
- # Touch just the library source file, which shouldn't cause a rerun of AUTOMOC
- # for app_with_qt target.
- touch("${RunCMake_SOURCE_DIR}/simple_lib.cpp")
- # 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}")
- endif()
- endif()
-endfunction()
-run_Qt5AutoMocDeps()
diff --git a/Tests/RunCMake/Ninja/SelectCompiler/1/gcc b/Tests/RunCMake/Ninja/SelectCompiler/1/gcc
new file mode 100755
index 000000000..151dfa692
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SelectCompiler/1/gcc
@@ -0,0 +1,2 @@
+#!/bin/sh
+false
diff --git a/Tests/RunCMake/Ninja/SelectCompiler/2/cc b/Tests/RunCMake/Ninja/SelectCompiler/2/cc
new file mode 100755
index 000000000..151dfa692
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SelectCompiler/2/cc
@@ -0,0 +1,2 @@
+#!/bin/sh
+false
diff --git a/Tests/RunCMake/Ninja/SelectCompilerUNIX-result.txt b/Tests/RunCMake/Ninja/SelectCompilerUNIX-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SelectCompilerUNIX-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Ninja/SelectCompilerUNIX-stderr.txt b/Tests/RunCMake/Ninja/SelectCompilerUNIX-stderr.txt
new file mode 100644
index 000000000..a2baa4898
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SelectCompilerUNIX-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at .*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(message\):
+ The C compiler
+
+ "[^"]*/Tests/RunCMake/Ninja/SelectCompiler/2/cc"
+
+ is not able to compile a simple test program.
diff --git a/Tests/RunCMake/Ninja/SelectCompilerUNIX.cmake b/Tests/RunCMake/Ninja/SelectCompilerUNIX.cmake
new file mode 100644
index 000000000..02c843992
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SelectCompilerUNIX.cmake
@@ -0,0 +1,3 @@
+set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/SelectCompiler/1:${CMAKE_CURRENT_SOURCE_DIR}/SelectCompiler/2:$ENV{PATH}")
+unset(ENV{CC})
+enable_language(C)
diff --git a/Tests/RunCMake/Ninja/SelectCompilerWindows-result.txt b/Tests/RunCMake/Ninja/SelectCompilerWindows-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SelectCompilerWindows-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Ninja/SelectCompilerWindows-stderr.txt b/Tests/RunCMake/Ninja/SelectCompilerWindows-stderr.txt
new file mode 100644
index 000000000..e4b506ef7
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SelectCompilerWindows-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at .*/Modules/CMakeTestCCompiler.cmake:[0-9]+ \(message\):
+ The C compiler
+
+ "[^"]*/Tests/RunCMake/Ninja/SelectCompiler/1/gcc"
+
+ is not able to compile a simple test program.
diff --git a/Tests/RunCMake/Ninja/SelectCompilerWindows.cmake b/Tests/RunCMake/Ninja/SelectCompilerWindows.cmake
new file mode 100644
index 000000000..f5a7e2b95
--- /dev/null
+++ b/Tests/RunCMake/Ninja/SelectCompilerWindows.cmake
@@ -0,0 +1,3 @@
+set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/SelectCompiler/1;${CMAKE_CURRENT_SOURCE_DIR}/SelectCompiler/2;$ENV{PATH}")
+unset(ENV{CC})
+enable_language(C)
diff --git a/Tests/RunCMake/Ninja/app.cpp b/Tests/RunCMake/Ninja/app.cpp
deleted file mode 100644
index 57380e489..000000000
--- a/Tests/RunCMake/Ninja/app.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-int main(int argc, char* argv[])
-{
- (void)argc;
- (void)argv;
- return 0;
-}
diff --git a/Tests/RunCMake/Ninja/app_qt.cpp b/Tests/RunCMake/Ninja/app_qt.cpp
deleted file mode 100644
index 302c6723c..000000000
--- a/Tests/RunCMake/Ninja/app_qt.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <QObject>
-
-class Mango : public QObject
-{
- Q_OBJECT
-public:
-Q_SIGNALS:
- void eatFruit();
-};
-
-#include "app_qt.moc"
diff --git a/Tests/RunCMake/Ninja/simple_lib.cpp b/Tests/RunCMake/Ninja/simple_lib.cpp
deleted file mode 100644
index cf8d6893d..000000000
--- a/Tests/RunCMake/Ninja/simple_lib.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
- void dummy_symbol()
-{
-}
diff --git a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
index 2e9b1cb59..00d8a1b37 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0104 NEW)
enable_language(CUDA)
file(TOUCH ${CMAKE_BINARY_DIR}/empty.cmake)
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index d4a08a9af..76b488ebb 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -289,7 +289,8 @@ run_cmake_command(NoUnusedVariables ${CMAKE_COMMAND} ${CMAKE_CURRENT_LIST_DIR}
"-DCMAKE_DEFAULT_CONFIGS=all"
)
-if(CMake_TEST_CUDA)
+# CudaSimple uses separable compilation, which is currently only supported on NVCC.
+if(CMake_TEST_CUDA AND NOT CMake_TEST_CUDA STREQUAL "Clang")
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CudaSimple-build)
run_cmake_configure(CudaSimple)
include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
diff --git a/Tests/RunCMake/ObjectLibrary/b.c b/Tests/RunCMake/ObjectLibrary/b.c
index 220ce0302..2c65a2b43 100644
--- a/Tests/RunCMake/ObjectLibrary/b.c
+++ b/Tests/RunCMake/ObjectLibrary/b.c
@@ -5,7 +5,7 @@
#endif
extern int a(void);
-EXPORT int b()
+EXPORT int b(void)
{
return a();
}
diff --git a/Tests/RunCMake/ObjectLibrary/requires.c b/Tests/RunCMake/ObjectLibrary/requires.c
index 685632b3d..a5b429a19 100644
--- a/Tests/RunCMake/ObjectLibrary/requires.c
+++ b/Tests/RunCMake/ObjectLibrary/requires.c
@@ -1,5 +1,5 @@
#ifdef REQUIRED
-int required()
+int required(void)
{
return 0;
}
diff --git a/Tests/RunCMake/PrecompileHeaders/PchWarnInvalid-check.cmake b/Tests/RunCMake/PrecompileHeaders/PchWarnInvalid-check.cmake
new file mode 100644
index 000000000..3e7fb301b
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchWarnInvalid-check.cmake
@@ -0,0 +1,22 @@
+if (NOT CMAKE_C_COMPILER_ID MATCHES "GNU|Intel" OR
+ (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND CMAKE_HOST_WIN32))
+ return()
+endif()
+
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/compile_commands.json empty_dir_commands
+ REGEX "command.*-Winvalid-pch.*empty.dir/cmake_pch.h")
+file(STRINGS ${RunCMake_TEST_BINARY_DIR}/compile_commands.json foo_dir_commands
+ REGEX "command.*-Winvalid-pch.*foo.dir/cmake_pch.h")
+
+list(LENGTH empty_dir_commands empty_dir_commands_size)
+list(LENGTH foo_dir_commands foo_dir_commands_size)
+
+if (empty_dir_commands_size EQUAL 0)
+ set(RunCMake_TEST_FAILED "empty target should have -Winvalid-pch compile option present")
+ return()
+endif()
+
+if (foo_dir_commands_size GREATER 0)
+ set(RunCMake_TEST_FAILED "foo target should not have -Winvalid-pch compile option present")
+ return()
+endif()
diff --git a/Tests/RunCMake/PrecompileHeaders/PchWarnInvalid.cmake b/Tests/RunCMake/PrecompileHeaders/PchWarnInvalid.cmake
new file mode 100644
index 000000000..4525664af
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchWarnInvalid.cmake
@@ -0,0 +1,16 @@
+enable_language(C)
+
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+add_library(empty empty.c)
+target_precompile_headers(empty PUBLIC
+ <stdio.h>
+ <string.h>
+)
+
+add_library(foo foo.c)
+target_precompile_headers(foo PUBLIC
+ <stdio.h>
+ <string.h>
+)
+set_target_properties(foo PROPERTIES PCH_WARN_INVALID OFF)
diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
index f587c7d84..381b800a6 100644
--- a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
+++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
@@ -4,12 +4,9 @@ include(RunCMake)
function(run_test name)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
run_cmake(${name})
- # Precompiled headers are not supported with multiple architectures.
- if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]")
- set(RunCMake_TEST_NO_CLEAN 1)
- run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug)
- run_cmake_command(${name}-test ${CMAKE_CTEST_COMMAND} -C Debug)
- endif()
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(${name}-test ${CMAKE_CTEST_COMMAND} -C Debug)
endfunction()
run_cmake(DisabledPch)
@@ -21,3 +18,6 @@ run_test(PchReuseFrom)
run_test(PchReuseFromPrefixed)
run_test(PchReuseFromSubdir)
run_cmake(PchMultilanguage)
+if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ run_cmake(PchWarnInvalid)
+endif()
diff --git a/Tests/RunCMake/PrecompileHeaders/empty.c b/Tests/RunCMake/PrecompileHeaders/empty.c
index 30ae1c4ef..2a51ebc19 100644
--- a/Tests/RunCMake/PrecompileHeaders/empty.c
+++ b/Tests/RunCMake/PrecompileHeaders/empty.c
@@ -1,3 +1,3 @@
-void nothing()
+void nothing(void)
{
}
diff --git a/Tests/RunCMake/SymlinkTrees/CMakeLists.txt b/Tests/RunCMake/SymlinkTrees/CMakeLists.txt
new file mode 100644
index 000000000..d6fea2c21
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(${RunCMake_TEST} NONE)
+include("${include_dir}/${RunCMake_TEST}.cmake")
diff --git a/Tests/RunCMake/SymlinkTrees/PrintTrees.cmake b/Tests/RunCMake/SymlinkTrees/PrintTrees.cmake
new file mode 100644
index 000000000..aa99127c5
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/PrintTrees.cmake
@@ -0,0 +1,6 @@
+message(STATUS "source: '${CMAKE_SOURCE_DIR}'")
+message(STATUS "binary: '${CMAKE_BINARY_DIR}'")
+get_filename_component(real_source "${CMAKE_SOURCE_DIR}" REALPATH)
+get_filename_component(real_binary "${CMAKE_BINARY_DIR}" REALPATH)
+message(STATUS "real source: '${real_source}'")
+message(STATUS "real binary: '${real_binary}'")
diff --git a/Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake b/Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake
new file mode 100644
index 000000000..e5f1f7fb3
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/RunCMakeTest.cmake
@@ -0,0 +1,34 @@
+include(RunCMake)
+
+# This function assumes that ``${RunCMake_BINARY_DIR}/${name}/source`` and
+# ``${RunCMake_BINARY_DIR}/${name}/binary`` are set up properly prior to
+# calling it.
+function (run_symlink_test name)
+ set(RunCMake_TEST_NO_CLEAN TRUE)
+ configure_file(
+ "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
+ "${RunCMake_BINARY_DIR}/${name}/source/CMakeLists.txt"
+ COPYONLY)
+ set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}/source")
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/${name}/binary")
+ # Emulate a shell using this directory.
+ set(ENV{PWD} "${RunCMake_TEST_BINARY_DIR}")
+ set(RunCMake_TEST_OPTIONS
+ "-Dinclude_dir:PATH=${CMAKE_CURRENT_LIST_DIR}")
+ run_cmake("${name}_symlinks")
+endfunction ()
+
+# Create the following structure:
+#
+# .../common_real/source
+# .../common_real/binary
+# .../common -> common_real
+#
+# In this case, CMake should act as if .../common *is* .../common_real for all
+# computations except ``REALPATH``. This supports the case where a system has
+# a stable *symlink*, but not a stable target for that symlink.
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/common_real")
+file(REMOVE "${RunCMake_BINARY_DIR}/common")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/common_real/source")
+file(CREATE_LINK "common_real" "${RunCMake_BINARY_DIR}/common" SYMBOLIC)
+run_symlink_test(common)
diff --git a/Tests/RunCMake/SymlinkTrees/common_symlinks-stdout.txt b/Tests/RunCMake/SymlinkTrees/common_symlinks-stdout.txt
new file mode 100644
index 000000000..bb04450b1
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/common_symlinks-stdout.txt
@@ -0,0 +1,4 @@
+-- source: '[^']*/Tests/RunCMake/SymlinkTrees/common/source'
+-- binary: '[^']*/Tests/RunCMake/SymlinkTrees/common/binary'
+-- real source: '[^']*/Tests/RunCMake/SymlinkTrees/common_real/source'
+-- real binary: '[^']*/Tests/RunCMake/SymlinkTrees/common_real/binary'
diff --git a/Tests/RunCMake/SymlinkTrees/common_symlinks.cmake b/Tests/RunCMake/SymlinkTrees/common_symlinks.cmake
new file mode 100644
index 000000000..5eafe26fb
--- /dev/null
+++ b/Tests/RunCMake/SymlinkTrees/common_symlinks.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/PrintTrees.cmake")
diff --git a/Tests/RunCMake/Syntax/CommandEOF-stderr.txt b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt
index 31cbc08d7..b9f8fd1ee 100644
--- a/Tests/RunCMake/Syntax/CommandEOF-stderr.txt
+++ b/Tests/RunCMake/Syntax/CommandEOF-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Error in CommandEOF.cmake:
+^CMake Error at CommandEOF.cmake:1:
Unexpected end of file.
Parse error. Function missing opening "\(".
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 9a1e02730..2454f25ff 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -29,6 +29,9 @@
\* CMP0083
\* CMP0095
\* CMP0099
+ \* CMP0104
+ \* CMP0105
+ \* CMP0108
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
index 24daa64ff..9ba3c856d 100644
--- a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
+++ b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
@@ -1,14 +1,20 @@
include(RunCMake)
run_cmake(unitybuild_c)
+run_cmake(unitybuild_c_batch)
+run_cmake(unitybuild_c_group)
run_cmake(unitybuild_cxx)
+run_cmake(unitybuild_cxx_group)
run_cmake(unitybuild_c_and_cxx)
+run_cmake(unitybuild_c_and_cxx_group)
run_cmake(unitybuild_batchsize)
run_cmake(unitybuild_default_batchsize)
run_cmake(unitybuild_skip)
run_cmake(unitybuild_code_before_and_after_include)
run_cmake(unitybuild_c_no_unity_build)
+run_cmake(unitybuild_c_no_unity_build_group)
run_cmake(unitybuild_order)
+run_cmake(unitybuild_invalid_mode)
function(run_test name)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
diff --git a/Tests/RunCMake/UnityBuild/f.c b/Tests/RunCMake/UnityBuild/f.c
new file mode 100644
index 000000000..d5813c67c
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/f.c
@@ -0,0 +1,5 @@
+int f(int x)
+{
+ (void)x;
+ return 0;
+}
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_group-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_group-check.cmake
new file mode 100644
index 000000000..b027682b1
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_group-check.cmake
@@ -0,0 +1,42 @@
+set(unitybuild_a_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_a_c.c")
+if(NOT EXISTS "${unitybuild_a_c}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_a_c} does not exist.")
+ return()
+else()
+ #verify that the 4 c file is part of this grouping and therefore UNITY_BUILD_BATCH_SIZE
+ #was ignored
+ file(STRINGS ${unitybuild_a_c} unitybuild_a_c_strings)
+ string(REGEX MATCH ".*#include.*s1.c.*#include.*s2.c.*#include.*s3.c.*#include.*s4.c.*" matched_code ${unitybuild_a_c_strings})
+ if(NOT matched_code)
+ set(RunCMake_TEST_FAILED "Generated unity file doesn't include expected source files")
+ return()
+ endif()
+endif()
+
+set(unitybuild_b_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_b_c.c")
+if(NOT EXISTS "${unitybuild_b_c}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_b_c} does not exist.")
+ return()
+endif()
+
+
+set(unitybuild_a_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_a_cxx.cxx")
+if(NOT EXISTS "${unitybuild_a_cxx}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_a_cxx} does not exist.")
+ return()
+else()
+ #verify that the 4 cxx file are part of this grouping and therefore UNITY_BUILD_BATCH_SIZE
+ #was ignored
+ file(STRINGS ${unitybuild_a_cxx} unitybuild_a_cxx_strings)
+ string(REGEX MATCH ".*#include.*s1.cxx.*#include.*s2.cxx.*#include.*s3.cxx.*#include.*s4.cxx.*" matched_code ${unitybuild_a_cxx_strings})
+ if(NOT matched_code)
+ set(RunCMake_TEST_FAILED "Generated unity file doesn't include expected source files")
+ return()
+ endif()
+endif()
+
+set(unitybuild_b_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_b_cxx.cxx")
+if(NOT EXISTS "${unitybuild_b_cxx}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_b_cxx} does not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_group.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_group.cmake
new file mode 100644
index 000000000..7bf3f4b3a
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_group.cmake
@@ -0,0 +1,39 @@
+project(unitybuild_c_and_cxx C CXX)
+
+set(srcs f.c)
+foreach(s RANGE 1 8)
+ set(src_c "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src_c}" "
+int f(int);\n
+int s${s}(void) { return f(${s}); }\n"
+ )
+
+ set(src_cxx "${CMAKE_CURRENT_BINARY_DIR}/s${s}.cxx")
+ file(WRITE "${src_cxx}" "
+extern \"C\" { \n
+ int f(int); \n
+}\n
+ int s${s}(void) { return f(${s}); }\n"
+ )
+
+ list(APPEND srcs "${src_c}")
+ list(APPEND srcs "${src_cxx}")
+endforeach()
+
+
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON
+ UNITY_BUILD_MODE GROUP
+ #UNITY_BUILD_BATCH_SIZE will be ignored
+ UNITY_BUILD_BATCH_SIZE 2)
+
+set_source_files_properties(s1.c s2.c s3.c s4.c
+ s1.cxx s2.cxx s3.cxx s4.cxx
+ PROPERTIES UNITY_GROUP "a"
+ )
+set_source_files_properties(s5.c s6.c s7.c s8.c
+ s5.cxx s6.cxx s7.cxx s8.cxx
+ PROPERTIES UNITY_GROUP "b"
+ )
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_batch-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_batch-check.cmake
new file mode 100644
index 000000000..024286d5a
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_batch-check.cmake
@@ -0,0 +1,5 @@
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
+if(NOT EXISTS "${unitybuild_c}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} does not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_batch.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_batch.cmake
new file mode 100644
index 000000000..33873b658
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_batch.cmake
@@ -0,0 +1,15 @@
+project(unitybuild_c C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES
+ UNITY_BUILD ON
+ UNITY_BUILD_MODE BATCH
+ )
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_group-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_group-check.cmake
new file mode 100644
index 000000000..0b9ea15de
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_group-check.cmake
@@ -0,0 +1,11 @@
+set(unitybuild_a_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_a_c.c")
+if(NOT EXISTS "${unitybuild_a_c}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_a_c} does not exist.")
+ return()
+endif()
+
+set(unitybuild_b_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_b_c.c")
+if(NOT EXISTS "${unitybuild_b_c}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_b_c} does not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake
new file mode 100644
index 000000000..1fa17f323
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_group.cmake
@@ -0,0 +1,17 @@
+project(unitybuild_c C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON
+ UNITY_BUILD_MODE GROUP)
+
+set_source_files_properties(s1.c PROPERTIES UNITY_GROUP "a")
+set_source_files_properties(s2.c PROPERTIES UNITY_GROUP "a")
+set_source_files_properties(s3.c s4.c PROPERTIES UNITY_GROUP "b")
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build_group-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build_group-check.cmake
new file mode 100644
index 000000000..e34462745
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build_group-check.cmake
@@ -0,0 +1,5 @@
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_a_c.c")
+if(EXISTS "${unitybuild_c}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} should not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build_group.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build_group.cmake
new file mode 100644
index 000000000..7b26dc166
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build_group.cmake
@@ -0,0 +1,16 @@
+project(unitybuild_c_no_unity_build C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+#These should be ignored as UNITY_BUILD is off
+set_target_properties(tgt PROPERTIES UNITY_BUILD_MODE GROUP)
+set_source_files_properties(s1.c s2.c s3.c s4.c s5.c s6.c s7.c s8.c
+ PROPERTIES UNITY_GROUP "a"
+ )
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_cxx_group-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_cxx_group-check.cmake
new file mode 100644
index 000000000..ecef3a3a7
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_cxx_group-check.cmake
@@ -0,0 +1,27 @@
+set(unitybuild_a_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_a_cxx.cxx")
+if(NOT EXISTS "${unitybuild_a_cxx}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_a_cxx} does not exist.")
+ return()
+else()
+ #verify that odr2 is not part of this source set
+ file(STRINGS ${unitybuild_a_cxx} unitybuild_a_cxx_strings)
+ string(REGEX MATCH ".*#include.*odr2.cxx" matched_code ${unitybuild_a_cxx_strings})
+ if(matched_code)
+ set(RunCMake_TEST_FAILED "Generated unity file includes un-expected ord2.cxx source file")
+ return()
+ endif()
+endif()
+
+set(unitybuild_b_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_b_cxx.cxx")
+if(NOT EXISTS "${unitybuild_b_cxx}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_b_cxx} does not exist.")
+ return()
+else()
+ #verify that odr1 is not part of this source set
+ file(STRINGS ${unitybuild_b_cxx} unitybuild_b_cxx_strings)
+ string(REGEX MATCH ".*#include.*odr1.cxx" matched_code ${unitybuild_b_cxx_strings})
+ if(matched_code)
+ set(RunCMake_TEST_FAILED "Generated unity file includes un-expected ord1.cxx source file")
+ return()
+ endif()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_cxx_group.cmake b/Tests/RunCMake/UnityBuild/unitybuild_cxx_group.cmake
new file mode 100644
index 000000000..98042896e
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_cxx_group.cmake
@@ -0,0 +1,27 @@
+project(unitybuild_cxx CXX)
+
+set(srcs "")
+foreach(s RANGE 1 4)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.cxx")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+foreach(s RANGE 1 2)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/odr${s}.cxx")
+ file(WRITE "${src}" "namespace odr { int s${s}(void) { return 0; } }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON
+ UNITY_BUILD_MODE GROUP
+ )
+
+set_source_files_properties(s1.cxx s2.cxx odr1.cxx
+ PROPERTIES UNITY_GROUP "a"
+ )
+set_source_files_properties(s3.cxx s4.cxx odr2.cxx
+ PROPERTIES UNITY_GROUP "b"
+ )
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode-result.txt b/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode-stderr.txt b/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode-stderr.txt
new file mode 100644
index 000000000..b1b17a03c
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error in CMakeLists.txt:
+ Invalid UNITY_BUILD_MODE value of INVALID assigned to target tgt\.
+ Acceptable values are BATCH and GROUP\.
+.*
+CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode.cmake b/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode.cmake
new file mode 100644
index 000000000..0212200d7
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_invalid_mode.cmake
@@ -0,0 +1,12 @@
+project(unitybuild_c C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE INVALID)
diff --git a/Tests/RunCMake/VS10Project/CSharpSourceGroup/foo.cs b/Tests/RunCMake/VS10Project/CSharpSourceGroup/foo.cs
new file mode 100644
index 000000000..3695dc91e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/CSharpSourceGroup/foo.cs
@@ -0,0 +1,3 @@
+void foo()
+{
+}
diff --git a/Tests/RunCMake/VS10Project/CSharpSourceGroup/images/empty.bmp b/Tests/RunCMake/VS10Project/CSharpSourceGroup/images/empty.bmp
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/CSharpSourceGroup/images/empty.bmp
diff --git a/Tests/RunCMake/VS10Project/CSharpSourceGroup/nested/baz.cs b/Tests/RunCMake/VS10Project/CSharpSourceGroup/nested/baz.cs
new file mode 100644
index 000000000..d5d334a67
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/CSharpSourceGroup/nested/baz.cs
@@ -0,0 +1,3 @@
+void baz()
+{
+}
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 8a04f785e..93ef60343 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -3,12 +3,12 @@ cmake_policy(SET CMP0057 NEW)
include(RunCMake)
cmake_policy(SET CMP0054 NEW)
+run_cmake(VsCsharpSourceGroup)
run_cmake(VsCSharpCompilerOpts)
run_cmake(ExplicitCMakeLists)
run_cmake(RuntimeLibrary)
run_cmake(SourceGroupCMakeLists)
run_cmake(SourceGroupTreeCMakeLists)
-
run_cmake(VsConfigurationType)
run_cmake(VsTargetsFileReferences)
run_cmake(VsCustomProps)
@@ -30,6 +30,10 @@ run_cmake(VsDpiAware)
run_cmake(VsDpiAwareBadParam)
run_cmake(VsPrecompileHeaders)
run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
+run_cmake(VsDeployEnabled)
+run_cmake(VsSettings)
+run_cmake(VsSourceSettingsTool)
+run_cmake(VsPlatformToolset)
run_cmake(VsWinRTByDefault)
@@ -52,6 +56,7 @@ if (RunCMake_GENERATOR MATCHES "Visual Studio 1[0-4] 201[0-5]" OR
run_cmake(UnityBuildPre2017)
else()
run_cmake(UnityBuildNative)
+ run_cmake(UnityBuildNativeGrouped)
endif()
run_cmake(VsDotnetTargetFramework)
diff --git a/Tests/RunCMake/VS10Project/UnityBuildNativeGrouped-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildNativeGrouped-check.cmake
new file mode 100644
index 000000000..d6380da46
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/UnityBuildNativeGrouped-check.cmake
@@ -0,0 +1,56 @@
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_poolA_c.c")
+if(NOT EXISTS "${unitybuild_c0}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
+ return()
+endif()
+
+set(unitybuild_c1 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_poolB_c.c")
+if(NOT EXISTS "${unitybuild_c1}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c1} does not exist.")
+ return()
+endif()
+
+set(tgt_project "${RunCMake_TEST_BINARY_DIR}/tgt.vcxproj")
+if (NOT EXISTS "${tgt_project}")
+ set(RunCMake_TEST_FAILED "Generated project file ${tgt_project} doesn't exist.")
+ return()
+endif()
+
+file(STRINGS ${tgt_project} tgt_projects_strings)
+
+foreach(line IN LISTS tgt_projects_strings)
+ if (line MATCHES "<EnableUnitySupport>true</EnableUnitySupport>")
+ set(have_unity_support ON)
+ endif()
+
+ if (line MATCHES "<ClCompile Include=.*IncludeInUnityFile=\"false\" CustomUnityFile=\"true\"")
+ list(APPEND unity_source_lines ${line})
+ endif()
+
+ if (line MATCHES "<ClCompile Include=.*IncludeInUnityFile=\"true\" CustomUnityFile=\"true\"")
+ list(APPEND sources_list ${line})
+ endif()
+endforeach()
+
+if (NOT have_unity_support)
+ set(RunCMake_TEST_FAILED "Generated project should include the <EnableUnitySupport> block.")
+ return()
+endif()
+
+string(REPLACE "\\" "/" unity_source_lines "${unity_source_lines}")
+string(FIND "${unity_source_lines}" "CMakeFiles/tgt.dir/Unity/unity_poolA_c.c" unity_source_file_position)
+if (unity_source_file_position EQUAL "-1")
+ set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file 'poolA'.")
+ return()
+endif()
+string(FIND "${unity_source_lines}" "CMakeFiles/tgt.dir/Unity/unity_poolB_c.c" unity_source_file_position)
+if (unity_source_file_position EQUAL "-1")
+ set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file 'poolB'.")
+ return()
+endif()
+
+list(LENGTH sources_list number_of_sources)
+if(NOT number_of_sources EQUAL 7)
+ set(RunCMake_TEST_FAILED "Generated project doesn't include the expect number of files.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/UnityBuildNativeGrouped.cmake b/Tests/RunCMake/VS10Project/UnityBuildNativeGrouped.cmake
new file mode 100644
index 000000000..b740e3b4e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/UnityBuildNativeGrouped.cmake
@@ -0,0 +1,20 @@
+project(unitybuild_c C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE GROUP)
+
+set_source_files_properties(s1.c s2.c s3.c s4.c
+ PROPERTIES UNITY_GROUP "poolA"
+ )
+
+set_source_files_properties(s5.c s6.c s7.c
+ PROPERTIES UNITY_GROUP "poolB"
+ )
diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017Grouped-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017Grouped-check.cmake
new file mode 100644
index 000000000..d9b8c01a0
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017Grouped-check.cmake
@@ -0,0 +1,59 @@
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_poolA.c")
+if(NOT EXISTS "${unitybuild_c0}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
+ return()
+endif()
+
+set(unitybuild_c1 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_poolB.c")
+if(NOT EXISTS "${unitybuild_c1}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c1} does not exist.")
+ return()
+endif()
+
+set(tgt_project "${RunCMake_TEST_BINARY_DIR}/tgt.vcxproj")
+if (NOT EXISTS "${tgt_project}")
+ set(RunCMake_TEST_FAILED "Generated project file ${tgt_project} doesn't exist.")
+ return()
+endif()
+
+file(STRINGS ${tgt_project} tgt_projects_strings)
+
+foreach(line IN LISTS tgt_projects_strings)
+ if (line MATCHES "<ClCompile Include=.*/>")
+ set(unity_source_line ${line})
+ endif()
+
+ if (line MATCHES "<ClCompile Include=\"[^\"]*\">")
+ string(REGEX MATCH "<ClCompile Include=\"([^\"]*)\">" source_file ${line})
+ list(APPEND sources_list ${source_file})
+ endif()
+
+ if (line MATCHES "<ExcludedFromBuild.*</ExcludedFromBuild>")
+ list(APPEND excluded_sources_list ${source_file})
+ endif()
+endforeach()
+
+string(REPLACE "\\" "/" unity_source_line ${unity_source_line})
+string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_poolA.c" unity_source_file_position)
+if (unity_source_file_position EQUAL "-1")
+ set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.")
+ return()
+endif()
+string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_poolB.c" unity_source_file_position)
+if (unity_source_file_position EQUAL "-1")
+ set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.")
+ return()
+endif()
+
+list(LENGTH sources_list number_of_sources)
+if(NOT number_of_sources EQUAL 7)
+ set(RunCMake_TEST_FAILED "Generated project doesn't include the expect number of files.")
+ return()
+endif()
+
+# Exclusions for Debug|Release|MinSizeRel|RelWithDebInfo
+list(LENGTH excluded_sources_list number_of_excluded_sources)
+if(NOT number_of_excluded_sources EQUAL 28)
+ set(RunCMake_TEST_FAILED "Generated project doesn't exclude the source files for all configurations.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017Grouped.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017Grouped.cmake
new file mode 100644
index 000000000..b740e3b4e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017Grouped.cmake
@@ -0,0 +1,20 @@
+project(unitybuild_c C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON UNITY_BUILD_MODE GROUP)
+
+set_source_files_properties(s1.c s2.c s3.c s4.c
+ PROPERTIES UNITY_GROUP "poolA"
+ )
+
+set_source_files_properties(s5.c s6.c s7.c
+ PROPERTIES UNITY_GROUP "poolB"
+ )
diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake
new file mode 100644
index 000000000..3b5c70f55
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup-check.cmake
@@ -0,0 +1,22 @@
+set(csProjFile "${RunCMake_TEST_BINARY_DIR}/VsCsharpSourceGroup.csproj")
+if(NOT EXISTS "${csProjFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjFile} does not exist.")
+ return()
+endif()
+
+file(STRINGS "${csProjFile}" lines)
+
+include(${RunCMake_TEST_SOURCE_DIR}/VsCsharpSourceGroupHelpers.cmake)
+
+set(SOURCE_GROUPS_TO_FIND
+ "CSharpSourceGroup"
+ "CSharpSourceGroup/nested"
+ "Images"
+)
+
+foreach(GROUP_NAME IN LISTS ${SOURCE_GROUPS_TO_FIND})
+ find_source_group("${lines}" ${GROUP_NAME})
+ if(NOT ${SOURCE_GROUP_FOUND})
+ return()
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake
new file mode 100644
index 000000000..024993c3f
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroup.cmake
@@ -0,0 +1,16 @@
+enable_language(CSharp)
+set(CMAKE_CONFIGURATION_TYPES Debug)
+
+set(SRC_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/foo.cs
+ ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/nested/baz.cs
+)
+
+set(IMAGE_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/Images/empty.bmp
+)
+
+add_library(VsCsharpSourceGroup SHARED ${SRC_FILES} ${IMAGE_FILES})
+source_group("CSharpSourceGroup" FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/foo.cs)
+source_group("CSharpSourceGroup/nested" FILES ${CMAKE_CURRENT_SOURCE_DIR}/CSharpSourceGroup/nested/baz.cs)
+source_group("Images" FILES ${IMAGE_FILES})
diff --git a/Tests/RunCMake/VS10Project/VsCsharpSourceGroupHelpers.cmake b/Tests/RunCMake/VS10Project/VsCsharpSourceGroupHelpers.cmake
new file mode 100644
index 000000000..bfa9a6767
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCsharpSourceGroupHelpers.cmake
@@ -0,0 +1,15 @@
+function(find_source_group LINES NAME)
+ set(foundSourceGroupLink 0)
+ foreach(line IN LISTS LINES)
+ if(line MATCHES "<Link>${NAME}</Link>")
+ set(foundSourceGroupLink 1)
+ endif()
+ endforeach()
+
+ if(NOT foundSourceGroupLink)
+ set(RunCMake_TEST_FAILED "Source group link for ${NAME} not found." PARENT_SCOPE)
+ set(SOURCE_GROUP_FOUND 0 PARENT_SCOPE)
+ return()
+ endif()
+ set(SOURCE_GROUP_FOUND 1 PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/VS10Project/VsDeployEnabled-check.cmake b/Tests/RunCMake/VS10Project/VsDeployEnabled-check.cmake
new file mode 100644
index 000000000..0ff8678e2
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDeployEnabled-check.cmake
@@ -0,0 +1,58 @@
+set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
+if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+endif()
+#
+# Test solution file for deployment.
+#
+
+set(vcSlnFile "${RunCMake_TEST_BINARY_DIR}/VsDeployEnabled.sln")
+if(NOT EXISTS "${vcSlnFile}")
+ set(RunCMake_TEST_FAILED "Solution file ${vcSlnFile} does not exist.")
+ return()
+endif()
+
+
+
+set(FooProjGUID "")
+set(FoundFooProj FALSE)
+set(InFooProj FALSE)
+set(FoundReleaseDeploy FALSE)
+set(DeployConfigs Debug MinSizeRel RelWithDebInfo )
+
+file(STRINGS "${vcSlnFile}" lines)
+foreach(line IN LISTS lines)
+#message(STATUS "${line}")
+ if( (NOT InFooProj ) AND (line MATCHES "^[ \\t]*Project\\(\"{[A-F0-9-]+}\"\\) = \"foo\", \"foo.vcxproj\", \"({[A-F0-9-]+})\"[ \\t]*$"))
+ # First, identify the GUID for the foo project, and record it.
+ set(FoundFooProj TRUE)
+ set(InFooProj TRUE)
+ set(FooProjGUID ${CMAKE_MATCH_1})
+ elseif(InFooProj AND line MATCHES "EndProject")
+ set(InFooProj FALSE)
+ elseif((NOT InFooProj) AND line MATCHES "${FooProjGUID}\\.Release.*\\.Deploy\\.0")
+ # If foo's Release configuration is set to deploy, this is the error.
+ set(FoundReleaseDeploy TRUE)
+ endif()
+ if( line MATCHES "{[A-F0-9-]+}\\.([^\\|]+).*\\.Deploy\\.0" )
+ # Check that the other configurations ARE set to deploy.
+ list( REMOVE_ITEM DeployConfigs ${CMAKE_MATCH_1})
+ endif()
+endforeach()
+
+if(FoundReleaseDeploy)
+ set(RunCMake_TEST_FAILED "Release deployment enabled.")
+ return()
+endif()
+
+if(NOT FoundFooProj)
+ set(RunCMake_TEST_FAILED "Failed to find foo project in the solution.")
+ return()
+endif()
+
+list(LENGTH DeployConfigs length)
+if( length GREATER 0 )
+ set(RunCMake_TEST_FAILED "Failed to find Deploy lines for non-Release configurations. (${length})")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsDeployEnabled.cmake b/Tests/RunCMake/VS10Project/VsDeployEnabled.cmake
new file mode 100644
index 000000000..02b42b25a
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDeployEnabled.cmake
@@ -0,0 +1,12 @@
+enable_language(CXX)
+
+set(DEPLOY_DIR
+ "temp\\foodir"
+)
+
+add_library(foo SHARED foo.cpp)
+
+set_target_properties(foo
+ PROPERTIES
+ VS_SOLUTION_DEPLOY $<NOT:$<CONFIG:Release>>
+)
diff --git a/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake b/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
index 512a1c99c..9c0f6e612 100644
--- a/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
@@ -4,6 +4,12 @@ if(NOT EXISTS "${vcProjectFile}")
return()
endif()
+set(installProjectFile "${RunCMake_TEST_BINARY_DIR}/INSTALL.vcxproj")
+if(NOT EXISTS "${installProjectFile}")
+ set(RunCMake_TEST_FAILED "Install file INSTALL.vcxproj does not exist.")
+ return()
+endif()
+
set(test1Library "boost")
set(test1Version "1.7.0")
@@ -37,3 +43,19 @@ if(NOT Library1Found OR NOT Library2Found)
set(RunCMake_TEST_FAILED "Failed to find package references")
return()
endif()
+
+set(DOT_NET_FRAMEWORK_VERSION_FOUND FALSE)
+
+file(STRINGS "${installProjectFile}" installlines)
+foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>$")
+ set(DOT_NET_FRAMEWORK_VERSION_FOUND TRUE)
+ message(STATUS "The install target contains the correct TargetFrameworkVersion.")
+ break()
+ endif()
+endforeach()
+
+if(NOT DOT_NET_FRAMEWORK_VERSION_FOUND)
+ set(RunCMake_TEST_FAILED "Failed to find TargetFrameworkVersion in the install target")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsPackageReferences.cmake b/Tests/RunCMake/VS10Project/VsPackageReferences.cmake
index 224ab18d7..30e8fd47b 100644
--- a/Tests/RunCMake/VS10Project/VsPackageReferences.cmake
+++ b/Tests/RunCMake/VS10Project/VsPackageReferences.cmake
@@ -1,4 +1,13 @@
enable_language(CXX)
+set(CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION "v4.7.2")
+
add_library(foo foo.cpp)
set_property(TARGET foo PROPERTY VS_PACKAGE_REFERENCES "boost_1.7.0;SFML_2.2.0")
+
+# install and export the targets to test the correct behavior
+# nuget restore will only work with an install target when the correct
+# target framework version is set
+set(INSTALL_CMAKE_DIR CMake)
+install(TARGETS foo EXPORT foo_Export_Target)
+install(EXPORT foo_Export_Target DESTINATION ${INSTALL_CMAKE_DIR} FILE fooConfig.cmake)
diff --git a/Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake b/Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake
new file mode 100644
index 000000000..416220b83
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsPlatformToolset-check.cmake
@@ -0,0 +1,36 @@
+macro(ReadPlatformToolset tgt outvar)
+ set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${tgt}.vcxproj")
+ if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not exist.")
+ return()
+ endif()
+
+ set(HAVE_PlatformToolset 0)
+
+ file(STRINGS "${vcProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<PlatformToolset>([^<>]+)</PlatformToolset>")
+ set(${outvar} "${CMAKE_MATCH_1}")
+ set(HAVE_PlatformToolset 1)
+ break()
+ endif()
+ endforeach()
+
+ if(NOT HAVE_PlatformToolset)
+ set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <PlatformToolset> field.")
+ return()
+ endif()
+endmacro()
+
+ReadPlatformToolset(NormalPlatformToolset NORMAL_TOOLSET)
+ReadPlatformToolset(OverridenPlatformToolset OVERRIDEN_TOOLSET)
+
+if (NOT "${OVERRIDEN_TOOLSET}" STREQUAL "MyCustomToolset")
+ set(RunCMake_TEST_FAILED "Failed to override the platform toolset")
+ return()
+endif()
+
+if ("${NORMAL_TOOLSET}" STREQUAL "MyCustomToolset")
+ set(RunCMake_TEST_FAILED "Main toolset was overriden (it shouldn't)")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsPlatformToolset.cmake b/Tests/RunCMake/VS10Project/VsPlatformToolset.cmake
new file mode 100644
index 000000000..dce97172d
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsPlatformToolset.cmake
@@ -0,0 +1,6 @@
+enable_language(CXX)
+
+add_library(NormalPlatformToolset foo.cpp)
+add_library(OverridenPlatformToolset foo.cpp)
+set_target_properties(OverridenPlatformToolset
+ PROPERTIES VS_PLATFORM_TOOLSET MyCustomToolset)
diff --git a/Tests/RunCMake/VS10Project/VsSettings-check.cmake b/Tests/RunCMake/VS10Project/VsSettings-check.cmake
new file mode 100644
index 000000000..0f8b26c28
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsSettings-check.cmake
@@ -0,0 +1,23 @@
+macro(ensure_props_set projectFile)
+ if(NOT EXISTS "${projectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+ return()
+ endif()
+
+ set(SettingFound FALSE)
+
+ file(STRINGS "${projectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "<SourceProperty1.*Debug.*>SourceProperty1Value</SourceProperty1>")
+ message("SourceProperty1 setting found")
+ set(SettingFound TRUE)
+ endif()
+ endforeach()
+
+ if (NOT SettingFound)
+ set(RunCMake_TEST_FAILED "SourceProperty1 setting was not found")
+ return()
+ endif()
+endmacro()
+
+ensure_props_set("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
diff --git a/Tests/RunCMake/VS10Project/VsSettings.cmake b/Tests/RunCMake/VS10Project/VsSettings.cmake
new file mode 100644
index 000000000..a4b321b65
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsSettings.cmake
@@ -0,0 +1,5 @@
+enable_language(CXX)
+
+add_library(foo foo.cpp shader.hlsl)
+set_property(SOURCE shader.hlsl PROPERTY VS_SETTINGS
+ "$<$<CONFIG:DEBUG>:SourceProperty1=SourceProperty1Value>")
diff --git a/Tests/RunCMake/VS10Project/VsSourceSettingsTool-check.cmake b/Tests/RunCMake/VS10Project/VsSourceSettingsTool-check.cmake
new file mode 100644
index 000000000..29a89c3ab
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsSourceSettingsTool-check.cmake
@@ -0,0 +1,34 @@
+macro(ensure_props_set projectFile)
+ if(NOT EXISTS "${projectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+ return()
+ endif()
+
+ set(FirstSettingFound FALSE)
+ set(SecondSettingFound FALSE)
+
+ file(STRINGS "${projectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "<TargetProperty1.*Debug.*>TargetProperty1ValueDebug</TargetProperty1>")
+ if (FirstSettingFound)
+ message("TargetProperty1 setting found twice")
+ set(SecondSettingFound TRUE)
+ else()
+ message("TargetProperty1 setting found once")
+ set(FirstSettingFound TRUE)
+ endif()
+ endif()
+ endforeach()
+
+ if (NOT FirstSettingFound)
+ set(RunCMake_TEST_FAILED "TargetProperty1 setting not found at all")
+ return()
+ endif()
+
+ if (NOT SecondSettingFound)
+ set(RunCMake_TEST_FAILED "TargetProperty1 setting found once when it should be found twice")
+ return()
+ endif()
+endmacro()
+
+ensure_props_set("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
diff --git a/Tests/RunCMake/VS10Project/VsSourceSettingsTool.cmake b/Tests/RunCMake/VS10Project/VsSourceSettingsTool.cmake
new file mode 100644
index 000000000..498962f0f
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsSourceSettingsTool.cmake
@@ -0,0 +1,5 @@
+enable_language(CXX)
+
+add_library(foo foo.cpp shader.hlsl shader2.hlsl)
+set_property(TARGET foo PROPERTY VS_SOURCE_SETTINGS_FXCompile
+ "$<$<CONFIG:DEBUG>:TargetProperty1=TargetProperty1ValueDebug>")
diff --git a/Tests/RunCMake/VS10Project/shader.hlsl b/Tests/RunCMake/VS10Project/shader.hlsl
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/shader.hlsl
@@ -0,0 +1 @@
+
diff --git a/Tests/RunCMake/VS10Project/shader2.hlsl b/Tests/RunCMake/VS10Project/shader2.hlsl
new file mode 100644
index 000000000..8b1378917
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/shader2.hlsl
@@ -0,0 +1 @@
+
diff --git a/Tests/RunCMake/add_link_options/GENEX_LINK_LANG.cmake b/Tests/RunCMake/add_link_options/GENEX_LINK_LANG.cmake
new file mode 100644
index 000000000..cc4ce4c6b
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/GENEX_LINK_LANG.cmake
@@ -0,0 +1,16 @@
+
+enable_language(C)
+
+set(obj "${CMAKE_C_OUTPUT_EXTENSION}")
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_link_options ($<$<LINK_LANGUAGE:C>:${pre}BADFLAG_LANG_C${obj}>
+ $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_LANG_CXX${obj}>)
+
+add_library(LinkOptions_shared SHARED LinkOptionsLib.c)
+
+add_library(LinkOptions_mod MODULE LinkOptionsLib.c)
+
+add_executable(LinkOptions_exe LinkOptionsExe.c)
diff --git a/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake b/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake
index bebd6c736..ece3ba05a 100644
--- a/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake
+++ b/Tests/RunCMake/add_link_options/LINKER_expansion-validation.cmake
@@ -11,5 +11,8 @@ endif()
file(READ "${RunCMake_TEST_BINARY_DIR}/LINKER.txt" linker_flag)
if (NOT actual_stdout MATCHES "${linker_flag}")
- set (RunCMake_TEST_FAILED "LINKER: was not expanded correctly.")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "LINKER: was not expanded correctly.")
endif()
diff --git a/Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake b/Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake
index 4a22d7e6d..127a2f500 100644
--- a/Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake
+++ b/Tests/RunCMake/add_link_options/LINK_OPTIONS-exe-check.cmake
@@ -3,5 +3,8 @@ if (NOT actual_stdout MATCHES "BADFLAG_EXECUTABLE_RELEASE")
set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_EXECUTABLE_RELEASE'.")
endif()
if (actual_stdout MATCHES "BADFLAG_(SHARED|MODULE)_RELEASE")
- set (RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(SHARED|MODULE)_RELEASE'.")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(SHARED|MODULE)_RELEASE'.")
endif()
diff --git a/Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake b/Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake
index d695761c9..874e0ad29 100644
--- a/Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake
+++ b/Tests/RunCMake/add_link_options/LINK_OPTIONS-mod-check.cmake
@@ -3,5 +3,8 @@ if (NOT actual_stdout MATCHES "BADFLAG_MODULE_RELEASE")
set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_MODULE_RELEASE'.")
endif()
if (actual_stdout MATCHES "BADFLAG_(SHARED|EXECUTABLE)_RELEASE")
- set (RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(SHARED|EXECUTABLE)_RELEASE'.")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(SHARED|EXECUTABLE)_RELEASE'.")
endif()
diff --git a/Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake b/Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake
index eaac8e372..ecba17e02 100644
--- a/Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake
+++ b/Tests/RunCMake/add_link_options/LINK_OPTIONS-shared-check.cmake
@@ -3,5 +3,8 @@ if (NOT actual_stdout MATCHES "BADFLAG_SHARED_RELEASE")
set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_SHARED_RELEASE'.")
endif()
if (actual_stdout MATCHES "BADFLAG_(MODULE|EXECUTABLE)_RELEASE")
- set (RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(MODULE|EXECUTABLE)_RELEASE'.")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(MODULE|EXECUTABLE)_RELEASE'.")
endif()
diff --git a/Tests/RunCMake/add_link_options/LinkOptionsLib.cxx b/Tests/RunCMake/add_link_options/LinkOptionsLib.cxx
new file mode 100644
index 000000000..9bbd24cd8
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/LinkOptionsLib.cxx
@@ -0,0 +1,7 @@
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ int flags_lib(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/add_link_options/RunCMakeTest.cmake b/Tests/RunCMake/add_link_options/RunCMakeTest.cmake
index 4f5df724e..465ff8523 100644
--- a/Tests/RunCMake/add_link_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_link_options/RunCMakeTest.cmake
@@ -23,6 +23,21 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release)
run_cmake_target(LINK_OPTIONS exe LinkOptions_exe --config Release)
+
+ run_cmake(genex_LINK_LANGUAGE)
+
+ run_cmake_target(genex_LINK_LANGUAGE shared_c LinkOptions_shared_c --config Release)
+ run_cmake_target(genex_LINK_LANGUAGE shared_cxx LinkOptions_shared_cxx --config Release)
+ run_cmake_target(genex_LINK_LANGUAGE mod LinkOptions_mod --config Release)
+ run_cmake_target(genex_LINK_LANGUAGE exe LinkOptions_exe --config Release)
+
+ run_cmake(genex_LINK_LANG_AND_ID)
+
+ run_cmake_target(genex_LINK_LANG_AND_ID shared_c LinkOptions_shared_c --config Release)
+ run_cmake_target(genex_LINK_LANG_AND_ID shared_cxx LinkOptions_shared_cxx --config Release)
+ run_cmake_target(genex_LINK_LANG_AND_ID mod LinkOptions_mod --config Release)
+ run_cmake_target(genex_LINK_LANG_AND_ID exe LinkOptions_exe --config Release)
+
unset(RunCMake_TEST_OPTIONS)
unset(RunCMake_TEST_OUTPUT_MERGE)
endif()
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-check.cmake
new file mode 100644
index 000000000..71f641d97
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-exe-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-check.cmake
new file mode 100644
index 000000000..71f641d97
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-mod-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake
new file mode 100644
index 000000000..ba0120ccd
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG C)
+set (INVALID_LANG CXX)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_c-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-check.cmake
new file mode 100644
index 000000000..aa3981023
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG CXX)
+set (INVALID_LANG C)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-shared_cxx-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-validation.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-validation.cmake
new file mode 100644
index 000000000..f0237abbe
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE-validation.cmake
@@ -0,0 +1,17 @@
+
+if (NOT DEFINED VALID_LANG)
+ set (VALID_LANG C)
+endif()
+if (NOT DEFINED INVALID_LANG)
+ set (INVALID_LANG CXX)
+endif()
+
+if (NOT actual_stdout MATCHES "BADFLAG_${VALID_LANG}_LANG")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_LANG}_LANG'.")
+endif()
+if (actual_stdout MATCHES "BADFLAG_${INVALID_LANG}_LANG")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_LANG}_LANG'.")
+endif()
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE.cmake
new file mode 100644
index 000000000..d74d4481e
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANGUAGE.cmake
@@ -0,0 +1,17 @@
+
+enable_language(C)
+enable_language(CXX)
+
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_link_options ($<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${CMAKE_CXX_OUTPUT_EXTENSION}>)
+
+add_library(LinkOptions_shared_c SHARED LinkOptionsLib.c)
+add_library(LinkOptions_shared_cxx SHARED LinkOptionsLib.cxx)
+
+add_library(LinkOptions_mod MODULE LinkOptionsLib.c)
+
+add_executable(LinkOptions_exe LinkOptionsExe.c)
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake
new file mode 100644
index 000000000..6bddee105
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-exe-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake
new file mode 100644
index 000000000..6bddee105
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-mod-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake
new file mode 100644
index 000000000..cf498d9af
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG C)
+set (INVALID_LANG CXX)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-check.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-check.cmake
new file mode 100644
index 000000000..ed4f851f1
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG CXX)
+set (INVALID_LANG C)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-result.txt b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-shared_cxx-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-validation.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-validation.cmake
new file mode 100644
index 000000000..a5dc27ff9
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID-validation.cmake
@@ -0,0 +1,23 @@
+
+if (NOT VALID_LANG)
+ set (VALID_LANG C)
+endif()
+if (NOT INVALID_LANG)
+ set (INVALID_LANG CXX)
+endif()
+
+if (NOT actual_stdout MATCHES "BADFLAG_${VALID_LANG}_LANG_ID")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_LANG}_LANG_ID'.\n")
+endif()
+if (actual_stdout MATCHES "BADFLAG_${INVALID_LANG}_LANG_ID")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_LANG}_LANG_ID '.")
+endif()
+if (actual_stdout MATCHES "BADFLAG_(${VALID_LANG}|${INVALID_LANG})_BADID")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(${VALID_LANG}|${INVALID_LANG})_BADID'.")
+endif()
diff --git a/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID.cmake b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID.cmake
new file mode 100644
index 000000000..c807050b4
--- /dev/null
+++ b/Tests/RunCMake/add_link_options/genex_LINK_LANG_AND_ID.cmake
@@ -0,0 +1,19 @@
+
+enable_language(C)
+enable_language(CXX)
+
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_link_options ($<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>)
+
+add_library(LinkOptions_shared_c SHARED LinkOptionsLib.c)
+add_library(LinkOptions_shared_cxx SHARED LinkOptionsLib.cxx)
+
+add_library(LinkOptions_mod MODULE LinkOptionsLib.c)
+
+add_executable(LinkOptions_exe LinkOptionsExe.c)
diff --git a/Tests/RunCMake/add_test/CMakeLists.txt.in b/Tests/RunCMake/add_test/CMakeLists.txt.in
new file mode 100644
index 000000000..495240d44
--- /dev/null
+++ b/Tests/RunCMake/add_test/CMakeLists.txt.in
@@ -0,0 +1,27 @@
+if (NOT DEFINED RUN_AS_SCRIPT)
+
+ cmake_minimum_required(VERSION 3.7)
+ project(@CASE_NAME@ NONE)
+ include(CTest)
+
+ # Two fallback tests for set_tests_properties.
+ add_test(NAME PrefixTest COMMAND "${CMAKE_COMMAND}" --version)
+ add_test(NAME SuffixTest COMMAND "${CMAKE_COMMAND}" --version)
+
+ add_test(
+ NAME @CASE_CMAKELISTS_NAME_1@
+ COMMAND "${CMAKE_COMMAND}" -D RUN_AS_SCRIPT=1 -P "${CMAKE_CURRENT_LIST_FILE}"
+ )
+ set_tests_properties(
+ @CASE_CMAKELISTS_NAME_2@
+ PROPERTIES
+ ENVIRONMENT CMAKE_add_test_ENVVAR=1
+ )
+
+else()
+
+ if(NOT DEFINED ENV{CMAKE_add_test_ENVVAR})
+ message(FATAL_ERROR "Setting property on test did not succeed!")
+ endif()
+
+endif()
diff --git a/Tests/RunCMake/add_test/NameContainsBracketArgument1-stdout.txt b/Tests/RunCMake/add_test/NameContainsBracketArgument1-stdout.txt
new file mode 100644
index 000000000..00865d013
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsBracketArgument1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \[=\[BracketArgument;SuffixTest\]=\] \.+[ ]+Passed
diff --git a/Tests/RunCMake/add_test/NameContainsBracketArgument2-stdout.txt b/Tests/RunCMake/add_test/NameContainsBracketArgument2-stdout.txt
new file mode 100644
index 000000000..a744beb19
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsBracketArgument2-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: BracketArgument;SuffixTest \.+[ ]+Passed
diff --git a/Tests/RunCMake/add_test/NameContainsBracketArgument3-result.txt b/Tests/RunCMake/add_test/NameContainsBracketArgument3-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsBracketArgument3-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsBracketArgument3-stderr.txt b/Tests/RunCMake/add_test/NameContainsBracketArgument3-stderr.txt
new file mode 100644
index 000000000..32c2112f8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsBracketArgument3-stderr.txt
@@ -0,0 +1,2 @@
+Error\(s\) when configuring the project
+No tests were found!!!
diff --git a/Tests/RunCMake/add_test/NameContainsBracketArgument4-result.txt b/Tests/RunCMake/add_test/NameContainsBracketArgument4-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsBracketArgument4-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsBracketArgument4-stderr.txt b/Tests/RunCMake/add_test/NameContainsBracketArgument4-stderr.txt
new file mode 100644
index 000000000..32c2112f8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsBracketArgument4-stderr.txt
@@ -0,0 +1,2 @@
+Error\(s\) when configuring the project
+No tests were found!!!
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote1-result.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote1-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote1-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote1-stderr.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote1-stderr.txt
new file mode 100644
index 000000000..066194508
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote1-stderr.txt
@@ -0,0 +1 @@
+Unable to find executable: SuffixTest
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote1-stdout.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote1-stdout.txt
new file mode 100644
index 000000000..4875409a8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: EscapedQuote \.+\*\*\*Not Run
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote2-result.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote2-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote2-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote2-stderr.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote2-stderr.txt
new file mode 100644
index 000000000..066194508
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote2-stderr.txt
@@ -0,0 +1 @@
+Unable to find executable: SuffixTest
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote2-stdout.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote2-stdout.txt
new file mode 100644
index 000000000..4875409a8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote2-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: EscapedQuote \.+\*\*\*Not Run
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote3-result.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote3-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote3-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote3-stderr.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote3-stderr.txt
new file mode 100644
index 000000000..066194508
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote3-stderr.txt
@@ -0,0 +1 @@
+Unable to find executable: SuffixTest
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote3-stdout.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote3-stdout.txt
new file mode 100644
index 000000000..4875409a8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote3-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: EscapedQuote \.+\*\*\*Not Run
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote4-result.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote4-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote4-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote4-stderr.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote4-stderr.txt
new file mode 100644
index 000000000..066194508
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote4-stderr.txt
@@ -0,0 +1 @@
+Unable to find executable: SuffixTest
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedQuote4-stdout.txt b/Tests/RunCMake/add_test/NameContainsEscapedQuote4-stdout.txt
new file mode 100644
index 000000000..4875409a8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedQuote4-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: EscapedQuote \.+\*\*\*Not Run
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars1-stdout.txt b/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars1-stdout.txt
new file mode 100644
index 000000000..80435b619
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \(\) # \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars2-stdout.txt b/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars2-stdout.txt
new file mode 100644
index 000000000..80435b619
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars2-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \(\) # \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars3-stdout.txt b/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars3-stdout.txt
new file mode 100644
index 000000000..80435b619
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars3-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \(\) # \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars4-stdout.txt b/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars4-stdout.txt
new file mode 100644
index 000000000..80435b619
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsEscapedSpecialChars4-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \(\) # \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax1-stdout.txt b/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax1-stdout.txt
new file mode 100644
index 000000000..172ff9933
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \$<BOOL:0> \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax2-stdout.txt b/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax2-stdout.txt
new file mode 100644
index 000000000..172ff9933
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax2-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \$<BOOL:0> \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax3-stdout.txt b/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax3-stdout.txt
new file mode 100644
index 000000000..172ff9933
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax3-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \$<BOOL:0> \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax4-stdout.txt b/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax4-stdout.txt
new file mode 100644
index 000000000..172ff9933
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsGeneratorExpressionSyntax4-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: \$<BOOL:0> \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsOtherSpecialChars1-stdout.txt b/Tests/RunCMake/add_test/NameContainsOtherSpecialChars1-stdout.txt
new file mode 100644
index 000000000..83e3f8634
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsOtherSpecialChars1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: !§\$%&/ü:\*😤~ \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsOtherSpecialChars2-stdout.txt b/Tests/RunCMake/add_test/NameContainsOtherSpecialChars2-stdout.txt
new file mode 100644
index 000000000..83e3f8634
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsOtherSpecialChars2-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: !§\$%&/ü:\*😤~ \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsOtherSpecialChars3-stdout.txt b/Tests/RunCMake/add_test/NameContainsOtherSpecialChars3-stdout.txt
new file mode 100644
index 000000000..83e3f8634
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsOtherSpecialChars3-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: !§\$%&/ü:\*😤~ \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsOtherSpecialChars4-stdout.txt b/Tests/RunCMake/add_test/NameContainsOtherSpecialChars4-stdout.txt
new file mode 100644
index 000000000..83e3f8634
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsOtherSpecialChars4-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: !§\$%&/ü:\*😤~ \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsSemicolon1-stdout.txt b/Tests/RunCMake/add_test/NameContainsSemicolon1-stdout.txt
new file mode 100644
index 000000000..0fbf486ae
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSemicolon1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: PrefixTest;SuffixTest \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsSemicolon2-result.txt b/Tests/RunCMake/add_test/NameContainsSemicolon2-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSemicolon2-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsSemicolon2-stderr.txt b/Tests/RunCMake/add_test/NameContainsSemicolon2-stderr.txt
new file mode 100644
index 000000000..32c2112f8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSemicolon2-stderr.txt
@@ -0,0 +1,2 @@
+Error\(s\) when configuring the project
+No tests were found!!!
diff --git a/Tests/RunCMake/add_test/NameContainsSemicolon3-stdout.txt b/Tests/RunCMake/add_test/NameContainsSemicolon3-stdout.txt
new file mode 100644
index 000000000..c5ab1d8d1
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSemicolon3-stdout.txt
@@ -0,0 +1,3 @@
+3/3 Test #3: PrefixTest;SuffixTest \.+\*\*\*Failed.*
+CMake Error at .+/CMakeLists.txt:[0-9]+ \(message\):
+[ ]*Setting property on test did not succeed!
diff --git a/Tests/RunCMake/add_test/NameContainsSemicolon4-result.txt b/Tests/RunCMake/add_test/NameContainsSemicolon4-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSemicolon4-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsSemicolon4-stderr.txt b/Tests/RunCMake/add_test/NameContainsSemicolon4-stderr.txt
new file mode 100644
index 000000000..32c2112f8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSemicolon4-stderr.txt
@@ -0,0 +1,2 @@
+Error\(s\) when configuring the project
+No tests were found!!!
diff --git a/Tests/RunCMake/add_test/NameContainsSpaces1-stdout.txt b/Tests/RunCMake/add_test/NameContainsSpaces1-stdout.txt
new file mode 100644
index 000000000..a255fb1ab
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSpaces1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: PrefixTest SuffixTest \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsSpaces2-result.txt b/Tests/RunCMake/add_test/NameContainsSpaces2-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSpaces2-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsSpaces2-stderr.txt b/Tests/RunCMake/add_test/NameContainsSpaces2-stderr.txt
new file mode 100644
index 000000000..32c2112f8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSpaces2-stderr.txt
@@ -0,0 +1,2 @@
+Error\(s\) when configuring the project
+No tests were found!!!
diff --git a/Tests/RunCMake/add_test/NameContainsSpaces3-stdout.txt b/Tests/RunCMake/add_test/NameContainsSpaces3-stdout.txt
new file mode 100644
index 000000000..3d42b0b2a
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSpaces3-stdout.txt
@@ -0,0 +1,3 @@
+3/3 Test #3: PrefixTest SuffixTest \.+\*\*\*Failed.*
+CMake Error at .+/CMakeLists.txt:[0-9]+ \(message\):
+[ ]*Setting property on test did not succeed!
diff --git a/Tests/RunCMake/add_test/NameContainsSpaces4-result.txt b/Tests/RunCMake/add_test/NameContainsSpaces4-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSpaces4-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/add_test/NameContainsSpaces4-stderr.txt b/Tests/RunCMake/add_test/NameContainsSpaces4-stderr.txt
new file mode 100644
index 000000000..32c2112f8
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsSpaces4-stderr.txt
@@ -0,0 +1,2 @@
+Error\(s\) when configuring the project
+No tests were found!!!
diff --git a/Tests/RunCMake/add_test/NameContainsValidSpecialChars1-stdout.txt b/Tests/RunCMake/add_test/NameContainsValidSpecialChars1-stdout.txt
new file mode 100644
index 000000000..ae1a0b112
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsValidSpecialChars1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: abc_\.\+-012 \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsValidSpecialChars2-stdout.txt b/Tests/RunCMake/add_test/NameContainsValidSpecialChars2-stdout.txt
new file mode 100644
index 000000000..ae1a0b112
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsValidSpecialChars2-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: abc_\.\+-012 \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsValidSpecialChars3-stdout.txt b/Tests/RunCMake/add_test/NameContainsValidSpecialChars3-stdout.txt
new file mode 100644
index 000000000..ae1a0b112
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsValidSpecialChars3-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: abc_\.\+-012 \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameContainsValidSpecialChars4-stdout.txt b/Tests/RunCMake/add_test/NameContainsValidSpecialChars4-stdout.txt
new file mode 100644
index 000000000..ae1a0b112
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameContainsValidSpecialChars4-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: abc_\.\+-012 \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameIsAlphaNumeric1-stdout.txt b/Tests/RunCMake/add_test/NameIsAlphaNumeric1-stdout.txt
new file mode 100644
index 000000000..ed939bf40
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameIsAlphaNumeric1-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: abcdefghijklmnopqrstuvwxyz0123456789 \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameIsAlphaNumeric2-stdout.txt b/Tests/RunCMake/add_test/NameIsAlphaNumeric2-stdout.txt
new file mode 100644
index 000000000..ed939bf40
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameIsAlphaNumeric2-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: abcdefghijklmnopqrstuvwxyz0123456789 \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameIsAlphaNumeric3-stdout.txt b/Tests/RunCMake/add_test/NameIsAlphaNumeric3-stdout.txt
new file mode 100644
index 000000000..ed939bf40
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameIsAlphaNumeric3-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: abcdefghijklmnopqrstuvwxyz0123456789 \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/NameIsAlphaNumeric4-stdout.txt b/Tests/RunCMake/add_test/NameIsAlphaNumeric4-stdout.txt
new file mode 100644
index 000000000..ed939bf40
--- /dev/null
+++ b/Tests/RunCMake/add_test/NameIsAlphaNumeric4-stdout.txt
@@ -0,0 +1 @@
+Test #[0-9]+: abcdefghijklmnopqrstuvwxyz0123456789 \.+[ ]*Passed
diff --git a/Tests/RunCMake/add_test/RunCMakeTest.cmake b/Tests/RunCMake/add_test/RunCMakeTest.cmake
new file mode 100644
index 000000000..6e9edda81
--- /dev/null
+++ b/Tests/RunCMake/add_test/RunCMakeTest.cmake
@@ -0,0 +1,263 @@
+include(RunCTest)
+
+set(ENV{CTEST_OUTPUT_ON_FAILURE} 1)
+
+function(run_NameIsAlphaNumeric1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ abcdefghijklmnopqrstuvwxyz0123456789 ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ abcdefghijklmnopqrstuvwxyz0123456789 ]==])
+ run_ctest(NameIsAlphaNumeric1)
+endfunction()
+run_NameIsAlphaNumeric1_test()
+
+function(run_NameIsAlphaNumeric2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["abcdefghijklmnopqrstuvwxyz0123456789"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["abcdefghijklmnopqrstuvwxyz0123456789"]==])
+ run_ctest(NameIsAlphaNumeric2)
+endfunction()
+run_NameIsAlphaNumeric2_test()
+
+function(run_NameIsAlphaNumeric3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["abcdefghijklmnopqrstuvwxyz0123456789"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ abcdefghijklmnopqrstuvwxyz0123456789 ]==])
+ run_ctest(NameIsAlphaNumeric3)
+endfunction()
+run_NameIsAlphaNumeric3_test()
+
+function(run_NameIsAlphaNumeric4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ abcdefghijklmnopqrstuvwxyz0123456789 ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["abcdefghijklmnopqrstuvwxyz0123456789"]==])
+ run_ctest(NameIsAlphaNumeric4)
+endfunction()
+run_NameIsAlphaNumeric4_test()
+
+
+function(run_NameContainsValidSpecialChars1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ abc_.+-012 ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ abc_.+-012 ]==])
+ run_ctest(NameContainsValidSpecialChars1)
+endfunction()
+run_NameContainsValidSpecialChars1_test()
+
+function(run_NameContainsValidSpecialChars2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["abc_.+-012"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["abc_.+-012"]==])
+ run_ctest(NameContainsValidSpecialChars2)
+endfunction()
+run_NameContainsValidSpecialChars2_test()
+
+function(run_NameContainsValidSpecialChars3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["abc_.+-012"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ abc_.+-012 ]==])
+ run_ctest(NameContainsValidSpecialChars3)
+endfunction()
+run_NameContainsValidSpecialChars3_test()
+
+function(run_NameContainsValidSpecialChars4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ abc_.+-012 ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["abc_.+-012"]==])
+ run_ctest(NameContainsValidSpecialChars4)
+endfunction()
+run_NameContainsValidSpecialChars4_test()
+
+
+function(run_NameContainsOtherSpecialChars1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ !§$%&/ü:*😤~ ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ !§$%&/ü:*😤~ ]==])
+ run_ctest(NameContainsOtherSpecialChars1)
+endfunction()
+run_NameContainsOtherSpecialChars1_test()
+
+function(run_NameContainsOtherSpecialChars2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["!§$%&/ü:*😤~"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["!§$%&/ü:*😤~"]==])
+ run_ctest(NameContainsOtherSpecialChars2)
+endfunction()
+run_NameContainsOtherSpecialChars2_test()
+
+function(run_NameContainsOtherSpecialChars3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["!§$%&/ü:*😤~"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ !§$%&/ü:*😤~ ]==])
+ run_ctest(NameContainsOtherSpecialChars3)
+endfunction()
+run_NameContainsOtherSpecialChars3_test()
+
+function(run_NameContainsOtherSpecialChars4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ !§$%&/ü:*😤~ ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["!§$%&/ü:*😤~"]==])
+ run_ctest(NameContainsOtherSpecialChars4)
+endfunction()
+run_NameContainsOtherSpecialChars4_test()
+
+
+function(run_NameContainsEscapedSpecialChars1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ \(\)\ \# ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ \(\)\ \# ]==])
+ run_ctest(NameContainsEscapedSpecialChars1)
+endfunction()
+run_NameContainsEscapedSpecialChars1_test()
+
+function(run_NameContainsEscapedSpecialChars2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["\(\)\ \#"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["\(\)\ \#"]==])
+ run_ctest(NameContainsEscapedSpecialChars2)
+endfunction()
+run_NameContainsEscapedSpecialChars2_test()
+
+function(run_NameContainsEscapedSpecialChars3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["\(\)\ \#"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ \(\)\ \# ]==])
+ run_ctest(NameContainsEscapedSpecialChars3)
+endfunction()
+run_NameContainsEscapedSpecialChars3_test()
+
+function(run_NameContainsEscapedSpecialChars4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ \(\)\ \# ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["\(\)\ \#"]==])
+ run_ctest(NameContainsEscapedSpecialChars4)
+endfunction()
+run_NameContainsEscapedSpecialChars4_test()
+
+
+function(run_NameContainsGeneratorExpressionSyntax1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ $<BOOL:0> ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ $<BOOL:0> ]==])
+ run_ctest(NameContainsGeneratorExpressionSyntax1)
+endfunction()
+run_NameContainsGeneratorExpressionSyntax1_test()
+
+function(run_NameContainsGeneratorExpressionSyntax2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["$<BOOL:0>"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["$<BOOL:0>"]==])
+ run_ctest(NameContainsGeneratorExpressionSyntax2)
+endfunction()
+run_NameContainsGeneratorExpressionSyntax2_test()
+
+function(run_NameContainsGeneratorExpressionSyntax3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["$<BOOL:0>"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ $<BOOL:0> ]==])
+ run_ctest(NameContainsGeneratorExpressionSyntax3)
+endfunction()
+run_NameContainsGeneratorExpressionSyntax3_test()
+
+function(run_NameContainsGeneratorExpressionSyntax4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ $<BOOL:0> ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["$<BOOL:0>"]==])
+ run_ctest(NameContainsGeneratorExpressionSyntax4)
+endfunction()
+run_NameContainsGeneratorExpressionSyntax4_test()
+
+
+function(run_NameContainsSpaces1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["PrefixTest SuffixTest"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["PrefixTest SuffixTest"]==])
+ run_ctest(NameContainsSpaces1)
+endfunction()
+run_NameContainsSpaces1_test()
+
+function(run_NameContainsSpaces2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ PrefixTest SuffixTest ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ PrefixTest SuffixTest ]==])
+ run_ctest(NameContainsSpaces2)
+endfunction()
+run_NameContainsSpaces2_test()
+
+function(run_NameContainsSpaces3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["PrefixTest SuffixTest"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ PrefixTest SuffixTest ]==])
+ run_ctest(NameContainsSpaces3)
+endfunction()
+run_NameContainsSpaces3_test()
+
+function(run_NameContainsSpaces4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ PrefixTest SuffixTest ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["PrefixTest SuffixTest"]==])
+ run_ctest(NameContainsSpaces4)
+endfunction()
+run_NameContainsSpaces4_test()
+
+
+function(run_NameContainsSemicolon1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["PrefixTest;SuffixTest"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["PrefixTest;SuffixTest"]==])
+ run_ctest(NameContainsSemicolon1)
+endfunction()
+run_NameContainsSemicolon1_test()
+
+function(run_NameContainsSemicolon2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ PrefixTest;SuffixTest ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ PrefixTest;SuffixTest ]==])
+ run_ctest(NameContainsSemicolon2)
+endfunction()
+run_NameContainsSemicolon2_test()
+
+function(run_NameContainsSemicolon3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["PrefixTest;SuffixTest"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ PrefixTest;SuffixTest ]==])
+ run_ctest(NameContainsSemicolon3)
+endfunction()
+run_NameContainsSemicolon3_test()
+
+function(run_NameContainsSemicolon4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ PrefixTest;SuffixTest ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["PrefixTest;SuffixTest"]==])
+ run_ctest(NameContainsSemicolon4)
+endfunction()
+run_NameContainsSemicolon4_test()
+
+
+function(run_NameContainsEscapedQuote1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["EscapedQuote\"\"SuffixTest"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["EscapedQuote\"\"SuffixTest"]==])
+ run_ctest(NameContainsEscapedQuote1)
+endfunction()
+run_NameContainsEscapedQuote1_test()
+
+function(run_NameContainsEscapedQuote2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ EscapedQuote\"\"SuffixTest ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ EscapedQuote\"\"SuffixTest ]==])
+ run_ctest(NameContainsEscapedQuote2)
+endfunction()
+run_NameContainsEscapedQuote2_test()
+
+function(run_NameContainsEscapedQuote3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["EscapedQuote\"\"SuffixTest"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ EscapedQuote\"\"SuffixTest ]==])
+ run_ctest(NameContainsEscapedQuote3)
+endfunction()
+run_NameContainsEscapedQuote3_test()
+
+function(run_NameContainsEscapedQuote4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ EscapedQuote\"\"SuffixTest ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["EscapedQuote\"\"SuffixTest"]==])
+ run_ctest(NameContainsEscapedQuote4)
+endfunction()
+run_NameContainsEscapedQuote4_test()
+
+
+function(run_NameContainsBracketArgument1_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["[=[BracketArgument;SuffixTest]=]"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["[=[BracketArgument;SuffixTest]=]"]==])
+ run_ctest(NameContainsBracketArgument1)
+endfunction()
+run_NameContainsBracketArgument1_test()
+
+function(run_NameContainsBracketArgument2_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ [=[BracketArgument;SuffixTest]=] ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ [=[BracketArgument;SuffixTest]=] ]==])
+ run_ctest(NameContainsBracketArgument2)
+endfunction()
+run_NameContainsBracketArgument2_test()
+
+function(run_NameContainsBracketArgument3_test)
+ set(CASE_CMAKELISTS_NAME_1 [==["[=[BracketArgument;SuffixTest]=]"]==])
+ set(CASE_CMAKELISTS_NAME_2 [==[ [=[BracketArgument;SuffixTest]=] ]==])
+ run_ctest(NameContainsBracketArgument3)
+endfunction()
+run_NameContainsBracketArgument3_test()
+
+function(run_NameContainsBracketArgument4_test)
+ set(CASE_CMAKELISTS_NAME_1 [==[ [=[BracketArgument;SuffixTest]=] ]==])
+ set(CASE_CMAKELISTS_NAME_2 [==["[=[BracketArgument;SuffixTest]=]"]==])
+ run_ctest(NameContainsBracketArgument4)
+endfunction()
+run_NameContainsBracketArgument4_test()
diff --git a/Tests/RunCMake/add_test/test.cmake.in b/Tests/RunCMake/add_test/test.cmake.in
new file mode 100644
index 000000000..9821c1cae
--- /dev/null
+++ b/Tests/RunCMake/add_test/test.cmake.in
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.17)
+
+set(CTEST_SITE "test-site")
+set(CTEST_BUILD_NAME "test-build-name")
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
+set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+
+set(ctest_test_args "@CASE_CTEST_TEST_ARGS@")
+ctest_start(Experimental)
+ctest_configure()
+#ctest_build()
+ctest_test(${ctest_test_args})
diff --git a/Tests/RunCMake/alias_targets/RunCMakeTest.cmake b/Tests/RunCMake/alias_targets/RunCMakeTest.cmake
index dded248ed..4be1b9d8d 100644
--- a/Tests/RunCMake/alias_targets/RunCMakeTest.cmake
+++ b/Tests/RunCMake/alias_targets/RunCMakeTest.cmake
@@ -2,6 +2,8 @@ include(RunCMake)
run_cmake(no-targets)
run_cmake(multiple-targets)
+run_cmake(duplicate-target-CMP0107-OLD)
+run_cmake(duplicate-target-CMP0107-NEW)
run_cmake(exclude-from-all)
run_cmake(imported)
run_cmake(invalid-name)
@@ -10,6 +12,7 @@ run_cmake(imported-global-target)
run_cmake(imported-target)
run_cmake(alias-target)
run_cmake(set_property)
+run_cmake(get_property)
run_cmake(set_target_properties)
run_cmake(target_link_libraries)
run_cmake(target_include_directories)
diff --git a/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW-result.txt b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW-stderr.txt b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW-stderr.txt
new file mode 100644
index 000000000..03ba5a6a9
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW-stderr.txt
@@ -0,0 +1,30 @@
+CMake Error at duplicate-target.cmake:[0-9]+ \(add_library\):
+ add_library cannot create ALIAS target "alias1" because another target with
+ the same name already exists.
+Call Stack \(most recent call first\):
+ duplicate-target-CMP0107-NEW.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+CMake Error at duplicate-target.cmake:[0-9]+ \(add_library\):
+ add_library cannot create ALIAS target "alias1" because another target with
+ the same name already exists.
+Call Stack \(most recent call first\):
+ duplicate-target-CMP0107-NEW.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+CMake Error at duplicate-target.cmake:[0-9]+ \(add_library\):
+ add_library cannot create ALIAS target "alias2" because another target with
+ the same name already exists.
+Call Stack \(most recent call first\):
+ duplicate-target-CMP0107-NEW.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+CMake Error at duplicate-target.cmake:[0-9]+ \(add_library\):
+ add_library cannot create ALIAS target "alias2" because another target with
+ the same name already exists.
+Call Stack \(most recent call first\):
+ duplicate-target-CMP0107-NEW.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW.cmake b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW.cmake
new file mode 100644
index 000000000..609857fe0
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy (SET CMP0107 NEW)
+
+include (duplicate-target.cmake)
diff --git a/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-OLD.cmake b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-OLD.cmake
new file mode 100644
index 000000000..d5bc998f2
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/duplicate-target-CMP0107-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy (SET CMP0107 OLD)
+
+include (duplicate-target.cmake)
diff --git a/Tests/RunCMake/alias_targets/duplicate-target.cmake b/Tests/RunCMake/alias_targets/duplicate-target.cmake
new file mode 100644
index 000000000..f81921b71
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/duplicate-target.cmake
@@ -0,0 +1,20 @@
+
+add_library (foo1 INTERFACE)
+add_library (foo2 INTERFACE)
+
+add_library (imp1 SHARED IMPORTED GLOBAL)
+add_library (imp2 SHARED IMPORTED GLOBAL)
+
+
+add_library (alias1 ALIAS foo1)
+# same alias to different library
+add_library (alias1 ALIAS foo2)
+# same alias to different imported library
+add_library (alias1 ALIAS imp1)
+
+
+add_library (alias2 ALIAS imp1)
+# same alias to different imported library
+add_library (alias2 ALIAS imp2)
+# same alias to different library
+add_library (alias2 ALIAS foo1)
diff --git a/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt b/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt
new file mode 100644
index 000000000..b114b7544
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/get_property-subdir/CMakeLists.txt
@@ -0,0 +1,15 @@
+
+
+add_library(alias::import-local-subdir ALIAS import-local)
+
+check_property (alias::import-local-subdir ALIASED_TARGET "import-local")
+check_property (alias::import-local-subdir IMPORTED "TRUE")
+check_property (alias::import-local-subdir ALIAS_GLOBAL "FALSE")
+check_property (alias::import-local-subdir IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL")
+
+
+# non-global alias defined in parent directory must be visible in sub-directory
+check_property (alias::import-local ALIASED_TARGET "import-local")
+check_property (alias::import-local IMPORTED "TRUE")
+check_property (alias::import-local ALIAS_GLOBAL "FALSE")
+check_property (alias::import-local IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL")
diff --git a/Tests/RunCMake/alias_targets/get_property.cmake b/Tests/RunCMake/alias_targets/get_property.cmake
new file mode 100644
index 000000000..8a01c6f5d
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/get_property.cmake
@@ -0,0 +1,59 @@
+
+enable_language(CXX)
+
+function (check_property alias property value)
+ get_property (data TARGET ${alias} PROPERTY ${property})
+ if (NOT "${value}" STREQUAL "${data}")
+ message (SEND_ERROR "get_property(): Target property '${property}' from ALIAS '${alias}' has wrong value: '${data}' instead of '${value}'.")
+ endif()
+ get_target_property (data ${alias} ${property})
+ if (NOT "${value}" STREQUAL "${data}")
+ message (SEND_ERROR "get_target_property(): Target property '${property}' from ALIAS '${alias}' has wrong value: '${data}' instead of '${value}'.")
+ endif()
+endfunction()
+
+
+add_library(lib empty.cpp)
+set_property (TARGET lib PROPERTY LIB_PROPERTY "LIB")
+
+add_library(alias::lib ALIAS lib)
+
+check_property (alias::lib ALIASED_TARGET "lib")
+check_property (alias::lib IMPORTED "FALSE")
+check_property (alias::lib ALIAS_GLOBAL "TRUE")
+check_property (alias::lib LIB_PROPERTY "LIB")
+
+
+add_library(import-global SHARED IMPORTED GLOBAL)
+set_property (TARGET import-global PROPERTY IMPORT_GLOBAL_PROPERTY "IMPORT_GLOBAL")
+
+add_library(alias::import-global ALIAS import-global)
+
+check_property (alias::import-global ALIASED_TARGET "import-global")
+check_property (alias::import-global IMPORTED "TRUE")
+check_property (alias::import-global ALIAS_GLOBAL "TRUE")
+check_property (alias::import-global IMPORT_GLOBAL_PROPERTY "IMPORT_GLOBAL")
+
+
+add_library(import-local SHARED IMPORTED)
+set_property (TARGET import-local PROPERTY IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL")
+
+add_library(alias::import-local ALIAS import-local)
+
+check_property (alias::import-local ALIASED_TARGET "import-local")
+check_property (alias::import-local IMPORTED "TRUE")
+check_property (alias::import-local ALIAS_GLOBAL "FALSE")
+check_property (alias::import-local IMPORT_LOCAL_PROPERTY "IMPORT_LOCAL")
+
+
+## upgrade imported target from local to global, alias stay local
+add_library(import-lib SHARED IMPORTED)
+add_library(alias::import-lib ALIAS import-lib)
+check_property (alias::import-lib IMPORTED_GLOBAL "FALSE")
+check_property (alias::import-lib ALIAS_GLOBAL "FALSE")
+set_property (TARGET import-lib PROPERTY IMPORTED_GLOBAL "TRUE")
+check_property (alias::import-lib IMPORTED_GLOBAL "TRUE")
+check_property (alias::import-lib ALIAS_GLOBAL "FALSE")
+
+
+add_subdirectory (get_property-subdir)
diff --git a/Tests/RunCMake/alias_targets/imported-target-stderr.txt b/Tests/RunCMake/alias_targets/imported-target-stderr.txt
index 465de0362..8259c8059 100644
--- a/Tests/RunCMake/alias_targets/imported-target-stderr.txt
+++ b/Tests/RunCMake/alias_targets/imported-target-stderr.txt
@@ -1,15 +1,2 @@
-^CMake Error at imported-target.cmake:[0-9]+ \(add_executable\):
- add_executable cannot create ALIAS target \"alias-test-exe\" because target
- \"test-exe\" is imported but not globally visible.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
-+
-'alias-test-exe' does not exist![?]
-*
-CMake Error at imported-target.cmake:[0-9]+ \(add_library\):
- add_library cannot create ALIAS target "alias-test-lib" because target
- "test-lib" is imported but not globally visible.
-Call Stack \(most recent call first\):
- CMakeLists.txt:[0-9]+ \(include\)
-+
-'alias-test-lib' does not exist![?]$
+^'alias-test-exe' is an alias for 'test-exe' and its name-property contains 'test-exe'.
+'alias-test-lib' is an alias for 'test-lib' and its name-property contains 'test-lib'.$
diff --git a/Tests/RunCMake/alias_targets/imported-target-subdir1/CMakeLists.txt b/Tests/RunCMake/alias_targets/imported-target-subdir1/CMakeLists.txt
new file mode 100644
index 000000000..bec05b3d9
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/imported-target-subdir1/CMakeLists.txt
@@ -0,0 +1,6 @@
+
+add_executable(alias-test-exe-subdir1 ALIAS test-exe)
+add_executable(alias-test-exe-local ALIAS test-exe)
+
+add_library(alias-test-lib-subdir1 ALIAS test-lib)
+add_library(alias-test-lib-local ALIAS test-lib)
diff --git a/Tests/RunCMake/alias_targets/imported-target-subdir2/CMakeLists.txt b/Tests/RunCMake/alias_targets/imported-target-subdir2/CMakeLists.txt
new file mode 100644
index 000000000..23c85bac2
--- /dev/null
+++ b/Tests/RunCMake/alias_targets/imported-target-subdir2/CMakeLists.txt
@@ -0,0 +1,20 @@
+
+add_executable(alias-test-exe-subdir2 ALIAS test-exe)
+add_executable(alias-test-exe-local ALIAS test-exe)
+
+add_library(alias-test-lib-subdir2 ALIAS test-lib)
+add_library(alias-test-lib-local ALIAS test-lib)
+
+
+foreach (item IN ITEMS exe lib)
+ get_property (aliasedTarget TARGET alias-test-${item}-local PROPERTY ALIASED_TARGET)
+ if (NOT aliasedTarget STREQUAL "test-${item}")
+ message (SEND_ERROR "Wrong aliased target '${aliasedTarget}' for ALIAS 'alias-test-${item}-local'.")
+ endif()
+endforeach()
+
+foreach (item IN ITEMS exe lib)
+ if (TARGET alias-test-${item}-subdir1)
+ message (SEND_ERROR "ALIAS 'alias-test-${item}-subdir1' unexpectedly defined.")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/alias_targets/imported-target.cmake b/Tests/RunCMake/alias_targets/imported-target.cmake
index bb682fecd..fa6f8d3f4 100644
--- a/Tests/RunCMake/alias_targets/imported-target.cmake
+++ b/Tests/RunCMake/alias_targets/imported-target.cmake
@@ -44,3 +44,14 @@ if(TARGET alias-test-lib)
else()
message("'alias-test-lib' does not exist!?")
endif()
+
+add_subdirectory (imported-target-subdir1)
+add_subdirectory (imported-target-subdir2)
+
+foreach (alias IN ITEMS exe-local lib-local
+ exe-subdir1 lib-subdir1
+ exe-subdir2 lib-subdir2)
+ if (TARGET alias-test-${alias})
+ message (SEND_ERROR "ALIAS 'alias-test-${alias}' unexpectedly defined.")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/cmake_language/CMakeLists.txt b/Tests/RunCMake/cmake_language/CMakeLists.txt
new file mode 100644
index 000000000..2632ffa91
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/cmake_language/CallInvalidCommand.cmake b/Tests/RunCMake/cmake_language/CallInvalidCommand.cmake
new file mode 100644
index 000000000..8bee6f264
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CallInvalidCommand.cmake
@@ -0,0 +1,2 @@
+
+cmake_language(CALL ${COMMAND})
diff --git a/Tests/RunCMake/cmake_language/CheckIncludeGuard.cmake b/Tests/RunCMake/cmake_language/CheckIncludeGuard.cmake
new file mode 100644
index 000000000..902c1e4cb
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CheckIncludeGuard.cmake
@@ -0,0 +1,4 @@
+
+cmake_language (CALL "include_guard")
+
+set (GUARD_VALUE 1)
diff --git a/Tests/RunCMake/cmake_language/CheckProject/CMakeLists.txt b/Tests/RunCMake/cmake_language/CheckProject/CMakeLists.txt
new file mode 100644
index 000000000..9a2769281
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CheckProject/CMakeLists.txt
@@ -0,0 +1,19 @@
+
+cmake_language (CALL cmake_minimum_required VERSION 3.17...3.18)
+
+cmake_language (CALL project CheckProject VERSION 1.2.3 LANGUAGES C)
+
+if (NOT PROJECT_NAME STREQUAL "CheckProject")
+ message (SEND_ERROR "error on project() usage.")
+endif()
+
+if (NOT CheckProject_VERSION VERSION_EQUAL "1.2.3")
+ message (SEND_ERROR "error on project() usage.")
+endif()
+
+get_property (languages GLOBAL PROPERTY ENABLED_LANGUAGES)
+if (NOT "C" IN_LIST languages)
+ message (SEND_ERROR "error on project() usage.")
+endif()
+
+add_library (lib SHARED lib.c)
diff --git a/Tests/RunCMake/cmake_language/CheckProject/lib.c b/Tests/RunCMake/cmake_language/CheckProject/lib.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/CheckProject/lib.c
diff --git a/Tests/RunCMake/cmake_language/RunCMakeTest.cmake b/Tests/RunCMake/cmake_language/RunCMakeTest.cmake
new file mode 100644
index 000000000..5fb93c8d8
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/RunCMakeTest.cmake
@@ -0,0 +1,25 @@
+include(RunCMake)
+
+run_cmake(no_parameters)
+run_cmake(unknown_meta_operation)
+run_cmake(call_invalid_command)
+run_cmake(call_valid_command)
+run_cmake(call_double_evaluation)
+run_cmake(call_expanded_command)
+run_cmake(call_expanded_command_and_arguments)
+run_cmake(call_expanded_command_with_explicit_argument)
+run_cmake(call_expand_command_name)
+run_cmake(call_expand_function_name)
+run_cmake(call_message)
+run_cmake(call_message_fatal_error)
+run_cmake(call_no_parameters)
+run_cmake(call_preserve_arguments)
+run_cmake(call_unknown_function)
+run_cmake(eval_expand_command_name)
+run_cmake(eval_expanded_command_and_arguments)
+run_cmake(eval_extra_parameters_between_eval_and_code)
+run_cmake(eval_message)
+run_cmake(eval_message_fatal_error)
+run_cmake(eval_no_code)
+run_cmake(eval_no_parameters)
+run_cmake(eval_variable_outside_message)
diff --git a/Tests/RunCMake/cmake_language/call_double_evaluation-stderr.txt b/Tests/RunCMake/cmake_language/call_double_evaluation-stderr.txt
new file mode 100644
index 000000000..59a70bd21
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_double_evaluation-stderr.txt
@@ -0,0 +1 @@
+var='\${foo}'
diff --git a/Tests/RunCMake/cmake_language/call_double_evaluation.cmake b/Tests/RunCMake/cmake_language/call_double_evaluation.cmake
new file mode 100644
index 000000000..cf8fc914c
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_double_evaluation.cmake
@@ -0,0 +1,2 @@
+set(var [[${foo}]])
+cmake_language(CALL cmake_language CALL message "var='${var}'")
diff --git a/Tests/RunCMake/cmake_language/call_expand_command_name-stderr.txt b/Tests/RunCMake/cmake_language/call_expand_command_name-stderr.txt
new file mode 100644
index 000000000..d64066171
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expand_command_name-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_language/call_expand_command_name.cmake b/Tests/RunCMake/cmake_language/call_expand_command_name.cmake
new file mode 100644
index 000000000..e03bb1fd2
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expand_command_name.cmake
@@ -0,0 +1,2 @@
+set (my_call "CALL")
+cmake_language (${my_call} message "OK!")
diff --git a/Tests/RunCMake/cmake_language/call_expand_function_name-stderr.txt b/Tests/RunCMake/cmake_language/call_expand_function_name-stderr.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expand_function_name-stderr.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/call_expand_function_name.cmake b/Tests/RunCMake/cmake_language/call_expand_function_name.cmake
new file mode 100644
index 000000000..565a7df40
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expand_function_name.cmake
@@ -0,0 +1,11 @@
+function(some_function_1)
+ message(1)
+endfunction()
+
+function(some_function_2)
+ message(2)
+endfunction()
+
+set(function_version 1)
+
+cmake_language(CALL some_function_${function_version})
diff --git a/Tests/RunCMake/cmake_language/call_expanded_command-stderr.txt b/Tests/RunCMake/cmake_language/call_expanded_command-stderr.txt
new file mode 100644
index 000000000..d64066171
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expanded_command-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_language/call_expanded_command.cmake b/Tests/RunCMake/cmake_language/call_expanded_command.cmake
new file mode 100644
index 000000000..e76e61231
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expanded_command.cmake
@@ -0,0 +1,6 @@
+function (itsok)
+ message(OK!)
+endfunction()
+
+set (cmd CALL itsok)
+cmake_language (${cmd})
diff --git a/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-result.txt b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-stderr.txt b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-stderr.txt
new file mode 100644
index 000000000..e87e9bc27
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at call_expanded_command_and_arguments.cmake:2 \(cmake_language\):
+ cmake_language called with incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments.cmake b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments.cmake
new file mode 100644
index 000000000..4ce6b34de
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expanded_command_and_arguments.cmake
@@ -0,0 +1,2 @@
+set(call_message CALL message a b)
+cmake_language(${call_message})
diff --git a/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument-stderr.txt b/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument-stderr.txt
new file mode 100644
index 000000000..d64066171
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument.cmake b/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument.cmake
new file mode 100644
index 000000000..056340005
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_expanded_command_with_explicit_argument.cmake
@@ -0,0 +1,2 @@
+set (cmd CALL message)
+cmake_language (${cmd} "OK!")
diff --git a/Tests/RunCMake/cmake_language/call_invalid_command.cmake b/Tests/RunCMake/cmake_language/call_invalid_command.cmake
new file mode 100644
index 000000000..88bf08c2d
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_invalid_command.cmake
@@ -0,0 +1,14 @@
+
+foreach (command IN ITEMS "function" "ENDFUNCTION"
+ "macro" "endMACRO"
+ "if" "elseif" "else" "endif"
+ "while" "endwhile"
+ "foreach" "endforeach")
+ execute_process(COMMAND "${CMAKE_COMMAND}" -DCOMMAND=${command}
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/CallInvalidCommand.cmake"
+ OUTPUT_QUIET ERROR_QUIET
+ RESULT_VARIABLE result)
+ if (NOT result)
+ message (SEND_ERROR "cmake_language(CALL ${command}) unexpectedly successfull.")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/cmake_language/call_message-stderr.txt b/Tests/RunCMake/cmake_language/call_message-stderr.txt
new file mode 100644
index 000000000..cfc8694cf
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_message-stderr.txt
@@ -0,0 +1 @@
+WORKS!
diff --git a/Tests/RunCMake/cmake_language/call_message.cmake b/Tests/RunCMake/cmake_language/call_message.cmake
new file mode 100644
index 000000000..31aefdf21
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_message.cmake
@@ -0,0 +1 @@
+cmake_language(CALL message WORKS!)
diff --git a/Tests/RunCMake/cmake_language/call_message_fatal_error-result.txt b/Tests/RunCMake/cmake_language/call_message_fatal_error-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_message_fatal_error-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/call_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_language/call_message_fatal_error-stderr.txt
new file mode 100644
index 000000000..83eb3d80a
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_message_fatal_error-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at call_message_fatal_error.cmake:1 \(message\):
+ error!
+Call Stack \(most recent call first\):
+ call_message_fatal_error.cmake:1 \(cmake_language\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/cmake_language/call_message_fatal_error.cmake b/Tests/RunCMake/cmake_language/call_message_fatal_error.cmake
new file mode 100644
index 000000000..935b43794
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_message_fatal_error.cmake
@@ -0,0 +1 @@
+cmake_language(CALL message FATAL_ERROR error!)
diff --git a/Tests/RunCMake/cmake_language/call_no_parameters-result.txt b/Tests/RunCMake/cmake_language/call_no_parameters-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_no_parameters-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/call_no_parameters-stderr.txt b/Tests/RunCMake/cmake_language/call_no_parameters-stderr.txt
new file mode 100644
index 000000000..9e2c08fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_no_parameters-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at call_no_parameters.cmake:1 \(cmake_language\):
+ cmake_language called with incorrect number of arguments
diff --git a/Tests/RunCMake/cmake_language/call_no_parameters.cmake b/Tests/RunCMake/cmake_language/call_no_parameters.cmake
new file mode 100644
index 000000000..8353e08da
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_no_parameters.cmake
@@ -0,0 +1 @@
+cmake_language(CALL)
diff --git a/Tests/RunCMake/cmake_language/call_preserve_arguments-stderr.txt b/Tests/RunCMake/cmake_language/call_preserve_arguments-stderr.txt
new file mode 100644
index 000000000..8ec5483cd
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_preserve_arguments-stderr.txt
@@ -0,0 +1,6 @@
+foo\(...\)
+\[a;b\]
+\[c;d\]
+cmake_language\(CALL foo ...\)
+\[a;b\]
+\[c;d\]
diff --git a/Tests/RunCMake/cmake_language/call_preserve_arguments.cmake b/Tests/RunCMake/cmake_language/call_preserve_arguments.cmake
new file mode 100644
index 000000000..bfef0fda1
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_preserve_arguments.cmake
@@ -0,0 +1,12 @@
+function(foo arg1 arg2)
+ math(EXPR last "${ARGC} - 1")
+ foreach(i RANGE 0 ${last})
+ message("[${ARGV${i}}]")
+ endforeach()
+endfunction()
+
+message("foo(...)")
+foo("a;b" "c;d")
+
+message("cmake_language(CALL foo ...)")
+cmake_language(CALL foo "a;b" "c;d")
diff --git a/Tests/RunCMake/cmake_language/call_unknown_function-result.txt b/Tests/RunCMake/cmake_language/call_unknown_function-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_unknown_function-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/call_unknown_function-stderr.txt b/Tests/RunCMake/cmake_language/call_unknown_function-stderr.txt
new file mode 100644
index 000000000..d09e708de
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_unknown_function-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at call_unknown_function.cmake:1 \(unknown\):
+ Unknown CMake command "unknown".
diff --git a/Tests/RunCMake/cmake_language/call_unknown_function.cmake b/Tests/RunCMake/cmake_language/call_unknown_function.cmake
new file mode 100644
index 000000000..efd6bafe9
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_unknown_function.cmake
@@ -0,0 +1 @@
+cmake_language(CALL unknown)
diff --git a/Tests/RunCMake/cmake_language/call_valid_command.cmake b/Tests/RunCMake/cmake_language/call_valid_command.cmake
new file mode 100644
index 000000000..2e965dc9d
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/call_valid_command.cmake
@@ -0,0 +1,99 @@
+
+## check continue() usage
+set (VALUE 0)
+foreach (i RANGE 1 4)
+ set (VALUE "${i}")
+ cmake_language (CALL "continue")
+ set (VALUE "0")
+endforeach()
+if (NOT VALUE EQUAL "4")
+ message (SEND_ERROR "error on continue() usage.")
+endif()
+
+
+## check break() usage
+set (VALUE 0)
+foreach (i RANGE 1 4)
+ set (VALUE "${i}")
+ cmake_language (CALL "break")
+ set (VALUE 0)
+endforeach()
+if (NOT VALUE EQUAL "1")
+ message (SEND_ERROR "error on break() usage.")
+endif()
+
+
+## check return() usage in macro
+macro (call_return_in_macro)
+ cmake_language (CALL "return")
+ set (VALUE 1)
+endmacro()
+function (wrapper)
+ call_return_in_macro()
+ set (VALUE 1 PARENT_SCOPE)
+endfunction()
+
+set (VALUE 0)
+wrapper()
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in macro.")
+endif()
+
+set (VALUE 0)
+cmake_language (CALL "wrapper")
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in macro.")
+endif()
+
+function (wrapper2)
+ cmake_language (CALL "call_return_in_macro")
+ set (VALUE 1 PARENT_SCOPE)
+endfunction()
+
+set (VALUE 0)
+wrapper2()
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in macro.")
+endif()
+
+set (VALUE 0)
+cmake_language (CALL "wrapper2")
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in macro.")
+endif()
+
+## check return() usage in function
+function (call_return_in_function)
+ cmake_language (CALL "return")
+ set (VALUE 1 PARENT_SCOPE)
+endfunction()
+
+set (VALUE 0)
+call_return_in_function()
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in function.")
+endif()
+
+set (VALUE 0)
+cmake_language (CALL "call_return_in_function")
+if (NOT VALUE EQUAL "0")
+ message (SEND_ERROR "error on return() usage in function.")
+endif()
+
+
+## check usage of include_guard()
+set (GUARD_VALUE 0)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckIncludeGuard.cmake")
+if (NOT GUARD_VALUE EQUAL "1")
+ message (SEND_ERROR "error on include_guard() on first include.")
+endif()
+
+set (GUARD_VALUE 0)
+include ("${CMAKE_CURRENT_SOURCE_DIR}/CheckIncludeGuard.cmake")
+if (NOT GUARD_VALUE EQUAL "0")
+ message (SEND_ERROR "error on include_guard() on second include.")
+endif()
+
+
+## check usage of cmake_minimum_required() and project()
+add_subdirectory (CheckProject)
diff --git a/Tests/RunCMake/cmake_language/eval_expand_command_name-stderr.txt b/Tests/RunCMake/cmake_language/eval_expand_command_name-stderr.txt
new file mode 100644
index 000000000..d64066171
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_expand_command_name-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_language/eval_expand_command_name.cmake b/Tests/RunCMake/cmake_language/eval_expand_command_name.cmake
new file mode 100644
index 000000000..2397232c1
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_expand_command_name.cmake
@@ -0,0 +1,2 @@
+set (my_eval "EVAL")
+cmake_language (${my_eval} CODE message("OK!"))
diff --git a/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments-stderr.txt b/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments-stderr.txt
new file mode 100644
index 000000000..d64066171
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments-stderr.txt
@@ -0,0 +1 @@
+OK!
diff --git a/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments.cmake b/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments.cmake
new file mode 100644
index 000000000..f7d2d515a
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_expanded_command_and_arguments.cmake
@@ -0,0 +1,2 @@
+set(cmd EVAL CODE [[message("OK!")]])
+cmake_language(${cmd})
diff --git a/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-result.txt b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-stderr.txt b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-stderr.txt
new file mode 100644
index 000000000..d32054fc8
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at eval_extra_parameters_between_eval_and_code.cmake:1 \(cmake_language\):
+ cmake_language called with unsupported arguments between EVAL and CODE
+ arguments
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code.cmake b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code.cmake
new file mode 100644
index 000000000..7c004d7cf
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_extra_parameters_between_eval_and_code.cmake
@@ -0,0 +1 @@
+cmake_language(EVAL BAD CODE "message(BAD CODE)")
diff --git a/Tests/RunCMake/cmake_language/eval_message-stderr.txt b/Tests/RunCMake/cmake_language/eval_message-stderr.txt
new file mode 100644
index 000000000..cfc8694cf
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_message-stderr.txt
@@ -0,0 +1 @@
+WORKS!
diff --git a/Tests/RunCMake/cmake_language/eval_message.cmake b/Tests/RunCMake/cmake_language/eval_message.cmake
new file mode 100644
index 000000000..91edcdda6
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_message.cmake
@@ -0,0 +1 @@
+cmake_language(EVAL CODE message(WORKS!))
diff --git a/Tests/RunCMake/cmake_language/eval_message_fatal_error-result.txt b/Tests/RunCMake/cmake_language/eval_message_fatal_error-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_message_fatal_error-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/eval_message_fatal_error-stderr.txt b/Tests/RunCMake/cmake_language/eval_message_fatal_error-stderr.txt
new file mode 100644
index 000000000..5cf11e37c
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_message_fatal_error-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at eval_message_fatal_error.cmake:1:EVAL:2 \(message\):
+ error!
+Call Stack \(most recent call first\):
+ eval_message_fatal_error.cmake:1 \(cmake_language\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/cmake_language/eval_message_fatal_error.cmake b/Tests/RunCMake/cmake_language/eval_message_fatal_error.cmake
new file mode 100644
index 000000000..72e155d06
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_message_fatal_error.cmake
@@ -0,0 +1,5 @@
+cmake_language(EVAL CODE
+"
+ message(FATAL_ERROR error!)
+"
+)
diff --git a/Tests/RunCMake/cmake_language/eval_no_code-result.txt b/Tests/RunCMake/cmake_language/eval_no_code-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_no_code-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/eval_no_code-stderr.txt b/Tests/RunCMake/cmake_language/eval_no_code-stderr.txt
new file mode 100644
index 000000000..608ba8866
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_no_code-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at eval_no_code.cmake:1 \(cmake_language\):
+ cmake_language called without CODE argument
diff --git a/Tests/RunCMake/cmake_language/eval_no_code.cmake b/Tests/RunCMake/cmake_language/eval_no_code.cmake
new file mode 100644
index 000000000..7f5bc21a2
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_no_code.cmake
@@ -0,0 +1 @@
+cmake_language(EVAL message "too many parameters")
diff --git a/Tests/RunCMake/cmake_language/eval_no_parameters-result.txt b/Tests/RunCMake/cmake_language/eval_no_parameters-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_no_parameters-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/eval_no_parameters-stderr.txt b/Tests/RunCMake/cmake_language/eval_no_parameters-stderr.txt
new file mode 100644
index 000000000..616689871
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_no_parameters-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at eval_no_parameters.cmake:1 \(cmake_language\):
+ cmake_language called with incorrect number of arguments
diff --git a/Tests/RunCMake/cmake_language/eval_no_parameters.cmake b/Tests/RunCMake/cmake_language/eval_no_parameters.cmake
new file mode 100644
index 000000000..e7ae808e2
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_no_parameters.cmake
@@ -0,0 +1 @@
+cmake_language(EVAL)
diff --git a/Tests/RunCMake/cmake_language/eval_variable_outside_message-stderr.txt b/Tests/RunCMake/cmake_language/eval_variable_outside_message-stderr.txt
new file mode 100644
index 000000000..cfc8694cf
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_variable_outside_message-stderr.txt
@@ -0,0 +1 @@
+WORKS!
diff --git a/Tests/RunCMake/cmake_language/eval_variable_outside_message.cmake b/Tests/RunCMake/cmake_language/eval_variable_outside_message.cmake
new file mode 100644
index 000000000..71f045701
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/eval_variable_outside_message.cmake
@@ -0,0 +1,2 @@
+cmake_language(EVAL CODE "set(phrase \"WORKS!\")")
+message(${phrase})
diff --git a/Tests/RunCMake/cmake_language/no_parameters-result.txt b/Tests/RunCMake/cmake_language/no_parameters-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/no_parameters-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/no_parameters-stderr.txt b/Tests/RunCMake/cmake_language/no_parameters-stderr.txt
new file mode 100644
index 000000000..194bbe355
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/no_parameters-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at no_parameters.cmake:1 \(cmake_language\):
+ cmake_language called with incorrect number of arguments
diff --git a/Tests/RunCMake/cmake_language/no_parameters.cmake b/Tests/RunCMake/cmake_language/no_parameters.cmake
new file mode 100644
index 000000000..8353e08da
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/no_parameters.cmake
@@ -0,0 +1 @@
+cmake_language(CALL)
diff --git a/Tests/RunCMake/cmake_language/unknown_meta_operation-result.txt b/Tests/RunCMake/cmake_language/unknown_meta_operation-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/unknown_meta_operation-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/cmake_language/unknown_meta_operation-stderr.txt b/Tests/RunCMake/cmake_language/unknown_meta_operation-stderr.txt
new file mode 100644
index 000000000..6a1d4fdf9
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/unknown_meta_operation-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at unknown_meta_operation.cmake:1 \(cmake_language\):
+ cmake_language called with unknown meta-operation
diff --git a/Tests/RunCMake/cmake_language/unknown_meta_operation.cmake b/Tests/RunCMake/cmake_language/unknown_meta_operation.cmake
new file mode 100644
index 000000000..699f36f15
--- /dev/null
+++ b/Tests/RunCMake/cmake_language/unknown_meta_operation.cmake
@@ -0,0 +1 @@
+cmake_language(UNKNOWN)
diff --git a/Tests/RunCMake/configure_file/RerunCMake.cmake b/Tests/RunCMake/configure_file/RerunCMake.cmake
index 890cc1fa8..98387d038 100644
--- a/Tests/RunCMake/configure_file/RerunCMake.cmake
+++ b/Tests/RunCMake/configure_file/RerunCMake.cmake
@@ -1,8 +1,4 @@
message("Running CMake on RerunCMake") # write to stderr if cmake reruns
-configure_file(
- "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in"
- "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt"
- @ONLY
- )
+add_subdirectory(RerunCMake)
# make sure CMakeCache.txt is newer than ConfigureFileOutput.txt
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1)
diff --git a/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt b/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt
new file mode 100644
index 000000000..c9681c70a
--- /dev/null
+++ b/Tests/RunCMake/configure_file/RerunCMake/CMakeLists.txt
@@ -0,0 +1,5 @@
+configure_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt"
+ @ONLY
+ )
diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
index de144682c..32a0770b9 100644
--- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
@@ -22,7 +22,7 @@ if(RunCMake_GENERATOR MATCHES "Make")
set(RunCMake_TEST_NO_CLEAN 1)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
- set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in")
+ set(in_conf "${RunCMake_TEST_BINARY_DIR}/RerunCMake/ConfigureFileInput.txt.in")
file(WRITE "${in_conf}" "1")
message(STATUS "RerunCMake: first configuration...")
@@ -42,7 +42,7 @@ if(RunCMake_GENERATOR MATCHES "Make")
run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .)
message(STATUS "RerunCMake: remove configure_file output...")
- file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt")
+ file(REMOVE "${RunCMake_TEST_BINARY_DIR}/RerunCMake/ConfigureFileOutput.txt")
run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .)
run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .)
diff --git a/Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake
index ca36a7c89..58c94d7af 100644
--- a/Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testAddressLeakSanitizer.cmake
@@ -2,7 +2,7 @@
# options
message("ASAN_OPTIONS = [$ENV{ASAN_OPTIONS}]")
-string(REGEX REPLACE ".*log_path=\'([^\']*)\'.*" "\\1" LOG_FILE "$ENV{ASAN_OPTIONS}")
+string(REGEX REPLACE ".*log_path='([^']*)'.*" "\\1" LOG_FILE "$ENV{ASAN_OPTIONS}")
message("LOG_FILE=[${LOG_FILE}]")
# if we are not asked to simulate AddressSanitizer don't do it
diff --git a/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake
index 1219666fd..8f18cd008 100644
--- a/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testAddressSanitizer.cmake
@@ -2,7 +2,7 @@
# options
message("ASAN_OPTIONS = [$ENV{ASAN_OPTIONS}]")
-string(REGEX REPLACE ".*log_path=\'([^\']*)\'.*" "\\1" LOG_FILE "$ENV{ASAN_OPTIONS}")
+string(REGEX REPLACE ".*log_path='([^']*)'.*" "\\1" LOG_FILE "$ENV{ASAN_OPTIONS}")
message("LOG_FILE=[${LOG_FILE}]")
# if we are not asked to simulate address sanitizer don't do it
diff --git a/Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake
index 6d51f8346..4990792ff 100644
--- a/Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testLeakSanitizer.cmake
@@ -2,7 +2,7 @@
# options
message("LSAN_OPTIONS = [$ENV{LSAN_OPTIONS}]")
-string(REGEX REPLACE ".*log_path=\'([^\']*)\'.*" "\\1" LOG_FILE "$ENV{LSAN_OPTIONS}")
+string(REGEX REPLACE ".*log_path='([^']*)'.*" "\\1" LOG_FILE "$ENV{LSAN_OPTIONS}")
message("LOG_FILE=[${LOG_FILE}]")
# if we are not asked to simulate LeakSanitizer don't do it
diff --git a/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake
index 3b3ac22bd..4a6adb1e3 100644
--- a/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testMemorySanitizer.cmake
@@ -2,7 +2,7 @@
# options
message("MSAN_OPTIONS = [$ENV{MSAN_OPTIONS}]")
-string(REGEX REPLACE ".*log_path=\'([^\']*)\'.*" "\\1" LOG_FILE "$ENV{MSAN_OPTIONS}")
+string(REGEX REPLACE ".*log_path='([^']*)'.*" "\\1" LOG_FILE "$ENV{MSAN_OPTIONS}")
message("LOG_FILE=[${LOG_FILE}]")
# if we are not asked to simulate address sanitizer don't do it
diff --git a/Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake
index e7a5c9f46..96251c301 100644
--- a/Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testThreadSanitizer.cmake
@@ -2,7 +2,7 @@
# options
message("TSAN_OPTIONS = [$ENV{TSAN_OPTIONS}]")
-string(REGEX REPLACE ".*log_path=\'([^\']*)\'.*" "\\1" LOG_FILE "$ENV{TSAN_OPTIONS}")
+string(REGEX REPLACE ".*log_path='([^']*)'.*" "\\1" LOG_FILE "$ENV{TSAN_OPTIONS}")
message("LOG_FILE=[${LOG_FILE}]")
set(error_types
diff --git a/Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake b/Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake
index ba6122d6c..7160280cb 100644
--- a/Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake
+++ b/Tests/RunCMake/ctest_memcheck/testUndefinedBehaviorSanitizer.cmake
@@ -2,7 +2,7 @@
# UndefinedBehaviorSanitizer options
message("UBSAN_OPTIONS = [$ENV{UBSAN_OPTIONS}]")
-string(REGEX REPLACE ".*log_path=\'([^\']*)\'.*" "\\1" LOG_FILE "$ENV{UBSAN_OPTIONS}")
+string(REGEX REPLACE ".*log_path='([^']*)'.*" "\\1" LOG_FILE "$ENV{UBSAN_OPTIONS}")
message("LOG_FILE=[${LOG_FILE}]")
# if we are not asked to simulate address sanitizer don't do it
diff --git a/Tests/RunCMake/ctest_start/NoStartTimeNightly-result.txt b/Tests/RunCMake/ctest_start/NoStartTimeNightly-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/NoStartTimeNightly-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_start/NoStartTimeNightly-stderr.txt b/Tests/RunCMake/ctest_start/NoStartTimeNightly-stderr.txt
new file mode 100644
index 000000000..79756eb17
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/NoStartTimeNightly-stderr.txt
@@ -0,0 +1,4 @@
+^WARNING: No nightly start time found please set in CTestConfig\.cmake or DartConfig\.cmake
+CMake Error at [^
+]*/Tests/RunCMake/ctest_start/NoStartTimeNightly/test\.cmake:[0-9]+ \(ctest_start\):
+ ctest_start unknown error\.$
diff --git a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
index da85b39ab..f11f1ec4b 100644
--- a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
@@ -48,6 +48,8 @@ run_ctest_start(TooManyArgs Experimental
${RunCMake_BINARY_DIR}/TooManyArgs-build
${RunCMake_BINARY_DIR}/TooManyArgs-build
${RunCMake_BINARY_DIR}/TooManyArgs-build)
+run_ctest_start(NoStartTimeExperimental Experimental)
+run_ctest_start(NoStartTimeNightly Nightly)
function(run_ConfigInBuild)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ConfigInBuild-build)
diff --git a/Tests/RunCMake/ctest_start/test.cmake.in b/Tests/RunCMake/ctest_start/test.cmake.in
index 8cd3cff5a..4063ece66 100644
--- a/Tests/RunCMake/ctest_start/test.cmake.in
+++ b/Tests/RunCMake/ctest_start/test.cmake.in
@@ -8,7 +8,9 @@ set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
-set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+if(NOT "@CASE_NAME@" MATCHES "^NoStartTime")
+ set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+endif()
function(setup_tests)
ctest_start(${ctest_start_args})
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index d0a6e5ff4..b82335f1b 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -121,3 +121,26 @@ add_test(NAME testNotRun
]])
run_TestRepeat(NotRun RETURN_VALUE:1 REPEAT UNTIL_PASS:3)
unset(CASE_CMAKELISTS_SUFFIX_CODE)
+
+# test --stop-on-failure
+function(run_stop_on_failure)
+ set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion)
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+add_test(NAME StoppingTest COMMAND ${CMAKE_COMMAND} -E false)
+add_test(NAME NotRunTest COMMAND ${CMAKE_COMMAND} -E true)
+ ]])
+
+ run_ctest_test(stop-on-failure STOP_ON_FAILURE)
+endfunction()
+run_stop_on_failure()
+
+# Make sure environment gets logged
+function(run_environment)
+ set(ENV{BAD_ENVIRONMENT_VARIABLE} "Bad environment variable")
+ set(CASE_CMAKELISTS_SUFFIX_CODE [[
+set_property(TEST RunCMakeVersion PROPERTY ENVIRONMENT "ENV1=env1;ENV2=env2")
+ ]])
+
+ run_ctest(TestEnvironment)
+endfunction()
+run_environment()
diff --git a/Tests/RunCMake/ctest_test/TestEnvironment-check.cmake b/Tests/RunCMake/ctest_test/TestEnvironment-check.cmake
new file mode 100644
index 000000000..91c9731d8
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestEnvironment-check.cmake
@@ -0,0 +1,10 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/Testing/TAG" _tag)
+string(REGEX REPLACE "^([^\n]*)\n.*$" "\\1" _date "${_tag}")
+file(READ "${RunCMake_TEST_BINARY_DIR}/Testing/${_date}/Test.xml" _test_contents)
+
+if(NOT _test_contents MATCHES "<Value>ENV1=env1\nENV2=env2\n#CTEST_RESOURCE_GROUP_COUNT=</Value>")
+ string(APPEND RunCMake_TEST_FAILED "Could not find expected environment variables in Test.xml")
+endif()
+if(_test_contents MATCHES "BAD_ENVIRONMENT_VARIABLE")
+ string(APPEND RunCMake_TEST_FAILED "Found BAD_ENVIRONMENT_VARIABLE in Test.xml")
+endif()
diff --git a/Tests/RunCMake/ctest_test/stop-on-failure-stdout.txt b/Tests/RunCMake/ctest_test/stop-on-failure-stdout.txt
new file mode 100644
index 000000000..fa4bce0b4
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/stop-on-failure-stdout.txt
@@ -0,0 +1,13 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/stop-on-failure-build
+ Start 1: RunCMakeVersion
+1/3 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
+ Start 2: StoppingTest
+2/3 Test #2: StoppingTest .....................\*\*\*Failed +[0-9.]+ sec
++
+50% tests passed, 1 tests failed out of 2
++
+Total Test time \(real\) = +[0-9.]+ sec
++
+The following tests FAILED:
+[ ]+2 - StoppingTest \(Failed\)$
diff --git a/Tests/RunCMake/execute_process/EchoVariable-stderr.txt b/Tests/RunCMake/execute_process/EchoVariable-stderr.txt
new file mode 100644
index 000000000..d92755345
--- /dev/null
+++ b/Tests/RunCMake/execute_process/EchoVariable-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error at [^
+]*EchoVariableOutput.cmake:2 \(message\):
+ Text to stderr
diff --git a/Tests/RunCMake/execute_process/EchoVariable-stdout.txt b/Tests/RunCMake/execute_process/EchoVariable-stdout.txt
new file mode 100644
index 000000000..7c868bd07
--- /dev/null
+++ b/Tests/RunCMake/execute_process/EchoVariable-stdout.txt
@@ -0,0 +1 @@
+-- Text to stdout
diff --git a/Tests/RunCMake/execute_process/EchoVariable.cmake b/Tests/RunCMake/execute_process/EchoVariable.cmake
new file mode 100644
index 000000000..99999c748
--- /dev/null
+++ b/Tests/RunCMake/execute_process/EchoVariable.cmake
@@ -0,0 +1,23 @@
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/EchoVariableOutput.cmake
+ OUTPUT_VARIABLE stdout
+ ERROR_QUIET
+ ECHO_OUTPUT_VARIABLE
+)
+
+file(READ ${CMAKE_CURRENT_LIST_DIR}/EchoVariable-stdout.txt expected_stdout)
+if (NOT stdout MATCHES "${expected_stdout}")
+ message(FATAL_ERROR "stdout differs from the expected stdout")
+endif()
+
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/EchoVariableOutput.cmake
+ ERROR_VARIABLE stderr
+ OUTPUT_QUIET
+ ECHO_ERROR_VARIABLE
+)
+
+file(READ ${CMAKE_CURRENT_LIST_DIR}/EchoVariable-stderr.txt expected_stderr)
+if (NOT stderr MATCHES "${expected_stderr}")
+ message(FATAL_ERROR "stderr differs from the expected stderr")
+endif()
diff --git a/Tests/RunCMake/execute_process/EchoVariableOutput.cmake b/Tests/RunCMake/execute_process/EchoVariableOutput.cmake
new file mode 100644
index 000000000..e63656748
--- /dev/null
+++ b/Tests/RunCMake/execute_process/EchoVariableOutput.cmake
@@ -0,0 +1,2 @@
+message(STATUS "Text to stdout")
+message(FATAL_ERROR "Text to stderr")
diff --git a/Tests/RunCMake/execute_process/RunCMakeTest.cmake b/Tests/RunCMake/execute_process/RunCMakeTest.cmake
index b203aabfd..89ad6b207 100644
--- a/Tests/RunCMake/execute_process/RunCMakeTest.cmake
+++ b/Tests/RunCMake/execute_process/RunCMakeTest.cmake
@@ -24,3 +24,5 @@ run_cmake_command(EchoCommand2 ${CMAKE_COMMAND} -P
run_cmake_command(EchoCommand3 ${CMAKE_COMMAND}
-DCHECK_ERROR_OUTPUT_LOCATION=TRUE -P
${RunCMake_SOURCE_DIR}/EchoCommand.cmake)
+
+run_cmake_command(EchoVariable ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/EchoVariable.cmake)
diff --git a/Tests/RunCMake/exit_code.c b/Tests/RunCMake/exit_code.c
index 3eba01941..9fa8eca62 100644
--- a/Tests/RunCMake/exit_code.c
+++ b/Tests/RunCMake/exit_code.c
@@ -21,7 +21,8 @@ int main(int argc, const char* argv[])
}
if (strcmp(str, substring_success) == 0) {
return EXIT_SUCCESS;
- } else if (strcmp(str, substring_failure) == 0) {
+ }
+ if (strcmp(str, substring_failure) == 0) {
return EXIT_FAILURE;
}
fprintf(stderr, "Failed to find string '%s' in '%s'\n", substring_success,
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
index b78c7e461..e8f8a09bb 100644
--- a/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
+++ b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
@@ -3,8 +3,7 @@ CMake Error in CMakeLists.txt:
that is not in this export set, but in multiple other export sets:
.*/Tests/RunCMake/export/DependOnDoubleExport-build/exportset.cmake,
.*/Tests/RunCMake/export/DependOnDoubleExport-build/manual.cmake.
-
-
++
An exported target cannot depend upon another target which is exported
multiple times. Consider consolidating the exports of the "doubleexported"
target to a single export.
diff --git a/Tests/RunCMake/export/Repeat-CMP0103-NEW-result.txt b/Tests/RunCMake/export/Repeat-CMP0103-NEW-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/export/Repeat-CMP0103-NEW-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/export/Repeat-CMP0103-NEW-stderr.txt b/Tests/RunCMake/export/Repeat-CMP0103-NEW-stderr.txt
new file mode 100644
index 000000000..48ab7b1d9
--- /dev/null
+++ b/Tests/RunCMake/export/Repeat-CMP0103-NEW-stderr.txt
@@ -0,0 +1,17 @@
+CMake Error at Repeat.cmake:[0-9]+ \(export\):
+ export command already specified for the file
+
+ foo.cmake
+
+ Did you miss 'APPEND' keyword\?
+Call Stack \(most recent call first\):
+ Repeat-CMP0103-NEW.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+
+
+CMake Error at Repeat/CMakeLists.txt:[0-9]+ \(export\):
+ export command already specified for the file
+
+ .+/foo.cmake
+
+ Did you miss 'APPEND' keyword\?
diff --git a/Tests/RunCMake/export/Repeat-CMP0103-NEW.cmake b/Tests/RunCMake/export/Repeat-CMP0103-NEW.cmake
new file mode 100644
index 000000000..69381df4e
--- /dev/null
+++ b/Tests/RunCMake/export/Repeat-CMP0103-NEW.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0103 NEW)
+include(Repeat.cmake)
diff --git a/Tests/RunCMake/export/Repeat-CMP0103-OLD.cmake b/Tests/RunCMake/export/Repeat-CMP0103-OLD.cmake
new file mode 100644
index 000000000..25134d6c8
--- /dev/null
+++ b/Tests/RunCMake/export/Repeat-CMP0103-OLD.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0103 OLD)
+include(Repeat.cmake)
diff --git a/Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt b/Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt
new file mode 100644
index 000000000..28e849d06
--- /dev/null
+++ b/Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt
@@ -0,0 +1,26 @@
+CMake Warning \(dev\) at Repeat.cmake:[0-9]+ \(export\):
+ Policy CMP0103 is not set: Multiple export\(\) with same FILE without APPEND
+ is not allowed. Run "cmake --help-policy CMP0103" for policy details. Use
+ the cmake_policy command to set the policy and suppress this warning.
+
+ export\(\) command already specified for the file
+
+ foo.cmake
+
+ Did you miss 'APPEND' keyword\?
+Call Stack \(most recent call first\):
+ Repeat-CMP0103-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 Repeat/CMakeLists.txt:[0-9]+ \(export\):
+ Policy CMP0103 is not set: Multiple export\(\) with same FILE without APPEND
+ is not allowed. Run "cmake --help-policy CMP0103" for policy details. Use
+ the cmake_policy command to set the policy and suppress this warning.
+
+ export\(\) command already specified for the file
+
+ .+/foo.cmake
+
+ Did you miss 'APPEND' keyword\?
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/export/Repeat-CMP0103-WARN.cmake b/Tests/RunCMake/export/Repeat-CMP0103-WARN.cmake
new file mode 100644
index 000000000..3a630c5d2
--- /dev/null
+++ b/Tests/RunCMake/export/Repeat-CMP0103-WARN.cmake
@@ -0,0 +1 @@
+include(Repeat.cmake)
diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake
index df35d959d..1c747623a 100644
--- a/Tests/RunCMake/export/RunCMakeTest.cmake
+++ b/Tests/RunCMake/export/RunCMakeTest.cmake
@@ -2,7 +2,9 @@ include(RunCMake)
run_cmake(CustomTarget)
run_cmake(Empty)
-run_cmake(Repeat)
+run_cmake(Repeat-CMP0103-WARN)
+run_cmake(Repeat-CMP0103-OLD)
+run_cmake(Repeat-CMP0103-NEW)
run_cmake(TargetNotFound)
run_cmake(AppendExport)
run_cmake(OldIface)
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt
new file mode 100644
index 000000000..2632ffa91
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
new file mode 100644
index 000000000..763d57ce3
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/RunCMakeTest.cmake
@@ -0,0 +1,55 @@
+cmake_minimum_required(VERSION 3.16)
+include(RunCMake)
+
+# Function to build and install a project.
+function(run_install_test case)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${case})
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug)
+ # Check "all" components.
+ set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-all)
+ run_cmake_command(${case}-all ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -P cmake_install.cmake)
+endfunction()
+
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
+ if(NOT CMake_INSTALL_NAME_TOOL_BUG)
+ run_install_test(macos)
+ run_install_test(macos-unresolved)
+ run_install_test(macos-conflict)
+ run_install_test(macos-notfile)
+ endif()
+ run_cmake(project)
+ run_cmake(badargs1)
+ run_cmake(badargs2)
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
+ run_install_test(windows)
+ run_install_test(windows-unresolved)
+ run_install_test(windows-conflict)
+ run_install_test(windows-notfile)
+ run_cmake(project)
+ run_cmake(badargs1)
+ run_cmake(badargs2)
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ if(DEFINED ENV{LDFLAGS})
+ # Some setups prebake disable-new-dtags into LDFLAGS
+ string(REPLACE "-Wl,--disable-new-dtags" "" new_ldflags "$ENV{LDFLAGS}")
+ set(ENV{LDFLAGS} "${new_ldflags}")
+ endif()
+
+ if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL")
+ run_install_test(linux)
+ endif()
+ run_install_test(linux-unresolved)
+ run_install_test(linux-conflict)
+ run_install_test(linux-notfile)
+ run_cmake(project)
+ run_cmake(badargs1)
+ run_cmake(badargs2)
+else()
+ run_cmake(unsupported)
+endif()
+
+run_install_test(variable-propagation)
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-stderr.txt
new file mode 100644
index 000000000..087447356
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1-stderr.txt
@@ -0,0 +1,18 @@
+^CMake Warning \(dev\) at badargs1\.cmake:[0-9]+ \(file\):
+ You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
+ probably not what you intended to do\. Instead, please consider using it in
+ an install\(CODE\) or install\(SCRIPT\) command\. For example:
+
+ install\(CODE \[\[
+ file\(GET_RUNTIME_DEPENDENCIES
+ # \.\.\.
+ \)
+ ]]\)
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
+
+CMake Error at badargs1\.cmake:[0-9]+ \(file\):
+ file Unrecognized argument: "invalid"
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1.cmake
index f3b8ce472..f3b8ce472 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs1.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt
new file mode 100644
index 000000000..c6ad3d090
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2-stderr.txt
@@ -0,0 +1,23 @@
+^CMake Warning \(dev\) at badargs2\.cmake:[0-9]+ \(file\):
+ You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
+ probably not what you intended to do\. Instead, please consider using it in
+ an install\(CODE\) or install\(SCRIPT\) command\. For example:
+
+ install\(CODE \[\[
+ file\(GET_RUNTIME_DEPENDENCIES
+ # \.\.\.
+ \)
+ ]]\)
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
+
+CMake Error at badargs2\.cmake:[0-9]+ \(file\):
+ file Keywords missing values:
+
+ RESOLVED_DEPENDENCIES_VAR
+ UNRESOLVED_DEPENDENCIES_VAR
+ CONFLICTING_DEPENDENCIES_PREFIX
+ BUNDLE_EXECUTABLE
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2.cmake
index ac6af8576..ac6af8576 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/badargs2.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake
new file mode 100644
index 000000000..381b60291
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-check.cmake
@@ -0,0 +1,44 @@
+function(check_contents filename contents_regex)
+ if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
+ file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
+ if(NOT contents MATCHES "${contents_regex}")
+ string(APPEND RunCMake_TEST_FAILED "File contents:
+ ${contents}
+do not match what we expected:
+ ${contents_regex}
+in file:
+ ${CMAKE_INSTALL_PREFIX}/${filename}\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+set(_check
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/libtest_rpath\.so]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/libtest_runpath\.so]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath/librpath\.so]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_parent/librpath_parent\.so]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search/librpath_search\.so]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath/librunpath\.so]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search/librunpath_search\.so]]
+ )
+check_contents(deps/deps1.txt "^${_check}$")
+check_contents(deps/deps2.txt "^${_check}$")
+check_contents(deps/deps3.txt "^${_check}$")
+set(_check
+ [[librpath_unresolved\.so]]
+ [[librunpath_parent_unresolved\.so]]
+ [[librunpath_unresolved\.so]]
+ )
+check_contents(deps/udeps1.txt "^${_check}$")
+check_contents(deps/udeps2.txt "^${_check}$")
+check_contents(deps/udeps3.txt "^${_check}$")
+set(_check
+ "^libconflict\\.so:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+ )
+check_contents(deps/cdeps1.txt "${_check}")
+check_contents(deps/cdeps2.txt "${_check}")
+check_contents(deps/cdeps3.txt "${_check}")
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-stderr.txt
new file mode 100644
index 000000000..aeb57361f
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-all-stderr.txt
@@ -0,0 +1,119 @@
+^CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/rpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-build/root-all/lib/runpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)$
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-stderr.txt
new file mode 100644
index 000000000..a6b65df53
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-all-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Multiple conflicting paths found for librpath\.so:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-build/root-all/lib/rpath1/librpath\.so
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict-build/root-all/lib/rpath2/librpath\.so$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict.cmake
index f7194995d..f7194995d 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-conflict.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt
new file mode 100644
index 000000000..d9758c579
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-all-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Failed to run objdump on:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile-build/root-all/bin/\.\./lib/libtest\.so$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake
index 6567438a2..6567438a2 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-notfile.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt
index eaca5121b..eaca5121b 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved-all-stderr.txt
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved.cmake
index 3efa305be..3efa305be 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux-unresolved.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux.cmake
new file mode 100644
index 000000000..d82d8fbb5
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux.cmake
@@ -0,0 +1,169 @@
+enable_language(C)
+cmake_policy(SET CMP0095 NEW)
+
+set(test_rpath_names
+ preexcluded
+ rpath_postexcluded
+ rpath
+ rpath_parent_postexcluded
+ rpath_parent
+ rpath_origin_postexcluded
+ rpath_origin
+ rpath_search_postexcluded
+ rpath_search
+ rpath_unresolved
+ conflict
+ )
+set(test_runpath_names
+ runpath_postexcluded
+ runpath
+ runpath_origin_postexcluded
+ runpath_origin
+ runpath_parent_unresolved
+ runpath_search_postexcluded
+ runpath_search
+ runpath_unresolved
+ )
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test_rpath.c")
+add_library(test_rpath SHARED "${CMAKE_BINARY_DIR}/test_rpath.c")
+foreach(name ${test_rpath_names})
+ file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
+ add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
+
+ file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "void test_rpath(void)\n{\n")
+foreach(name ${test_rpath_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "}\n")
+
+install(TARGETS rpath_postexcluded DESTINATION lib/rpath_postexcluded)
+install(TARGETS rpath DESTINATION lib/rpath)
+install(TARGETS rpath_origin_postexcluded DESTINATION lib/rpath_origin_postexcluded)
+install(TARGETS rpath_origin DESTINATION lib/rpath_origin)
+install(TARGETS rpath_parent_postexcluded DESTINATION lib/rpath_parent_postexcluded)
+install(TARGETS rpath rpath_origin rpath_parent DESTINATION lib/rpath_parent)
+install(TARGETS rpath_search_postexcluded DESTINATION lib/rpath_search_postexcluded)
+install(TARGETS rpath rpath_origin rpath_parent rpath_search DESTINATION lib/rpath_search)
+install(TARGETS conflict DESTINATION lib/conflict)
+
+target_link_libraries(test_rpath PRIVATE ${test_rpath_names})
+set_property(TARGET test_rpath PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded"
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath"
+ "\$ORIGIN/rpath_origin_postexcluded"
+ "\${ORIGIN}/rpath_origin"
+ "${CMAKE_BINARY_DIR}/root-all/lib/conflict"
+ )
+target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags)
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test_runpath.c")
+add_library(test_runpath SHARED "${CMAKE_BINARY_DIR}/test_runpath.c")
+foreach(name ${test_runpath_names} rpath conflict)
+ file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
+ if(NOT name MATCHES "^(rpath|conflict)$")
+ add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
+ endif()
+
+ file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "void test_runpath(void)\n{\n")
+foreach(name ${test_runpath_names} rpath conflict)
+ file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "}\n")
+
+install(TARGETS runpath_postexcluded DESTINATION lib/runpath_postexcluded)
+install(TARGETS runpath DESTINATION lib/runpath)
+install(TARGETS runpath_origin_postexcluded DESTINATION lib/runpath_origin_postexcluded)
+install(TARGETS runpath_origin DESTINATION lib/runpath_origin)
+install(TARGETS runpath_parent_unresolved DESTINATION lib/runpath_parent_unresolved)
+install(TARGETS runpath_search_postexcluded DESTINATION lib/runpath_search_postexcluded)
+install(TARGETS runpath runpath_origin runpath_search DESTINATION lib/runpath_search)
+install(TARGETS conflict DESTINATION lib/conflict2)
+
+target_link_libraries(test_runpath PRIVATE ${test_runpath_names} rpath conflict)
+set_property(TARGET test_runpath PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly
+ "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded"
+ "${CMAKE_BINARY_DIR}/root-all/lib/runpath"
+ "\${ORIGIN}/runpath_origin_postexcluded"
+ "\$ORIGIN/runpath_origin"
+ "${CMAKE_BINARY_DIR}/root-all/lib/conflict2"
+ )
+target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags)
+
+set_property(TARGET test_rpath ${test_rpath_names} test_runpath ${test_runpath_names} PROPERTY LIBRARY_OUTPUT_DIRECTORY lib)
+install(TARGETS test_rpath test_runpath DESTINATION lib)
+
+add_executable(topexe linux/topexe.c)
+add_library(toplib SHARED linux/toplib.c)
+add_library(topmod MODULE linux/toplib.c)
+target_link_libraries(topexe PRIVATE test_rpath test_runpath)
+target_link_libraries(toplib PRIVATE test_rpath test_runpath)
+target_link_libraries(topmod PRIVATE test_rpath test_runpath)
+set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib"
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent_postexcluded"
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent"
+ "${CMAKE_BINARY_DIR}/root-all/lib/runpath_parent_unresolved"
+ )
+target_link_options(topexe PRIVATE -Wl,--disable-new-dtags)
+target_link_options(toplib PRIVATE -Wl,--disable-new-dtags)
+target_link_options(topmod PRIVATE -Wl,--disable-new-dtags)
+
+install(TARGETS topexe toplib RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
+install(TARGETS topmod LIBRARY DESTINATION lib/modules)
+
+install(CODE [[
+ function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
+ file(GET_RUNTIME_DEPENDENCIES
+ RESOLVED_DEPENDENCIES_VAR deps
+ UNRESOLVED_DEPENDENCIES_VAR udeps
+ CONFLICTING_DEPENDENCIES_PREFIX cdeps
+ PRE_INCLUDE_REGEXES
+ "^lib(test_rpath|rpath_postexcluded|rpath|rpath_parent_postexcluded|rpath_parent|rpath_origin_postexcluded|rpath_origin|rpath_search_postexcluded|rpath_search|rpath_unresolved|test_runpath|runpath_postexcluded|runpath|runpath_origin_postexcluded|runpath_origin|runpath_parent_unresolved|runpath_search_postexcluded|runpath_search|runpath_unresolved|conflict)\\.so$"
+ "^libc\\.so"
+ PRE_EXCLUDE_REGEXES ".*"
+ POST_INCLUDE_REGEXES "^.*/(libtest_rpath|rpath/librpath|rpath_parent/librpath_parent|rpath_search/librpath_search|libtest_runpath|runpath/librunpath|runpath_origin_postexcluded|runpath_origin|runpath_search/librunpath_search|conflict2?/libconflict)\\.so$"
+ POST_EXCLUDE_REGEXES ".*"
+ DIRECTORIES
+ "${CMAKE_INSTALL_PREFIX}/lib/rpath_search_postexcluded"
+ "${CMAKE_INSTALL_PREFIX}/lib/rpath_search"
+ "${CMAKE_INSTALL_PREFIX}/lib/runpath_search_postexcluded"
+ "${CMAKE_INSTALL_PREFIX}/lib/runpath_search"
+ ${ARGN}
+ )
+ list(SORT deps)
+ list(SORT udeps)
+ list(SORT cdeps_FILENAMES)
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
+ foreach(cdep IN LISTS cdeps_FILENAMES)
+ set(cdep_values ${cdeps_${cdep}})
+ list(SORT cdep_values)
+ file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
+ endforeach()
+ endfunction()
+
+ exec_get_runtime_dependencies(
+ deps1.txt udeps1.txt cdeps1.txt
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topexe>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps2.txt udeps2.txt cdeps2.txt
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:toplib>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps3.txt udeps3.txt cdeps3.txt
+ MODULES
+ "${CMAKE_INSTALL_PREFIX}/lib/modules/$<TARGET_FILE_NAME:topmod>"
+ )
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/topexe.c
index d196afe0d..d196afe0d 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/topexe.c
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/toplib.c
index 040e59191..040e59191 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/linux/toplib.c
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake
new file mode 100644
index 000000000..e6f2623c5
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-all-check.cmake
@@ -0,0 +1,159 @@
+function(check_contents filename contents_regex)
+ if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
+ file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
+ if(NOT contents MATCHES "${contents_regex}")
+ string(APPEND RunCMake_TEST_FAILED "File contents:
+ ${contents}
+do not match what we expected:
+ ${contents_regex}
+in file:
+ ${CMAKE_INSTALL_PREFIX}/${filename}\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(set_with_libsystem var)
+ set(_tmp "${ARGN}")
+ if(EXISTS "/usr/lib/libSystem.B.dylib")
+ list(APPEND _tmp [[/usr/lib/libSystem\.B\.dylib]])
+ endif()
+ set("${var}" "${_tmp}" PARENT_SCOPE)
+endfunction()
+
+set_with_libsystem(_check
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ )
+check_contents(deps/deps1.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps1.txt "^${_check}$")
+
+set_with_libsystem(_check
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ )
+check_contents(deps/deps2.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
+ [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_executable_path_postexcluded\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps2.txt "^${_check}$")
+
+set_with_libsystem(_check
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ )
+check_contents(deps/deps3.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
+ [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_executable_path_postexcluded\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps3.txt "^${_check}$")
+
+set_with_libsystem(_check
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ )
+check_contents(deps/deps4.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps4.txt "^${_check}$")
+
+set_with_libsystem(_check
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ )
+check_contents(deps/deps5.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps5.txt "^${_check}$")
+
+set_with_libsystem(_check
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ )
+check_contents(deps/deps6.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps6.txt "^${_check}$")
+
+set(_check
+ "^libconflict\\.dylib:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$"
+ )
+check_contents(deps/cdeps1.txt "${_check}")
+check_contents(deps/cdeps2.txt "${_check}")
+check_contents(deps/cdeps3.txt "${_check}")
+check_contents(deps/cdeps4.txt "${_check}")
+check_contents(deps/cdeps5.txt "${_check}")
+check_contents(deps/cdeps6.txt "${_check}")
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-stderr.txt
new file mode 100644
index 000000000..d8323a8a0
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-all-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Multiple conflicting paths found for librpath\.dylib:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-build/root-all/lib/rpath1/librpath\.dylib
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict-build/root-all/lib/rpath2/librpath\.dylib$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict.cmake
index a8446fe2d..a8446fe2d 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-conflict.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-stderr.txt
new file mode 100644
index 000000000..1afc1b106
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-all-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Failed to run otool on:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile-build/root-all/bin/\.\./lib/libtest\.dylib$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile.cmake
index 3e4c43423..3e4c43423 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-notfile.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt
index 01762b45f..01762b45f 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved-all-stderr.txt
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved.cmake
index c9b6c9559..c9b6c9559 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos-unresolved.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake
new file mode 100644
index 000000000..c56a14b6c
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos.cmake
@@ -0,0 +1,216 @@
+enable_language(C)
+
+set(testlib_names
+ preexcluded
+ executable_path
+ executable_path_bundle
+ executable_path_postexcluded
+ loader_path
+ loader_path_unresolved
+ loader_path_postexcluded
+ rpath
+ rpath_unresolved
+ rpath_postexcluded
+ rpath_executable_path
+ rpath_executable_path_bundle
+ rpath_executable_path_postexcluded
+ rpath_loader_path
+ rpath_loader_path_unresolved
+ rpath_loader_path_postexcluded
+ normal
+ normal_unresolved
+ normal_postexcluded
+ conflict
+ )
+
+file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c")
+add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
+foreach(name ${testlib_names})
+ if(name STREQUAL "normal")
+ file(WRITE "${CMAKE_BINARY_DIR}/normal.c" "extern void rpath(void);\nvoid normal(void)\n{\n rpath();\n}\n")
+ else()
+ file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
+ endif()
+ add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
+
+ file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "void testlib(void)\n{\n")
+foreach(name ${testlib_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n")
+set_property(TARGET ${testlib_names} PROPERTY BUILD_WITH_INSTALL_NAME_DIR 1)
+target_link_libraries(normal PRIVATE rpath)
+set_property(TARGET normal PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/normal/../rpath"
+ )
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "extern void conflict(void);\nvoid testlib_conflict(void)\n{\n conflict();\n}\n")
+add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c")
+target_link_libraries(testlib_conflict PRIVATE conflict)
+
+set_property(TARGET testlib PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath"
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_unresolved"
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_postexcluded"
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict"
+ @executable_path/../lib/rpath_executable_path
+ @executable_path/../lib/rpath_executable_path_unresolved
+ @executable_path/../lib/rpath_executable_path_postexcluded
+ @loader_path/rpath_loader_path
+ @loader_path/rpath_loader_path_unresolved
+ @loader_path/rpath_loader_path_postexcluded
+ )
+set_property(TARGET testlib_conflict PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict2"
+ )
+
+foreach(t
+ executable_path
+ executable_path_postexcluded
+ loader_path
+ loader_path_postexcluded
+ rpath
+ rpath_postexcluded
+ rpath_executable_path
+ rpath_executable_path_postexcluded
+ rpath_loader_path
+ rpath_loader_path_postexcluded
+ conflict
+ )
+ install(TARGETS ${t} DESTINATION executable/lib/${t})
+endforeach()
+install(TARGETS conflict DESTINATION executable/lib/conflict2)
+
+foreach(t
+ executable_path_bundle
+ executable_path_postexcluded
+ loader_path_postexcluded
+ rpath_postexcluded
+ rpath_executable_path_bundle
+ rpath_executable_path_postexcluded
+ rpath_loader_path_postexcluded
+ )
+ install(TARGETS ${t} DESTINATION bundle_executable/lib/${t})
+endforeach()
+
+foreach(t executable_path executable_path_bundle executable_path_postexcluded)
+ set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @executable_path/../lib/${t})
+endforeach()
+
+foreach(t loader_path loader_path_unresolved loader_path_postexcluded)
+ set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @loader_path/${t})
+endforeach()
+
+foreach(t
+ rpath
+ rpath_unresolved
+ rpath_postexcluded
+ rpath_executable_path
+ rpath_executable_path_bundle
+ rpath_executable_path_postexcluded
+ rpath_loader_path
+ rpath_loader_path_unresolved
+ rpath_loader_path_postexcluded
+ conflict
+ )
+ set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @rpath)
+endforeach()
+
+foreach(t normal normal_unresolved normal_postexcluded)
+ set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR "${CMAKE_BINARY_DIR}/root-all/executable/lib/${t}")
+ if(NOT t STREQUAL "normal_unresolved")
+ install(TARGETS ${t} DESTINATION executable/lib/${t})
+ endif()
+endforeach()
+
+target_link_libraries(testlib PRIVATE ${testlib_names})
+
+add_executable(topexe macos/topexe.c)
+add_library(toplib SHARED macos/toplib.c)
+add_library(topmod MODULE macos/toplib.c)
+target_link_libraries(topexe PRIVATE testlib)
+target_link_libraries(toplib PRIVATE testlib)
+target_link_libraries(topmod PRIVATE testlib)
+
+set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib")
+
+install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib)
+install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib)
+
+install(CODE [[
+ function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
+ file(GET_RUNTIME_DEPENDENCIES
+ RESOLVED_DEPENDENCIES_VAR deps
+ UNRESOLVED_DEPENDENCIES_VAR udeps
+ CONFLICTING_DEPENDENCIES_PREFIX cdeps
+ PRE_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|executable_path_postexcluded|loader_path|loader_path_unresolved|loader_path_postexcluded|rpath|rpath_unresolved|rpath_postexcluded|rpath_executable_path|rpath_executable_path_bundle|rpath_executable_path_postexcluded|rpath_loader_path|rpath_loader_path_unresolved|rpath_loader_path_postexcluded|normal|normal_unresolved|normal_postexcluded|conflict|System\\.B)\\.dylib$"
+ PRE_EXCLUDE_REGEXES ".*"
+ POST_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|loader_path|rpath|rpath_executable_path|rpath_executable_path_bundle|rpath_loader_path|normal|conflict|System\\.B)\\.dylib$"
+ POST_EXCLUDE_REGEXES ".*"
+ ${ARGN}
+ )
+ list(SORT deps)
+ list(SORT udeps)
+ list(SORT cdeps_FILENAMES)
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
+ foreach(cdep IN LISTS cdeps_FILENAMES)
+ set(cdep_values ${cdeps_${cdep}})
+ list(SORT cdep_values)
+ file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
+ endforeach()
+ endfunction()
+
+ exec_get_runtime_dependencies(
+ deps1.txt udeps1.txt cdeps1.txt
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/executable/bin/$<TARGET_FILE_NAME:topexe>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps2.txt udeps2.txt cdeps2.txt
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:toplib>"
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps3.txt udeps3.txt cdeps3.txt
+ MODULES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:topmod>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps4.txt udeps4.txt cdeps4.txt
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/executable/bin/$<TARGET_FILE_NAME:topexe>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ BUNDLE_EXECUTABLE
+ "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps5.txt udeps5.txt cdeps5.txt
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:toplib>"
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps6.txt udeps6.txt cdeps6.txt
+ MODULES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:topmod>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
+ )
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/topexe.c
index 20c608731..20c608731 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/topexe.c
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/toplib.c
index cff1bff3f..cff1bff3f 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/macos/toplib.c
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project-stderr.txt
new file mode 100644
index 000000000..f14a10dcb
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project-stderr.txt
@@ -0,0 +1,13 @@
+^CMake Warning \(dev\) at project\.cmake:[0-9]+ \(file\):
+ You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
+ probably not what you intended to do\. Instead, please consider using it in
+ an install\(CODE\) or install\(SCRIPT\) command\. For example:
+
+ install\(CODE \[\[
+ file\(GET_RUNTIME_DEPENDENCIES
+ # \.\.\.
+ \)
+ ]]\)
+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/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project.cmake
index 842d7abd7..842d7abd7 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/project.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-stderr.txt
new file mode 100644
index 000000000..000159f0b
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at unsupported\.cmake:[0-9]+ \(file\):
+ file GET_RUNTIME_DEPENDENCIES is not supported on system "[^
+ ]+"
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported.cmake
index b91eefef3..b91eefef3 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/unsupported.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-stderr.txt
new file mode 100644
index 000000000..591a5e7ab
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-all-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(message\):
+.*
+.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.*
+.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.*
+.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.*
+.*CMAKE_OBJDUMP: custom-objdump.*
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-stderr.txt
new file mode 100644
index 000000000..591a5e7ab
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation-dev-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(message\):
+.*
+.*CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: custom-platform.*
+.*CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: custom-platform-objdump.*
+.*CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: path/to/custom-objdump.*
+.*CMAKE_OBJDUMP: custom-objdump.*
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation.cmake
new file mode 100644
index 000000000..07bbc5ec4
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/variable-propagation.cmake
@@ -0,0 +1,17 @@
+enable_language(C)
+
+set(CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM "custom-platform")
+set(CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL "custom-platform-objdump")
+set(CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND "path/to/custom-objdump")
+set(CMAKE_OBJDUMP "custom-objdump")
+
+install(CODE [[
+message(FATAL_ERROR "
+ CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM: ${CMAKE_GET_RUNTIME_DEPENDENCIES_PLATFORM}
+ CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL: ${CMAKE_GET_RUNTIME_DEPENDENCIES_TOOL}
+ CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND: ${CMAKE_GET_RUNTIME_DEPENDENCIES_COMMAND}
+ CMAKE_OBJDUMP: ${CMAKE_OBJDUMP}
+")
+]]
+COMPONENT dev
+)
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-all-check.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-all-check.cmake
new file mode 100644
index 000000000..f1d70a109
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-all-check.cmake
@@ -0,0 +1,38 @@
+function(check_contents filename contents_regex)
+ if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
+ file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
+ if(NOT contents MATCHES "${contents_regex}")
+ string(APPEND RunCMake_TEST_FAILED "File contents:
+ ${contents}
+do not match what we expected:
+ ${contents_regex}
+in file:
+ ${CMAKE_INSTALL_PREFIX}/${filename}\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+set(_check
+ [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/\.conflict/\.\./(lib)?libdir\.dll]=]
+ [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/\.search/(lib)?search\.dll]=]
+ [=[[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/(lib)?testlib\.dll]=]
+ )
+check_contents(deps/deps1.txt "^${_check}$")
+check_contents(deps/deps2.txt "^${_check}$")
+check_contents(deps/deps3.txt "^${_check}$")
+set(_check
+ [=[(lib)?unresolved\.dll]=]
+ )
+check_contents(deps/udeps1.txt "^${_check}$")
+check_contents(deps/udeps2.txt "^${_check}$")
+check_contents(deps/udeps3.txt "^${_check}$")
+set(_check
+ "^(lib)?conflict\\.dll:[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/\\.conflict/(lib)?conflict\\.dll;[^;]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-build/root-all/bin/(lib)?conflict\\.dll\n$"
+ )
+check_contents(deps/cdeps1.txt "${_check}")
+check_contents(deps/cdeps2.txt "${_check}")
+check_contents(deps/cdeps3.txt "${_check}")
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-stderr.txt
new file mode 100644
index 000000000..c48c55dc2
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-all-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Multiple conflicting paths found for (lib)?path\.dll:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-build/root-all/lib/test1/(lib)?path\.dll
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict-build/root-all/lib/test2/(lib)?path\.dll$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict.cmake
index d41344375..d41344375 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-conflict.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-stderr.txt
new file mode 100644
index 000000000..33c0390c2
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-all-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Failed to run (dumpbin|objdump) on:
+
+ [^
+]*/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile-build/root-all/bin/(lib)?test\.dll$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile.cmake
index 6665a3b3e..6665a3b3e 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-notfile.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-result.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt
index a20654c5a..a20654c5a 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved-all-stderr.txt
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake
index 4cc74c70d..4cc74c70d 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows-unresolved.cmake
diff --git a/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake
new file mode 100644
index 000000000..9160ce5f2
--- /dev/null
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows.cmake
@@ -0,0 +1,114 @@
+enable_language(C)
+
+set(testlib_names
+ preexcluded
+ libdir_postexcluded
+ libdir
+ search_postexcluded
+ search
+ unresolved
+ conflict
+ )
+
+file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c")
+add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
+foreach(name ${testlib_names})
+ file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "__declspec(dllexport) void ${name}(void) {}\n")
+ add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
+
+ file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllexport) void testlib(void)\n{\n")
+foreach(name ${testlib_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n")
+
+target_link_libraries(testlib PRIVATE ${testlib_names})
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "__declspec(dllimport) extern void conflict(void);\n__declspec(dllexport) void testlib_conflict(void)\n{\n conflict();\n}\n")
+add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c")
+target_link_libraries(testlib_conflict PRIVATE conflict)
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib_noconflict.c" "__declspec(dllimport) extern void libdir(void);\n__declspec(dllexport) void testlib_noconflict(void)\n{\n libdir();\n}\n")
+add_library(testlib_noconflict SHARED "${CMAKE_BINARY_DIR}/testlib_noconflict.c")
+target_link_libraries(testlib_noconflict PRIVATE libdir)
+
+install(TARGETS testlib libdir_postexcluded libdir conflict testlib_noconflict DESTINATION bin)
+install(TARGETS libdir search_postexcluded search DESTINATION bin/.search) # Prefixing with "." ensures it is the first item after list(SORT)
+install(TARGETS testlib_conflict conflict DESTINATION bin/.conflict)
+
+add_executable(topexe windows/topexe.c)
+add_library(toplib SHARED windows/toplib.c)
+add_library(topmod MODULE windows/toplib.c)
+target_link_libraries(topexe PRIVATE testlib)
+target_link_libraries(toplib PRIVATE testlib)
+target_link_libraries(topmod PRIVATE testlib)
+
+install(TARGETS topexe toplib topmod DESTINATION bin)
+
+install(CODE [[
+ function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
+ file(GET_RUNTIME_DEPENDENCIES
+ RESOLVED_DEPENDENCIES_VAR deps
+ UNRESOLVED_DEPENDENCIES_VAR udeps
+ CONFLICTING_DEPENDENCIES_PREFIX cdeps
+ PRE_INCLUDE_REGEXES
+ "^(lib)?testlib\\.dll$"
+ "^(lib)?libdir_postexcluded\\.dll$"
+ "^(lib)?libdir\\.dll$"
+ "^(lib)?search_postexcluded\\.dll$"
+ "^(lib)?search\\.dll$"
+ "^(lib)?unresolved\\.dll$"
+ "^(lib)?conflict\\.dll$"
+ "^kernel32\\.dll$"
+ PRE_EXCLUDE_REGEXES ".*"
+ POST_INCLUDE_REGEXES
+ "^.*/(lib)?testlib\\.dll$"
+ "^.*/(lib)?libdir\\.dll$"
+ "^.*/(lib)?search\\.dll$"
+ "^.*/(lib)?conflict\\.dll$"
+ POST_EXCLUDE_REGEXES ".*"
+ DIRECTORIES
+ "${CMAKE_INSTALL_PREFIX}/bin/.search"
+ ${ARGN}
+ )
+ list(SORT deps)
+ list(SORT udeps)
+ list(SORT cdeps_FILENAMES)
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
+ foreach(cdep IN LISTS cdeps_FILENAMES)
+ set(cdep_values ${cdeps_${cdep}})
+ list(SORT cdep_values)
+ file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
+ endforeach()
+ endfunction()
+
+ exec_get_runtime_dependencies(
+ deps1.txt udeps1.txt cdeps1.txt
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topexe>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps2.txt udeps2.txt cdeps2.txt
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:toplib>"
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps3.txt udeps3.txt cdeps3.txt
+ MODULES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topmod>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
+ )
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/topexe.c
index 713b8eb41..713b8eb41 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/topexe.c
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/toplib.c
index 69971759e..69971759e 100644
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c
+++ b/Tests/RunCMake/file-GET_RUNTIME_DEPENDENCIES/windows/toplib.c
diff --git a/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set-result.txt b/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set-stderr.txt b/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set-stderr.txt
new file mode 100644
index 000000000..1552baa27
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at DOWNLOAD-tls-cainfo-not-set.cmake:[0-9]+ \(file\):
+ file DOWNLOAD missing file value for TLS_CAINFO.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set.cmake b/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set.cmake
new file mode 100644
index 000000000..b47642596
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-tls-cainfo-not-set.cmake
@@ -0,0 +1 @@
+file(DOWNLOAD "" "" TLS_CAINFO)
diff --git a/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set-result.txt b/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set-stderr.txt b/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set-stderr.txt
new file mode 100644
index 000000000..2f46c0ca1
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at DOWNLOAD-tls-verify-not-set.cmake:[0-9]+ \(file\):
+ file DOWNLOAD missing bool value for TLS_VERIFY.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set.cmake b/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set.cmake
new file mode 100644
index 000000000..919368c68
--- /dev/null
+++ b/Tests/RunCMake/file/DOWNLOAD-tls-verify-not-set.cmake
@@ -0,0 +1 @@
+file(DOWNLOAD "" "" TLS_VERIFY)
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index f5461ad8a..a4de1d3ee 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -8,6 +8,8 @@ run_cmake(DOWNLOAD-hash-mismatch)
run_cmake(DOWNLOAD-unused-argument)
run_cmake(DOWNLOAD-httpheader-not-set)
run_cmake(DOWNLOAD-netrc-bad)
+run_cmake(DOWNLOAD-tls-cainfo-not-set)
+run_cmake(DOWNLOAD-tls-verify-not-set)
run_cmake(DOWNLOAD-pass-not-set)
run_cmake(TOUCH)
run_cmake(TOUCH-error-in-source-directory)
@@ -15,6 +17,8 @@ run_cmake(TOUCH-error-missing-directory)
run_cmake(UPLOAD-unused-argument)
run_cmake(UPLOAD-httpheader-not-set)
run_cmake(UPLOAD-netrc-bad)
+run_cmake(UPLOAD-tls-cainfo-not-set)
+run_cmake(UPLOAD-tls-verify-not-set)
run_cmake(UPLOAD-pass-not-set)
run_cmake(INSTALL-DIRECTORY)
run_cmake(INSTALL-FILES_FROM_DIR)
diff --git a/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set-result.txt b/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set-stderr.txt b/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set-stderr.txt
new file mode 100644
index 000000000..a5fa4e8c5
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at UPLOAD-tls-cainfo-not-set.cmake:[0-9]+ \(file\):
+ file UPLOAD missing file value for TLS_CAINFO.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set.cmake b/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set.cmake
new file mode 100644
index 000000000..8eb7c830c
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-tls-cainfo-not-set.cmake
@@ -0,0 +1 @@
+file(UPLOAD "" "" TLS_CAINFO)
diff --git a/Tests/RunCMake/file/UPLOAD-tls-verify-not-set-result.txt b/Tests/RunCMake/file/UPLOAD-tls-verify-not-set-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-tls-verify-not-set-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/file/UPLOAD-tls-verify-not-set-stderr.txt b/Tests/RunCMake/file/UPLOAD-tls-verify-not-set-stderr.txt
new file mode 100644
index 000000000..c4dffcdf2
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-tls-verify-not-set-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at UPLOAD-tls-verify-not-set.cmake:[0-9]+ \(file\):
+ file UPLOAD missing bool value for TLS_VERIFY.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/file/UPLOAD-tls-verify-not-set.cmake b/Tests/RunCMake/file/UPLOAD-tls-verify-not-set.cmake
new file mode 100644
index 000000000..8b9d293be
--- /dev/null
+++ b/Tests/RunCMake/file/UPLOAD-tls-verify-not-set.cmake
@@ -0,0 +1 @@
+file(UPLOAD "" "" TLS_VERIFY)
diff --git a/Tests/RunCMake/find_file/Required-result.txt b/Tests/RunCMake/find_file/Required-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/find_file/Required-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/find_file/Required-stderr.txt b/Tests/RunCMake/find_file/Required-stderr.txt
new file mode 100644
index 000000000..f9c337c83
--- /dev/null
+++ b/Tests/RunCMake/find_file/Required-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at Required.cmake:9 \(find_file\):
+ Could not find FILE_doNotExists using the following files: doNotExists.h
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_file/Required-stdout.txt b/Tests/RunCMake/find_file/Required-stdout.txt
new file mode 100644
index 000000000..87a8e86d2
--- /dev/null
+++ b/Tests/RunCMake/find_file/Required-stdout.txt
@@ -0,0 +1 @@
+-- FILE_exists='[^']*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
diff --git a/Tests/RunCMake/find_file/Required.cmake b/Tests/RunCMake/find_file/Required.cmake
new file mode 100644
index 000000000..9cf092777
--- /dev/null
+++ b/Tests/RunCMake/find_file/Required.cmake
@@ -0,0 +1,12 @@
+find_file(FILE_exists
+ NAMES PrefixInPATH.h
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/include
+ NO_DEFAULT_PATH
+ REQUIRED
+ )
+message(STATUS "FILE_exists='${FILE_exists}'")
+
+find_file(FILE_doNotExists
+ NAMES doNotExists.h
+ REQUIRED
+ )
diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake
index 9f56a570f..93dfb7870 100644
--- a/Tests/RunCMake/find_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake
@@ -3,3 +3,4 @@ include(RunCMake)
run_cmake(FromPATHEnv)
run_cmake(FromPrefixPath)
run_cmake(PrefixInPATH)
+run_cmake(Required)
diff --git a/Tests/RunCMake/find_library/LibSymLink-stderr.txt b/Tests/RunCMake/find_library/LibSymLink-stderr.txt
new file mode 100644
index 000000000..8a2f088a9
--- /dev/null
+++ b/Tests/RunCMake/find_library/LibSymLink-stderr.txt
@@ -0,0 +1,2 @@
+^SYMLINK_LIBRARY='SYMLINK_LIBRARY-NOTFOUND'
+SYMLINK_LIBRARY='[^']*/Tests/RunCMake/find_library/LibSymLink-build/lib/libsymlink.a'$
diff --git a/Tests/RunCMake/find_library/LibSymLink.cmake b/Tests/RunCMake/find_library/LibSymLink.cmake
new file mode 100644
index 000000000..8ee4b75bd
--- /dev/null
+++ b/Tests/RunCMake/find_library/LibSymLink.cmake
@@ -0,0 +1,17 @@
+list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
+list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
+file(CREATE_LINK "libsymlinked.a" "${CMAKE_CURRENT_BINARY_DIR}/lib/libsymlink.a" SYMBOLIC)
+find_library(SYMLINK_LIBRARY
+ NAMES symlink
+ PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib
+ NO_DEFAULT_PATH
+ )
+message("SYMLINK_LIBRARY='${SYMLINK_LIBRARY}'")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libsymlinked.a" "symlinked")
+find_library(SYMLINK_LIBRARY
+ NAMES symlink
+ PATHS ${CMAKE_CURRENT_BINARY_DIR}/lib
+ NO_DEFAULT_PATH
+ )
+message("SYMLINK_LIBRARY='${SYMLINK_LIBRARY}'")
diff --git a/Tests/RunCMake/find_library/Required-result.txt b/Tests/RunCMake/find_library/Required-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/find_library/Required-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/find_library/Required-stderr.txt b/Tests/RunCMake/find_library/Required-stderr.txt
new file mode 100644
index 000000000..545d16454
--- /dev/null
+++ b/Tests/RunCMake/find_library/Required-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at Required.cmake:11 \(find_library\):
+ Could not find LIB_doNotExists using the following names: doNotExists
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_library/Required-stdout.txt b/Tests/RunCMake/find_library/Required-stdout.txt
new file mode 100644
index 000000000..b88ab791c
--- /dev/null
+++ b/Tests/RunCMake/find_library/Required-stdout.txt
@@ -0,0 +1 @@
+-- LIB_exists='[^']*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
diff --git a/Tests/RunCMake/find_library/Required.cmake b/Tests/RunCMake/find_library/Required.cmake
new file mode 100644
index 000000000..78c9f878e
--- /dev/null
+++ b/Tests/RunCMake/find_library/Required.cmake
@@ -0,0 +1,14 @@
+list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
+list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
+find_library(LIB_exists
+ NAMES PrefixInPATH
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/lib
+ NO_DEFAULT_PATH
+ REQUIRED
+ )
+message(STATUS "LIB_exists='${LIB_exists}'")
+
+find_library(LIB_doNotExists
+ NAMES doNotExists
+ REQUIRED
+ )
diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake
index 643a5b9b4..c7d69e401 100644
--- a/Tests/RunCMake/find_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake
@@ -3,7 +3,9 @@ include(RunCMake)
run_cmake(Created)
run_cmake(FromPrefixPath)
run_cmake(FromPATHEnv)
-if(CMAKE_HOST_UNIX)
+if(UNIX AND NOT CYGWIN)
run_cmake(LibArchLink)
+ run_cmake(LibSymLink)
endif()
run_cmake(PrefixInPATH)
+run_cmake(Required)
diff --git a/Tests/RunCMake/find_path/Required-result.txt b/Tests/RunCMake/find_path/Required-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/find_path/Required-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/find_path/Required-stderr.txt b/Tests/RunCMake/find_path/Required-stderr.txt
new file mode 100644
index 000000000..db65c2f15
--- /dev/null
+++ b/Tests/RunCMake/find_path/Required-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at Required.cmake:9 \(find_path\):
+ Could not find PATH_doNotExists using the following files: doNotExists.h
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_path/Required-stdout.txt b/Tests/RunCMake/find_path/Required-stdout.txt
new file mode 100644
index 000000000..225fcab12
--- /dev/null
+++ b/Tests/RunCMake/find_path/Required-stdout.txt
@@ -0,0 +1 @@
+-- PATH_exists='[^']*/Tests/RunCMake/find_path/include'
diff --git a/Tests/RunCMake/find_path/Required.cmake b/Tests/RunCMake/find_path/Required.cmake
new file mode 100644
index 000000000..172dc11d9
--- /dev/null
+++ b/Tests/RunCMake/find_path/Required.cmake
@@ -0,0 +1,12 @@
+find_path(PATH_exists
+ NAMES PrefixInPATH.h
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/include
+ NO_DEFAULT_PATH
+ REQUIRED
+ )
+message(STATUS "PATH_exists='${PATH_exists}'")
+
+find_path(PATH_doNotExists
+ NAMES doNotExists.h
+ REQUIRED
+ )
diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake
index ed55f5107..5c919bb66 100644
--- a/Tests/RunCMake/find_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake
@@ -3,6 +3,7 @@ include(RunCMake)
run_cmake(EmptyOldStyle)
run_cmake(FromPATHEnv)
run_cmake(PrefixInPATH)
+run_cmake(Required)
if(APPLE)
run_cmake(FrameworksWithSubdirs)
diff --git a/Tests/RunCMake/find_program/ExeNoRead-stdout.txt b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt
new file mode 100644
index 000000000..f2311782d
--- /dev/null
+++ b/Tests/RunCMake/find_program/ExeNoRead-stdout.txt
@@ -0,0 +1 @@
+-- ExeNoRead_EXECUTABLE='ExeNoRead_EXECUTABLE-NOTFOUND'
diff --git a/Tests/RunCMake/find_program/ExeNoRead.cmake b/Tests/RunCMake/find_program/ExeNoRead.cmake
new file mode 100644
index 000000000..7e22dc5b3
--- /dev/null
+++ b/Tests/RunCMake/find_program/ExeNoRead.cmake
@@ -0,0 +1,4 @@
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead" "#!/bin/sh\n")
+execute_process(COMMAND chmod -r+x "${CMAKE_CURRENT_BINARY_DIR}/ExeNoRead")
+find_program(ExeNoRead_EXECUTABLE NAMES ExeNoRead NO_DEFAULT_PATH PATHS "${CMAKE_CURRENT_BINARY_DIR}")
+message(STATUS "ExeNoRead_EXECUTABLE='${ExeNoRead_EXECUTABLE}'")
diff --git a/Tests/RunCMake/find_program/Required-result.txt b/Tests/RunCMake/find_program/Required-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/find_program/Required-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/find_program/Required-stderr.txt b/Tests/RunCMake/find_program/Required-stderr.txt
new file mode 100644
index 000000000..214a8d4ab
--- /dev/null
+++ b/Tests/RunCMake/find_program/Required-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at Required.cmake:9 \(find_program\):
+ Could not find PROG_AandB using the following names: testAandB
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/find_program/Required-stdout.txt b/Tests/RunCMake/find_program/Required-stdout.txt
new file mode 100644
index 000000000..3c8f1b552
--- /dev/null
+++ b/Tests/RunCMake/find_program/Required-stdout.txt
@@ -0,0 +1 @@
+-- PROG_A='[^']*/Tests/RunCMake/find_program/A/testA'
diff --git a/Tests/RunCMake/find_program/Required.cmake b/Tests/RunCMake/find_program/Required.cmake
new file mode 100644
index 000000000..a75aa53cf
--- /dev/null
+++ b/Tests/RunCMake/find_program/Required.cmake
@@ -0,0 +1,12 @@
+find_program(PROG_A
+ NAMES testA
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A
+ NO_DEFAULT_PATH
+ REQUIRED
+ )
+message(STATUS "PROG_A='${PROG_A}'")
+
+find_program(PROG_AandB
+ NAMES testAandB
+ REQUIRED
+ )
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
index 6903f057b..2bb777bff 100644
--- a/Tests/RunCMake/find_program/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -4,8 +4,19 @@ run_cmake(EnvAndHints)
run_cmake(DirsPerName)
run_cmake(NamesPerDir)
run_cmake(RelAndAbsPath)
+run_cmake(Required)
if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
run_cmake(WindowsCom)
run_cmake(WindowsExe)
+else()
+ # test non readable file only if not root
+ execute_process(
+ COMMAND id -u $ENV{USER}
+ OUTPUT_VARIABLE uid
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(NOT "${uid}" STREQUAL "0")
+ run_cmake(ExeNoRead)
+ endif()
endif()
diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.cmake b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
index 54b858f92..c2762adf8 100644
--- a/Tests/RunCMake/get_filename_component/KnownComponents.cmake
+++ b/Tests/RunCMake/get_filename_component/KnownComponents.cmake
@@ -85,12 +85,12 @@ check("PROGRAM with args output: args" "${test_program_args}" " arg1 arg2")
get_filename_component(test_program_name " " PROGRAM)
check("PROGRAM with just a space" "${test_program_name}" "")
-get_filename_component(test_program_name "${CMAKE_CURRENT_LIST_FILE}" PROGRAM)
-check("PROGRAM specified explicitly without quoting" "${test_program_name}" "${CMAKE_CURRENT_LIST_FILE}")
+get_filename_component(test_program_name "${CMAKE_CURRENT_LIST_DIR}/KnownComponents.sh" PROGRAM)
+check("PROGRAM specified explicitly without quoting" "${test_program_name}" "${CMAKE_CURRENT_LIST_DIR}/KnownComponents.sh")
-get_filename_component(test_program_name "\"${CMAKE_CURRENT_LIST_FILE}\" arg1 arg2" PROGRAM
+get_filename_component(test_program_name "\"${CMAKE_CURRENT_LIST_DIR}/KnownComponents.sh\" arg1 arg2" PROGRAM
PROGRAM_ARGS test_program_args)
-check("PROGRAM specified explicitly with arguments: name" "${test_program_name}" "${CMAKE_CURRENT_LIST_FILE}")
+check("PROGRAM specified explicitly with arguments: name" "${test_program_name}" "${CMAKE_CURRENT_LIST_DIR}/KnownComponents.sh")
check("PROGRAM specified explicitly with arguments: args" "${test_program_args}" " arg1 arg2")
list(APPEND non_cache_vars test_program_name)
diff --git a/Tests/RunCMake/get_filename_component/KnownComponents.sh b/Tests/RunCMake/get_filename_component/KnownComponents.sh
new file mode 100755
index 000000000..1a2485251
--- /dev/null
+++ b/Tests/RunCMake/get_filename_component/KnownComponents.sh
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake
index 6e364739a..c4ee53d1e 100644
--- a/Tests/RunCMake/get_property/RunCMakeTest.cmake
+++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake
@@ -5,6 +5,7 @@ run_cmake(directory_properties)
run_cmake(global_properties)
run_cmake(install_properties)
run_cmake(source_properties)
+run_cmake(source_properties_failures)
run_cmake(target_properties)
run_cmake(test_properties)
run_cmake(DebugConfigurations)
diff --git a/Tests/RunCMake/get_property/source_properties_failures-result.txt b/Tests/RunCMake/get_property/source_properties_failures-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/get_property/source_properties_failures-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/get_property/source_properties_failures-stderr.txt b/Tests/RunCMake/get_property/source_properties_failures-stderr.txt
new file mode 100644
index 000000000..0accb8fb6
--- /dev/null
+++ b/Tests/RunCMake/get_property/source_properties_failures-stderr.txt
@@ -0,0 +1,66 @@
+^CMake Error at source_properties_failures.cmake:1 \(set_source_files_properties\):
+ set_source_files_properties called with incorrect number of arguments no
+ value provided to the DIRECTORY option
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:2 \(set_source_files_properties\):
+ set_source_files_properties given non-existent DIRECTORY non_existing_dir
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:3 \(set_source_files_properties\):
+ set_source_files_properties called with incorrect number of arguments no
+ value provided to the TARGET_DIRECTORY option
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:4 \(set_source_files_properties\):
+ set_source_files_properties given non-existent target for TARGET_DIRECTORY
+ non_existing_target
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:6 \(get_property\):
+ get_property called with incorrect number of arguments no value provided to
+ the DIRECTORY option
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:7 \(get_property\):
+ get_property given non-existent DIRECTORY non_existing_dir
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:8 \(get_property\):
+ get_property called with incorrect number of arguments no value provided to
+ the TARGET_DIRECTORY option
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:9 \(get_property\):
+ get_property given non-existent target for TARGET_DIRECTORY
+ non_existing_dir
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:11 \(get_source_file_property\):
+ get_source_file_property given non-existent DIRECTORY PROPERTY
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:12 \(get_source_file_property\):
+ get_source_file_property called with incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:13 \(get_source_file_property\):
+ get_source_file_property given non-existent target for TARGET_DIRECTORY
+ PROPERTY
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at source_properties_failures.cmake:14 \(get_source_file_property\):
+ get_source_file_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/source_properties_failures.cmake b/Tests/RunCMake/get_property/source_properties_failures.cmake
new file mode 100644
index 000000000..f4b87f988
--- /dev/null
+++ b/Tests/RunCMake/get_property/source_properties_failures.cmake
@@ -0,0 +1,14 @@
+set_source_files_properties(a.txt DIRECTORY PROPERTIES COMPILE_DEFINITIONS "def")
+set_source_files_properties(a.txt DIRECTORY non_existing_dir PROPERTIES COMPILE_DEFINITIONS "def")
+set_source_files_properties(a.txt TARGET_DIRECTORY PROPERTIES COMPILE_DEFINITIONS "def")
+set_source_files_properties(a.txt TARGET_DIRECTORY non_existing_target PROPERTIES COMPILE_DEFINITIONS "def")
+
+get_property(in_var SOURCE a.txt DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+get_property(in_var SOURCE a.txt DIRECTORY non_existing_dir PROPERTY COMPILE_DEFINITIONS)
+get_property(in_var SOURCE a.txt TARGET_DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+get_property(in_var SOURCE a.txt TARGET_DIRECTORY non_existing_dir PROPERTY COMPILE_DEFINITIONS)
+
+get_source_file_property(in_var a.txt DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+get_source_file_property(in_var a.txt DIRECTORY non_existing_dir PROPERTY COMPILE_DEFINITIONS)
+get_source_file_property(in_var a.txt TARGET_DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+get_source_file_property(in_var a.txt TARGET_DIRECTORY non_existing_dir PROPERTY COMPILE_DEFINITIONS)
diff --git a/Tests/RunCMake/install/CMakeLists.txt b/Tests/RunCMake/install/CMakeLists.txt
index c7e99ada4..6dd8cdf55 100644
--- a/Tests/RunCMake/install/CMakeLists.txt
+++ b/Tests/RunCMake/install/CMakeLists.txt
@@ -1,6 +1,3 @@
cmake_minimum_required(VERSION 3.4)
-if(RunCMake_TEST MATCHES "^file-GET_RUNTIME_DEPENDENCIES")
- cmake_policy(SET CMP0087 NEW)
-endif()
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index 70570b797..d83a07cdb 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -155,38 +155,6 @@ run_install_test(FILES-PERMISSIONS)
run_install_test(TARGETS-RPATH)
run_install_test(InstallRequiredSystemLibraries)
-if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
- if(NOT CMake_INSTALL_NAME_TOOL_BUG)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-unresolved)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-conflict)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-notfile)
- endif()
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-project)
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1)
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2)
-elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-unresolved)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-conflict)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-notfile)
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-project)
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1)
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2)
-elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
- if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL")
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux)
- endif()
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-unresolved)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-conflict)
- run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-notfile)
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-project)
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1)
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2)
-else()
- run_cmake(file-GET_RUNTIME_DEPENDENCIES-unsupported)
-endif()
-
set(run_install_test_components 1)
run_install_test(FILES-EXCLUDE_FROM_ALL)
run_install_test(TARGETS-EXCLUDE_FROM_ALL)
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt
deleted file mode 100644
index b66d1fe5b..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\):
- You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
- probably not what you intended to do\. Instead, please consider using it in
- an install\(CODE\) or install\(SCRIPT\) command\. For example:
-
- install\(CODE \[\[
- file\(GET_RUNTIME_DEPENDENCIES
- # \.\.\.
- \)
- ]]\)
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers\. Use -Wno-dev to suppress it\.
-
-CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\):
- file Unrecognized argument: "invalid"
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt
deleted file mode 100644
index 50fa81fa1..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\):
- You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
- probably not what you intended to do\. Instead, please consider using it in
- an install\(CODE\) or install\(SCRIPT\) command\. For example:
-
- install\(CODE \[\[
- file\(GET_RUNTIME_DEPENDENCIES
- # \.\.\.
- \)
- ]]\)
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers\. Use -Wno-dev to suppress it\.
-
-CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\):
- file Keywords missing values:
-
- RESOLVED_DEPENDENCIES_VAR
- UNRESOLVED_DEPENDENCIES_VAR
- CONFLICTING_DEPENDENCIES_PREFIX
- BUNDLE_EXECUTABLE
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake
deleted file mode 100644
index ab630f0ac..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake
+++ /dev/null
@@ -1,44 +0,0 @@
-function(check_contents filename contents_regex)
- if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
- file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
- if(NOT contents MATCHES "${contents_regex}")
- string(APPEND RunCMake_TEST_FAILED "File contents:
- ${contents}
-do not match what we expected:
- ${contents_regex}
-in file:
- ${CMAKE_INSTALL_PREFIX}/${filename}\n")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- endif()
- else()
- string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- endif()
-endfunction()
-
-set(_check
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_rpath\.so]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_runpath\.so]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath/librpath\.so]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_parent/librpath_parent\.so]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search/librpath_search\.so]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath/librunpath\.so]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search/librunpath_search\.so]]
- )
-check_contents(deps/deps1.txt "^${_check}$")
-check_contents(deps/deps2.txt "^${_check}$")
-check_contents(deps/deps3.txt "^${_check}$")
-set(_check
- [[librpath_unresolved\.so]]
- [[librunpath_parent_unresolved\.so]]
- [[librunpath_unresolved\.so]]
- )
-check_contents(deps/udeps1.txt "^${_check}$")
-check_contents(deps/udeps2.txt "^${_check}$")
-check_contents(deps/udeps3.txt "^${_check}$")
-set(_check
- "^libconflict\\.so:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
- )
-check_contents(deps/cdeps1.txt "${_check}")
-check_contents(deps/cdeps2.txt "${_check}")
-check_contents(deps/cdeps3.txt "${_check}")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt
deleted file mode 100644
index 123ae48ab..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-^CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librpath_search_postexcluded\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librpath_search\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librunpath_search_postexcluded\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librunpath_search\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librpath_search_postexcluded\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librpath_search\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librunpath_search_postexcluded\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librunpath_search\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librpath_search_postexcluded\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librpath_search\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librunpath_search_postexcluded\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
-
-*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
- Dependency librunpath_search\.so found in search directory:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search
-
- See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
-Call Stack \(most recent call first\):
- cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt
deleted file mode 100644
index 1692348f4..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Multiple conflicting paths found for librpath\.so:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath1/librpath\.so
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath2/librpath\.so$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt
deleted file mode 100644
index 83a87c9c5..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Failed to run objdump on:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-build/root-all/bin/\.\./lib/libtest\.so$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake
deleted file mode 100644
index bd0f9f169..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake
+++ /dev/null
@@ -1,169 +0,0 @@
-enable_language(C)
-cmake_policy(SET CMP0095 NEW)
-
-set(test_rpath_names
- preexcluded
- rpath_postexcluded
- rpath
- rpath_parent_postexcluded
- rpath_parent
- rpath_origin_postexcluded
- rpath_origin
- rpath_search_postexcluded
- rpath_search
- rpath_unresolved
- conflict
- )
-set(test_runpath_names
- runpath_postexcluded
- runpath
- runpath_origin_postexcluded
- runpath_origin
- runpath_parent_unresolved
- runpath_search_postexcluded
- runpath_search
- runpath_unresolved
- )
-
-file(REMOVE "${CMAKE_BINARY_DIR}/test_rpath.c")
-add_library(test_rpath SHARED "${CMAKE_BINARY_DIR}/test_rpath.c")
-foreach(name ${test_rpath_names})
- file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
- add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
-
- file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "extern void ${name}(void);\n")
-endforeach()
-file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "void test_rpath(void)\n{\n")
-foreach(name ${test_rpath_names})
- file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" " ${name}();\n")
-endforeach()
-file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "}\n")
-
-install(TARGETS rpath_postexcluded DESTINATION lib/rpath_postexcluded)
-install(TARGETS rpath DESTINATION lib/rpath)
-install(TARGETS rpath_origin_postexcluded DESTINATION lib/rpath_origin_postexcluded)
-install(TARGETS rpath_origin DESTINATION lib/rpath_origin)
-install(TARGETS rpath_parent_postexcluded DESTINATION lib/rpath_parent_postexcluded)
-install(TARGETS rpath rpath_origin rpath_parent DESTINATION lib/rpath_parent)
-install(TARGETS rpath_search_postexcluded DESTINATION lib/rpath_search_postexcluded)
-install(TARGETS rpath rpath_origin rpath_parent rpath_search DESTINATION lib/rpath_search)
-install(TARGETS conflict DESTINATION lib/conflict)
-
-target_link_libraries(test_rpath PRIVATE ${test_rpath_names})
-set_property(TARGET test_rpath PROPERTY INSTALL_RPATH
- "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded"
- "${CMAKE_BINARY_DIR}/root-all/lib/rpath"
- "\$ORIGIN/rpath_origin_postexcluded"
- "\${ORIGIN}/rpath_origin"
- "${CMAKE_BINARY_DIR}/root-all/lib/conflict"
- )
-target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags)
-
-file(REMOVE "${CMAKE_BINARY_DIR}/test_runpath.c")
-add_library(test_runpath SHARED "${CMAKE_BINARY_DIR}/test_runpath.c")
-foreach(name ${test_runpath_names} rpath conflict)
- file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
- if(NOT name MATCHES "^(rpath|conflict)$")
- add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
- endif()
-
- file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "extern void ${name}(void);\n")
-endforeach()
-file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "void test_runpath(void)\n{\n")
-foreach(name ${test_runpath_names} rpath conflict)
- file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" " ${name}();\n")
-endforeach()
-file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "}\n")
-
-install(TARGETS runpath_postexcluded DESTINATION lib/runpath_postexcluded)
-install(TARGETS runpath DESTINATION lib/runpath)
-install(TARGETS runpath_origin_postexcluded DESTINATION lib/runpath_origin_postexcluded)
-install(TARGETS runpath_origin DESTINATION lib/runpath_origin)
-install(TARGETS runpath_parent_unresolved DESTINATION lib/runpath_parent_unresolved)
-install(TARGETS runpath_search_postexcluded DESTINATION lib/runpath_search_postexcluded)
-install(TARGETS runpath runpath_origin runpath_search DESTINATION lib/runpath_search)
-install(TARGETS conflict DESTINATION lib/conflict2)
-
-target_link_libraries(test_runpath PRIVATE ${test_runpath_names} rpath conflict)
-set_property(TARGET test_runpath PROPERTY INSTALL_RPATH
- "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly
- "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded"
- "${CMAKE_BINARY_DIR}/root-all/lib/runpath"
- "\${ORIGIN}/runpath_origin_postexcluded"
- "\$ORIGIN/runpath_origin"
- "${CMAKE_BINARY_DIR}/root-all/lib/conflict2"
- )
-target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags)
-
-set_property(TARGET test_rpath ${test_rpath_names} test_runpath ${test_runpath_names} PROPERTY LIBRARY_OUTPUT_DIRECTORY lib)
-install(TARGETS test_rpath test_runpath DESTINATION lib)
-
-add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c)
-add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c)
-add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c)
-target_link_libraries(topexe PRIVATE test_rpath test_runpath)
-target_link_libraries(toplib PRIVATE test_rpath test_runpath)
-target_link_libraries(topmod PRIVATE test_rpath test_runpath)
-set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH
- "${CMAKE_BINARY_DIR}/root-all/lib"
- "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent_postexcluded"
- "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent"
- "${CMAKE_BINARY_DIR}/root-all/lib/runpath_parent_unresolved"
- )
-target_link_options(topexe PRIVATE -Wl,--disable-new-dtags)
-target_link_options(toplib PRIVATE -Wl,--disable-new-dtags)
-target_link_options(topmod PRIVATE -Wl,--disable-new-dtags)
-
-install(TARGETS topexe toplib RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
-install(TARGETS topmod LIBRARY DESTINATION lib/modules)
-
-install(CODE [[
- function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
- file(GET_RUNTIME_DEPENDENCIES
- RESOLVED_DEPENDENCIES_VAR deps
- UNRESOLVED_DEPENDENCIES_VAR udeps
- CONFLICTING_DEPENDENCIES_PREFIX cdeps
- PRE_INCLUDE_REGEXES
- "^lib(test_rpath|rpath_postexcluded|rpath|rpath_parent_postexcluded|rpath_parent|rpath_origin_postexcluded|rpath_origin|rpath_search_postexcluded|rpath_search|rpath_unresolved|test_runpath|runpath_postexcluded|runpath|runpath_origin_postexcluded|runpath_origin|runpath_parent_unresolved|runpath_search_postexcluded|runpath_search|runpath_unresolved|conflict)\\.so$"
- "^libc\\.so"
- PRE_EXCLUDE_REGEXES ".*"
- POST_INCLUDE_REGEXES "^.*/(libtest_rpath|rpath/librpath|rpath_parent/librpath_parent|rpath_search/librpath_search|libtest_runpath|runpath/librunpath|runpath_origin_postexcluded|runpath_origin|runpath_search/librunpath_search|conflict2?/libconflict)\\.so$"
- POST_EXCLUDE_REGEXES ".*"
- DIRECTORIES
- "${CMAKE_INSTALL_PREFIX}/lib/rpath_search_postexcluded"
- "${CMAKE_INSTALL_PREFIX}/lib/rpath_search"
- "${CMAKE_INSTALL_PREFIX}/lib/runpath_search_postexcluded"
- "${CMAKE_INSTALL_PREFIX}/lib/runpath_search"
- ${ARGN}
- )
- list(SORT deps)
- list(SORT udeps)
- list(SORT cdeps_FILENAMES)
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
- foreach(cdep IN LISTS cdeps_FILENAMES)
- set(cdep_values ${cdeps_${cdep}})
- list(SORT cdep_values)
- file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
- endforeach()
- endfunction()
-
- exec_get_runtime_dependencies(
- deps1.txt udeps1.txt cdeps1.txt
- EXECUTABLES
- "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topexe>"
- )
-
- exec_get_runtime_dependencies(
- deps2.txt udeps2.txt cdeps2.txt
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:toplib>"
- )
-
- exec_get_runtime_dependencies(
- deps3.txt udeps3.txt cdeps3.txt
- MODULES
- "${CMAKE_INSTALL_PREFIX}/lib/modules/$<TARGET_FILE_NAME:topmod>"
- )
- ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake
deleted file mode 100644
index 4d6dde12d..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake
+++ /dev/null
@@ -1,157 +0,0 @@
-function(check_contents filename contents_regex)
- if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
- file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
- if(NOT contents MATCHES "${contents_regex}")
- string(APPEND RunCMake_TEST_FAILED "File contents:
- ${contents}
-do not match what we expected:
- ${contents_regex}
-in file:
- ${CMAKE_INSTALL_PREFIX}/${filename}\n")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- endif()
- else()
- string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- endif()
-endfunction()
-
-set(_check
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
- [[/usr/lib/libSystem\.B\.dylib]]
- )
-check_contents(deps/deps1.txt "^${_check}$")
-
-set(_check
- [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
- [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
- [[@rpath/librpath_executable_path_bundle\.dylib]]
- [[@rpath/librpath_loader_path_unresolved\.dylib]]
- [[@rpath/librpath_unresolved\.dylib]]
- )
-check_contents(deps/udeps1.txt "^${_check}$")
-
-set(_check
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
- [[/usr/lib/libSystem\.B\.dylib]]
- )
-check_contents(deps/deps2.txt "^${_check}$")
-
-set(_check
- [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
- [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
- [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]]
- [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
- [[@rpath/librpath_executable_path\.dylib]]
- [[@rpath/librpath_executable_path_bundle\.dylib]]
- [[@rpath/librpath_executable_path_postexcluded\.dylib]]
- [[@rpath/librpath_loader_path_unresolved\.dylib]]
- [[@rpath/librpath_unresolved\.dylib]]
- )
-check_contents(deps/udeps2.txt "^${_check}$")
-
-set(_check
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
- [[/usr/lib/libSystem\.B\.dylib]]
- )
-check_contents(deps/deps3.txt "^${_check}$")
-
-set(_check
- [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
- [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
- [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]]
- [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
- [[@rpath/librpath_executable_path\.dylib]]
- [[@rpath/librpath_executable_path_bundle\.dylib]]
- [[@rpath/librpath_executable_path_postexcluded\.dylib]]
- [[@rpath/librpath_loader_path_unresolved\.dylib]]
- [[@rpath/librpath_unresolved\.dylib]]
- )
-check_contents(deps/udeps3.txt "^${_check}$")
-
-set(_check
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
- [[/usr/lib/libSystem\.B\.dylib]]
- )
-check_contents(deps/deps4.txt "^${_check}$")
-
-set(_check
- [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
- [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
- [[@rpath/librpath_executable_path_bundle\.dylib]]
- [[@rpath/librpath_loader_path_unresolved\.dylib]]
- [[@rpath/librpath_unresolved\.dylib]]
- )
-check_contents(deps/udeps4.txt "^${_check}$")
-
-set(_check
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
- [[/usr/lib/libSystem\.B\.dylib]]
- )
-check_contents(deps/deps5.txt "^${_check}$")
-
-set(_check
- [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
- [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
- [[@rpath/librpath_executable_path\.dylib]]
- [[@rpath/librpath_executable_path_bundle\.dylib]]
- [[@rpath/librpath_loader_path_unresolved\.dylib]]
- [[@rpath/librpath_unresolved\.dylib]]
- )
-check_contents(deps/udeps5.txt "^${_check}$")
-
-set(_check
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
- [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
- [[/usr/lib/libSystem\.B\.dylib]]
- )
-check_contents(deps/deps6.txt "^${_check}$")
-
-set(_check
- [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
- [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
- [[@rpath/librpath_executable_path\.dylib]]
- [[@rpath/librpath_executable_path_bundle\.dylib]]
- [[@rpath/librpath_loader_path_unresolved\.dylib]]
- [[@rpath/librpath_unresolved\.dylib]]
- )
-check_contents(deps/udeps6.txt "^${_check}$")
-
-set(_check
- "^libconflict\\.dylib:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$"
- )
-check_contents(deps/cdeps1.txt "${_check}")
-check_contents(deps/cdeps2.txt "${_check}")
-check_contents(deps/cdeps3.txt "${_check}")
-check_contents(deps/cdeps4.txt "${_check}")
-check_contents(deps/cdeps5.txt "${_check}")
-check_contents(deps/cdeps6.txt "${_check}")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt
deleted file mode 100644
index bc9e97a82..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Multiple conflicting paths found for librpath\.dylib:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath1/librpath\.dylib
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath2/librpath\.dylib$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt
deleted file mode 100644
index 73ab9f1c5..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Failed to run otool on:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-build/root-all/bin/\.\./lib/libtest\.dylib$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake
deleted file mode 100644
index 6db05b3ff..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake
+++ /dev/null
@@ -1,216 +0,0 @@
-enable_language(C)
-
-set(testlib_names
- preexcluded
- executable_path
- executable_path_bundle
- executable_path_postexcluded
- loader_path
- loader_path_unresolved
- loader_path_postexcluded
- rpath
- rpath_unresolved
- rpath_postexcluded
- rpath_executable_path
- rpath_executable_path_bundle
- rpath_executable_path_postexcluded
- rpath_loader_path
- rpath_loader_path_unresolved
- rpath_loader_path_postexcluded
- normal
- normal_unresolved
- normal_postexcluded
- conflict
- )
-
-file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c")
-add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
-foreach(name ${testlib_names})
- if(name STREQUAL "normal")
- file(WRITE "${CMAKE_BINARY_DIR}/normal.c" "extern void rpath(void);\nvoid normal(void)\n{\n rpath();\n}\n")
- else()
- file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
- endif()
- add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
-
- file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "extern void ${name}(void);\n")
-endforeach()
-file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "void testlib(void)\n{\n")
-foreach(name ${testlib_names})
- file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n")
-endforeach()
-file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n")
-set_property(TARGET ${testlib_names} PROPERTY BUILD_WITH_INSTALL_NAME_DIR 1)
-target_link_libraries(normal PRIVATE rpath)
-set_property(TARGET normal PROPERTY INSTALL_RPATH
- "${CMAKE_BINARY_DIR}/root-all/executable/lib/normal/../rpath"
- )
-
-file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "extern void conflict(void);\nvoid testlib_conflict(void)\n{\n conflict();\n}\n")
-add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c")
-target_link_libraries(testlib_conflict PRIVATE conflict)
-
-set_property(TARGET testlib PROPERTY INSTALL_RPATH
- "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath"
- "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_unresolved"
- "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_postexcluded"
- "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict"
- @executable_path/../lib/rpath_executable_path
- @executable_path/../lib/rpath_executable_path_unresolved
- @executable_path/../lib/rpath_executable_path_postexcluded
- @loader_path/rpath_loader_path
- @loader_path/rpath_loader_path_unresolved
- @loader_path/rpath_loader_path_postexcluded
- )
-set_property(TARGET testlib_conflict PROPERTY INSTALL_RPATH
- "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict2"
- )
-
-foreach(t
- executable_path
- executable_path_postexcluded
- loader_path
- loader_path_postexcluded
- rpath
- rpath_postexcluded
- rpath_executable_path
- rpath_executable_path_postexcluded
- rpath_loader_path
- rpath_loader_path_postexcluded
- conflict
- )
- install(TARGETS ${t} DESTINATION executable/lib/${t})
-endforeach()
-install(TARGETS conflict DESTINATION executable/lib/conflict2)
-
-foreach(t
- executable_path_bundle
- executable_path_postexcluded
- loader_path_postexcluded
- rpath_postexcluded
- rpath_executable_path_bundle
- rpath_executable_path_postexcluded
- rpath_loader_path_postexcluded
- )
- install(TARGETS ${t} DESTINATION bundle_executable/lib/${t})
-endforeach()
-
-foreach(t executable_path executable_path_bundle executable_path_postexcluded)
- set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @executable_path/../lib/${t})
-endforeach()
-
-foreach(t loader_path loader_path_unresolved loader_path_postexcluded)
- set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @loader_path/${t})
-endforeach()
-
-foreach(t
- rpath
- rpath_unresolved
- rpath_postexcluded
- rpath_executable_path
- rpath_executable_path_bundle
- rpath_executable_path_postexcluded
- rpath_loader_path
- rpath_loader_path_unresolved
- rpath_loader_path_postexcluded
- conflict
- )
- set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @rpath)
-endforeach()
-
-foreach(t normal normal_unresolved normal_postexcluded)
- set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR "${CMAKE_BINARY_DIR}/root-all/executable/lib/${t}")
- if(NOT t STREQUAL "normal_unresolved")
- install(TARGETS ${t} DESTINATION executable/lib/${t})
- endif()
-endforeach()
-
-target_link_libraries(testlib PRIVATE ${testlib_names})
-
-add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c)
-add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c)
-add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c)
-target_link_libraries(topexe PRIVATE testlib)
-target_link_libraries(toplib PRIVATE testlib)
-target_link_libraries(topmod PRIVATE testlib)
-
-set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib")
-
-install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib)
-install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib)
-
-install(CODE [[
- function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
- file(GET_RUNTIME_DEPENDENCIES
- RESOLVED_DEPENDENCIES_VAR deps
- UNRESOLVED_DEPENDENCIES_VAR udeps
- CONFLICTING_DEPENDENCIES_PREFIX cdeps
- PRE_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|executable_path_postexcluded|loader_path|loader_path_unresolved|loader_path_postexcluded|rpath|rpath_unresolved|rpath_postexcluded|rpath_executable_path|rpath_executable_path_bundle|rpath_executable_path_postexcluded|rpath_loader_path|rpath_loader_path_unresolved|rpath_loader_path_postexcluded|normal|normal_unresolved|normal_postexcluded|conflict|System\\.B)\\.dylib$"
- PRE_EXCLUDE_REGEXES ".*"
- POST_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|loader_path|rpath|rpath_executable_path|rpath_executable_path_bundle|rpath_loader_path|normal|conflict|System\\.B)\\.dylib$"
- POST_EXCLUDE_REGEXES ".*"
- ${ARGN}
- )
- list(SORT deps)
- list(SORT udeps)
- list(SORT cdeps_FILENAMES)
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
- foreach(cdep IN LISTS cdeps_FILENAMES)
- set(cdep_values ${cdeps_${cdep}})
- list(SORT cdep_values)
- file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
- endforeach()
- endfunction()
-
- exec_get_runtime_dependencies(
- deps1.txt udeps1.txt cdeps1.txt
- EXECUTABLES
- "${CMAKE_INSTALL_PREFIX}/executable/bin/$<TARGET_FILE_NAME:topexe>"
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
- )
-
- exec_get_runtime_dependencies(
- deps2.txt udeps2.txt cdeps2.txt
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:toplib>"
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
- )
-
- exec_get_runtime_dependencies(
- deps3.txt udeps3.txt cdeps3.txt
- MODULES
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:topmod>"
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
- )
-
- exec_get_runtime_dependencies(
- deps4.txt udeps4.txt cdeps4.txt
- EXECUTABLES
- "${CMAKE_INSTALL_PREFIX}/executable/bin/$<TARGET_FILE_NAME:topexe>"
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
- BUNDLE_EXECUTABLE
- "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
- )
-
- exec_get_runtime_dependencies(
- deps5.txt udeps5.txt cdeps5.txt
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:toplib>"
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
- BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
- )
-
- exec_get_runtime_dependencies(
- deps6.txt udeps6.txt cdeps6.txt
- MODULES
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:topmod>"
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
- BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
- )
- ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt
deleted file mode 100644
index d506645a0..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-project\.cmake:[0-9]+ \(file\):
- You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
- probably not what you intended to do\. Instead, please consider using it in
- an install\(CODE\) or install\(SCRIPT\) command\. For example:
-
- install\(CODE \[\[
- file\(GET_RUNTIME_DEPENDENCIES
- # \.\.\.
- \)
- ]]\)
-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/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt
deleted file mode 100644
index 3db835c08..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Error at file-GET_RUNTIME_DEPENDENCIES-unsupported\.cmake:[0-9]+ \(file\):
- file GET_RUNTIME_DEPENDENCIES is not supported on system "[^
- ]+"
-Call Stack \(most recent call first\):
- CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake
deleted file mode 100644
index c120ce461..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake
+++ /dev/null
@@ -1,38 +0,0 @@
-function(check_contents filename contents_regex)
- if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
- file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
- if(NOT contents MATCHES "${contents_regex}")
- string(APPEND RunCMake_TEST_FAILED "File contents:
- ${contents}
-do not match what we expected:
- ${contents_regex}
-in file:
- ${CMAKE_INSTALL_PREFIX}/${filename}\n")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- endif()
- else()
- string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
- set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
- endif()
-endfunction()
-
-set(_check
- [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.conflict/\.\./(lib)?libdir\.dll]=]
- [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.search/(lib)?search\.dll]=]
- [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?testlib\.dll]=]
- )
-check_contents(deps/deps1.txt "^${_check}$")
-check_contents(deps/deps2.txt "^${_check}$")
-check_contents(deps/deps3.txt "^${_check}$")
-set(_check
- [=[(lib)?unresolved\.dll]=]
- )
-check_contents(deps/udeps1.txt "^${_check}$")
-check_contents(deps/udeps2.txt "^${_check}$")
-check_contents(deps/udeps3.txt "^${_check}$")
-set(_check
- "^(lib)?conflict\\.dll:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\\.conflict/(lib)?conflict\\.dll;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?conflict\\.dll\n$"
- )
-check_contents(deps/cdeps1.txt "${_check}")
-check_contents(deps/cdeps2.txt "${_check}")
-check_contents(deps/cdeps3.txt "${_check}")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt
deleted file mode 100644
index 66ecb932c..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Multiple conflicting paths found for (lib)?path\.dll:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test1/(lib)?path\.dll
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test2/(lib)?path\.dll$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt
deleted file mode 100644
index f921409f9..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
- file Failed to run (dumpbin|objdump) on:
-
- [^
-]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-build/root-all/bin/(lib)?test\.dll$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake
deleted file mode 100644
index 19288d853..000000000
--- a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake
+++ /dev/null
@@ -1,114 +0,0 @@
-enable_language(C)
-
-set(testlib_names
- preexcluded
- libdir_postexcluded
- libdir
- search_postexcluded
- search
- unresolved
- conflict
- )
-
-file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c")
-add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
-foreach(name ${testlib_names})
- file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "__declspec(dllexport) void ${name}(void) {}\n")
- add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
-
- file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void ${name}(void);\n")
-endforeach()
-file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllexport) void testlib(void)\n{\n")
-foreach(name ${testlib_names})
- file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n")
-endforeach()
-file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n")
-
-target_link_libraries(testlib PRIVATE ${testlib_names})
-
-file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "__declspec(dllimport) extern void conflict(void);\n__declspec(dllexport) void testlib_conflict(void)\n{\n conflict();\n}\n")
-add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c")
-target_link_libraries(testlib_conflict PRIVATE conflict)
-
-file(WRITE "${CMAKE_BINARY_DIR}/testlib_noconflict.c" "__declspec(dllimport) extern void libdir(void);\n__declspec(dllexport) void testlib_noconflict(void)\n{\n libdir();\n}\n")
-add_library(testlib_noconflict SHARED "${CMAKE_BINARY_DIR}/testlib_noconflict.c")
-target_link_libraries(testlib_noconflict PRIVATE libdir)
-
-install(TARGETS testlib libdir_postexcluded libdir conflict testlib_noconflict DESTINATION bin)
-install(TARGETS libdir search_postexcluded search DESTINATION bin/.search) # Prefixing with "." ensures it is the first item after list(SORT)
-install(TARGETS testlib_conflict conflict DESTINATION bin/.conflict)
-
-add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c)
-add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c)
-add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c)
-target_link_libraries(topexe PRIVATE testlib)
-target_link_libraries(toplib PRIVATE testlib)
-target_link_libraries(topmod PRIVATE testlib)
-
-install(TARGETS topexe toplib topmod DESTINATION bin)
-
-install(CODE [[
- function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
- file(GET_RUNTIME_DEPENDENCIES
- RESOLVED_DEPENDENCIES_VAR deps
- UNRESOLVED_DEPENDENCIES_VAR udeps
- CONFLICTING_DEPENDENCIES_PREFIX cdeps
- PRE_INCLUDE_REGEXES
- "^(lib)?testlib\\.dll$"
- "^(lib)?libdir_postexcluded\\.dll$"
- "^(lib)?libdir\\.dll$"
- "^(lib)?search_postexcluded\\.dll$"
- "^(lib)?search\\.dll$"
- "^(lib)?unresolved\\.dll$"
- "^(lib)?conflict\\.dll$"
- "^kernel32\\.dll$"
- PRE_EXCLUDE_REGEXES ".*"
- POST_INCLUDE_REGEXES
- "^.*/(lib)?testlib\\.dll$"
- "^.*/(lib)?libdir\\.dll$"
- "^.*/(lib)?search\\.dll$"
- "^.*/(lib)?conflict\\.dll$"
- POST_EXCLUDE_REGEXES ".*"
- DIRECTORIES
- "${CMAKE_INSTALL_PREFIX}/bin/.search"
- ${ARGN}
- )
- list(SORT deps)
- list(SORT udeps)
- list(SORT cdeps_FILENAMES)
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
- file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
- foreach(cdep IN LISTS cdeps_FILENAMES)
- set(cdep_values ${cdeps_${cdep}})
- list(SORT cdep_values)
- file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
- endforeach()
- endfunction()
-
- exec_get_runtime_dependencies(
- deps1.txt udeps1.txt cdeps1.txt
- EXECUTABLES
- "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topexe>"
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
- "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
- )
-
- exec_get_runtime_dependencies(
- deps2.txt udeps2.txt cdeps2.txt
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:toplib>"
- "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
- "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
- )
-
- exec_get_runtime_dependencies(
- deps3.txt udeps3.txt cdeps3.txt
- MODULES
- "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topmod>"
- LIBRARIES
- "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
- "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
- )
- ]])
diff --git a/Tests/RunCMake/message/message-indent-multiline.cmake b/Tests/RunCMake/message/message-indent-multiline.cmake
index 0f789bfce..38155690b 100644
--- a/Tests/RunCMake/message/message-indent-multiline.cmake
+++ b/Tests/RunCMake/message/message-indent-multiline.cmake
@@ -9,5 +9,5 @@ message]]) # No `\n` at the end!
message(STATUS "${msg}\n\n")
message(STATUS "${msg}")
# This is just to make sure NOTICE messages are also get indented:
-# https://gitlab.kitware.com/cmake/cmake/issues/19418#note_588011
+# https://gitlab.kitware.com/cmake/cmake/-/issues/19418#note_588011
message(NOTICE "${msg}")
diff --git a/Tests/RunCMake/pseudo_cppcheck.c b/Tests/RunCMake/pseudo_cppcheck.c
index 5b1531bb4..e80620c45 100644
--- a/Tests/RunCMake/pseudo_cppcheck.c
+++ b/Tests/RunCMake/pseudo_cppcheck.c
@@ -11,7 +11,8 @@ int main(int argc, char* argv[])
fprintf(stdout, "stdout from bad command line arg '-bad'\n");
fprintf(stderr, "stderr from bad command line arg '-bad'\n");
return 1;
- } else if (strcmp(argv[i], "-error") == 0) {
+ }
+ if (strcmp(argv[i], "-error") == 0) {
// The real cppcheck allows to set the exitcode with --error-exitcode
result = 5;
}
diff --git a/Tests/RunCMake/set_property/RunCMakeTest.cmake b/Tests/RunCMake/set_property/RunCMakeTest.cmake
index 8d4614c5d..692c6b942 100644
--- a/Tests/RunCMake/set_property/RunCMakeTest.cmake
+++ b/Tests/RunCMake/set_property/RunCMakeTest.cmake
@@ -9,6 +9,7 @@ run_cmake(LINK_OPTIONS)
run_cmake(LINK_DIRECTORIES)
run_cmake(LINK_LIBRARIES)
run_cmake(SOURCES)
+run_cmake(SOURCE_FILE)
run_cmake(TYPE)
run_cmake(USER_PROP)
run_cmake(USER_PROP_INHERITED)
diff --git a/Tests/RunCMake/set_property/SOURCE_FILE-result.txt b/Tests/RunCMake/set_property/SOURCE_FILE-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/set_property/SOURCE_FILE-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/set_property/SOURCE_FILE-stderr.txt b/Tests/RunCMake/set_property/SOURCE_FILE-stderr.txt
new file mode 100644
index 000000000..a2b6cf4b1
--- /dev/null
+++ b/Tests/RunCMake/set_property/SOURCE_FILE-stderr.txt
@@ -0,0 +1,22 @@
+^CMake Error at SOURCE_FILE.cmake:1 \(set_property\):
+ set_property called with incorrect number of arguments no value provided to
+ the DIRECTORY option
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at SOURCE_FILE.cmake:2 \(set_property\):
+ set_property given non-existent DIRECTORY non_existing_dir
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at SOURCE_FILE.cmake:3 \(set_property\):
+ set_property called with incorrect number of arguments no value provided to
+ the TARGET_DIRECTORY option
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
++
+CMake Error at SOURCE_FILE.cmake:4 \(set_property\):
+ set_property given non-existent target for TARGET_DIRECTORY
+ non_existing_target
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/set_property/SOURCE_FILE.cmake b/Tests/RunCMake/set_property/SOURCE_FILE.cmake
new file mode 100644
index 000000000..b1d78bd3f
--- /dev/null
+++ b/Tests/RunCMake/set_property/SOURCE_FILE.cmake
@@ -0,0 +1,4 @@
+set_property(SOURCE a.txt DIRECTORY PROPERTY COMPILE_DEFINITIONS "def")
+set_property(SOURCE a.txt DIRECTORY non_existing_dir PROPERTY COMPILE_DEFINITIONS "def")
+set_property(SOURCE a.txt TARGET_DIRECTORY PROPERTY COMPILE_DEFINITIONS "def")
+set_property(SOURCE a.txt TARGET_DIRECTORY non_existing_target PROPERTY COMPILE_DEFINITIONS "def")
diff --git a/Tests/RunCMake/string/Hex.cmake b/Tests/RunCMake/string/Hex.cmake
new file mode 100644
index 000000000..1c5aaa174
--- /dev/null
+++ b/Tests/RunCMake/string/Hex.cmake
@@ -0,0 +1,20 @@
+function(assert_strequal input actual expected)
+ if(NOT expected STREQUAL actual)
+ message(SEND_ERROR "Output did not match expected\nInput string:\n ${input}\nExpected:\n ${expected}\nActual:\n ${actual}")
+ endif()
+endfunction()
+
+set(_input1 "The quick brown fox jumps over the lazy dog.")
+string(HEX "${_input1}" _result1)
+assert_strequal("${_input1}" "${_result1}" "54686520717569636b2062726f776e20666f78206a756d7073206f76657220746865206c617a7920646f672e")
+
+set(_input2 "Hello world!")
+string(HEX "${_input2}" _result2)
+assert_strequal("${_input2}" "${_result2}" "48656c6c6f20776f726c6421")
+
+set(_input3 "Ash nazg durbatulûk\nAsh nazg gimbatul\nAsh nazg thrakatulûk\nAgh burzum-ishi krimpatul")
+string(HEX "${_input3}" _result3)
+assert_strequal("${_input3}" "${_result3}" "417368206e617a6720647572626174756cc3bb6b0a417368206e617a672067696d626174756c0a417368206e617a6720746872616b6174756cc3bb6b0a416768206275727a756d2d69736869206b72696d706174756c")
+
+string(HEX "" _result_empty)
+assert_strequal("" "${_result_empty}" "")
diff --git a/Tests/RunCMake/string/HexNotEnoughArgs-result.txt b/Tests/RunCMake/string/HexNotEnoughArgs-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/string/HexNotEnoughArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/string/HexNotEnoughArgs-stderr.txt b/Tests/RunCMake/string/HexNotEnoughArgs-stderr.txt
new file mode 100644
index 000000000..444f79da2
--- /dev/null
+++ b/Tests/RunCMake/string/HexNotEnoughArgs-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at HexNotEnoughArgs\.cmake:[0-9]+ \(string\):
+ string Incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)$
diff --git a/Tests/RunCMake/string/HexNotEnoughArgs.cmake b/Tests/RunCMake/string/HexNotEnoughArgs.cmake
new file mode 100644
index 000000000..7002af0a0
--- /dev/null
+++ b/Tests/RunCMake/string/HexNotEnoughArgs.cmake
@@ -0,0 +1 @@
+string(HEX "Hello world!")
diff --git a/Tests/RunCMake/string/HexTooManyArgs-result.txt b/Tests/RunCMake/string/HexTooManyArgs-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/string/HexTooManyArgs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/string/HexTooManyArgs-stderr.txt b/Tests/RunCMake/string/HexTooManyArgs-stderr.txt
new file mode 100644
index 000000000..91b40ede6
--- /dev/null
+++ b/Tests/RunCMake/string/HexTooManyArgs-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at HexTooManyArgs\.cmake:[0-9]+ \(string\):
+ string Incorrect number of arguments
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:3 \(include\)$
diff --git a/Tests/RunCMake/string/HexTooManyArgs.cmake b/Tests/RunCMake/string/HexTooManyArgs.cmake
new file mode 100644
index 000000000..8986cf8f3
--- /dev/null
+++ b/Tests/RunCMake/string/HexTooManyArgs.cmake
@@ -0,0 +1 @@
+string(HEX "Hello world!" _output bad)
diff --git a/Tests/RunCMake/string/RunCMakeTest.cmake b/Tests/RunCMake/string/RunCMakeTest.cmake
index c432b4ed5..bb7cb174e 100644
--- a/Tests/RunCMake/string/RunCMakeTest.cmake
+++ b/Tests/RunCMake/string/RunCMakeTest.cmake
@@ -37,3 +37,7 @@ run_cmake(UTF-32LE)
run_cmake(Repeat)
run_cmake(RepeatNoArgs)
run_cmake(RepeatNegativeCount)
+
+run_cmake(Hex)
+run_cmake(HexTooManyArgs)
+run_cmake(HexNotEnoughArgs)
diff --git a/Tests/RunCMake/target_link_directories/CMP0099.cmake b/Tests/RunCMake/target_link_directories/CMP0099.cmake
index a2be27968..aff1e33ab 100644
--- a/Tests/RunCMake/target_link_directories/CMP0099.cmake
+++ b/Tests/RunCMake/target_link_directories/CMP0099.cmake
@@ -5,7 +5,7 @@ set(CMAKE_VERBOSE_MAKEFILE TRUE)
set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
add_library(LinkDirs_interface INTERFACE)
-target_link_directories (LinkDirs_interface INTERFACE "/DIR_INTERFACE"})
+target_link_directories (LinkDirs_interface INTERFACE "/DIR_INTERFACE")
add_library(LinkDirs_static STATIC lib.c)
target_link_libraries (LinkDirs_static PRIVATE LinkDirs_interface)
diff --git a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
index a74ee257c..699e87188 100644
--- a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
@@ -21,10 +21,21 @@ if(RunCMake_GENERATOR MATCHES "(Ninja|Makefiles)" AND
set(VERBOSE -- -v)
endif()
+ run_cmake(genex_LINK_LANGUAGE)
+ run_cmake_target(genex_LINK_LANGUAGE interface LinkDirs_exe_interface --config Release ${VERBOSE})
+ run_cmake_target(genex_LINK_LANGUAGE basic LinkDirs_exe_c --config Release ${VERBOSE})
+ run_cmake_target(genex_LINK_LANGUAGE LINKER_LANGUAGE LinkDirs_exe_cxx --config Release ${VERBOSE})
+
+ run_cmake(genex_LINK_LANG_AND_ID)
+
+ run_cmake_target(genex_LINK_LANG_AND_ID interface LinkDirs_exe_interface --config Release ${VERBOSE})
+ run_cmake_target(genex_LINK_LANG_AND_ID basic LinkDirs_exe_c --config Release ${VERBOSE})
+ run_cmake_target(genex_LINK_LANG_AND_ID LINKER_LANGUAGE LinkDirs_exe_cxx --config Release ${VERBOSE})
+
+
run_cmake(CMP0099-NEW)
run_cmake_target(CMP0099-NEW basic LinkDirs_exe ${VERBOSE})
-
run_cmake(CMP0099-OLD)
run_cmake_target(CMP0099-OLD basic LinkDirs_exe ${VERBOSE})
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake
new file mode 100644
index 000000000..aa3981023
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG CXX)
+set (INVALID_LANG C)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-check.cmake
new file mode 100644
index 000000000..71f641d97
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-check.cmake
new file mode 100644
index 000000000..8313de61a
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-check.cmake
@@ -0,0 +1,4 @@
+
+set (TYPE INTERFACE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-interface-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-validation.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-validation.cmake
new file mode 100644
index 000000000..298564e1e
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE-validation.cmake
@@ -0,0 +1,20 @@
+
+if (NOT VALID_LANG)
+ set (VALID_LANG C)
+endif()
+if (NOT INVALID_LANG)
+ set (INVALID_LANG CXX)
+endif()
+if (NOT TYPE)
+ set (TYPE EXE)
+endif()
+
+if (NOT actual_stdout MATCHES "DIR_${VALID_LANG}_${TYPE}")
+ set (RunCMake_TEST_FAILED "Not found expected 'DIR_${VALID_LANG}_${TYPE}'.")
+endif()
+if (actual_stdout MATCHES "DIR_${INVALID_LANG}_${TYPE}")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'DIR_${INVALID_LANG}_${TYPE}'.")
+endif()
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake
new file mode 100644
index 000000000..1f266b16d
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANGUAGE.cmake
@@ -0,0 +1,23 @@
+
+enable_language(C)
+enable_language(CXX)
+
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+
+add_library(LinkDirs_interface INTERFACE)
+target_link_directories (LinkDirs_interface INTERFACE "$<$<LINK_LANGUAGE:C>:/DIR_C_INTERFACE>"
+ "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_INTERFACE>")
+
+add_executable(LinkDirs_exe_interface exe.c)
+target_link_libraries (LinkDirs_exe_interface PRIVATE LinkDirs_interface)
+
+add_executable(LinkDirs_exe_c exe.c)
+target_link_directories (LinkDirs_exe_c PRIVATE "$<$<LINK_LANGUAGE:C>:/DIR_C_EXE>"
+ "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_EXE>")
+
+add_executable(LinkDirs_exe_cxx exe.c)
+target_link_directories (LinkDirs_exe_cxx PRIVATE "$<$<LINK_LANGUAGE:C>:/DIR_C_EXE>"
+ "$<$<LINK_LANGUAGE:CXX>:/DIR_CXX_EXE>")
+set_property (TARGET LinkDirs_exe_cxx PROPERTY LINKER_LANGUAGE CXX)
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake
new file mode 100644
index 000000000..ed4f851f1
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG CXX)
+set (INVALID_LANG C)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-check.cmake
new file mode 100644
index 000000000..6bddee105
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-check.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-check.cmake
new file mode 100644
index 000000000..a32873819
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-check.cmake
@@ -0,0 +1,4 @@
+
+set (TYPE INTERFACE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-result.txt b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-interface-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-validation.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-validation.cmake
new file mode 100644
index 000000000..9872953a9
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID-validation.cmake
@@ -0,0 +1,26 @@
+
+if (NOT VALID_LANG)
+ set (VALID_LANG C)
+endif()
+if (NOT INVALID_LANG)
+ set (INVALID_LANG CXX)
+endif()
+if (NOT TYPE)
+ set (TYPE EXE)
+endif()
+
+if (NOT actual_stdout MATCHES "DIR_${VALID_LANG}_${TYPE}")
+ set (RunCMake_TEST_FAILED "Not found expected 'DIR_${VALID_LANG}_${TYPE}'.\n")
+endif()
+if (actual_stdout MATCHES "DIR_${INVALID_LANG}_${TYPE}")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'DIR_${INVALID_LANG}_${TYPE} '.")
+endif()
+if (actual_stdout MATCHES "DIR_(${VALID_LANG}|${INVALID_LANG})_BADID_${TYPE}")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'DIR_(${VALID_LANG}|${INVALID_LANG})_BADID_${TYPE}'.")
+endif()
diff --git a/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID.cmake b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID.cmake
new file mode 100644
index 000000000..eb3b3422b
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/genex_LINK_LANG_AND_ID.cmake
@@ -0,0 +1,29 @@
+
+enable_language(C)
+enable_language(CXX)
+
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+
+add_library(LinkDirs_interface INTERFACE)
+target_link_directories (LinkDirs_interface INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:/DIR_C_INTERFACE>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:/DIR_CXX_INTERFACE>
+ $<$<LINK_LANG_AND_ID:C,BADID>:/DIR_C_BADID_INTERFACE>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:/DIR_CXX_BADID_INTERFACE>)
+
+add_executable(LinkDirs_exe_interface exe.c)
+target_link_libraries (LinkDirs_exe_interface PRIVATE LinkDirs_interface)
+
+add_executable(LinkDirs_exe_c exe.c)
+target_link_options (LinkDirs_exe_c PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:/DIR_C_EXE>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:/DIR_CXX_EXE>
+ $<$<LINK_LANG_AND_ID:C,BADID>:/DIR_C_BADID_EXE>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:/DIR_CXX_BADID_EXE>)
+
+add_executable(LinkDirs_exe_cxx exe.c)
+target_link_directories (LinkDirs_exe_cxx PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:/DIR_C_EXE>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:/DIR_CXX_EXE>
+ $<$<LINK_LANG_AND_ID:C,BADID>:/DIR_C_BADID_EXE>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:/DIR_CXX_BADID_EXE>)
+set_property (TARGET LinkDirs_exe_cxx PROPERTY LINKER_LANGUAGE CXX)
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake
new file mode 100644
index 000000000..316b74b13
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/AliasTargets.cmake
@@ -0,0 +1,39 @@
+
+cmake_minimum_required(VERSION 3.16...3.17)
+
+enable_language(C)
+
+add_library (func SHARED func.c)
+
+set (binary_dir "${CMAKE_BINARY_DIR}")
+get_property (is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if (is_multi_config)
+ string (APPEND binary_dir "/Release")
+endif()
+
+
+add_library(import-local SHARED IMPORTED)
+set_property(TARGET import-local PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}")
+set_property(TARGET import-local PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+add_library(alias::local ALIAS import-local)
+
+add_library (lib-local SHARED lib.c)
+target_link_libraries (lib-local PRIVATE alias::local)
+
+add_executable (main-local main.c)
+target_link_libraries (main-local PRIVATE alias::local)
+
+
+add_library(import-global SHARED IMPORTED GLOBAL)
+set_property(TARGET import-global PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_SHARED_LIBRARY_SUFFIX}")
+set_property(TARGET import-global PROPERTY IMPORTED_IMPLIB "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}func${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+add_library(alias::global ALIAS import-global)
+
+add_library (lib-global SHARED lib.c)
+target_link_libraries (lib-global PRIVATE alias::global)
+
+add_executable (main-global main.c)
+target_link_libraries (main-global PRIVATE alias::global)
+
+
+add_subdirectory(sub_dir)
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/CMakeLists.txt b/Tests/RunCMake/target_link_libraries-ALIAS/CMakeLists.txt
new file mode 100644
index 000000000..9cf020fb0
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.1)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake
new file mode 100644
index 000000000..42ec47e97
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/RunCMakeTest.cmake
@@ -0,0 +1,25 @@
+include(RunCMake)
+
+macro(run_cmake_target test subtest target)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endmacro()
+
+set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+endif()
+run_cmake(AliasTargets)
+run_cmake_target(AliasTargets func func --config Release)
+run_cmake_target(AliasTargets lib-local lib-local --config Release)
+run_cmake_target(AliasTargets main-local main-local --config Release)
+run_cmake_target(AliasTargets lib-global lib-global --config Release)
+run_cmake_target(AliasTargets main-global main-global --config Release)
+run_cmake_target(AliasTargets lib-sub lib-sub --config Release)
+run_cmake_target(AliasTargets main-sub main-sub --config Release)
+unset(RunCMake_TEST_OPTIONS)
+unset(RunCMake_TEST_OUTPUT_MERGE)
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/func.c b/Tests/RunCMake/target_link_libraries-ALIAS/func.c
new file mode 100644
index 000000000..415a9bf98
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/func.c
@@ -0,0 +1,7 @@
+
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ void func_c()
+{
+}
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/lib.c b/Tests/RunCMake/target_link_libraries-ALIAS/lib.c
new file mode 100644
index 000000000..b2d1b6697
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/lib.c
@@ -0,0 +1,10 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_c();
+
+void lib()
+{
+ func_c();
+}
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/main.c b/Tests/RunCMake/target_link_libraries-ALIAS/main.c
new file mode 100644
index 000000000..a908dea23
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/main.c
@@ -0,0 +1,12 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_c();
+
+int main()
+{
+ func_c();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt b/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt
new file mode 100644
index 000000000..326e9643a
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/sub_dir/CMakeLists.txt
@@ -0,0 +1,7 @@
+
+
+add_library (lib-sub SHARED ../lib.c)
+target_link_libraries (lib-sub PRIVATE alias::local)
+
+add_executable (main-sub ../main.c)
+target_link_libraries (main-sub PRIVATE alias::local)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/CMakeLists.txt b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/CMakeLists.txt
new file mode 100644
index 000000000..9cf020fb0
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.1)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake
new file mode 100644
index 000000000..0f0e5d87a
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/RunCMakeTest.cmake
@@ -0,0 +1,41 @@
+include(RunCMake)
+
+macro(run_cmake_target test subtest target)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endmacro()
+
+run_cmake(bad-usage)
+
+if (RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Visual Studio|Xcode|Watcom WMake")
+
+ run_cmake(bad-mix-lang)
+
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ endif()
+
+ run_cmake(genex)
+
+ run_cmake_target(genex lib LinkLibraries_lib --config Release)
+ run_cmake_target(genex lib2 LinkLibraries_lib2 --config Release)
+ run_cmake_target(genex lib3 LinkLibraries_lib3 --config Release)
+ run_cmake_target(genex exe LinkLibraries_exe --config Release)
+ run_cmake_target(genex C_import LinkLibraries_C_import --config Release)
+ run_cmake_target(genex CXX_import LinkLibraries_CXX_import --config Release)
+ run_cmake_target(genex C_interface LinkLibraries_C_interface --config Release)
+ run_cmake_target(genex CXX_interface LinkLibraries_CXX_interface --config Release)
+ run_cmake_target(genex C_interface2 LinkLibraries_C_interface2 --config Release)
+ 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)
+
+ unset(RunCMake_TEST_OPTIONS)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang-stderr.txt b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang-stderr.txt
new file mode 100644
index 000000000..2ecdc0c1b
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: Evaluation of \$<LINK_LANGUAGE:...> or \$<LINK_LAND_AND_ID:...> changes
+the linker language for target "LinkLibraries_bad_mix_languages" \(from 'C' to 'CXX'\) which is invalid.
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang.cmake
new file mode 100644
index 000000000..e8efa7530
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-mix-lang.cmake
@@ -0,0 +1,8 @@
+
+enable_language(C)
+enable_language(CXX)
+
+add_library(static_CXX STATIC func.cxx)
+
+add_executable(LinkLibraries_bad_mix_languages main.c)
+target_link_libraries (LinkLibraries_bad_mix_languages PRIVATE $<$<LINK_LANGUAGE:C>:static_CXX>)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage-stderr.txt b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage-stderr.txt
new file mode 100644
index 000000000..d61f78915
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at bad-usage.cmake:4 \(target_link_libraries\):
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE> is not supported in link libraries expression.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage.cmake
new file mode 100644
index 000000000..81cfb0cef
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/bad-usage.cmake
@@ -0,0 +1,4 @@
+enable_language(C)
+
+add_library(simple SHARED empty.c)
+target_link_libraries(simple PRIVATE lib$<LINK_LANGUAGE>)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/empty.c b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/empty.c
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c
new file mode 100644
index 000000000..415a9bf98
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c
@@ -0,0 +1,7 @@
+
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ void func_c()
+{
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx
new file mode 100644
index 000000000..a12cacadb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.cxx
@@ -0,0 +1,7 @@
+
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ void func_cxx()
+{
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake
new file mode 100644
index 000000000..f3fe9554d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/genex.cmake
@@ -0,0 +1,72 @@
+
+cmake_minimum_required(VERSION 3.16...3.17)
+
+enable_language(C)
+enable_language(CXX)
+
+add_library(shared_C SHARED func.c)
+add_library(shared_CXX SHARED func.cxx)
+
+
+add_library(static1_C STATIC empty.c)
+target_link_libraries (static1_C INTERFACE $<$<LINK_LANGUAGE:C>:shared_C>)
+
+add_library(static2_C STATIC empty.c)
+target_link_libraries (static2_C PRIVATE $<$<LINK_LANGUAGE:C>:shared_C>)
+
+
+set (binary_dir "${CMAKE_BINARY_DIR}")
+get_property (is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if (is_multi_config)
+ string (APPEND binary_dir "/Release")
+endif()
+add_library(import STATIC IMPORTED)
+set_property(TARGET import PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}static1_C${CMAKE_STATIC_LIBRARY_SUFFIX}")
+target_link_libraries (import INTERFACE $<$<LINK_LANGUAGE:C>:shared_C>)
+target_link_libraries (import INTERFACE $<$<LINK_LANGUAGE:CXX>:shared_CXX>)
+
+
+add_library(interface INTERFACE)
+target_link_libraries (interface INTERFACE $<$<LINK_LANGUAGE:C>:shared_C>
+ $<$<LINK_LANGUAGE:CXX>:shared_CXX>)
+
+
+add_library(interface2 INTERFACE)
+target_link_libraries (interface2 INTERFACE import)
+
+
+add_library(static3 STATIC empty.c)
+target_link_libraries (static3 PRIVATE interface)
+
+
+add_library(LinkLibraries_lib SHARED lib.c)
+target_link_libraries (LinkLibraries_lib PRIVATE $<$<LINK_LANGUAGE:C>:shared_C>)
+
+add_library(LinkLibraries_lib2 SHARED lib.c)
+target_link_libraries (LinkLibraries_lib2 PRIVATE $<$<LINK_LANGUAGE:C>:static1_C>)
+
+add_library(LinkLibraries_lib3 SHARED lib.c)
+target_link_libraries (LinkLibraries_lib3 PRIVATE $<$<LINK_LANGUAGE:C>:static2_C>)
+
+add_executable(LinkLibraries_exe main.c)
+target_link_libraries (LinkLibraries_exe PRIVATE $<$<LINK_LANGUAGE:C>:shared_C>)
+
+add_executable(LinkLibraries_C_import main.c)
+target_link_libraries (LinkLibraries_C_import PRIVATE import)
+add_executable(LinkLibraries_CXX_import main.cxx)
+target_link_libraries (LinkLibraries_CXX_import PRIVATE import)
+
+add_executable(LinkLibraries_C_interface main.c)
+target_link_libraries (LinkLibraries_C_interface PRIVATE interface)
+add_executable(LinkLibraries_CXX_interface main.cxx)
+target_link_libraries (LinkLibraries_CXX_interface PRIVATE interface)
+
+add_executable(LinkLibraries_C_interface2 main.c)
+target_link_libraries (LinkLibraries_C_interface2 PRIVATE interface2)
+add_executable(LinkLibraries_CXX_interface2 main.cxx)
+target_link_libraries (LinkLibraries_CXX_interface2 PRIVATE interface2)
+
+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)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c
new file mode 100644
index 000000000..b2d1b6697
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c
@@ -0,0 +1,10 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_c();
+
+void lib()
+{
+ func_c();
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c
new file mode 100644
index 000000000..a908dea23
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c
@@ -0,0 +1,12 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_c();
+
+int main()
+{
+ func_c();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.cxx b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.cxx
new file mode 100644
index 000000000..ffaa3b47d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.cxx
@@ -0,0 +1,12 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_cxx();
+
+int main()
+{
+ func_cxx();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/CMakeLists.txt b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/CMakeLists.txt
new file mode 100644
index 000000000..9cf020fb0
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.1)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/RunCMakeTest.cmake
new file mode 100644
index 000000000..3b16f9e69
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/RunCMakeTest.cmake
@@ -0,0 +1,38 @@
+include(RunCMake)
+
+macro(run_cmake_target test subtest target)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endmacro()
+
+if (RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Visual Studio|Xcode|Watcom WMake")
+
+ run_cmake(bad-mix-lang)
+
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ endif()
+
+ run_cmake(genex)
+
+ run_cmake_target(genex lib LinkLibraries_lib --config Release)
+ run_cmake_target(genex lib2 LinkLibraries_lib2 --config Release)
+ run_cmake_target(genex lib3 LinkLibraries_lib3 --config Release)
+ run_cmake_target(genex exe LinkLibraries_exe --config Release)
+ run_cmake_target(genex C_import LinkLibraries_C_import --config Release)
+ run_cmake_target(genex CXX_import LinkLibraries_CXX_import --config Release)
+ run_cmake_target(genex C_interface LinkLibraries_C_interface --config Release)
+ run_cmake_target(genex CXX_interface LinkLibraries_CXX_interface --config Release)
+ run_cmake_target(genex C_interface2 LinkLibraries_C_interface2 --config Release)
+ run_cmake_target(genex CXX_interface2 LinkLibraries_CXX_interface2 --config Release)
+ run_cmake_target(genex CXX_static LinkLibraries_CXX_static --config Release)
+
+ unset(RunCMake_TEST_OPTIONS)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang-stderr.txt b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang-stderr.txt
new file mode 100644
index 000000000..2ecdc0c1b
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error: Evaluation of \$<LINK_LANGUAGE:...> or \$<LINK_LAND_AND_ID:...> changes
+the linker language for target "LinkLibraries_bad_mix_languages" \(from 'C' to 'CXX'\) which is invalid.
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang.cmake
new file mode 100644
index 000000000..f80010add
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/bad-mix-lang.cmake
@@ -0,0 +1,8 @@
+
+enable_language(C)
+enable_language(CXX)
+
+add_library(static_CXX STATIC func.cxx)
+
+add_executable(LinkLibraries_bad_mix_languages main.c)
+target_link_libraries (LinkLibraries_bad_mix_languages PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:static_CXX>)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/basic-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/basic-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/empty.c b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/empty.c
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/empty.c
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/exe_c-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/exe_c-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/exe_c-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/exe_cxx-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/exe_cxx-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/exe_cxx-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.c b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.c
new file mode 100644
index 000000000..415a9bf98
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.c
@@ -0,0 +1,7 @@
+
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ void func_c()
+{
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.cxx b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.cxx
new file mode 100644
index 000000000..a12cacadb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.cxx
@@ -0,0 +1,7 @@
+
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ void func_cxx()
+{
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/genex.cmake b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/genex.cmake
new file mode 100644
index 000000000..9feccd074
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/genex.cmake
@@ -0,0 +1,73 @@
+
+cmake_minimum_required(VERSION 3.16...3.17)
+
+enable_language(C)
+enable_language(CXX)
+
+
+add_library(shared_C SHARED func.c)
+add_library(shared_CXX SHARED func.cxx)
+
+
+add_library(static1_C STATIC empty.c)
+target_link_libraries (static1_C INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>)
+
+add_library(static2_C STATIC empty.c)
+target_link_libraries (static2_C PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>)
+
+
+set (binary_dir "${CMAKE_BINARY_DIR}")
+get_property (is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if (is_multi_config)
+ string (APPEND binary_dir "/Release")
+endif()
+add_library(import STATIC IMPORTED)
+set_property(TARGET import PROPERTY IMPORTED_LOCATION "${binary_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}static1_C${CMAKE_STATIC_LIBRARY_SUFFIX}")
+target_link_libraries (import INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>)
+target_link_libraries (import INTERFACE $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:shared_CXX>)
+
+
+add_library(interface INTERFACE)
+target_link_libraries (interface INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:shared_CXX>)
+
+
+add_library(interface2 INTERFACE)
+target_link_libraries (interface2 INTERFACE import)
+
+
+add_library(static3 STATIC empty.c)
+target_link_libraries (static3 PRIVATE interface)
+
+
+add_library(LinkLibraries_lib SHARED lib.c)
+target_link_libraries (LinkLibraries_lib PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>)
+
+add_library(LinkLibraries_lib2 SHARED lib.c)
+target_link_libraries (LinkLibraries_lib2 PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:static1_C>)
+
+add_library(LinkLibraries_lib3 SHARED lib.c)
+target_link_libraries (LinkLibraries_lib3 PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:static2_C>)
+
+add_executable(LinkLibraries_exe main.c)
+target_link_libraries (LinkLibraries_exe PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:shared_C>)
+
+add_executable(LinkLibraries_C_import main.c)
+target_link_libraries (LinkLibraries_C_import PRIVATE import)
+add_executable(LinkLibraries_CXX_import main.cxx)
+target_link_libraries (LinkLibraries_CXX_import PRIVATE import)
+
+add_executable(LinkLibraries_C_interface main.c)
+target_link_libraries (LinkLibraries_C_interface PRIVATE interface)
+add_executable(LinkLibraries_CXX_interface main.cxx)
+target_link_libraries (LinkLibraries_CXX_interface PRIVATE interface)
+
+add_executable(LinkLibraries_C_interface2 main.c)
+target_link_libraries (LinkLibraries_C_interface2 PRIVATE interface2)
+add_executable(LinkLibraries_CXX_interface2 main.cxx)
+target_link_libraries (LinkLibraries_CXX_interface2 PRIVATE interface2)
+
+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)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/interface-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/interface-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/interface-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/lib.c b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/lib.c
new file mode 100644
index 000000000..b2d1b6697
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/lib.c
@@ -0,0 +1,10 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_c();
+
+void lib()
+{
+ func_c();
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.c b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.c
new file mode 100644
index 000000000..a908dea23
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.c
@@ -0,0 +1,12 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_c();
+
+int main()
+{
+ func_c();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.cxx b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.cxx
new file mode 100644
index 000000000..ffaa3b47d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.cxx
@@ -0,0 +1,12 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_cxx();
+
+int main()
+{
+ func_cxx();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/no_language-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/no_language-result.txt
new file mode 100644
index 000000000..573541ac9
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/no_language-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt
new file mode 100644
index 000000000..7389effc2
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at CMP0108-self-link.cmake:[0-9]+ \(add_library\):
+ Target "foo" links to itself.
+Call Stack \(most recent call first\):
+ CMP0108-NEW-self-link.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake
new file mode 100644
index 000000000..4ee962177
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy (SET CMP0108 NEW)
+
+include (CMP0108-self-link.cmake)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake
new file mode 100644
index 000000000..813104a41
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy (SET CMP0108 OLD)
+
+include (CMP0108-self-link.cmake)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
new file mode 100644
index 000000000..07a3490dd
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
@@ -0,0 +1,9 @@
+
+cmake_policy (SET CMP0038 NEW)
+cmake_policy (SET CMP0042 NEW)
+
+enable_language(C)
+
+add_library(foo SHARED lib.c)
+add_library(Bar::foo ALIAS foo)
+target_link_libraries(foo PRIVATE Bar::foo)
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index 8eed98619..189592d76 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -19,6 +19,8 @@ run_cmake(CMP0079-link-WARN)
run_cmake(CMP0079-link-OLD)
run_cmake(CMP0079-link-NEW)
run_cmake(CMP0079-link-NEW-bogus)
+run_cmake(CMP0108-OLD-self-link)
+run_cmake(CMP0108-NEW-self-link)
run_cmake(ImportedTarget)
run_cmake(ImportedTargetFailure)
run_cmake(MixedSignature)
diff --git a/Tests/RunCMake/target_link_libraries/lib.c b/Tests/RunCMake/target_link_libraries/lib.c
new file mode 100644
index 000000000..b2d1b6697
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/lib.c
@@ -0,0 +1,10 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void func_c();
+
+void lib()
+{
+ func_c();
+}
diff --git a/Tests/RunCMake/target_link_options/LinkOptionsDevice.cu b/Tests/RunCMake/target_link_options/LinkOptionsDevice.cu
new file mode 100644
index 000000000..96504e129
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/LinkOptionsDevice.cu
@@ -0,0 +1,14 @@
+#include <cuda.h>
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+ int simplelib()
+{
+ return 0;
+}
+
+int main(void)
+{
+ return simplelib();
+}
diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
index cdfdd7b59..8ef13f96a 100644
--- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
@@ -13,8 +13,9 @@ endmacro()
if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
# Intel compiler does not reject bad flags or objects!
set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ set(RunCMake_TEST_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
- set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
endif()
run_cmake(LINK_OPTIONS)
@@ -27,6 +28,39 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
run_cmake_target(LINK_OPTIONS mod LinkOptions_mod --config Release)
run_cmake_target(LINK_OPTIONS exe LinkOptions_exe --config Release)
+
+ run_cmake(genex_LINK_LANGUAGE)
+
+ run_cmake_target(genex_LINK_LANGUAGE interface LinkOptions_shared_interface --config Release)
+ run_cmake_target(genex_LINK_LANGUAGE shared_c LinkOptions_shared_c --config Release)
+ run_cmake_target(genex_LINK_LANGUAGE LINKER_LANGUAGE LinkOptions_shared_cxx --config Release)
+ run_cmake_target(genex_LINK_LANGUAGE mod LinkOptions_mod --config Release)
+ run_cmake_target(genex_LINK_LANGUAGE exe LinkOptions_exe --config Release)
+
+ run_cmake(genex_LINK_LANG_AND_ID)
+
+ run_cmake_target(genex_LINK_LANG_AND_ID interface LinkOptions_shared_interface --config Release)
+ run_cmake_target(genex_LINK_LANG_AND_ID shared_c LinkOptions_shared_c --config Release)
+ run_cmake_target(genex_LINK_LANG_AND_ID LINKER_LANGUAGE LinkOptions_shared_cxx --config Release)
+ run_cmake_target(genex_LINK_LANG_AND_ID mod LinkOptions_mod --config Release)
+ run_cmake_target(genex_LINK_LANG_AND_ID exe LinkOptions_exe --config Release)
+
+ run_cmake(genex_DEVICE_LINK)
+
+ run_cmake_target(genex_DEVICE_LINK interface LinkOptions_shared_interface --config Release)
+ run_cmake_target(genex_DEVICE_LINK private LinkOptions_private --config Release)
+ if (CMake_TEST_CUDA)
+ # Separable compilation is only supported on NVCC.
+ if(NOT CMake_TEST_CUDA STREQUAL "Clang")
+ run_cmake_target(genex_DEVICE_LINK CMP0105_UNSET LinkOptions_CMP0105_UNSET --config Release)
+ run_cmake_target(genex_DEVICE_LINK CMP0105_OLD LinkOptions_CMP0105_OLD --config Release)
+ run_cmake_target(genex_DEVICE_LINK CMP0105_NEW LinkOptions_CMP0105_NEW --config Release)
+ run_cmake_target(genex_DEVICE_LINK device LinkOptions_device --config Release)
+ endif()
+
+ run_cmake_target(genex_DEVICE_LINK no_device LinkOptions_no_device --config Release)
+ endif()
+
unset(RunCMake_TEST_OPTIONS)
unset(RunCMake_TEST_OUTPUT_MERGE)
endif()
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-check.cmake
new file mode 100644
index 000000000..20c4fabbd
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "BADFLAG_DEVICE_LINK")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_DEVICE_LINK'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-check.cmake
new file mode 100644
index 000000000..23c3b4633
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-check.cmake
@@ -0,0 +1,3 @@
+set (DEVICE_LINK TRUE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_DEVICE_LINK-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-check.cmake
new file mode 100644
index 000000000..8431e2240
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-check.cmake
@@ -0,0 +1,3 @@
+set (DEVICE_LINK FALSE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_DEVICE_LINK-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-check.cmake
new file mode 100644
index 000000000..8431e2240
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-check.cmake
@@ -0,0 +1,3 @@
+set (DEVICE_LINK FALSE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_DEVICE_LINK-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-check.cmake
new file mode 100644
index 000000000..8431e2240
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-check.cmake
@@ -0,0 +1,3 @@
+set (DEVICE_LINK FALSE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_DEVICE_LINK-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-validation.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-validation.cmake
new file mode 100644
index 000000000..28f5d0111
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-validation.cmake
@@ -0,0 +1,22 @@
+
+if (NOT DEFINED DEVICE_LINK)
+ set (DEVICE_LINK FALSE)
+endif()
+
+if (DEVICE_LINK)
+ set (VALID_ID DEVICE_LINK)
+ set (INVALID_ID NORMAL_LINK)
+else()
+ set (VALID_ID NORMAL_LINK)
+ set (INVALID_ID DEVICE_LINK)
+endif()
+
+if (NOT actual_stdout MATCHES "BADFLAG_${VALID_ID}")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_ID}'.")
+endif()
+if (actual_stdout MATCHES "BADFLAG_${INVALID_ID}")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_ID}'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
new file mode 100644
index 000000000..01260805a
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
@@ -0,0 +1,51 @@
+
+enable_language(C)
+
+set (obj "${CMAKE_C_OUTPUT_EXTENSION}")
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_library(LinkOptions_interface INTERFACE)
+target_link_options (LinkOptions_interface INTERFACE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+
+add_library(LinkOptions_shared_interface SHARED LinkOptionsLib.c)
+target_link_libraries (LinkOptions_shared_interface PRIVATE LinkOptions_interface)
+
+
+add_library(LinkOptions_private SHARED LinkOptionsLib.c)
+target_link_options (LinkOptions_private PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+
+if (CMake_TEST_CUDA)
+ enable_language(CUDA)
+
+ # Separable compilation is only supported on NVCC.
+ if(NOT CMake_TEST_CUDA STREQUAL "Clang")
+ add_executable(LinkOptions_CMP0105_UNSET LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_UNSET PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_UNSET PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+
+ cmake_policy(SET CMP0105 OLD)
+
+ add_executable(LinkOptions_CMP0105_OLD LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_OLD PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_OLD PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+
+ cmake_policy(SET CMP0105 NEW)
+
+ add_executable(LinkOptions_CMP0105_NEW LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_NEW PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_NEW PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+
+ add_executable(LinkOptions_device LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_device PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_device PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+ endif()
+
+ add_executable(LinkOptions_no_device LinkOptionsDevice.cu)
+ target_link_options(LinkOptions_no_device PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+endif()
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake
new file mode 100644
index 000000000..aa3981023
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG CXX)
+set (INVALID_LANG C)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-LINKER_LANGUAGE-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-check.cmake
new file mode 100644
index 000000000..71f641d97
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-exe-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-check.cmake
new file mode 100644
index 000000000..ba0120ccd
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG C)
+set (INVALID_LANG CXX)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-interface-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-check.cmake
new file mode 100644
index 000000000..71f641d97
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-mod-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake
new file mode 100644
index 000000000..ba0120ccd
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG C)
+set (INVALID_LANG CXX)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANGUAGE-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-shared_c-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-validation.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-validation.cmake
new file mode 100644
index 000000000..f0237abbe
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE-validation.cmake
@@ -0,0 +1,17 @@
+
+if (NOT DEFINED VALID_LANG)
+ set (VALID_LANG C)
+endif()
+if (NOT DEFINED INVALID_LANG)
+ set (INVALID_LANG CXX)
+endif()
+
+if (NOT actual_stdout MATCHES "BADFLAG_${VALID_LANG}_LANG")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_LANG}_LANG'.")
+endif()
+if (actual_stdout MATCHES "BADFLAG_${INVALID_LANG}_LANG")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_LANG}_LANG'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE.cmake
new file mode 100644
index 000000000..61e615927
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANGUAGE.cmake
@@ -0,0 +1,32 @@
+
+enable_language(C)
+enable_language(CXX)
+
+set (obj "${CMAKE_C_OUTPUT_EXTENSION}")
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_library(LinkOptions_interface INTERFACE)
+target_link_options (LinkOptions_interface INTERFACE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>
+ $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>)
+
+add_library(LinkOptions_shared_interface SHARED LinkOptionsLib.c)
+target_link_libraries (LinkOptions_shared_interface PRIVATE LinkOptions_interface)
+
+add_library(LinkOptions_shared_c SHARED LinkOptionsLib.c)
+target_link_options (LinkOptions_shared_c PRIVATE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>
+ $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>)
+
+add_library(LinkOptions_shared_cxx SHARED LinkOptionsLib.c)
+target_link_options (LinkOptions_shared_cxx PRIVATE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>
+ $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>)
+set_property (TARGET LinkOptions_shared_cxx PROPERTY LINKER_LANGUAGE CXX)
+
+add_library(LinkOptions_mod MODULE LinkOptionsLib.c)
+target_link_options (LinkOptions_mod PRIVATE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>
+ $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>)
+
+add_executable(LinkOptions_exe LinkOptionsExe.c)
+target_link_options (LinkOptions_exe PRIVATE $<$<LINK_LANGUAGE:C>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>
+ $<$<LINK_LANGUAGE:CXX>:${pre}BADFLAG_$<LINK_LANGUAGE>_LANG${obj}>)
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake
new file mode 100644
index 000000000..ed4f851f1
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG CXX)
+set (INVALID_LANG C)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-LINKER_LANGUAGE-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake
new file mode 100644
index 000000000..6bddee105
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-exe-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-check.cmake
new file mode 100644
index 000000000..cf498d9af
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG C)
+set (INVALID_LANG CXX)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-interface-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake
new file mode 100644
index 000000000..6bddee105
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-check.cmake
@@ -0,0 +1,2 @@
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-mod-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake
new file mode 100644
index 000000000..cf498d9af
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-check.cmake
@@ -0,0 +1,5 @@
+
+set (VALID_LANG C)
+set (INVALID_LANG CXX)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_LINK_LANG_AND_ID-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt
new file mode 100644
index 000000000..8d98f9deb
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-shared_c-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-validation.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-validation.cmake
new file mode 100644
index 000000000..a5dc27ff9
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID-validation.cmake
@@ -0,0 +1,23 @@
+
+if (NOT VALID_LANG)
+ set (VALID_LANG C)
+endif()
+if (NOT INVALID_LANG)
+ set (INVALID_LANG CXX)
+endif()
+
+if (NOT actual_stdout MATCHES "BADFLAG_${VALID_LANG}_LANG_ID")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_LANG}_LANG_ID'.\n")
+endif()
+if (actual_stdout MATCHES "BADFLAG_${INVALID_LANG}_LANG_ID")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_LANG}_LANG_ID '.")
+endif()
+if (actual_stdout MATCHES "BADFLAG_(${VALID_LANG}|${INVALID_LANG})_BADID")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_(${VALID_LANG}|${INVALID_LANG})_BADID'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID.cmake b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID.cmake
new file mode 100644
index 000000000..db0f500f7
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_LINK_LANG_AND_ID.cmake
@@ -0,0 +1,41 @@
+
+enable_language(C)
+enable_language(CXX)
+
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_library(LinkOptions_interface INTERFACE)
+target_link_options (LinkOptions_interface INTERFACE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>)
+
+add_library(LinkOptions_shared_interface SHARED LinkOptionsLib.c)
+target_link_libraries (LinkOptions_shared_interface PRIVATE LinkOptions_interface)
+
+add_library(LinkOptions_shared_c SHARED LinkOptionsLib.c)
+target_link_options (LinkOptions_shared_c PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>)
+
+add_library(LinkOptions_shared_cxx SHARED LinkOptionsLib.c)
+target_link_options (LinkOptions_shared_cxx PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>)
+set_property (TARGET LinkOptions_shared_cxx PROPERTY LINKER_LANGUAGE CXX)
+
+add_library(LinkOptions_mod MODULE LinkOptionsLib.c)
+target_link_options (LinkOptions_mod PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>)
+
+add_executable(LinkOptions_exe LinkOptionsExe.c)
+target_link_options (LinkOptions_exe PRIVATE $<$<LINK_LANG_AND_ID:C,${CMAKE_C_COMPILER_ID}>:${pre}BADFLAG_C_LANG_ID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,${CMAKE_CXX_COMPILER_ID}>:${pre}BADFLAG_CXX_LANG_ID${CMAKE_CXX_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:C,BADID>:${pre}BADFLAG_C_BADID${CMAKE_C_OUTPUT_EXTENSION}>
+ $<$<LINK_LANG_AND_ID:CXX,BADID>:${pre}BADFLAG_CXX_BADID${CMAKE_CXX_OUTPUT_EXTENSION}>)
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index bee9e5bba..82c55ccb6 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -83,13 +83,17 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
message(STATUS "RerunCMake: first configuration...")
run_cmake(RerunCMake)
- run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+ if(NOT CMake_TEST_FILESYSTEM_1S)
+ run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+ endif()
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
message(STATUS "RerunCMake: modify try_compile input...")
file(WRITE "${in_tc}" "does-not-compile\n")
run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .)
- run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+ if(NOT CMake_TEST_FILESYSTEM_1S)
+ run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+ endif()
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt
index a5740bba9..d726395ee 100644
--- a/Tests/SourceGroups/CMakeLists.txt
+++ b/Tests/SourceGroups/CMakeLists.txt
@@ -30,6 +30,9 @@ source_group(Base\\Sub1\\Base FILES bar.c)
# a group without files, is currently not created
source_group(EmptyGroup)
+# Forward slashes can be delimiters too
+source_group(Base/Nested FILES nested.c)
+
set(root ${CMAKE_CURRENT_SOURCE_DIR})
set(tree_files_without_prefix ${root}/sub1/tree_bar.c
@@ -58,4 +61,5 @@ source_group(PREFIX "" FILES ${tree_files_with_empty_prefix} TREE ${root})
add_executable(SourceGroups main.c bar.c foo.c sub1/foo.c sub1/foobar.c baz.c
${tree_files_with_prefix} ${tree_files_without_prefix}
- ${tree_files_with_empty_prefix} README.txt)
+ ${tree_files_with_empty_prefix} README.txt
+ nested.c)
diff --git a/Tests/SourceGroups/main.c b/Tests/SourceGroups/main.c
index 87225f546..f646b4901 100644
--- a/Tests/SourceGroups/main.c
+++ b/Tests/SourceGroups/main.c
@@ -12,6 +12,7 @@ extern int tree_empty_prefix_bar(void);
extern int tree_bar(void);
extern int tree_foobar(void);
extern int tree_baz(void);
+extern int nested(void);
int main()
{
@@ -23,5 +24,8 @@ int main()
"tree_empty_prefix_bar: %d\n",
tree_prefix_foo(), tree_prefix_bar(), tree_bar(), tree_foobar(),
tree_baz(), tree_empty_prefix_foo(), tree_empty_prefix_bar());
+
+ printf("nested: %d\n", nested());
+
return 0;
}
diff --git a/Tests/SourceGroups/nested.c b/Tests/SourceGroups/nested.c
new file mode 100644
index 000000000..4e314807f
--- /dev/null
+++ b/Tests/SourceGroups/nested.c
@@ -0,0 +1,4 @@
+int nested(void)
+{
+ return 123;
+}
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index f4cbac212..e24279b5b 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -1,4 +1,16 @@
cmake_minimum_required(VERSION 3.3)
+
+# NOTE: Force the Release mode configuration as there are some issues with the
+# debug information handling on macOS on certain Xcode builds.
+if(NOT CMAKE_CONFIGURATION_TYPES)
+ set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build" FORCE)
+endif()
+
+# NOTE: enable shared libraries by default. Older Xcode releases do not play
+# well with static libraries, and Windows does not currently support static
+# libraries in Swift.
+set(BUILD_SHARED_LIBS YES)
+
project(SwiftOnly Swift)
if(NOT XCODE_VERSION VERSION_LESS 10.2)
@@ -7,7 +19,19 @@ elseif(NOT XCODE_VERSION VERSION_LESS 8.0)
set(CMAKE_Swift_LANGUAGE_VERSION 3.0)
endif()
+set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
+
add_executable(SwiftOnly main.swift)
+add_library(L L.swift)
+
+add_library(M M.swift)
+target_link_libraries(M PUBLIC
+ L)
+
+add_library(N N.swift)
+target_link_libraries(N PUBLIC
+ M)
+
# Dummy to make sure generation works with such targets.
add_library(SwiftIface INTERFACE)
diff --git a/Tests/SwiftOnly/L.swift b/Tests/SwiftOnly/L.swift
new file mode 100644
index 000000000..79ff87eaf
--- /dev/null
+++ b/Tests/SwiftOnly/L.swift
@@ -0,0 +1 @@
+public let ThirtyTwo: Int = 32
diff --git a/Tests/SwiftOnly/M.swift b/Tests/SwiftOnly/M.swift
new file mode 100644
index 000000000..dd333fe13
--- /dev/null
+++ b/Tests/SwiftOnly/M.swift
@@ -0,0 +1,2 @@
+import L
+public let SixtyFour: Int = ThirtyTwo * 2
diff --git a/Tests/SwiftOnly/N.swift b/Tests/SwiftOnly/N.swift
new file mode 100644
index 000000000..990ddf948
--- /dev/null
+++ b/Tests/SwiftOnly/N.swift
@@ -0,0 +1,2 @@
+import M
+public let OneTwentyEight = SixtyFour * 2
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 9ec9b70fd..df921d814 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -187,7 +187,7 @@ try_compile(SHOULD_FAIL_DUE_TO_BAD_SOURCE
if(SHOULD_FAIL_DUE_TO_BAD_SOURCE AND NOT CMAKE_GENERATOR MATCHES "Watcom WMake|NMake Makefiles")
string(REPLACE "\n" "\n " output " ${output}")
message(SEND_ERROR "try_compile with bad#source.c did not fail:\n${output}")
-elseif(NOT output MATCHES [[(bad#source\.c|bad\\)]])
+elseif(NOT output MATCHES [[(bad#source\.c|bad\.c|bad')]])
string(REPLACE "\n" "\n " output " ${output}")
message(SEND_ERROR "try_compile with bad#source.c failed without mentioning bad source:\n${output}")
else()
diff --git a/Tests/UseSWIG/BasicConfiguration.cmake b/Tests/UseSWIG/BasicConfiguration.cmake
index fd3ac4031..d054953e4 100644
--- a/Tests/UseSWIG/BasicConfiguration.cmake
+++ b/Tests/UseSWIG/BasicConfiguration.cmake
@@ -18,6 +18,9 @@ unset(SWIG_LANG_LIBRARIES)
if(${language} MATCHES csharp)
set(SWIG_LANG_TYPE TYPE SHARED)
endif()
+if(${language} MATCHES fortran)
+ set(SWIG_LANG_TYPE TYPE SHARED)
+endif()
if(${language} MATCHES python)
find_package(Python REQUIRED COMPONENTS Interpreter Development)
set(SWIG_LANG_INCLUDE_DIRECTORIES ${Python_INCLUDE_DIRS})
diff --git a/Tests/UseSWIG/BasicFortran/CMakeLists.txt b/Tests/UseSWIG/BasicFortran/CMakeLists.txt
new file mode 100644
index 000000000..e81fb85ce
--- /dev/null
+++ b/Tests/UseSWIG/BasicFortran/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 3.12...3.13)
+
+project(TestBasicFortran CXX Fortran)
+
+include(CTest)
+
+set(language "fortran")
+
+include (../BasicConfiguration.cmake)
+get_target_property(EXAMPLE_PREFIX example PREFIX)
+if (NOT EXAMPLE_PREFIX STREQUAL "${CMAKE_SHARED_LIBRARY_PREFIX}"
+ AND NOT EXAMPLE_PREFIX STREQUAL "EXAMPLE_PREFIX-NOTFOUND")
+ message(FATAL_ERROR "Unexpected library prefix on target: got "
+ "'${EXAMPLE_PREFIX}' but expected '${CMAKE_SHARED_LIBRARY_PREFIX}'")
+endif()
+
+
+add_executable(runme ${CMAKE_CURRENT_SOURCE_DIR}/../runme.f90)
+target_link_libraries(runme example)
+set_target_properties(runme PROPERTIES LINKER_LANGUAGE Fortran)
+
+add_test (NAME BasicFortran
+ COMMAND $<TARGET_FILE:runme>)
diff --git a/Tests/UseSWIG/CMakeLists.txt b/Tests/UseSWIG/CMakeLists.txt
index 3cc910fec..d10284674 100644
--- a/Tests/UseSWIG/CMakeLists.txt
+++ b/Tests/UseSWIG/CMakeLists.txt
@@ -55,6 +55,21 @@ add_test(NAME UseSWIG.BasicPerl COMMAND
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+if (CMake_TEST_UseSWIG_Fortran)
+ check_language(Fortran)
+ if (CMAKE_Fortran_COMPILER)
+ add_test(NAME UseSWIG.BasicFortran COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/UseSWIG/BasicFortran"
+ "${CMake_BINARY_DIR}/Tests/UseSWIG/BasicFortran"
+ ${build_generator_args}
+ --build-project TestBasicFortran
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ endif()
+endif()
add_test(NAME UseSWIG.MultipleModules COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
diff --git a/Tests/UseSWIG/runme.f90 b/Tests/UseSWIG/runme.f90
new file mode 100644
index 000000000..1d985d3ac
--- /dev/null
+++ b/Tests/UseSWIG/runme.f90
@@ -0,0 +1,77 @@
+! File : runme.f90
+program runme
+ use ISO_FORTRAN_ENV
+ implicit none
+ integer, parameter :: STDOUT = OUTPUT_UNIT
+
+ call run()
+contains
+
+subroutine run()
+ use example
+ use iso_c_binding
+ implicit none
+
+ type(Circle) :: c
+ type(Square), target :: s ! 'target' allows it to be pointed to
+ class(Shape), pointer :: sh
+ integer(C_INT) :: n_shapes
+
+ ! ----- Object creation -----
+
+ write(STDOUT,*) "Creating some objects"
+ c = Circle(10.0d0)
+ s = Square(10.0d0)
+
+ ! ----- Access a static member -----
+ write(STDOUT,'(a,i2,a)')"A total of", s%get_nshapes(), " shapes were created"
+
+ ! ----- Member data access -----
+
+ ! Notice how we can do this using functions specific to
+ ! the 'Circle' class.
+ call c%set_x(20.0d0)
+ call c%set_y(30.0d0)
+
+ ! Now use the same functions in the base class
+ sh => s
+ call sh%set_x(-10.0d0)
+ call sh%set_y( 5.0d0)
+
+ write(STDOUT,*)"Here is their current position:"
+ write(STDOUT,'(a,f5.1,a,f5.1,a)')" Circle = (", c%get_x(), ",", c%get_y(), " )"
+ write(STDOUT,'(a,f5.1,a,f5.1,a)')" Square = (", s%get_x(), ",", s%get_y(), " )"
+
+ ! ----- Call some methods -----
+
+ write(STDOUT,*)"Here are some properties of the shapes:"
+ call print_shape(c)
+ call print_shape(s)
+
+ ! ----- Delete everything -----
+
+ ! Note: this invokes the virtual destructor
+ call c%release()
+ call s%release()
+
+ n_shapes = c%get_nshapes()
+ write(STDOUT,*) n_shapes, "shapes remain"
+ if (n_shapes /= 0) then
+ write(STDOUT,*) "Shapes were not freed properly!"
+ stop 1
+ endif
+
+ write(STDOUT,*) "Goodbye"
+end subroutine
+
+subroutine print_shape(s)
+ use example, only : Shape
+ use iso_c_binding
+ implicit none
+ class(Shape), intent(in) :: s
+
+ write(STDOUT,*)" area = ",s%area()
+ write(STDOUT,*)" perimeter = ",s%perimeter()
+end subroutine
+
+end program
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index b8e157dae..558d5de95 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -127,7 +127,7 @@ 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_OUTPUT_HEADER_FILE "$(OutDir)%(Filename).h")
-
+set_property(SOURCE ${VERTEXSHADER_FILES} PROPERTY VS_SETTINGS "$<$<CONFIG:DEBUG>:SourceProperty1=SourceProperty1Value>")
source_group("Source Files" FILES ${SOURCE_FILES})
source_group("Header Files" FILES ${HEADER_FILES})
@@ -135,6 +135,11 @@ source_group("Resource Files" FILES ${RESOURCE_FILES})
add_executable(${EXE_NAME} WIN32 ${SOURCE_FILES} ${HEADER_FILES} ${RESOURCE_FILES})
set_property(TARGET ${EXE_NAME} PROPERTY VS_WINRT_COMPONENT TRUE)
+set_property(TARGET ${EXE_NAME} PROPERTY VS_SOURCE_SETTINGS_FXCompile
+ "TargetProperty1=$<$<CONFIG:DEBUG>:TargetProperty1ValueDebug>$<$<CONFIG:RELEASE>:TargetProperty1ValueRelease>")
+
+add_custom_command(TARGET ${EXE_NAME} POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -Dvcxproj="${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}.vcxproj" -P "${CMAKE_CURRENT_SOURCE_DIR}/EnsurePropertiesSet.cmake")
string(SUBSTRING "${CMAKE_SYSTEM_VERSION}" 0, 4, SHORT_VERSION)
diff --git a/Tests/VSWinStorePhone/EnsurePropertiesSet.cmake b/Tests/VSWinStorePhone/EnsurePropertiesSet.cmake
new file mode 100644
index 000000000..528c46f96
--- /dev/null
+++ b/Tests/VSWinStorePhone/EnsurePropertiesSet.cmake
@@ -0,0 +1,45 @@
+macro(ensure_props_set projectFile)
+ if(NOT EXISTS "${projectFile}")
+ message(FATAL_ERROR "Project file ${projectFile} does not exist.")
+ return()
+ endif()
+
+ set(SourcePropertyFound FALSE)
+ set(DebugTargetPropertyFound FALSE)
+ set(ReleaseTargetPropertyFound FALSE)
+
+ file(STRINGS "${projectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "<SourceProperty1.*Debug.*>SourceProperty1Value</SourceProperty1>")
+ message("SourceProperty1 setting found")
+ set(SourcePropertyFound TRUE)
+ endif()
+
+ if(line MATCHES "<TargetProperty1.*Debug.*>TargetProperty1ValueDebug</TargetProperty1>")
+ message("Debug TargetProperty1 setting found")
+ set(DebugTargetPropertyFound TRUE)
+ endif()
+
+ if(line MATCHES "<TargetProperty1.*Release.*>TargetProperty1ValueRelease</TargetProperty1>")
+ message("Release TargetProperty1 setting found")
+ set(ReleaseTargetPropertyFound TRUE)
+ endif()
+ endforeach()
+
+ if (NOT SourcePropertyFound)
+ message(FATAL_ERROR "SourceProperty1 setting not found")
+ return()
+ endif()
+
+ if (NOT DebugTargetPropertyFound)
+ message(FATAL_ERROR "Debug TargetProperty1 setting not found")
+ return()
+ endif()
+
+ if (NOT ReleaseTargetPropertyFound)
+ message(FATAL_ERROR "Release TargetProperty1 setting not found")
+ return()
+ endif()
+endmacro()
+
+ensure_props_set("${vcxproj}")
diff --git a/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp
index 154e268c7..0c37370c0 100644
--- a/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp
+++ b/Tests/VSWindowsFormsResx/WindowsFormsResx/MyForm.cpp
@@ -1 +1 @@
-#include "MyForm.h" \ No newline at end of file
+#include "MyForm.h"