summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Architecture/bar.c2
-rw-r--r--Tests/BuildDepends/Project/link_depends_no_shared_exe.c2
-rw-r--r--Tests/CMakeCommands/target_compile_definitions/consumer.c2
-rw-r--r--Tests/CMakeCommands/target_compile_features/main.c2
-rw-r--r--Tests/CMakeCommands/target_compile_features/restrict_user.c2
-rw-r--r--Tests/CMakeCommands/target_compile_options/consumer.c2
-rw-r--r--Tests/CMakeCommands/target_include_directories/consumer.c2
-rw-r--r--Tests/CMakeLib/CMakeLists.txt3
-rw-r--r--Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt2
-rw-r--r--Tests/CMakeLib/testDebuggerThread.cxx33
-rw-r--r--Tests/CMakeLib/testUVHandlePtr.cxx153
-rw-r--r--Tests/CMakeLib/testUVJobServerClient.cxx179
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx53
-rw-r--r--Tests/CMakeLib/testUVRAII.cxx7
-rw-r--r--Tests/COnly/conly.c2
-rw-r--r--Tests/COnly/libc1.c2
-rw-r--r--Tests/COnly/libc2.c2
-rw-r--r--Tests/CPackInnoSetupGenerator/main.c2
-rw-r--r--Tests/CTestTestVerboseOutput/nop.c2
-rw-r--r--Tests/CommandLength/test.c2
-rw-r--r--Tests/CompileDefinitions/runtest.c2
-rw-r--r--Tests/CompileFeatures/c_variadic_macros.c2
-rw-r--r--Tests/CompileFeatures/default_dialect.c2
-rw-r--r--Tests/CompileFeatures/genex_test.c2
-rw-r--r--Tests/Complex/Executable/Sub1/NameConflictTest.c2
-rw-r--r--Tests/Complex/Executable/Sub2/NameConflictTest.c2
-rw-r--r--Tests/Complex/Library/TestLink.c2
-rw-r--r--Tests/Complex/Library/testConly.c2
-rw-r--r--Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c2
-rw-r--r--Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c2
-rw-r--r--Tests/ComplexOneConfig/Library/TestLink.c2
-rw-r--r--Tests/ComplexOneConfig/Library/testConly.c2
-rw-r--r--Tests/ConfigSources/CMakeLists.txt8
-rw-r--r--Tests/ConfigSources/main_one_config.cpp8
-rw-r--r--Tests/Cuda/WithC/main.c2
-rw-r--r--Tests/CudaOnly/CMakeLists.txt1
-rw-r--r--Tests/CudaOnly/TryCompileTargetStatic/CMakeLists.txt6
-rw-r--r--Tests/CudaOnly/TryCompileTargetStatic/main.cu5
-rw-r--r--Tests/CustomCommand/gen_redirect_in.c2
-rw-r--r--Tests/CustomCommandWorkingDirectory/customTarget.c2
-rw-r--r--Tests/Dependency/1/OneSrc.c2
-rw-r--r--Tests/Dependency/Case1/a.c2
-rw-r--r--Tests/Dependency/Case1/b.c4
-rw-r--r--Tests/Dependency/Case1/b2.c2
-rw-r--r--Tests/Dependency/Case1/c.c4
-rw-r--r--Tests/Dependency/Case1/c2.c4
-rw-r--r--Tests/Dependency/Case1/d.c4
-rw-r--r--Tests/Dependency/Case1/main.c2
-rw-r--r--Tests/Dependency/Case4/bar.c4
-rw-r--r--Tests/Dependency/Case4/foo.c2
-rw-r--r--Tests/Dependency/Eight/EightSrc.c4
-rw-r--r--Tests/Dependency/Exec/ExecMain.c2
-rw-r--r--Tests/Dependency/Exec2/ExecMain.c2
-rw-r--r--Tests/Dependency/Exec3/ExecMain.c2
-rw-r--r--Tests/Dependency/Exec4/ExecMain.c2
-rw-r--r--Tests/Dependency/Five/FiveSrc.c4
-rw-r--r--Tests/Dependency/Four/FourSrc.c8
-rw-r--r--Tests/Dependency/NoDepA/NoDepASrc.c2
-rw-r--r--Tests/Dependency/NoDepB/NoDepBSrc.c4
-rw-r--r--Tests/Dependency/NoDepC/NoDepCSrc.c4
-rw-r--r--Tests/Dependency/Seven/SevenSrc.c4
-rw-r--r--Tests/Dependency/Six/SixASrc.c6
-rw-r--r--Tests/Dependency/Six/SixBSrc.c8
-rw-r--r--Tests/Dependency/Three/ThreeSrc.c6
-rw-r--r--Tests/Dependency/Two/TwoCustomSrc.c4
-rw-r--r--Tests/Dependency/Two/TwoSrc.c2
-rw-r--r--Tests/DoubleProject/silly.c2
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt5
-rw-r--r--Tests/ExportImport/Export/testExe2.c2
-rw-r--r--Tests/ExportImport/External/FooConfig.cmake3
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt87
-rw-r--r--Tests/ExportImport/Import/A/deps_iface.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_mod1.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_testExe1.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_testExeAbs1.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_testLib8.c2
-rw-r--r--Tests/ExportImport/Import/A/imp_testLib9.c2
-rw-r--r--Tests/ExportImport/Import/CMakeLists.txt1
-rw-r--r--Tests/ExportImport/Import/imp_testTransExe1.c2
-rw-r--r--Tests/ExportImport/InitialCache.cmake.in1
-rw-r--r--Tests/ExportImport/main.c2
-rw-r--r--Tests/FindALSA/Test/main.c2
-rw-r--r--Tests/FindBLAS/Test/main.c2
-rw-r--r--Tests/FindBZip2/Test/main.c2
-rw-r--r--Tests/FindCURL/Test/main.c2
-rw-r--r--Tests/FindCups/Test/main.c2
-rw-r--r--Tests/FindDevIL/Test/main.c2
-rw-r--r--Tests/FindDevIL/Test/main_ilu.c2
-rw-r--r--Tests/FindEXPAT/Test/main.c2
-rw-r--r--Tests/FindFontconfig/Test/main.c2
-rw-r--r--Tests/FindFreetype/Test/main.c2
-rw-r--r--Tests/FindGDAL/Test/main.c2
-rw-r--r--Tests/FindGIF/Test/main.c2
-rw-r--r--Tests/FindGLUT/Test/main.c2
-rw-r--r--Tests/FindGnuTLS/Test/main.c2
-rw-r--r--Tests/FindImageMagick/Test/main_magick_wand.c2
-rw-r--r--Tests/FindJPEG/Test/main.c2
-rw-r--r--Tests/FindJasper/Test/main.c2
-rw-r--r--Tests/FindLAPACK/Test/main.c2
-rw-r--r--Tests/FindLibLZMA/Test/main.c2
-rw-r--r--Tests/FindLibRHash/Test/main.c2
-rw-r--r--Tests/FindLibUV/Test/main.c2
-rw-r--r--Tests/FindLibXml2/Test/main.c2
-rw-r--r--Tests/FindLibXslt/Test/libexslt.c2
-rw-r--r--Tests/FindLibXslt/Test/libxslt.c2
-rw-r--r--Tests/FindLibinput/Test/main.c2
-rw-r--r--Tests/FindODBC/Test/main.c2
-rw-r--r--Tests/FindOpenACC/CTest/main.c2
-rw-r--r--Tests/FindOpenCL/Test/main.c2
-rw-r--r--Tests/FindOpenGL/Test/main.c2
-rw-r--r--Tests/FindOpenGL/Test/main_gles2.c2
-rw-r--r--Tests/FindOpenGL/Test/main_gles3.c2
-rw-r--r--Tests/FindOpenMP/Test/main.c2
-rw-r--r--Tests/FindOpenMP/Test/scaltest.c2
-rw-r--r--Tests/FindPNG/Test/main.c2
-rw-r--r--Tests/FindPackageTest/Exporter/dummy.c2
-rw-r--r--Tests/FindPostgreSQL/Test/main.c2
-rw-r--r--Tests/FindPython/display_time.c2
-rw-r--r--Tests/FindPython/main.c2
-rw-r--r--Tests/FindSDL/Test/main.c2
-rw-r--r--Tests/FindSQLite3/Test/main.c2
-rw-r--r--Tests/FindTIFF/Test/main.c2
-rw-r--r--Tests/FindVulkan/Test/main-SPIRV-Tools.c2
-rw-r--r--Tests/FindVulkan/Test/main.c2
-rw-r--r--Tests/Fortran/mainc.c2
-rw-r--r--Tests/Fortran/maincxx.c2
-rw-r--r--Tests/FortranModules/Issue25252-iface-sources/lib.c2
-rw-r--r--Tests/GeneratorExpression/objlib1.c2
-rw-r--r--Tests/GeneratorExpression/objlib2.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c2
-rw-r--r--Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c2
-rw-r--r--Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c2
-rw-r--r--Tests/IncludeDirectories/StandardIncludeDirectories/main.c2
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c2
-rw-r--r--Tests/JavaExportImport/main.c2
-rw-r--r--Tests/LibName/bar.c2
-rw-r--r--Tests/LibName/foo.c4
-rw-r--r--Tests/LibName/foobar.c2
-rw-r--r--Tests/LinkLanguage/LinkLanguage.c2
-rw-r--r--Tests/LinkLine/Exec.c2
-rw-r--r--Tests/LinkLine/One.c4
-rw-r--r--Tests/LinkLine/Two.c4
-rw-r--r--Tests/LinkLineOrder/Exec1.c2
-rw-r--r--Tests/LinkLineOrder/Exec2.c2
-rw-r--r--Tests/LinkLineOrder/NoDepA.c4
-rw-r--r--Tests/LinkLineOrder/NoDepB.c2
-rw-r--r--Tests/LinkLineOrder/NoDepC.c4
-rw-r--r--Tests/LinkLineOrder/NoDepE.c4
-rw-r--r--Tests/LinkLineOrder/NoDepF.c4
-rw-r--r--Tests/LinkLineOrder/NoDepX.c4
-rw-r--r--Tests/LinkLineOrder/NoDepY.c2
-rw-r--r--Tests/LinkLineOrder/NoDepZ.c4
-rw-r--r--Tests/LinkLineOrder/One.c6
-rw-r--r--Tests/LinkLineOrder/Two.c6
-rw-r--r--Tests/LoadCommand/CMakeCommands/cmTestCommand.c13
-rw-r--r--Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c15
-rw-r--r--Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt8
-rw-r--r--Tests/Module/CheckIPOSupported-C/bar.c2
-rw-r--r--Tests/Module/CheckIPOSupported-C/foo.c2
-rw-r--r--Tests/Module/CheckIPOSupported-C/main.c2
-rw-r--r--Tests/Module/CheckTypeSize/CheckTypeSize.c2
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/c_undefined.c2
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/main.c2
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/main_multi.c2
-rw-r--r--Tests/OutOfBinary/outlib.c2
-rw-r--r--Tests/PDBDirectoryAndName/myexe.c10
-rw-r--r--Tests/PDBDirectoryAndName/myexe2.c6
-rw-r--r--Tests/PDBDirectoryAndName/mylibA.c2
-rw-r--r--Tests/PDBDirectoryAndName/mylibB.c2
-rw-r--r--Tests/PDBDirectoryAndName/mylibC.c2
-rw-r--r--Tests/PDBDirectoryAndName/mylibD.c2
-rw-r--r--Tests/PerConfig/perconfig.c2
-rw-r--r--Tests/PolicyScope/main.c2
-rw-r--r--Tests/PrecompiledHeader/foo1.c2
-rw-r--r--Tests/PrecompiledHeader/foo2.c2
-rw-r--r--Tests/RunCMake/AppleTextStubs/foo.c2
-rw-r--r--Tests/RunCMake/AppleTextStubs/main.c2
-rw-r--r--Tests/RunCMake/AutoExportDll/foo.c4
-rw-r--r--Tests/RunCMake/AutoExportDll/hello2.c2
-rw-r--r--Tests/RunCMake/AutoExportDll/objlib.c2
-rw-r--r--Tests/RunCMake/BuildDepends/MakeInProjectOnly.c2
-rw-r--r--Tests/RunCMake/BuiltinTargets/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake19
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Default-build-check.cmake1
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Default.cmake1
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-No-build-check.cmake3
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake2
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake3
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake2
-rw-r--r--Tests/RunCMake/BuiltinTargets/TestDependsAll-common.cmake3
-rw-r--r--Tests/RunCMake/CMP0126/CMP0126-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0126/CMP0126-OLD_CL-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-Common.cmake27
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-NEW-AppleClang.cmake5
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-NEW.cmake4
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-result.txt1
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-stdout.txt3
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang.cmake5
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-OLD.cmake4
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-WARN-stderr.txt35
-rw-r--r--Tests/RunCMake/CMP0156/CMP0156-WARN.cmake4
-rw-r--r--Tests/RunCMake/CMP0156/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMP0156/RunCMakeTest.cmake26
-rw-r--r--Tests/RunCMake/CMP0156/lib1.c7
-rw-r--r--Tests/RunCMake/CMP0156/lib2.c7
-rw-r--r--Tests/RunCMake/CMP0156/lib3.c7
-rw-r--r--Tests/RunCMake/CMP0156/lib4.c9
-rw-r--r--Tests/RunCMake/CMP0156/main.c9
-rw-r--r--Tests/RunCMake/CMP0156/main2.c9
-rw-r--r--Tests/RunCMake/CMakeLists.txt47
-rw-r--r--Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-result.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-stderr.txt6
-rw-r--r--Tests/RunCMake/CMakePackage/ApplePlatformMissingDest.cmake4
-rw-r--r--Tests/RunCMake/CMakePackage/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CMakePackage/RunCMakeTest.cmake110
-rw-r--r--Tests/RunCMake/CMakePackage/apple-common.cmake15
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-common.cmake29
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator-arm64.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake13
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator-x86_64.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios-simulator.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-ios.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-macos.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-tvos-simulator.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-tvos.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-visionos-simulator.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-visionos.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-watchos-simulator.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-export-watchos.cmake2
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-common.cmake7
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-simulator.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-ios.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-macos-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-macos.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-tvos-simulator-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-tvos-simulator.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-tvos-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-tvos.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-visionos-simulator-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-visionos-simulator.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-visionos-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-visionos.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-watchos-simulator-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-watchos-simulator.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-watchos-stdout.txt1
-rw-r--r--Tests/RunCMake/CMakePackage/apple-import-watchos.cmake1
-rw-r--r--Tests/RunCMake/CMakePackage/include/mylib.h3
-rw-r--r--Tests/RunCMake/CMakePackage/src/myexe.c6
-rw-r--r--Tests/RunCMake/CMakePackage/src/mylib.c4
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake8
-rw-r--r--Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake5
-rw-r--r--Tests/RunCMake/CPack/tests/DUPLICATE_FILE/ExpectedFiles.cmake16
-rw-r--r--Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_file-stderr.txt1
-rw-r--r--Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_symlink-stderr.txt1
-rw-r--r--Tests/RunCMake/CPack/tests/DUPLICATE_FILE/test.cmake74
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-wait0-stdout.txt (renamed from Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt)2
-rw-r--r--Tests/RunCMake/CTestCommandLine/test-load-wait1-stdout.txt21
-rw-r--r--Tests/RunCMake/CXXModules/sources/c-anchor.c2
-rw-r--r--Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake1
-rw-r--r--Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/E_capabilities-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_cat-stdin-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_cat-stdin.cmake10
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/CompileDefinitions/foo.c2
-rw-r--r--Tests/RunCMake/CompileWarningAsError/warn.c2
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt3
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt6
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt6
-rw-r--r--Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt6
-rw-r--r--Tests/RunCMake/Configure/ReadOnly-result.txt1
-rw-r--r--Tests/RunCMake/Configure/ReadOnly-stderr.txt8
-rw-r--r--Tests/RunCMake/Configure/ReadOnly.cmake1
-rw-r--r--Tests/RunCMake/Configure/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW-check.cmake28
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW.cmake25
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD-check.cmake28
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD.cmake25
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake4
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake6
-rw-r--r--Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/DependencyProviders/ProviderFirst-stdout.txt6
-rw-r--r--Tests/RunCMake/DependencyProviders/ProviderFirst.cmake8
-rw-r--r--Tests/RunCMake/DependencyProviders/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/ExcludeFromAll/main.c2
-rw-r--r--Tests/RunCMake/FetchContent/CMake/FindFDE-S.cmake6
-rw-r--r--Tests/RunCMake/FetchContent/CMake/FindFDE-U.cmake6
-rw-r--r--Tests/RunCMake/FetchContent/FindDependencyExport.cmake78
-rw-r--r--Tests/RunCMake/FetchContent/FindDependencyExport/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FetchContent/FindDependencyExportDP.cmake11
-rw-r--r--Tests/RunCMake/FetchContent/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py31
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.cross.json16
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json5
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json7
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json16
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json16
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator.json105
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator_args.json109
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json105
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher_and_cross_emulator.json109
-rw-r--r--Tests/RunCMake/FileAPI/cxx/CMakeLists.txt5
-rw-r--r--Tests/RunCMake/FileAPI/cxx/cross/CMakeLists.txt11
-rw-r--r--Tests/RunCMake/File_Generate/empty.c2
-rw-r--r--Tests/RunCMake/Framework/consumer.c2
-rw-r--r--Tests/RunCMake/Framework/foo.c2
-rw-r--r--Tests/RunCMake/Framework/foo.h2
-rw-r--r--Tests/RunCMake/Framework/main.c2
-rw-r--r--Tests/RunCMake/Framework/main2.c2
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetFortran-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetFortran-stderr.txt11
-rw-r--r--Tests/RunCMake/GeneratorToolset/BadToolsetFortran.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT-stdout.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX-stdout.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX.cmake1
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt1
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stderr.txt1
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped.cmake13
-rw-r--r--Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped/CMakeLists.txt13
-rw-r--r--Tests/RunCMake/GoogleTest/RunCMakeTest.cmake27
-rw-r--r--Tests/RunCMake/Graphviz/test_project/core_library.c2
-rw-r--r--Tests/RunCMake/Graphviz/test_project/graphic_library.c2
-rw-r--r--Tests/RunCMake/Graphviz/test_project/module.c2
-rw-r--r--Tests/RunCMake/Graphviz/test_project/system_library.c2
-rw-r--r--Tests/RunCMake/IAR/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/IAR/RunCMakeTest.cmake64
-rw-r--r--Tests/RunCMake/IAR/iar-asm.cmake5
-rw-r--r--Tests/RunCMake/IAR/iar-c.cmake5
-rw-r--r--Tests/RunCMake/IAR/iar-cxx.cmake5
-rw-r--r--Tests/RunCMake/IAR/iar-lib.cmake10
-rw-r--r--Tests/RunCMake/IAR/libmod.c4
-rw-r--r--Tests/RunCMake/IAR/module.asm41
-rw-r--r--Tests/RunCMake/IAR/module.c14
-rw-r--r--Tests/RunCMake/IAR/module.cxx7
-rw-r--r--Tests/RunCMake/IAR/module.h14
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt8
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-result.txt1
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-stderr.txt7
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY.cmake9
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/lib.c4
-rw-r--r--Tests/RunCMake/LinkLibrariesProcessing/main.c5
-rw-r--r--Tests/RunCMake/LinkerSelection/AppleClassic.cmake7
-rw-r--r--Tests/RunCMake/LinkerSelection/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/LinkerSelection/CustomLinkerType-build-check.cmake2
-rw-r--r--Tests/RunCMake/LinkerSelection/CustomLinkerType.cmake36
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType-result.txt1
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType-stderr.txt3
-rw-r--r--Tests/RunCMake/LinkerSelection/InvalidLinkerType.cmake5
-rw-r--r--Tests/RunCMake/LinkerSelection/LinkerType-validation.cmake9
-rw-r--r--Tests/RunCMake/LinkerSelection/RunCMakeTest.cmake44
-rw-r--r--Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-result.txt1
-rw-r--r--Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-stderr.txt3
-rw-r--r--Tests/RunCMake/LinkerSelection/UnsupportedLinkerType.cmake5
-rw-r--r--Tests/RunCMake/LinkerSelection/ValidLinkerType-build-check.cmake2
-rw-r--r--Tests/RunCMake/LinkerSelection/ValidLinkerType.cmake32
-rw-r--r--Tests/RunCMake/LinkerSelection/main.c4
-rw-r--r--Tests/RunCMake/LinkerSelection/main.cu5
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-NoPipe-j2-stdout.txt9
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stderr.txt1
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stdout.txt3
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-Tests-j2-stdout.txt6
-rw-r--r--Tests/RunCMake/Make/CTestJobServer-Tests-j3-stdout.txt7
-rw-r--r--Tests/RunCMake/Make/CTestJobServer.cmake4
-rw-r--r--Tests/RunCMake/Make/CTestJobServer.make11
-rw-r--r--Tests/RunCMake/Make/RunCMakeTest.cmake20
-rw-r--r--Tests/RunCMake/Ninja/CheckNoPrefixSubDirScript.cmake2
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake35
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct-check.cmake47
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct.cmake24
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput-check.cmake47
-rw-r--r--Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput.cmake24
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/Ninja/dep.c2
-rw-r--r--Tests/RunCMake/Ninja/top.c2
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake35
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct-check.cmake47
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct.cmake22
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput-check.cmake47
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput.cmake22
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/ObjectLibrary/exe.c2
-rw-r--r--Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input20
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake1
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/foo.c4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/foobar.c2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/include/bar.h2
-rw-r--r--Tests/RunCMake/PrintHelpers/nothing.c2
-rw-r--r--Tests/RunCMake/PrintHelpers/something.c2
-rw-r--r--Tests/RunCMake/RunCMake.cmake16
-rw-r--r--Tests/RunCMake/SourceProperties/empty.c2
-rw-r--r--Tests/RunCMake/Swift/CMP0157-NEW-stderr.txt3
-rw-r--r--Tests/RunCMake/Swift/CMP0157-NEW.cmake4
-rw-r--r--Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt1
-rw-r--r--Tests/RunCMake/Swift/CMP0157-OLD.cmake4
-rw-r--r--Tests/RunCMake/Swift/CMP0157-WARN.cmake3
-rw-r--r--Tests/RunCMake/Swift/CMP0157-common.cmake19
-rw-r--r--Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt6
-rw-r--r--Tests/RunCMake/Swift/IncrementalSwift.cmake1
-rw-r--r--Tests/RunCMake/Swift/NoWorkToDo.cmake1
-rw-r--r--Tests/RunCMake/Swift/RunCMakeTest.cmake26
-rw-r--r--Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake1
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt2
-rw-r--r--Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt13
-rw-r--r--Tests/RunCMake/TransformDepfile/noexist-gcc-stderr.txt4
-rw-r--r--Tests/RunCMake/UnityBuild/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_and_objc_and_objcxx.cmake25
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_objc.cmake12
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_objc_group.cmake27
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_objcxx.cmake12
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_objcxx_group.cmake27
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake2
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake2
-rw-r--r--Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsCharacterSet-check.cmake49
-rw-r--r--Tests/RunCMake/VS10Project/VsCharacterSet.cmake17
-rw-r--r--Tests/RunCMake/XcFramework/RunCMakeTest.cmake170
-rw-r--r--Tests/RunCMake/XcFramework/export-common.cmake46
-rw-r--r--Tests/RunCMake/XcFramework/export-ios-simulator.cmake3
-rw-r--r--Tests/RunCMake/XcFramework/export-ios.cmake3
-rw-r--r--Tests/RunCMake/XcFramework/export-macos.cmake3
-rw-r--r--Tests/RunCMake/XcFramework/import-common.cmake5
-rw-r--r--Tests/RunCMake/XcFramework/import-genex-common.cmake5
-rw-r--r--Tests/RunCMake/XcFramework/import-ios-install-general.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-general-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-general.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-specific-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-specific-genex-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-specific-genex.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-build-specific.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-general-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-general.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-genex-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-genex.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework-build-stdout.txt2
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/import-macos-install-specific.cmake1
-rw-r--r--Tests/RunCMake/XcFramework/mylib-config.cmake.in3
-rw-r--r--Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c2
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS-check.cmake3
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices.cmake17
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject-Embed/XPCService.Info.plist.in24
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeXCConfig.c2
-rw-r--r--Tests/RunCMake/add_compile_definitions/foo.c2
-rw-r--r--Tests/RunCMake/add_custom_command/a.c2
-rw-r--r--Tests/RunCMake/add_dependencies/a.c2
-rw-r--r--Tests/RunCMake/add_dependencies/b.c2
-rw-r--r--Tests/RunCMake/add_dependencies/c.c2
-rw-r--r--Tests/RunCMake/add_test/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/add_test/TestLauncher-check.cmake28
-rw-r--r--Tests/RunCMake/add_test/TestLauncher.cmake22
-rw-r--r--Tests/RunCMake/add_test/TestLauncher/CMakeLists.txt9
-rw-r--r--Tests/RunCMake/add_test/TestLauncherProperty.cmake41
-rw-r--r--Tests/RunCMake/add_test/simple_src_exiterror.cxx4
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/CMakeLists.txt.in2
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/NoCache-result.txt1
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/NoCache-stderr.txt12
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ctest_empty_binary_directory/test.cmake.in5
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c2
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadWait0-stdout.txt (renamed from Tests/RunCMake/ctest_test/TestLoadWait-stdout.txt)4
-rw-r--r--Tests/RunCMake/ctest_test/CTestTestLoadWait1-stdout.txt15
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake19
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadWait0-stdout.txt (renamed from Tests/RunCMake/ctest_test/CTestTestLoadWait-stdout.txt)4
-rw-r--r--Tests/RunCMake/ctest_test/TestLoadWait1-stdout.txt15
-rw-r--r--Tests/RunCMake/export/CMake/FindHasDeps.cmake17
-rw-r--r--Tests/RunCMake/export/CMake/FindP1.cmake2
-rw-r--r--Tests/RunCMake/export/CMake/FindP2.cmake2
-rw-r--r--Tests/RunCMake/export/CMake/FindP3.cmake2
-rw-r--r--Tests/RunCMake/export/CMake/FindP4.cmake2
-rw-r--r--Tests/RunCMake/export/CMake/FindP9.cmake2
-rw-r--r--Tests/RunCMake/export/FindDependencyExport-check.cmake35
-rw-r--r--Tests/RunCMake/export/FindDependencyExport.cmake30
-rw-r--r--Tests/RunCMake/export/FindDependencyExportFetchContent-check.cmake14
-rw-r--r--Tests/RunCMake/export/FindDependencyExportFetchContent.cmake37
-rw-r--r--Tests/RunCMake/export/FindDependencyExportShared-check.cmake4
-rw-r--r--Tests/RunCMake/export/FindDependencyExportShared.cmake14
-rw-r--r--Tests/RunCMake/export/FindDependencyExportStatic-check.cmake13
-rw-r--r--Tests/RunCMake/export/FindDependencyExportStatic.cmake14
-rw-r--r--Tests/RunCMake/export/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_file/NO_CACHE-stderr.txt10
-rw-r--r--Tests/RunCMake/find_library/NO_CACHE-stderr.txt10
-rw-r--r--Tests/RunCMake/find_library/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC-stdout.txt2
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC.cmake7
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib0
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib0
-rw-r--r--Tests/RunCMake/find_library/Windows-MSVC/static.lib0
-rw-r--r--Tests/RunCMake/find_path/NO_CACHE-stderr.txt10
-rw-r--r--Tests/RunCMake/find_program/NO_CACHE-stderr.txt10
-rw-r--r--Tests/RunCMake/foreach/foreach-var-scope-CMP0124-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/if/FilePermissions.cmake179
-rw-r--r--Tests/RunCMake/if/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake4
-rw-r--r--Tests/RunCMake/install/EXPORT-FindDependencyExport.cmake18
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/install/cmake/FindP1.cmake2
-rw-r--r--Tests/RunCMake/install/cmake/FindP2.cmake2
-rw-r--r--Tests/RunCMake/install/cmake/FindP3.cmake2
-rw-r--r--Tests/RunCMake/print_stdin.c2
-rw-r--r--Tests/RunCMake/project/CodeInjection-stdout.txt10
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_include.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_include_before.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_includes_1.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_includes_2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_1.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include_before.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_1.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_1.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection/initial_cache_1.cmake (renamed from Tests/RunCMake/project/CodeInjection/initial_cache.cmake)11
-rw-r--r--Tests/RunCMake/project/CodeInjection/initial_cache_2.cmake27
-rw-r--r--Tests/RunCMake/project/CodeInjection/initial_cache_3.cmake28
-rw-r--r--Tests/RunCMake/project/CodeInjection1-stdout.txt9
-rw-r--r--Tests/RunCMake/project/CodeInjection1.cmake (renamed from Tests/RunCMake/project/CodeInjection.cmake)0
-rw-r--r--Tests/RunCMake/project/CodeInjection2-stdout.txt16
-rw-r--r--Tests/RunCMake/project/CodeInjection2.cmake1
-rw-r--r--Tests/RunCMake/project/CodeInjection3-stdout.txt16
-rw-r--r--Tests/RunCMake/project/CodeInjection3.cmake1
-rw-r--r--Tests/RunCMake/project/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/property_init/Executable.cmake1
-rw-r--r--Tests/RunCMake/showIncludes.c2
-rw-r--r--Tests/RunCMake/target_compile_definitions/foo.c2
-rw-r--r--Tests/RunCMake/target_compile_features/empty.c2
-rw-r--r--Tests/RunCMake/target_compile_options/CMP0101.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/func.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/lib.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-ALIAS/main.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/base.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/func1.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/func2.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/func3.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/lib.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_GROUP/main.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c6
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.c2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/lib.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.c4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-with-DEFAULT-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features4-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features3-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items3-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items3-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items3-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items4-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items4-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items4-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features3-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items4-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items3-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-check.cmake12
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group2-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple1-result.txt (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group1-result.txt)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features1-check.cmake)2
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features3-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features3-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features4-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features1-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features2-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-check.cmake (renamed from Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-with-DEFAULT-check.cmake)0
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY.cmake14
-rw-r--r--Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake52
-rw-r--r--Tests/RunCMake/target_link_libraries/lib.c4
-rw-r--r--Tests/RunCMake/try_compile/LinkOptions.cmake3
-rw-r--r--Tests/RunCMake/try_compile/lib.c2
-rw-r--r--Tests/RunCMake/try_compile/main.c2
-rw-r--r--Tests/RunCMake/try_run/ConfigureLog-test.c2
-rw-r--r--Tests/RunCMake/try_run/Inspect.cmake22
-rw-r--r--Tests/RunCMake/try_run/LinkOptions.cmake3
-rw-r--r--Tests/RunCMake/try_run/LinkerLanguage.cmake29
-rw-r--r--Tests/RunCMake/try_run/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/try_run/lib.c2
-rw-r--r--Tests/RunCMake/try_run/lib.cxx4
-rw-r--r--Tests/RunCMake/try_run/main.c2
-rw-r--r--Tests/RunCMake/try_run/main.f9012
-rw-r--r--Tests/RuntimePath/bar1.c4
-rw-r--r--Tests/RuntimePath/bar2.c4
-rw-r--r--Tests/RuntimePath/foo1.c2
-rw-r--r--Tests/RuntimePath/foo2.c2
-rw-r--r--Tests/RuntimePath/main.c4
-rw-r--r--Tests/SetLang/bar.c2
-rw-r--r--Tests/Simple/simpleCLib.c2
-rw-r--r--Tests/SimpleCOnly/bar.c2
-rw-r--r--Tests/SimpleCOnly/foo.c2
-rw-r--r--Tests/SimpleCOnly/main.c2
-rw-r--r--Tests/SourceFileIncludeDirProperty/main.c2
-rw-r--r--Tests/SourceFileProperty/ICaseTest.c2
-rw-r--r--Tests/SourceGroups/main.c2
-rw-r--r--Tests/SourceGroups/sub2/main.c2
-rw-r--r--Tests/SubDir/AnotherSubdir/pair+int.int.c2
-rw-r--r--Tests/SubDir/AnotherSubdir/pair_int.int.c2
-rw-r--r--Tests/SubDir/AnotherSubdir/secondone.c2
-rw-r--r--Tests/SubDir/AnotherSubdir/testfromsubdir.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/pair+int.int1.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/pair_int.int1.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/pair_p_int.int1.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/testfromauxsubdir.c2
-rw-r--r--Tests/SubDir/ThirdSubDir/thirdone.c2
-rw-r--r--Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c2
-rw-r--r--Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c2
-rw-r--r--Tests/SubDirSpaces/Another Subdir/pair+int.int.c2
-rw-r--r--Tests/SubDirSpaces/Another Subdir/pair_int.int.c2
-rw-r--r--Tests/SubDirSpaces/Another Subdir/secondone.c2
-rw-r--r--Tests/SubDirSpaces/Another Subdir/testfromsubdir.c2
-rw-r--r--Tests/SubDirSpaces/Some(x86) Sources/test.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/pair+int.int1.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/pair_int.int1.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/pair_p_int.int1.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/testfromauxsubdir.c2
-rw-r--r--Tests/SubDirSpaces/ThirdSubDir/thirdone.c2
-rw-r--r--Tests/SubDirSpaces/vcl_algorithm+vcl_pair+double.foo.c2
-rw-r--r--Tests/SubDirSpaces/vcl_algorithm_vcl_pair_double.foo.c2
-rw-r--r--Tests/SwiftOnly/CMakeLists.txt28
-rw-r--r--Tests/SwiftOnly/O.swift0
-rw-r--r--Tests/TryCompile/Inner/innerexe.c2
-rw-r--r--Tests/TryCompile/check_a_b.c2
-rw-r--r--Tests/TryCompile/exit_success.c2
-rw-r--r--Tests/TryCompile/exit_with_error.c2
-rw-r--r--Tests/TryCompile/pass.c2
-rw-r--r--Tests/TryCompile/pass2a.c2
-rw-r--r--Tests/TryCompile/stdout_and_stderr.c2
-rw-r--r--Tests/Unset/unset.c2
-rw-r--r--Tests/VSGNUFortran/c_code/main.c2
-rw-r--r--Tests/Visibility/bar.c2
-rw-r--r--Tests/X11/X11.c4
-rw-r--r--Tests/XCTest/FrameworkExample/FrameworkExample.c2
725 files changed, 5046 insertions, 455 deletions
diff --git a/Tests/Architecture/bar.c b/Tests/Architecture/bar.c
index 37946c7..18ddb78 100644
--- a/Tests/Architecture/bar.c
+++ b/Tests/Architecture/bar.c
@@ -1,5 +1,5 @@
extern int foo(void);
-int main()
+int main(void)
{
return foo();
}
diff --git a/Tests/BuildDepends/Project/link_depends_no_shared_exe.c b/Tests/BuildDepends/Project/link_depends_no_shared_exe.c
index cfaf051..8830776 100644
--- a/Tests/BuildDepends/Project/link_depends_no_shared_exe.c
+++ b/Tests/BuildDepends/Project/link_depends_no_shared_exe.c
@@ -3,7 +3,7 @@
__declspec(dllimport)
#endif
int link_depends_no_shared_lib(void);
-int main()
+int main(void)
{
return link_depends_no_shared_lib() + link_depends_no_shared_exe_value;
}
diff --git a/Tests/CMakeCommands/target_compile_definitions/consumer.c b/Tests/CMakeCommands/target_compile_definitions/consumer.c
index bb65e01..08554f4 100644
--- a/Tests/CMakeCommands/target_compile_definitions/consumer.c
+++ b/Tests/CMakeCommands/target_compile_definitions/consumer.c
@@ -39,6 +39,6 @@
# error Expected LANG_IS_C_OR_CXX
#endif
-void consumer_c()
+void consumer_c(void)
{
}
diff --git a/Tests/CMakeCommands/target_compile_features/main.c b/Tests/CMakeCommands/target_compile_features/main.c
index 76e98c4..60f0f9e 100644
--- a/Tests/CMakeCommands/target_compile_features/main.c
+++ b/Tests/CMakeCommands/target_compile_features/main.c
@@ -6,7 +6,7 @@ int foo(int* restrict a, int* restrict b)
return 0;
}
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CMakeCommands/target_compile_features/restrict_user.c b/Tests/CMakeCommands/target_compile_features/restrict_user.c
index 76c956f..42e3efb 100644
--- a/Tests/CMakeCommands/target_compile_features/restrict_user.c
+++ b/Tests/CMakeCommands/target_compile_features/restrict_user.c
@@ -8,7 +8,7 @@ int bar(int* restrict a, int* restrict b)
return foo(a, b);
}
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CMakeCommands/target_compile_options/consumer.c b/Tests/CMakeCommands/target_compile_options/consumer.c
index f9b6654..0984166 100644
--- a/Tests/CMakeCommands/target_compile_options/consumer.c
+++ b/Tests/CMakeCommands/target_compile_options/consumer.c
@@ -35,6 +35,6 @@
# endif
#endif
-void consumer_c()
+void consumer_c(void)
{
}
diff --git a/Tests/CMakeCommands/target_include_directories/consumer.c b/Tests/CMakeCommands/target_include_directories/consumer.c
index 7fd694b..1975050 100644
--- a/Tests/CMakeCommands/target_include_directories/consumer.c
+++ b/Tests/CMakeCommands/target_include_directories/consumer.c
@@ -15,7 +15,7 @@
# endif
#endif
-int consumer_c()
+int consumer_c(void)
{
return 0;
}
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index b44c8dd..2c1d22b 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -25,6 +25,8 @@ set(CMakeLib_TESTS
testXMLParser.cxx
testXMLSafe.cxx
testFindPackageCommand.cxx
+ testUVHandlePtr.cxx
+ testUVJobServerClient.cxx
testUVProcessChain.cxx
testUVRAII.cxx
testUVStreambuf.cxx
@@ -42,6 +44,7 @@ if(CMake_ENABLE_DEBUGGER)
testDebuggerVariables.cxx
testDebuggerVariablesHelper.cxx
testDebuggerVariablesManager.cxx
+ testDebuggerThread.cxx
)
endif()
if (CMake_TEST_FILESYSTEM_PATH OR NOT CMake_HAVE_CXX_FILESYSTEM)
diff --git a/Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt b/Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt
index e47b9db..f3de7e1 100644
--- a/Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt
+++ b/Tests/CMakeLib/PseudoMemcheck/NoLog/CMakeLists.txt
@@ -1,7 +1,7 @@
# A dummy checker implementation that does not write the requested output file
# so it triggers an error for every checker.
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" "int main(){return 0;}\n")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in" "int main(void){return 0;}\n")
configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/ret0.c.in"
diff --git a/Tests/CMakeLib/testDebuggerThread.cxx b/Tests/CMakeLib/testDebuggerThread.cxx
new file mode 100644
index 0000000..0ea95b6
--- /dev/null
+++ b/Tests/CMakeLib/testDebuggerThread.cxx
@@ -0,0 +1,33 @@
+#include <functional>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include <cm3p/cppdap/protocol.h>
+#include <cm3p/cppdap/types.h>
+
+#include "cmDebuggerThread.h"
+#include "cmListFileCache.h"
+
+#include "testCommon.h"
+
+static bool testStackFrameFunctionName()
+{
+ auto thread = std::make_shared<cmDebugger::cmDebuggerThread>(0, "name");
+ const auto* functionName = "function_name";
+ auto arguments = std::vector<cmListFileArgument>{};
+ cmListFileFunction func(functionName, 10, 20, arguments);
+ thread->PushStackFrame(nullptr, "CMakeLists.txt", func);
+
+ auto stackTrace = GetStackTraceResponse(thread);
+
+ ASSERT_TRUE(stackTrace.stackFrames[0].name == functionName);
+ return true;
+}
+
+int testDebuggerThread(int, char*[])
+{
+ return runTests(std::vector<std::function<bool()>>{
+ testStackFrameFunctionName,
+ });
+}
diff --git a/Tests/CMakeLib/testUVHandlePtr.cxx b/Tests/CMakeLib/testUVHandlePtr.cxx
new file mode 100644
index 0000000..17f672d
--- /dev/null
+++ b/Tests/CMakeLib/testUVHandlePtr.cxx
@@ -0,0 +1,153 @@
+#include <functional>
+#include <iostream>
+#include <memory>
+
+#include <cm3p/uv.h>
+
+#include "cmGetPipes.h"
+#include "cmUVHandlePtr.h"
+
+static bool testBool()
+{
+ cm::uv_async_ptr async;
+ cm::uv_handle_ptr handle;
+ cm::uv_idle_ptr idle;
+ cm::uv_pipe_ptr pipe;
+ cm::uv_process_ptr process;
+ cm::uv_signal_ptr signal;
+ cm::uv_stream_ptr stream;
+ cm::uv_timer_ptr timer;
+ cm::uv_tty_ptr tty;
+ return !async && !handle && !idle && !pipe && !process && !signal &&
+ !stream && !timer && !tty;
+}
+
+static bool testIdle()
+{
+ bool idled = false;
+
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ auto cb = [](uv_idle_t* handle) {
+ auto idledPtr = static_cast<bool*>(handle->data);
+ *idledPtr = true;
+ uv_idle_stop(handle);
+ };
+
+ cm::uv_idle_ptr idle;
+ idle.init(*loop, &idled);
+ idle.start(cb);
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ if (!idled) {
+ std::cerr << "uv_idle_ptr did not trigger callback" << std::endl;
+ return false;
+ }
+
+ idled = false;
+
+ idle.start(cb);
+ idle.stop();
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ if (idled) {
+ std::cerr << "uv_idle_ptr::stop did not stop callback" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+static bool testTimer()
+{
+ bool timed = false;
+
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ auto cb = [](uv_timer_t* handle) {
+ auto timedPtr = static_cast<bool*>(handle->data);
+ *timedPtr = true;
+ uv_timer_stop(handle);
+ };
+
+ cm::uv_timer_ptr timer;
+ timer.init(*loop, &timed);
+ timer.start(cb, 10, 0);
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ if (!timed) {
+ std::cerr << "uv_timer_ptr did not trigger callback" << std::endl;
+ return false;
+ }
+
+ timed = false;
+ timer.start(cb, 10, 0);
+ timer.stop();
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ if (timed) {
+ std::cerr << "uv_timer_ptr::stop did not stop callback" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+static bool testWriteCallback()
+{
+ int pipe[] = { -1, -1 };
+ if (cmGetPipes(pipe) < 0) {
+ std::cout << "cmGetPipes() returned an error" << std::endl;
+ return false;
+ }
+
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ cm::uv_pipe_ptr pipeRead;
+ pipeRead.init(*loop, 0);
+ uv_pipe_open(pipeRead, pipe[0]);
+
+ cm::uv_pipe_ptr pipeWrite;
+ pipeWrite.init(*loop, 0);
+ uv_pipe_open(pipeWrite, pipe[1]);
+
+ char c = '.';
+ uv_buf_t buf = uv_buf_init(&c, sizeof(c));
+ int status = -1;
+ auto cb = std::make_shared<std::function<void(int)>>(
+ [&status](int s) { status = s; });
+
+ // Test getting a callback after the write is done.
+ cm::uv_write(pipeWrite, &buf, 1, cb);
+ uv_run(loop, UV_RUN_DEFAULT);
+ if (status != 0) {
+ std::cout << "cm::uv_write non-zero status: " << status << std::endl;
+ return false;
+ }
+
+ // Test deleting the callback before it is made.
+ status = -1;
+ cm::uv_write(pipeWrite, &buf, 1, cb);
+ cb.reset();
+ uv_run(loop, UV_RUN_DEFAULT);
+ if (status != -1) {
+ std::cout << "cm::uv_write callback incorrectly called with status: "
+ << status << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+int testUVHandlePtr(int, char** const)
+{
+ bool passed = true;
+ passed = testBool() && passed;
+ passed = testIdle() && passed;
+ passed = testTimer() && passed;
+ passed = testWriteCallback() && passed;
+ return passed ? 0 : -1;
+}
diff --git a/Tests/CMakeLib/testUVJobServerClient.cxx b/Tests/CMakeLib/testUVJobServerClient.cxx
new file mode 100644
index 0000000..13f0f40
--- /dev/null
+++ b/Tests/CMakeLib/testUVJobServerClient.cxx
@@ -0,0 +1,179 @@
+#include <cassert>
+#include <cstddef>
+#include <deque>
+#include <iostream>
+#include <vector>
+
+#include <cm/optional>
+
+#include <cm3p/uv.h>
+
+#ifndef _WIN32
+# include <unistd.h>
+#endif
+
+#include "cmGetPipes.h"
+#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVJobServerClient.h"
+
+namespace {
+
+const std::size_t kTOTAL_JOBS = 10;
+const std::size_t kTOTAL_TOKENS = 3;
+
+struct Job
+{
+ cm::uv_timer_ptr Timer;
+};
+
+struct JobRunner
+{
+ cm::uv_loop_ptr Loop;
+ cm::optional<cmUVJobServerClient> JSC;
+ std::vector<Job> Jobs;
+ std::size_t NextJobIndex = 0;
+
+ std::size_t ActiveJobs = 0;
+
+ std::deque<std::size_t> Queue;
+
+ bool Okay = true;
+
+ JobRunner()
+ : Jobs(kTOTAL_JOBS)
+ {
+ this->Loop.init(nullptr);
+ this->JSC = cmUVJobServerClient::Connect(
+ *this->Loop, [this]() { this->StartQueuedJob(); }, nullptr);
+ if (!this->JSC) {
+ std::cerr << "Failed to connect to job server.\n";
+ this->Okay = false;
+ }
+ }
+
+ ~JobRunner() {}
+
+ bool Run()
+ {
+ if (this->Okay) {
+ this->QueueNextJobs();
+ uv_run(this->Loop, UV_RUN_DEFAULT);
+ std::cerr << "HeldTokens: " << this->JSC->GetHeldTokens() << '\n';
+ std::cerr << "NeedTokens: " << this->JSC->GetNeedTokens() << '\n';
+ }
+#ifdef _WIN32
+ // FIXME: Windows job server client not yet implemented.
+ return true;
+#else
+ return this->Okay;
+#endif
+ }
+
+ void QueueNextJobs()
+ {
+ std::cerr << "QueueNextJobs()\n";
+ std::size_t queued = 0;
+ while (queued < 2 && this->NextJobIndex < this->Jobs.size()) {
+ this->QueueJob(this->NextJobIndex);
+ ++this->NextJobIndex;
+ ++queued;
+ }
+ std::cerr << "QueueNextJobs done\n";
+ }
+
+ void StartQueuedJob()
+ {
+ std::cerr << "StartQueuedJob()\n";
+ assert(!this->Queue.empty());
+
+ std::size_t index = this->Queue.front();
+ this->Queue.pop_front();
+ this->StartJob(index);
+
+ std::cerr << "StartQueuedJob done\n";
+ }
+
+ void StartJob(std::size_t index)
+ {
+ cm::uv_timer_ptr& job = this->Jobs[index].Timer;
+ job.init(*this->Loop, this);
+ uv_timer_start(
+ job,
+ [](uv_timer_t* handle) {
+ uv_timer_stop(handle);
+ auto self = static_cast<JobRunner*>(handle->data);
+ self->FinishJob();
+ },
+ /*timeout_ms=*/10 * (1 + (index % 3)), /*repeat_ms=*/0);
+ ++this->ActiveJobs;
+ std::cerr << " StartJob(" << index
+ << "): Active jobs: " << this->ActiveJobs << '\n';
+
+ if (this->ActiveJobs > kTOTAL_TOKENS) {
+ std::cerr << "Started more than " << kTOTAL_TOKENS << " jobs at once!\n";
+ this->Okay = false;
+ return;
+ }
+ }
+
+ void QueueJob(std::size_t index)
+ {
+ this->JSC->RequestToken();
+ this->Queue.push_back(index);
+ std::cerr << " QueueJob(" << index
+ << "): Queue length: " << this->Queue.size() << '\n';
+ }
+
+ void FinishJob()
+ {
+ --this->ActiveJobs;
+ std::cerr << "FinishJob: Active jobs: " << this->ActiveJobs << '\n';
+
+ this->JSC->ReleaseToken();
+ this->QueueNextJobs();
+ }
+};
+
+bool testJobServer()
+{
+#ifdef _WIN32
+ // FIXME: Windows job server client not yet implemented.
+#else
+ // Create a job server pipe.
+ int jobServerPipe[2];
+ if (cmGetPipes(jobServerPipe) < 0) {
+ std::cerr << "Failed to create job server pipe\n";
+ return false;
+ }
+
+ // Write N-1 tokens to the pipe.
+ std::vector<char> jobServerInit(kTOTAL_TOKENS - 1, '.');
+ if (write(jobServerPipe[1], jobServerInit.data(), jobServerInit.size()) !=
+ kTOTAL_TOKENS - 1) {
+ std::cerr << "Failed to initialize job server pipe\n";
+ return false;
+ }
+
+ // Establish the job server client context.
+ // Add a bogus server spec to verify we use the last spec.
+ cmSystemTools::PutEnv(cmStrCat("MAKEFLAGS=--flags-before"
+ " --jobserver-auth=bogus"
+ " --flags-between"
+ " --jobserver-fds=",
+ jobServerPipe[0], ',', jobServerPipe[1],
+ " --flags-after"));
+#endif
+
+ JobRunner jobRunner;
+ return jobRunner.Run();
+}
+}
+
+int testUVJobServerClient(int, char** const)
+{
+ bool passed = true;
+ passed = testJobServer() && passed;
+ return passed ? 0 : -1;
+}
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index aab084b..6014889 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -297,7 +297,12 @@ bool testUVProcessChainBuiltin(const char* helperCommand)
.AddCommand({ helperCommand, "capitalize" })
.AddCommand({ helperCommand, "dedup" })
.SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
- .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR);
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_ERROR)
+ .SetBuiltinLoop();
+ if (builder.GetLoop()) {
+ std::cout << "GetLoop() should return null" << std::endl;
+ return false;
+ }
if (!checkExecution(builder, chain)) {
return false;
@@ -400,6 +405,10 @@ bool testUVProcessChainExternal(const char* helperCommand)
.AddCommand({ helperCommand, "dedup" })
.SetExternalStream(cmUVProcessChainBuilder::Stream_OUTPUT, outputPipe[1])
.SetExternalStream(cmUVProcessChainBuilder::Stream_ERROR, errorPipe[1]);
+ if (builder.GetLoop()) {
+ std::cout << "GetLoop() should return null" << std::endl;
+ return false;
+ }
if (!checkExecution(builder, chain)) {
return false;
@@ -668,6 +677,43 @@ bool testUVProcessChainWait0(const char* helperCommand)
return true;
}
+bool testUVProcessChainExternalLoop(const char* helperCommand)
+{
+ cm::uv_loop_ptr loop;
+ loop.init();
+
+ cmUVProcessChainBuilder builder;
+ builder.AddCommand({ helperCommand, "echo" })
+ .SetBuiltinStream(cmUVProcessChainBuilder::Stream_OUTPUT)
+ .SetExternalLoop(*loop);
+ if (builder.GetLoop() != loop) {
+ std::cout << "GetLoop() should return external loop" << std::endl;
+ return false;
+ }
+
+ auto chain = builder.Start();
+
+ if (&chain.GetLoop() != loop) {
+ std::cout << "GetLoop() should return external loop" << std::endl;
+ return false;
+ }
+
+ if (!chain.Wait()) {
+ std::cout << "Wait() timed out" << std::endl;
+ return false;
+ }
+
+ cmUVPipeIStream stream(chain.GetLoop(), chain.OutputStream());
+ std::string output = getInput(stream);
+ if (output != "HELLO world!") {
+ std::cout << "Output was \"" << output << "\", expected \"HELLO world!\""
+ << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
int testUVProcessChain(int argc, char** const argv)
{
if (argc < 2) {
@@ -720,5 +766,10 @@ int testUVProcessChain(int argc, char** const argv)
return -1;
}
+ if (!testUVProcessChainExternalLoop(argv[1])) {
+ std::cout << "While executing testUVProcessChainExternalLoop().\n";
+ return -1;
+ }
+
return 0;
}
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index 0bdd44c..9e79d5c 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -37,7 +37,7 @@ static bool testAsyncShutdown()
return false;
}
- if (signal.get()) {
+ if (signal) {
std::cerr << "Loop exited with signal not being cleaned up" << std::endl;
return false;
}
@@ -125,13 +125,13 @@ static bool testCrossAssignment()
pipe.init(Loop, 0);
cm::uv_stream_ptr stream = std::move(pipe);
- if (pipe.get()) {
+ if (pipe) {
std::cerr << "Move should be sure to invalidate the previous ptr"
<< std::endl;
return false;
}
cm::uv_handle_ptr handle = std::move(stream);
- if (stream.get()) {
+ if (stream) {
std::cerr << "Move should be sure to invalidate the previous ptr"
<< std::endl;
return false;
@@ -162,6 +162,7 @@ static bool testAllMoves()
uv_async_ptr _13;
uv_signal_ptr _14;
uv_handle_ptr _15;
+ uv_idle_ptr _16;
};
allTypes a;
diff --git a/Tests/COnly/conly.c b/Tests/COnly/conly.c
index 2ae8a1a..c5f18ad 100644
--- a/Tests/COnly/conly.c
+++ b/Tests/COnly/conly.c
@@ -4,7 +4,7 @@
#include "libc1.h"
#include "libc2.h"
-int main()
+int main(void)
{
int class = 0;
if (LibC1Func() != 2.0) {
diff --git a/Tests/COnly/libc1.c b/Tests/COnly/libc1.c
index b01e1e1..e1f7e27 100644
--- a/Tests/COnly/libc1.c
+++ b/Tests/COnly/libc1.c
@@ -1,4 +1,4 @@
-float LibC1Func()
+float LibC1Func(void)
{
return 2.0;
}
diff --git a/Tests/COnly/libc2.c b/Tests/COnly/libc2.c
index 0fd8956..28d46f3 100644
--- a/Tests/COnly/libc2.c
+++ b/Tests/COnly/libc2.c
@@ -1,6 +1,6 @@
#include "libc2.h"
-float LibC2Func()
+float LibC2Func(void)
{
return 1.0;
}
diff --git a/Tests/CPackInnoSetupGenerator/main.c b/Tests/CPackInnoSetupGenerator/main.c
index 413899c..9165c97 100644
--- a/Tests/CPackInnoSetupGenerator/main.c
+++ b/Tests/CPackInnoSetupGenerator/main.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-int main()
+int main(void)
{
printf("Hello, World!\n");
return 42;
diff --git a/Tests/CTestTestVerboseOutput/nop.c b/Tests/CTestTestVerboseOutput/nop.c
index f8b643a..8488f4e 100644
--- a/Tests/CTestTestVerboseOutput/nop.c
+++ b/Tests/CTestTestVerboseOutput/nop.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CommandLength/test.c b/Tests/CommandLength/test.c
index f8b643a..8488f4e 100644
--- a/Tests/CommandLength/test.c
+++ b/Tests/CommandLength/test.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CompileDefinitions/runtest.c b/Tests/CompileDefinitions/runtest.c
index c6dac4d..37317b8 100644
--- a/Tests/CompileDefinitions/runtest.c
+++ b/Tests/CompileDefinitions/runtest.c
@@ -6,7 +6,7 @@
# error "BUILD_CONFIG_NAME not defined!"
#endif
-int main()
+int main(void)
{
char build_config_name[] = BUILD_CONFIG_NAME;
char* c;
diff --git a/Tests/CompileFeatures/c_variadic_macros.c b/Tests/CompileFeatures/c_variadic_macros.c
index 4da111e..7a21902 100644
--- a/Tests/CompileFeatures/c_variadic_macros.c
+++ b/Tests/CompileFeatures/c_variadic_macros.c
@@ -9,7 +9,7 @@ int someFunc(int i1, char c, int i2)
#define FUNC_WRAPPER(...) someFunc(__VA_ARGS__)
-void otherFunc()
+void otherFunc(void)
{
FUNC_WRAPPER(42, 'a', 7);
}
diff --git a/Tests/CompileFeatures/default_dialect.c b/Tests/CompileFeatures/default_dialect.c
index c696c83..cae107b 100644
--- a/Tests/CompileFeatures/default_dialect.c
+++ b/Tests/CompileFeatures/default_dialect.c
@@ -26,7 +26,7 @@
# endif
#endif
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/CompileFeatures/genex_test.c b/Tests/CompileFeatures/genex_test.c
index de408ce..8ccad35 100644
--- a/Tests/CompileFeatures/genex_test.c
+++ b/Tests/CompileFeatures/genex_test.c
@@ -38,6 +38,6 @@
# endif
#endif
-int main()
+int main(void)
{
}
diff --git a/Tests/Complex/Executable/Sub1/NameConflictTest.c b/Tests/Complex/Executable/Sub1/NameConflictTest.c
index 8720386..740c236 100644
--- a/Tests/Complex/Executable/Sub1/NameConflictTest.c
+++ b/Tests/Complex/Executable/Sub1/NameConflictTest.c
@@ -1,4 +1,4 @@
-int NameConflictTest1()
+int NameConflictTest1(void)
{
return 0;
}
diff --git a/Tests/Complex/Executable/Sub2/NameConflictTest.c b/Tests/Complex/Executable/Sub2/NameConflictTest.c
index 4a32572..cee9f6f 100644
--- a/Tests/Complex/Executable/Sub2/NameConflictTest.c
+++ b/Tests/Complex/Executable/Sub2/NameConflictTest.c
@@ -1,4 +1,4 @@
-int NameConflictTest2()
+int NameConflictTest2(void)
{
return 0;
}
diff --git a/Tests/Complex/Library/TestLink.c b/Tests/Complex/Library/TestLink.c
index 25dee08..f4bc255 100644
--- a/Tests/Complex/Library/TestLink.c
+++ b/Tests/Complex/Library/TestLink.c
@@ -1,4 +1,4 @@
-int TestLinkGetType()
+int TestLinkGetType(void)
{
#ifdef CMakeTestLinkShared_EXPORTS
return 0;
diff --git a/Tests/Complex/Library/testConly.c b/Tests/Complex/Library/testConly.c
index eb933a2..05ecc18 100644
--- a/Tests/Complex/Library/testConly.c
+++ b/Tests/Complex/Library/testConly.c
@@ -2,7 +2,7 @@
#include <stdio.h>
-int CsharedFunction()
+int CsharedFunction(void)
{
#ifndef TEST_C_FLAGS
printf("TEST_C_FLAGS failed\n");
diff --git a/Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c b/Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c
index 8720386..740c236 100644
--- a/Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c
+++ b/Tests/ComplexOneConfig/Executable/Sub1/NameConflictTest.c
@@ -1,4 +1,4 @@
-int NameConflictTest1()
+int NameConflictTest1(void)
{
return 0;
}
diff --git a/Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c b/Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c
index 4a32572..cee9f6f 100644
--- a/Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c
+++ b/Tests/ComplexOneConfig/Executable/Sub2/NameConflictTest.c
@@ -1,4 +1,4 @@
-int NameConflictTest2()
+int NameConflictTest2(void)
{
return 0;
}
diff --git a/Tests/ComplexOneConfig/Library/TestLink.c b/Tests/ComplexOneConfig/Library/TestLink.c
index 25dee08..f4bc255 100644
--- a/Tests/ComplexOneConfig/Library/TestLink.c
+++ b/Tests/ComplexOneConfig/Library/TestLink.c
@@ -1,4 +1,4 @@
-int TestLinkGetType()
+int TestLinkGetType(void)
{
#ifdef CMakeTestLinkShared_EXPORTS
return 0;
diff --git a/Tests/ComplexOneConfig/Library/testConly.c b/Tests/ComplexOneConfig/Library/testConly.c
index eb933a2..05ecc18 100644
--- a/Tests/ComplexOneConfig/Library/testConly.c
+++ b/Tests/ComplexOneConfig/Library/testConly.c
@@ -2,7 +2,7 @@
#include <stdio.h>
-int CsharedFunction()
+int CsharedFunction(void)
{
#ifndef TEST_C_FLAGS
printf("TEST_C_FLAGS failed\n");
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index 38475f8..770afb3 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -154,7 +154,15 @@ else()
endif()
add_library(OneConfigOnly OBJECT "$<$<CONFIG:${one_config}>:${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp>")
set_property(TARGET OneConfigOnly PROPERTY LINKER_LANGUAGE CXX)
+add_executable(ConfigSourcesUseOne main_one_config.cpp)
+target_compile_definitions(ConfigSourcesUseOne PRIVATE "$<$<CONFIG:${one_config}>:CFG_ONE>")
+target_link_libraries(ConfigSourcesUseOne PRIVATE "$<$<CONFIG:${one_config}>:OneConfigOnly>")
+add_library(OneConfigOnlyIface INTERFACE)
+target_sources(OneConfigOnlyIface INTERFACE "$<$<CONFIG:${one_config}>:${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp>")
+add_executable(ConfigSourcesUseOneIface main_one_config.cpp)
+target_compile_definitions(ConfigSourcesUseOneIface PRIVATE "$<$<CONFIG:${one_config}>:CFG_ONE>")
+target_link_libraries(ConfigSourcesUseOneIface PRIVATE "$<$<CONFIG:${one_config}>:OneConfigOnlyIface>")
# ---------------------------------------------------------------------------
# Makes sure that each configuration uses the correct generated file.
diff --git a/Tests/ConfigSources/main_one_config.cpp b/Tests/ConfigSources/main_one_config.cpp
new file mode 100644
index 0000000..318944b
--- /dev/null
+++ b/Tests/ConfigSources/main_one_config.cpp
@@ -0,0 +1,8 @@
+#include "iface.h"
+int main()
+{
+#ifdef CFG_ONE
+ iface_src();
+#endif
+ return 0;
+}
diff --git a/Tests/Cuda/WithC/main.c b/Tests/Cuda/WithC/main.c
index 5f3c781..ed64427 100644
--- a/Tests/Cuda/WithC/main.c
+++ b/Tests/Cuda/WithC/main.c
@@ -4,7 +4,7 @@ extern int use_cuda(void);
# include <windows.h>
#endif
-int main()
+int main(void)
{
#ifdef _WIN32
/* Use an API that requires CMake's "standard" C libraries. */
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index 82366df..9f49498 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -16,6 +16,7 @@ set(CudaOnly.Toolkit_BUILD_OPTIONS -DHAS_CUPTI:BOOL=${CMake_TEST_CUDA_CUPTI})
add_cuda_test_macro(CudaOnly.Toolkit CudaOnlyToolkit)
add_cuda_test_macro(CudaOnly.ToolkitBeforeLang CudaOnlyToolkitBeforeLang)
add_cuda_test_macro(CudaOnly.ToolkitMultipleDirs CudaOnlyToolkitMultipleDirs)
+add_cuda_test_macro(CudaOnly.TryCompileTargetStatic CudaOnlyTryCompileTargetStatic)
add_cuda_test_macro(CudaOnly.WithDefs CudaOnlyWithDefs)
add_cuda_test_macro(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine)
add_cuda_test_macro(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
diff --git a/Tests/CudaOnly/TryCompileTargetStatic/CMakeLists.txt b/Tests/CudaOnly/TryCompileTargetStatic/CMakeLists.txt
new file mode 100644
index 0000000..340c1c9
--- /dev/null
+++ b/Tests/CudaOnly/TryCompileTargetStatic/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.25)
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+project(TryCompileTargetStatic LANGUAGES CUDA)
+
+add_executable(CudaOnlyTryCompileTargetStatic main.cu)
diff --git a/Tests/CudaOnly/TryCompileTargetStatic/main.cu b/Tests/CudaOnly/TryCompileTargetStatic/main.cu
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/CudaOnly/TryCompileTargetStatic/main.cu
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/CustomCommand/gen_redirect_in.c b/Tests/CustomCommand/gen_redirect_in.c
index 6af364b..c71123a 100644
--- a/Tests/CustomCommand/gen_redirect_in.c
+++ b/Tests/CustomCommand/gen_redirect_in.c
@@ -1,6 +1,6 @@
#if 1
-int gen_redirect()
+int gen_redirect(void)
{
return 3;
}
diff --git a/Tests/CustomCommandWorkingDirectory/customTarget.c b/Tests/CustomCommandWorkingDirectory/customTarget.c
index 8dbf0d4..9735287 100644
--- a/Tests/CustomCommandWorkingDirectory/customTarget.c
+++ b/Tests/CustomCommandWorkingDirectory/customTarget.c
@@ -1,4 +1,4 @@
-int customTarget()
+int customTarget(void)
{
return 0;
}
diff --git a/Tests/Dependency/1/OneSrc.c b/Tests/Dependency/1/OneSrc.c
index 9801c25..7f527f4 100644
--- a/Tests/Dependency/1/OneSrc.c
+++ b/Tests/Dependency/1/OneSrc.c
@@ -1,3 +1,3 @@
-void OneFunction()
+void OneFunction(void)
{
}
diff --git a/Tests/Dependency/Case1/a.c b/Tests/Dependency/Case1/a.c
index 262f523..bf1c773 100644
--- a/Tests/Dependency/Case1/a.c
+++ b/Tests/Dependency/Case1/a.c
@@ -1,4 +1,4 @@
-int a()
+int a(void)
{
return 5;
}
diff --git a/Tests/Dependency/Case1/b.c b/Tests/Dependency/Case1/b.c
index deda685..f4ef707 100644
--- a/Tests/Dependency/Case1/b.c
+++ b/Tests/Dependency/Case1/b.c
@@ -1,6 +1,6 @@
-extern int a();
+extern int a(void);
-int b()
+int b(void)
{
return a() + 17;
}
diff --git a/Tests/Dependency/Case1/b2.c b/Tests/Dependency/Case1/b2.c
index f341da7..108e76a 100644
--- a/Tests/Dependency/Case1/b2.c
+++ b/Tests/Dependency/Case1/b2.c
@@ -1,4 +1,4 @@
-int b2()
+int b2(void)
{
return 3;
}
diff --git a/Tests/Dependency/Case1/c.c b/Tests/Dependency/Case1/c.c
index a3ec162..ddda855 100644
--- a/Tests/Dependency/Case1/c.c
+++ b/Tests/Dependency/Case1/c.c
@@ -1,6 +1,6 @@
-extern int b();
+extern int b(void);
-int c()
+int c(void)
{
return b() + 42;
}
diff --git a/Tests/Dependency/Case1/c2.c b/Tests/Dependency/Case1/c2.c
index 317bb0f..826c746 100644
--- a/Tests/Dependency/Case1/c2.c
+++ b/Tests/Dependency/Case1/c2.c
@@ -1,6 +1,6 @@
-extern int b2();
+extern int b2(void);
-int c2()
+int c2(void)
{
return b2() + 1;
}
diff --git a/Tests/Dependency/Case1/d.c b/Tests/Dependency/Case1/d.c
index f67aef7..fdeb2bf 100644
--- a/Tests/Dependency/Case1/d.c
+++ b/Tests/Dependency/Case1/d.c
@@ -1,6 +1,6 @@
-extern int c2();
+extern int c2(void);
-int d()
+int d(void)
{
return c2() + 2;
}
diff --git a/Tests/Dependency/Case1/main.c b/Tests/Dependency/Case1/main.c
index 07191cc..6847f7d 100644
--- a/Tests/Dependency/Case1/main.c
+++ b/Tests/Dependency/Case1/main.c
@@ -2,7 +2,7 @@ extern int b();
extern int c();
extern int d();
-int main()
+int main(void)
{
c();
b();
diff --git a/Tests/Dependency/Case4/bar.c b/Tests/Dependency/Case4/bar.c
index 08092f9..18ddb78 100644
--- a/Tests/Dependency/Case4/bar.c
+++ b/Tests/Dependency/Case4/bar.c
@@ -1,5 +1,5 @@
-extern int foo();
-int main()
+extern int foo(void);
+int main(void)
{
return foo();
}
diff --git a/Tests/Dependency/Case4/foo.c b/Tests/Dependency/Case4/foo.c
index e05eb7e..c83d856 100644
--- a/Tests/Dependency/Case4/foo.c
+++ b/Tests/Dependency/Case4/foo.c
@@ -1,4 +1,4 @@
-int foo()
+int foo(void)
{
return 0;
}
diff --git a/Tests/Dependency/Eight/EightSrc.c b/Tests/Dependency/Eight/EightSrc.c
index 7bfa481..16605ce 100644
--- a/Tests/Dependency/Eight/EightSrc.c
+++ b/Tests/Dependency/Eight/EightSrc.c
@@ -1,6 +1,6 @@
-void SevenFunction();
+void SevenFunction(void);
-void EightFunction()
+void EightFunction(void)
{
SevenFunction();
}
diff --git a/Tests/Dependency/Exec/ExecMain.c b/Tests/Dependency/Exec/ExecMain.c
index 9572afd..793bc18 100644
--- a/Tests/Dependency/Exec/ExecMain.c
+++ b/Tests/Dependency/Exec/ExecMain.c
@@ -5,7 +5,7 @@ void NoDepCFunction();
void SixAFunction();
void SixBFunction();
-int main()
+int main(void)
{
SixAFunction();
SixBFunction();
diff --git a/Tests/Dependency/Exec2/ExecMain.c b/Tests/Dependency/Exec2/ExecMain.c
index 385cce1..085f30f 100644
--- a/Tests/Dependency/Exec2/ExecMain.c
+++ b/Tests/Dependency/Exec2/ExecMain.c
@@ -3,7 +3,7 @@
void FiveFunction();
void EightFunction();
-int main()
+int main(void)
{
FiveFunction();
EightFunction();
diff --git a/Tests/Dependency/Exec3/ExecMain.c b/Tests/Dependency/Exec3/ExecMain.c
index 385cce1..085f30f 100644
--- a/Tests/Dependency/Exec3/ExecMain.c
+++ b/Tests/Dependency/Exec3/ExecMain.c
@@ -3,7 +3,7 @@
void FiveFunction();
void EightFunction();
-int main()
+int main(void)
{
FiveFunction();
EightFunction();
diff --git a/Tests/Dependency/Exec4/ExecMain.c b/Tests/Dependency/Exec4/ExecMain.c
index 0cfcce9..48552d3 100644
--- a/Tests/Dependency/Exec4/ExecMain.c
+++ b/Tests/Dependency/Exec4/ExecMain.c
@@ -3,7 +3,7 @@
void FiveFunction();
void TwoFunction();
-int main()
+int main(void)
{
FiveFunction();
TwoFunction();
diff --git a/Tests/Dependency/Five/FiveSrc.c b/Tests/Dependency/Five/FiveSrc.c
index 33d8ad7..b35b05b 100644
--- a/Tests/Dependency/Five/FiveSrc.c
+++ b/Tests/Dependency/Five/FiveSrc.c
@@ -1,6 +1,6 @@
-void TwoFunction();
+void TwoFunction(void);
-void FiveFunction()
+void FiveFunction(void)
{
TwoFunction();
}
diff --git a/Tests/Dependency/Four/FourSrc.c b/Tests/Dependency/Four/FourSrc.c
index 4ea996d..b91c5fd 100644
--- a/Tests/Dependency/Four/FourSrc.c
+++ b/Tests/Dependency/Four/FourSrc.c
@@ -1,9 +1,9 @@
#include <two-test.h> /* Requires TwoCustom to be built first. */
-void NoDepAFunction();
-void OneFunction();
-void TwoFunction();
+void NoDepAFunction(void);
+void OneFunction(void);
+void TwoFunction(void);
-void FourFunction()
+void FourFunction(void)
{
static int count = 0;
if (count == 0) {
diff --git a/Tests/Dependency/NoDepA/NoDepASrc.c b/Tests/Dependency/NoDepA/NoDepASrc.c
index 8c4072b..e972df2 100644
--- a/Tests/Dependency/NoDepA/NoDepASrc.c
+++ b/Tests/Dependency/NoDepA/NoDepASrc.c
@@ -1,3 +1,3 @@
-void NoDepAFunction()
+void NoDepAFunction(void)
{
}
diff --git a/Tests/Dependency/NoDepB/NoDepBSrc.c b/Tests/Dependency/NoDepB/NoDepBSrc.c
index ddc71c5..81dc5ed 100644
--- a/Tests/Dependency/NoDepB/NoDepBSrc.c
+++ b/Tests/Dependency/NoDepB/NoDepBSrc.c
@@ -1,6 +1,6 @@
-void NoDepAFunction();
+void NoDepAFunction(void);
-void NoDepBFunction()
+void NoDepBFunction(void)
{
NoDepAFunction();
}
diff --git a/Tests/Dependency/NoDepC/NoDepCSrc.c b/Tests/Dependency/NoDepC/NoDepCSrc.c
index b478c59..d90007e 100644
--- a/Tests/Dependency/NoDepC/NoDepCSrc.c
+++ b/Tests/Dependency/NoDepC/NoDepCSrc.c
@@ -1,6 +1,6 @@
-void NoDepAFunction();
+void NoDepAFunction(void);
-void NoDepCFunction()
+void NoDepCFunction(void)
{
NoDepAFunction();
}
diff --git a/Tests/Dependency/Seven/SevenSrc.c b/Tests/Dependency/Seven/SevenSrc.c
index e1f3329..9c74ec8 100644
--- a/Tests/Dependency/Seven/SevenSrc.c
+++ b/Tests/Dependency/Seven/SevenSrc.c
@@ -1,6 +1,6 @@
-void TwoFunction();
+void TwoFunction(void);
-void SevenFunction()
+void SevenFunction(void)
{
TwoFunction();
}
diff --git a/Tests/Dependency/Six/SixASrc.c b/Tests/Dependency/Six/SixASrc.c
index 7ea3711..ddd2d7d 100644
--- a/Tests/Dependency/Six/SixASrc.c
+++ b/Tests/Dependency/Six/SixASrc.c
@@ -1,7 +1,7 @@
-void FiveFunction();
-void TwoFunction();
+void FiveFunction(void);
+void TwoFunction(void);
-void SixAFunction()
+void SixAFunction(void)
{
FiveFunction();
TwoFunction();
diff --git a/Tests/Dependency/Six/SixBSrc.c b/Tests/Dependency/Six/SixBSrc.c
index 92f9607..42f2de6 100644
--- a/Tests/Dependency/Six/SixBSrc.c
+++ b/Tests/Dependency/Six/SixBSrc.c
@@ -1,8 +1,8 @@
-void TwoFunction();
-void FiveFunction();
-void FourFunction();
+void TwoFunction(void);
+void FiveFunction(void);
+void FourFunction(void);
-void SixBFunction()
+void SixBFunction(void)
{
TwoFunction();
FiveFunction();
diff --git a/Tests/Dependency/Three/ThreeSrc.c b/Tests/Dependency/Three/ThreeSrc.c
index 3e814f3..85c51fc 100644
--- a/Tests/Dependency/Three/ThreeSrc.c
+++ b/Tests/Dependency/Three/ThreeSrc.c
@@ -1,7 +1,7 @@
-void OneFunction();
-void FourFunction();
+void OneFunction(void);
+void FourFunction(void);
-void ThreeFunction()
+void ThreeFunction(void)
{
static int count = 0;
if (count == 0) {
diff --git a/Tests/Dependency/Two/TwoCustomSrc.c b/Tests/Dependency/Two/TwoCustomSrc.c
index ac31dcf..432dca1 100644
--- a/Tests/Dependency/Two/TwoCustomSrc.c
+++ b/Tests/Dependency/Two/TwoCustomSrc.c
@@ -1,10 +1,10 @@
-extern void NoFunction();
+extern void NoFunction(void);
/* Provide a function that is supposed to be found in the Three
library. If Two links to TwoCustom then TwoCustom will come before
Three and this symbol will be used. Since NoFunction is not
defined, that will cause a link failure. */
-void ThreeFunction()
+void ThreeFunction(void)
{
NoFunction();
}
diff --git a/Tests/Dependency/Two/TwoSrc.c b/Tests/Dependency/Two/TwoSrc.c
index dbdf524..dadac22 100644
--- a/Tests/Dependency/Two/TwoSrc.c
+++ b/Tests/Dependency/Two/TwoSrc.c
@@ -1,6 +1,6 @@
#include <two-test.h>
-void TwoFunction()
+void TwoFunction(void)
{
static int count = 0;
if (count == 0) {
diff --git a/Tests/DoubleProject/silly.c b/Tests/DoubleProject/silly.c
index f8b643a..8488f4e 100644
--- a/Tests/DoubleProject/silly.c
+++ b/Tests/DoubleProject/silly.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 67f2fcb..56b8aaa 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -4,6 +4,8 @@ if(POLICY CMP0129)
endif()
project(Export C CXX)
+find_package(Foo REQUIRED CONFIG NO_DEFAULT_PATH)
+
# Pretend that RelWithDebInfo should link to debug libraries to test
# the DEBUG_CONFIGURATIONS property.
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS Debug RelWithDebInfo)
@@ -110,6 +112,7 @@ add_library(testLib9ObjIface OBJECT testLib9ObjIface.c)
target_compile_definitions(testLib9ObjIface INTERFACE testLib9ObjIface_USED)
add_library(testLib9 STATIC testLib9.c)
target_link_libraries(testLib9 INTERFACE testLib9ObjIface PUBLIC testLib9ObjPub PRIVATE testLib9ObjPriv)
+target_link_libraries(testLib9 PUBLIC Foo::Foo)
cmake_policy(POP)
# Test using the target_link_libraries command to set the
@@ -624,7 +627,7 @@ install(
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)
-install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp)
+install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp EXPORT_PACKAGE_DEPENDENCIES)
# Install testLib5.dll outside the export.
if(WIN32)
diff --git a/Tests/ExportImport/Export/testExe2.c b/Tests/ExportImport/Export/testExe2.c
index 958e4d2..8e6ee44 100644
--- a/Tests/ExportImport/Export/testExe2.c
+++ b/Tests/ExportImport/Export/testExe2.c
@@ -9,7 +9,7 @@ testExe2_EXPORT int testExe2Func(void)
return 123;
}
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/ExportImport/External/FooConfig.cmake b/Tests/ExportImport/External/FooConfig.cmake
new file mode 100644
index 0000000..48b6289
--- /dev/null
+++ b/Tests/ExportImport/External/FooConfig.cmake
@@ -0,0 +1,3 @@
+if(NOT TARGET Foo::Foo)
+ add_library(Foo::Foo INTERFACE IMPORTED)
+endif()
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 2c5662d..2a57633 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -500,7 +500,7 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA
OUTPUT_VARIABLE OUTPUT
)
if(NOT BLD_ERROR_VARIABLE)
- message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was expected to succeed.")
+ message(SEND_ERROR "BLD_ERROR_VARIABLE try_compile failed, but it was expected to succeed. ${OUTPUT}")
endif()
if(NOT CMAKE_CROSSCOMPILING)
@@ -518,6 +518,91 @@ if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREA
endif()
endif()
endif()
+
+ # Testing try_compile with ALIAS targets.
+ # These assume that previous test were successful, or at least the failures will be at the linking stage
+ # with symbol not found errors
+
+ # First make sure that if the test run without appropriate alias targets, they should error out
+ try_compile(FAILING_LIBRARY_ALIAS_ERROR_VARIABLE
+ "${CMAKE_CURRENT_BINARY_DIR}/test_failing_library_alias"
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
+ LINK_LIBRARIES not_existing_library
+ OUTPUT_VARIABLE OUTPUT
+ NO_CACHE
+ )
+ if(FAILING_LIBRARY_ALIAS_ERROR_VARIABLE)
+ message(SEND_ERROR "FAILING_LIBRARY_ALIAS_ERROR_VARIABLE try_compile succeeded, but it was expected to fail ${OUTPUT}.")
+ endif()
+
+ # FIXME: CMAKE_TRY_COMPILE_TARGET_TYPE=MODULE is needed to properly link and test targets linked to an executable
+# set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+# try_compile(FAILING_EXE_ALIAS_ERROR_VARIABLE
+# "${CMAKE_CURRENT_BINARY_DIR}/test_failing_exe_alias"
+# "${CMAKE_CURRENT_SOURCE_DIR}/imp_mod1.c"
+# LINK_LIBRARIES not_existing_executable
+# OUTPUT_VARIABLE OUTPUT
+# NO_CACHE
+# )
+# unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
+# if(FAILING_EXE_ALIAS_ERROR_VARIABLE)
+# message(SEND_ERROR "FAILING_EXE_ALIAS_ERROR_VARIABLE try_compile succeeded, but it was expected to fail ${OUTPUT}.")
+# endif()
+
+ # Do the actual try_compile tests for ALIAS targets
+ add_library(exp_systemlib_alias ALIAS exp_systemlib)
+ try_compile(EXP_LIBRARY_ALIAS_ERROR_VARIABLE
+ "${CMAKE_CURRENT_BINARY_DIR}/test_library_alias"
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
+ LINK_LIBRARIES exp_systemlib_alias
+ OUTPUT_VARIABLE OUTPUT
+ NO_CACHE
+ )
+ if(NOT EXP_LIBRARY_ALIAS_ERROR_VARIABLE)
+ message(SEND_ERROR "EXP_LIBRARY_ALIAS_ERROR_VARIABLE try_compile failed with library aliased target, but it was expected to succeed ${OUTPUT}.")
+ endif()
+
+ # FIXME: CMAKE_TRY_COMPILE_TARGET_TYPE=MODULE is needed to properly link and test targets linked to an executable
+# set(CMAKE_TRY_COMPILE_TARGET_TYPE MODULE)
+# add_executable(exp_exe_alias ALIAS exp_testExe2)
+# try_compile(EXP_EXE_ALIAS_ERROR_VARIABLE
+# "${CMAKE_CURRENT_BINARY_DIR}/test_exe_alias"
+# "${CMAKE_CURRENT_SOURCE_DIR}/imp_mod1.c"
+# LINK_LIBRARIES exp_exe_alias
+# OUTPUT_VARIABLE OUTPUT
+# NO_CACHE
+# )
+# unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
+# if(NOT EXP_EXE_ALIAS_ERROR_VARIABLE)
+# message(SEND_ERROR "EXP_EXE_ALIAS_ERROR_VARIABLE try_compile failed with executable aliased target, but it was expected to succeed ${OUTPUT}.")
+# endif()
+
+ add_library(bld_systemlib_alias ALIAS bld_systemlib)
+ try_compile(BLD_LIBRARY_ALIAS_ERROR_VARIABLE
+ "${CMAKE_CURRENT_BINARY_DIR}/test_library_alias"
+ "${CMAKE_CURRENT_SOURCE_DIR}/test_system.cpp"
+ LINK_LIBRARIES bld_systemlib_alias
+ OUTPUT_VARIABLE OUTPUT
+ NO_CACHE
+ )
+ if(NOT BLD_LIBRARY_ALIAS_ERROR_VARIABLE)
+ message(SEND_ERROR "BLD_LIBRARY_ALIAS_ERROR_VARIABLE try_compile failed with library aliased target, but it was expected to succeed. ${OUTPUT}")
+ endif()
+
+ # FIXME: CMAKE_TRY_COMPILE_TARGET_TYPE=MODULE is needed to properly link and test targets linked to an executable
+# set(CMAKE_TRY_COMPILE_TARGET_TYPE MODULE)
+# add_executable(bld_exe_alias ALIAS bld_testExe2)
+# try_compile(BLD_EXE_ALIAS_ERROR_VARIABLE
+# "${CMAKE_CURRENT_BINARY_DIR}/test_exe_alias"
+# "${CMAKE_CURRENT_SOURCE_DIR}/imp_mod1.c"
+# LINK_LIBRARIES bld_exe_alias
+# OUTPUT_VARIABLE OUTPUT
+# NO_CACHE
+# )
+# unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
+# if(NOT BLD_EXE_ALIAS_ERROR_VARIABLE)
+# message(SEND_ERROR "BLD_EXE_ALIAS_ERROR_VARIABLE try_compile failed with executable aliased target, but it was expected to succeed. ${OUTPUT}")
+# endif()
endif()
#---------------------------------------------------------------------------------
diff --git a/Tests/ExportImport/Import/A/deps_iface.c b/Tests/ExportImport/Import/A/deps_iface.c
index afb1af0..fd2c47f 100644
--- a/Tests/ExportImport/Import/A/deps_iface.c
+++ b/Tests/ExportImport/Import/A/deps_iface.c
@@ -26,7 +26,7 @@
extern int testLibDepends(void);
-int main()
+int main(void)
{
return testLibDepends();
}
diff --git a/Tests/ExportImport/Import/A/imp_mod1.c b/Tests/ExportImport/Import/A/imp_mod1.c
index 9385d55..138962e 100644
--- a/Tests/ExportImport/Import/A/imp_mod1.c
+++ b/Tests/ExportImport/Import/A/imp_mod1.c
@@ -7,7 +7,7 @@
testExe2_IMPORT int testExe2Func(void);
testExe2_IMPORT int testExe2lib(void);
-int imp_mod1()
+int imp_mod1(void)
{
return testExe2Func() + testExe2lib();
}
diff --git a/Tests/ExportImport/Import/A/imp_testExe1.c b/Tests/ExportImport/Import/A/imp_testExe1.c
index d3b0e9e..e409b1c 100644
--- a/Tests/ExportImport/Import/A/imp_testExe1.c
+++ b/Tests/ExportImport/Import/A/imp_testExe1.c
@@ -21,7 +21,7 @@ extern int testStaticLibPlugin(void);
#endif
extern int testLib4libcfg(void);
-int main()
+int main(void)
{
return (testLib2() + generated_by_testExe1() + testLib3() + testLib4() +
testLib5() + testLib6() + testLib7() + testLibCycleA1() +
diff --git a/Tests/ExportImport/Import/A/imp_testExeAbs1.c b/Tests/ExportImport/Import/A/imp_testExeAbs1.c
index fd05242..07d33a5 100644
--- a/Tests/ExportImport/Import/A/imp_testExeAbs1.c
+++ b/Tests/ExportImport/Import/A/imp_testExeAbs1.c
@@ -7,7 +7,7 @@
#ifndef testLibAbs1b
# error "testLibAbs1b not defined"
#endif
-int main()
+int main(void)
{
return 0 + testLibAbs1();
}
diff --git a/Tests/ExportImport/Import/A/imp_testLib8.c b/Tests/ExportImport/Import/A/imp_testLib8.c
index 2749b17..ef97dbe 100644
--- a/Tests/ExportImport/Import/A/imp_testLib8.c
+++ b/Tests/ExportImport/Import/A/imp_testLib8.c
@@ -2,7 +2,7 @@
int testLib8A(void);
int testLib8B(void);
-int main()
+int main(void)
{
return (testLib8A() + testLib8B());
}
diff --git a/Tests/ExportImport/Import/A/imp_testLib9.c b/Tests/ExportImport/Import/A/imp_testLib9.c
index e014857..2a8d8d5 100644
--- a/Tests/ExportImport/Import/A/imp_testLib9.c
+++ b/Tests/ExportImport/Import/A/imp_testLib9.c
@@ -10,7 +10,7 @@
int testLib9(void);
-int main()
+int main(void)
{
return testLib9();
}
diff --git a/Tests/ExportImport/Import/CMakeLists.txt b/Tests/ExportImport/Import/CMakeLists.txt
index e6dcd65..83c87a8 100644
--- a/Tests/ExportImport/Import/CMakeLists.txt
+++ b/Tests/ExportImport/Import/CMakeLists.txt
@@ -1,5 +1,6 @@
cmake_minimum_required (VERSION 2.7.20090711)
cmake_policy(SET CMP0025 NEW)
+cmake_policy(SET CMP0028 NEW)
if(POLICY CMP0129)
cmake_policy(SET CMP0129 NEW)
endif()
diff --git a/Tests/ExportImport/Import/imp_testTransExe1.c b/Tests/ExportImport/Import/imp_testTransExe1.c
index 360a112..579c992 100644
--- a/Tests/ExportImport/Import/imp_testTransExe1.c
+++ b/Tests/ExportImport/Import/imp_testTransExe1.c
@@ -1,6 +1,6 @@
extern int imp_lib1(void);
-int main()
+int main(void)
{
return imp_lib1();
}
diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in
index 44cd179..55aef86 100644
--- a/Tests/ExportImport/InitialCache.cmake.in
+++ b/Tests/ExportImport/InitialCache.cmake.in
@@ -15,3 +15,4 @@ set(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installa
set(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH")
set(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS")
set(CMake_TEST_CUDA "@CMake_TEST_CUDA@" CACHE BOOL "CMake_TEST_CUDA")
+set(Foo_DIR "@CMAKE_CURRENT_SOURCE_DIR@/External" CACHE PATH "Foo cmake package directory")
diff --git a/Tests/ExportImport/main.c b/Tests/ExportImport/main.c
index f8b643a..8488f4e 100644
--- a/Tests/ExportImport/main.c
+++ b/Tests/ExportImport/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/FindALSA/Test/main.c b/Tests/FindALSA/Test/main.c
index d3303d0..53831a9 100644
--- a/Tests/FindALSA/Test/main.c
+++ b/Tests/FindALSA/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
printf("Found ALSA version %s, expected version %s\n",
snd_asoundlib_version(), CMAKE_EXPECTED_ALSA_VERSION);
diff --git a/Tests/FindBLAS/Test/main.c b/Tests/FindBLAS/Test/main.c
index 4fc9fe4..4ce1efb 100644
--- a/Tests/FindBLAS/Test/main.c
+++ b/Tests/FindBLAS/Test/main.c
@@ -13,7 +13,7 @@ typedef int64_t blas_int;
// declare what parts of the blas C-API we need
void dswap_(blas_int* N, double* X, blas_int* incX, double* Y, blas_int* incY);
-int main()
+int main(void)
{
double x[4] = { 1, 2, 3, 4 };
double y[4] = { 8, 7, 7, 6 };
diff --git a/Tests/FindBZip2/Test/main.c b/Tests/FindBZip2/Test/main.c
index 8e24c94..b3cf34b 100644
--- a/Tests/FindBZip2/Test/main.c
+++ b/Tests/FindBZip2/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
-int main()
+int main(void)
{
int chunksize = 1024;
FILE* file = fopen("test.bzip2", "wb");
diff --git a/Tests/FindCURL/Test/main.c b/Tests/FindCURL/Test/main.c
index 263775f..82075f1 100644
--- a/Tests/FindCURL/Test/main.c
+++ b/Tests/FindCURL/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
-int main()
+int main(void)
{
struct curl_slist* slist;
diff --git a/Tests/FindCups/Test/main.c b/Tests/FindCups/Test/main.c
index b69d621..86952db 100644
--- a/Tests/FindCups/Test/main.c
+++ b/Tests/FindCups/Test/main.c
@@ -1,6 +1,6 @@
#include <cups/cups.h>
-int main()
+int main(void)
{
int num_options = 0;
cups_option_t* options = NULL;
diff --git a/Tests/FindDevIL/Test/main.c b/Tests/FindDevIL/Test/main.c
index 4a07087..dfb2f63 100644
--- a/Tests/FindDevIL/Test/main.c
+++ b/Tests/FindDevIL/Test/main.c
@@ -1,6 +1,6 @@
#include <IL/il.h>
-int main()
+int main(void)
{
// Test 1 requires to link to the library.
ilInit();
diff --git a/Tests/FindDevIL/Test/main_ilu.c b/Tests/FindDevIL/Test/main_ilu.c
index a9e7819..ac7237a 100644
--- a/Tests/FindDevIL/Test/main_ilu.c
+++ b/Tests/FindDevIL/Test/main_ilu.c
@@ -1,6 +1,6 @@
#include <IL/ilu.h>
-int main()
+int main(void)
{
// IL Utilities requires only initialization.
// Unlike main DevIL there are no shutdown function.
diff --git a/Tests/FindEXPAT/Test/main.c b/Tests/FindEXPAT/Test/main.c
index 94ee3ef..703aaf9 100644
--- a/Tests/FindEXPAT/Test/main.c
+++ b/Tests/FindEXPAT/Test/main.c
@@ -3,7 +3,7 @@
#include <stdlib.h>
#include <string.h>
-int main()
+int main(void)
{
XML_Expat_Version expat_version;
char expat_version_string[16];
diff --git a/Tests/FindFontconfig/Test/main.c b/Tests/FindFontconfig/Test/main.c
index c5b5963..96b0af1 100644
--- a/Tests/FindFontconfig/Test/main.c
+++ b/Tests/FindFontconfig/Test/main.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
FcInit();
printf("Found Fontconfig.\n");
diff --git a/Tests/FindFreetype/Test/main.c b/Tests/FindFreetype/Test/main.c
index bb838a5..315a6cb 100644
--- a/Tests/FindFreetype/Test/main.c
+++ b/Tests/FindFreetype/Test/main.c
@@ -3,7 +3,7 @@
#include FT_FREETYPE_H
#include <string.h>
-int main()
+int main(void)
{
FT_Library library;
FT_Error error;
diff --git a/Tests/FindGDAL/Test/main.c b/Tests/FindGDAL/Test/main.c
index 7b31a13..2e19843 100644
--- a/Tests/FindGDAL/Test/main.c
+++ b/Tests/FindGDAL/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
printf("Found GDAL version %s, expected version %s\n", GDAL_RELEASE_NAME,
CMAKE_EXPECTED_GDAL_VERSION);
diff --git a/Tests/FindGIF/Test/main.c b/Tests/FindGIF/Test/main.c
index 656a99c..fa2c224 100644
--- a/Tests/FindGIF/Test/main.c
+++ b/Tests/FindGIF/Test/main.c
@@ -8,7 +8,7 @@
# define GIFLIB_MAJOR 4
#endif
-int main()
+int main(void)
{
// because of the API changes we have to test different functions depending
// on the version of GIFLIB
diff --git a/Tests/FindGLUT/Test/main.c b/Tests/FindGLUT/Test/main.c
index 1c8569c..02ac34f 100644
--- a/Tests/FindGLUT/Test/main.c
+++ b/Tests/FindGLUT/Test/main.c
@@ -1,7 +1,7 @@
#include <GL/glut.h>
#include <stdio.h>
-int main()
+int main(void)
{
/* The following should call exit(1) and print
freeglut ERROR: Function <glutCreateWindow> called
diff --git a/Tests/FindGnuTLS/Test/main.c b/Tests/FindGnuTLS/Test/main.c
index 1105358..c379cc2 100644
--- a/Tests/FindGnuTLS/Test/main.c
+++ b/Tests/FindGnuTLS/Test/main.c
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
// test the linker
gnutls_session_t session;
diff --git a/Tests/FindImageMagick/Test/main_magick_wand.c b/Tests/FindImageMagick/Test/main_magick_wand.c
index fa6d170..52d179d 100644
--- a/Tests/FindImageMagick/Test/main_magick_wand.c
+++ b/Tests/FindImageMagick/Test/main_magick_wand.c
@@ -1,6 +1,6 @@
#include <wand/MagickWand.h>
-int main()
+int main(void)
{
MagickWand* wand = NewMagickWand();
wand = DestroyMagickWand(wand);
diff --git a/Tests/FindJPEG/Test/main.c b/Tests/FindJPEG/Test/main.c
index 5a67faa..0116cb6 100644
--- a/Tests/FindJPEG/Test/main.c
+++ b/Tests/FindJPEG/Test/main.c
@@ -4,7 +4,7 @@
#include <jpeglib.h>
// clang-format on
-int main()
+int main(void)
{
/* Without any JPEG file to open, test that the call fails as
expected. This tests that linking worked. */
diff --git a/Tests/FindJasper/Test/main.c b/Tests/FindJasper/Test/main.c
index 771344d..242ff7d 100644
--- a/Tests/FindJasper/Test/main.c
+++ b/Tests/FindJasper/Test/main.c
@@ -4,7 +4,7 @@
#include <jasper/jasper.h>
// clang-format on
-int main()
+int main(void)
{
/* Without any JPEG file to open, test that the call fails as
expected. This tests that linking worked. */
diff --git a/Tests/FindLAPACK/Test/main.c b/Tests/FindLAPACK/Test/main.c
index dd33fb3..3c7ad9f 100644
--- a/Tests/FindLAPACK/Test/main.c
+++ b/Tests/FindLAPACK/Test/main.c
@@ -14,7 +14,7 @@ typedef int64_t blas_int;
void dgesv_(blas_int*, blas_int*, double*, blas_int*, blas_int*, double*,
blas_int*, blas_int*);
-int main()
+int main(void)
{
double A[8] = {
0, 1, 2, 3, 4, 5, 6, 7,
diff --git a/Tests/FindLibLZMA/Test/main.c b/Tests/FindLibLZMA/Test/main.c
index 06e8065..0b3de31 100644
--- a/Tests/FindLibLZMA/Test/main.c
+++ b/Tests/FindLibLZMA/Test/main.c
@@ -4,7 +4,7 @@
static const uint8_t test_string[9] = "123456789";
-int main()
+int main(void)
{
static const uint32_t test_vector = 0xCBF43926;
diff --git a/Tests/FindLibRHash/Test/main.c b/Tests/FindLibRHash/Test/main.c
index 201dced..4cc6394 100644
--- a/Tests/FindLibRHash/Test/main.c
+++ b/Tests/FindLibRHash/Test/main.c
@@ -1,6 +1,6 @@
#include <rhash.h>
-int main()
+int main(void)
{
rhash_library_init();
return 0;
diff --git a/Tests/FindLibUV/Test/main.c b/Tests/FindLibUV/Test/main.c
index cbd0db3..a14adbb 100644
--- a/Tests/FindLibUV/Test/main.c
+++ b/Tests/FindLibUV/Test/main.c
@@ -1,6 +1,6 @@
#include <uv.h>
-int main()
+int main(void)
{
uv_loop_close(uv_default_loop());
return 0;
diff --git a/Tests/FindLibXml2/Test/main.c b/Tests/FindLibXml2/Test/main.c
index 264f07d..4ded2f7 100644
--- a/Tests/FindLibXml2/Test/main.c
+++ b/Tests/FindLibXml2/Test/main.c
@@ -2,7 +2,7 @@
#include <libxml/tree.h>
#include <string.h>
-int main()
+int main(void)
{
xmlDoc* doc;
diff --git a/Tests/FindLibXslt/Test/libexslt.c b/Tests/FindLibXslt/Test/libexslt.c
index ea6eb3d..5916024 100644
--- a/Tests/FindLibXslt/Test/libexslt.c
+++ b/Tests/FindLibXslt/Test/libexslt.c
@@ -2,7 +2,7 @@
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
-int main()
+int main(void)
{
xsltInit();
diff --git a/Tests/FindLibXslt/Test/libxslt.c b/Tests/FindLibXslt/Test/libxslt.c
index 5b3d766..4a149c1 100644
--- a/Tests/FindLibXslt/Test/libxslt.c
+++ b/Tests/FindLibXslt/Test/libxslt.c
@@ -4,7 +4,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
xsltInit();
diff --git a/Tests/FindLibinput/Test/main.c b/Tests/FindLibinput/Test/main.c
index 3919962..a6b1aa4 100644
--- a/Tests/FindLibinput/Test/main.c
+++ b/Tests/FindLibinput/Test/main.c
@@ -1,7 +1,7 @@
#include <libinput.h>
#include <stdio.h>
-int main()
+int main(void)
{
struct libinput_interface interface;
interface.open_restricted = 0;
diff --git a/Tests/FindODBC/Test/main.c b/Tests/FindODBC/Test/main.c
index 34f279c..6c4318b 100644
--- a/Tests/FindODBC/Test/main.c
+++ b/Tests/FindODBC/Test/main.c
@@ -3,7 +3,7 @@
#endif
#include <sql.h>
-int main()
+int main(void)
{
SQLHENV env;
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);
diff --git a/Tests/FindOpenACC/CTest/main.c b/Tests/FindOpenACC/CTest/main.c
index 53b6cae..6c005c1 100644
--- a/Tests/FindOpenACC/CTest/main.c
+++ b/Tests/FindOpenACC/CTest/main.c
@@ -8,7 +8,7 @@ void vecaddgpu(float* r, float* a, float* b, int n)
r[i] = a[i] + b[i];
}
-int main()
+int main(void)
{
int n = 100000; /* vector length */
float* a; /* input vector 1 */
diff --git a/Tests/FindOpenCL/Test/main.c b/Tests/FindOpenCL/Test/main.c
index 2fe949b..d3d0cfb 100644
--- a/Tests/FindOpenCL/Test/main.c
+++ b/Tests/FindOpenCL/Test/main.c
@@ -4,7 +4,7 @@
# include <CL/cl.h>
#endif
-int main()
+int main(void)
{
cl_uint platformIdCount;
diff --git a/Tests/FindOpenGL/Test/main.c b/Tests/FindOpenGL/Test/main.c
index e1f25c6..88a4a8a 100644
--- a/Tests/FindOpenGL/Test/main.c
+++ b/Tests/FindOpenGL/Test/main.c
@@ -9,7 +9,7 @@
#include <stdio.h>
-int main()
+int main(void)
{
/* Reference a GL symbol without requiring a context at runtime. */
printf("&glGetString = %p\n", &glGetString);
diff --git a/Tests/FindOpenGL/Test/main_gles2.c b/Tests/FindOpenGL/Test/main_gles2.c
index 52f5936..355795b 100644
--- a/Tests/FindOpenGL/Test/main_gles2.c
+++ b/Tests/FindOpenGL/Test/main_gles2.c
@@ -9,7 +9,7 @@
#include <stdio.h>
-int main()
+int main(void)
{
/* Reference a GL symbol without requiring a context at runtime. */
printf("&glGetString = %p\n", &glGetString);
diff --git a/Tests/FindOpenGL/Test/main_gles3.c b/Tests/FindOpenGL/Test/main_gles3.c
index 875f73c..383954f7 100644
--- a/Tests/FindOpenGL/Test/main_gles3.c
+++ b/Tests/FindOpenGL/Test/main_gles3.c
@@ -9,7 +9,7 @@
#include <stdio.h>
-int main()
+int main(void)
{
/* Reference a GL symbol without requiring a context at runtime. */
printf("&glGetString = %p\n", &glGetString);
diff --git a/Tests/FindOpenMP/Test/main.c b/Tests/FindOpenMP/Test/main.c
index 4f0e874..9fb67e4 100644
--- a/Tests/FindOpenMP/Test/main.c
+++ b/Tests/FindOpenMP/Test/main.c
@@ -1,5 +1,5 @@
#include <omp.h>
-int main()
+int main(void)
{
#ifndef _OPENMP
breaks_on_purpose
diff --git a/Tests/FindOpenMP/Test/scaltest.c b/Tests/FindOpenMP/Test/scaltest.c
index 4678b87..be48827 100644
--- a/Tests/FindOpenMP/Test/scaltest.c
+++ b/Tests/FindOpenMP/Test/scaltest.c
@@ -6,7 +6,7 @@ extern "C"
#endif
int scalprod(int n, double* x, double* y, double* res);
-int main()
+int main(void)
{
double a[5] = { 1., 2., 3., 4., 5. };
double b[5] = { 2., 3., 4., 5., 6. };
diff --git a/Tests/FindPNG/Test/main.c b/Tests/FindPNG/Test/main.c
index b33b28e..05b55c0 100644
--- a/Tests/FindPNG/Test/main.c
+++ b/Tests/FindPNG/Test/main.c
@@ -2,7 +2,7 @@
#include <png.h>
#include <string.h>
-int main()
+int main(void)
{
png_uint_32 png_version;
char png_version_string[16];
diff --git a/Tests/FindPackageTest/Exporter/dummy.c b/Tests/FindPackageTest/Exporter/dummy.c
index f8b643a..8488f4e 100644
--- a/Tests/FindPackageTest/Exporter/dummy.c
+++ b/Tests/FindPackageTest/Exporter/dummy.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/FindPostgreSQL/Test/main.c b/Tests/FindPostgreSQL/Test/main.c
index a63377a..b5fcf64 100644
--- a/Tests/FindPostgreSQL/Test/main.c
+++ b/Tests/FindPostgreSQL/Test/main.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <string.h>
-int main()
+int main(void)
{
int version = PQlibVersion();
char version_string[100];
diff --git a/Tests/FindPython/display_time.c b/Tests/FindPython/display_time.c
index 0e78434..568d510 100644
--- a/Tests/FindPython/display_time.c
+++ b/Tests/FindPython/display_time.c
@@ -6,7 +6,7 @@
#include "display_time.h"
-void display_time()
+void display_time(void)
{
#if defined(PYTHON3)
wchar_t* program = Py_DecodeLocale("display_time", NULL);
diff --git a/Tests/FindPython/main.c b/Tests/FindPython/main.c
index 0acba29..0119ce0 100644
--- a/Tests/FindPython/main.c
+++ b/Tests/FindPython/main.c
@@ -1,7 +1,7 @@
#include "display_time.h"
-int main()
+int main(void)
{
display_time();
}
diff --git a/Tests/FindSDL/Test/main.c b/Tests/FindSDL/Test/main.c
index 057289c..3b774f5 100644
--- a/Tests/FindSDL/Test/main.c
+++ b/Tests/FindSDL/Test/main.c
@@ -1,6 +1,6 @@
#include <SDL.h>
-int main()
+int main(void)
{
// Test 1 requires headers only.
SDL_version compiled;
diff --git a/Tests/FindSQLite3/Test/main.c b/Tests/FindSQLite3/Test/main.c
index fb17c67..f812034 100644
--- a/Tests/FindSQLite3/Test/main.c
+++ b/Tests/FindSQLite3/Test/main.c
@@ -1,7 +1,7 @@
#include <sqlite3.h>
#include <string.h>
-int main()
+int main(void)
{
char sqlite3_version[] = SQLITE_VERSION;
diff --git a/Tests/FindTIFF/Test/main.c b/Tests/FindTIFF/Test/main.c
index 9182652..bce4a3e 100644
--- a/Tests/FindTIFF/Test/main.c
+++ b/Tests/FindTIFF/Test/main.c
@@ -1,7 +1,7 @@
#include <assert.h>
#include <tiffio.h>
-int main()
+int main(void)
{
/* Without any TIFF file to open, test that the call fails as
expected. This tests that linking worked. */
diff --git a/Tests/FindVulkan/Test/main-SPIRV-Tools.c b/Tests/FindVulkan/Test/main-SPIRV-Tools.c
index 097198d..c38f38d 100644
--- a/Tests/FindVulkan/Test/main-SPIRV-Tools.c
+++ b/Tests/FindVulkan/Test/main-SPIRV-Tools.c
@@ -2,7 +2,7 @@
#include <spirv-tools/libspirv.h>
#include <stdio.h>
-int main()
+int main(void)
{
const char* spv_version = spvSoftwareVersionString();
const char* spv_details = spvSoftwareVersionDetailsString();
diff --git a/Tests/FindVulkan/Test/main.c b/Tests/FindVulkan/Test/main.c
index 1bff651..78eaa4d 100644
--- a/Tests/FindVulkan/Test/main.c
+++ b/Tests/FindVulkan/Test/main.c
@@ -1,6 +1,6 @@
#include <vulkan/vulkan.h>
-int main()
+int main(void)
{
VkInstanceCreateInfo instanceCreateInfo = { 0 };
instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
diff --git a/Tests/Fortran/mainc.c b/Tests/Fortran/mainc.c
index 9efafc5..607b9fd 100644
--- a/Tests/Fortran/mainc.c
+++ b/Tests/Fortran/mainc.c
@@ -1,5 +1,5 @@
extern int myc(void);
-int main()
+int main(void)
{
return myc();
}
diff --git a/Tests/Fortran/maincxx.c b/Tests/Fortran/maincxx.c
index d35ea7e..3056d96 100644
--- a/Tests/Fortran/maincxx.c
+++ b/Tests/Fortran/maincxx.c
@@ -1,6 +1,6 @@
extern int myc(void);
extern int mycxx(void);
-int main()
+int main(void)
{
return myc() + mycxx();
}
diff --git a/Tests/FortranModules/Issue25252-iface-sources/lib.c b/Tests/FortranModules/Issue25252-iface-sources/lib.c
index 6ccdb8d..894540c 100644
--- a/Tests/FortranModules/Issue25252-iface-sources/lib.c
+++ b/Tests/FortranModules/Issue25252-iface-sources/lib.c
@@ -1,4 +1,4 @@
-int f()
+int f(void)
{
return 0;
}
diff --git a/Tests/GeneratorExpression/objlib1.c b/Tests/GeneratorExpression/objlib1.c
index 98a95a4..b33aa48 100644
--- a/Tests/GeneratorExpression/objlib1.c
+++ b/Tests/GeneratorExpression/objlib1.c
@@ -1,4 +1,4 @@
-void objlib1()
+void objlib1(void)
{
}
diff --git a/Tests/GeneratorExpression/objlib2.c b/Tests/GeneratorExpression/objlib2.c
index b2c1050..5543f75 100644
--- a/Tests/GeneratorExpression/objlib2.c
+++ b/Tests/GeneratorExpression/objlib2.c
@@ -1,4 +1,4 @@
-void objlib2()
+void objlib2(void)
{
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
index 5d857dd..ef922a3 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/test.c
@@ -1,4 +1,4 @@
-int test_b()
+int test_b(void)
{
return 2;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
index 66ee6f3..1df9613 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder/testcase.c
@@ -1,4 +1,4 @@
-int test_f()
+int test_f(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
index 83589ba..8bcb13a 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test.c
@@ -1,4 +1,4 @@
-int test_c()
+int test_c(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
index 82f9a52..24e2d75 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/subfolder_test_0.c
@@ -1,4 +1,4 @@
-int test_d()
+int test_d(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
index feba80e..5dd1214 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/test.c
@@ -1,4 +1,4 @@
-int test_a()
+int test_a(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
index 943c19d..658f5ab 100644
--- a/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
+++ b/Tests/GhsMulti/GhsMultiDuplicateSourceFilenames/testCase.c
@@ -1,4 +1,4 @@
-int test_e()
+int test_e(void)
{
return 1;
}
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
index d1bce33..9282163 100644
--- a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
+++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c
@@ -1,7 +1,7 @@
#include "INTEGRITY.h"
#include "boottable.h"
-void main()
+void main(void)
{
Exit(0);
}
diff --git a/Tests/IncludeDirectories/StandardIncludeDirectories/main.c b/Tests/IncludeDirectories/StandardIncludeDirectories/main.c
index edfe9ce..29a2ee1 100644
--- a/Tests/IncludeDirectories/StandardIncludeDirectories/main.c
+++ b/Tests/IncludeDirectories/StandardIncludeDirectories/main.c
@@ -1,5 +1,5 @@
#include "StdIncDir.h"
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c b/Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c
index f8b643a..8488f4e 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c
+++ b/Tests/IncludeDirectories/SystemIncludeDirectoriesPerLang/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/JavaExportImport/main.c b/Tests/JavaExportImport/main.c
index f8b643a..8488f4e 100644
--- a/Tests/JavaExportImport/main.c
+++ b/Tests/JavaExportImport/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/LibName/bar.c b/Tests/LibName/bar.c
index c6c1e66..b1c5cf2 100644
--- a/Tests/LibName/bar.c
+++ b/Tests/LibName/bar.c
@@ -2,6 +2,6 @@
__declspec(dllexport)
#endif
- extern void foo()
+ extern void foo(void)
{
}
diff --git a/Tests/LibName/foo.c b/Tests/LibName/foo.c
index 52e8d89..1bdb58b 100644
--- a/Tests/LibName/foo.c
+++ b/Tests/LibName/foo.c
@@ -1,11 +1,11 @@
#ifdef _WIN32
__declspec(dllimport)
#endif
- extern void foo();
+ extern void foo(void);
#ifdef _WIN32
__declspec(dllexport)
#endif
- void bar()
+ void bar(void)
{
foo();
}
diff --git a/Tests/LibName/foobar.c b/Tests/LibName/foobar.c
index 2f28d30..fa7d3e9 100644
--- a/Tests/LibName/foobar.c
+++ b/Tests/LibName/foobar.c
@@ -3,7 +3,7 @@ __declspec(dllimport)
#endif
extern void bar();
-int main()
+int main(void)
{
bar();
return 0;
diff --git a/Tests/LinkLanguage/LinkLanguage.c b/Tests/LinkLanguage/LinkLanguage.c
index 37946c7..18ddb78 100644
--- a/Tests/LinkLanguage/LinkLanguage.c
+++ b/Tests/LinkLanguage/LinkLanguage.c
@@ -1,5 +1,5 @@
extern int foo(void);
-int main()
+int main(void)
{
return foo();
}
diff --git a/Tests/LinkLine/Exec.c b/Tests/LinkLine/Exec.c
index 807a7a8..11b5650 100644
--- a/Tests/LinkLine/Exec.c
+++ b/Tests/LinkLine/Exec.c
@@ -1,7 +1,7 @@
void OneFunc();
void TwoFunc();
-int main()
+int main(void)
{
OneFunc();
TwoFunc();
diff --git a/Tests/LinkLine/One.c b/Tests/LinkLine/One.c
index 856d0d1..4f3ad63 100644
--- a/Tests/LinkLine/One.c
+++ b/Tests/LinkLine/One.c
@@ -1,6 +1,6 @@
-void TwoFunc();
+void TwoFunc(void);
-void OneFunc()
+void OneFunc(void)
{
static int i = 0;
++i;
diff --git a/Tests/LinkLine/Two.c b/Tests/LinkLine/Two.c
index 5fc212e..ac84367 100644
--- a/Tests/LinkLine/Two.c
+++ b/Tests/LinkLine/Two.c
@@ -1,6 +1,6 @@
-void OneFunc();
+void OneFunc(void);
-void TwoFunc()
+void TwoFunc(void)
{
static int i = 0;
++i;
diff --git a/Tests/LinkLineOrder/Exec1.c b/Tests/LinkLineOrder/Exec1.c
index 9bbf0f6..e47841d 100644
--- a/Tests/LinkLineOrder/Exec1.c
+++ b/Tests/LinkLineOrder/Exec1.c
@@ -1,7 +1,7 @@
/* Directly depends on One */
void OneFunc();
-int main()
+int main(void)
{
OneFunc();
return 0;
diff --git a/Tests/LinkLineOrder/Exec2.c b/Tests/LinkLineOrder/Exec2.c
index 91b8575..d60c94e 100644
--- a/Tests/LinkLineOrder/Exec2.c
+++ b/Tests/LinkLineOrder/Exec2.c
@@ -1,7 +1,7 @@
/* Directly depends on Two */
void TwoFunc();
-int main()
+int main(void)
{
TwoFunc();
return 0;
diff --git a/Tests/LinkLineOrder/NoDepA.c b/Tests/LinkLineOrder/NoDepA.c
index 76f97bc..72333bc 100644
--- a/Tests/LinkLineOrder/NoDepA.c
+++ b/Tests/LinkLineOrder/NoDepA.c
@@ -1,7 +1,7 @@
/* depends on NoDepB */
-void NoDepB_func();
+void NoDepB_func(void);
-void NoDepA_func()
+void NoDepA_func(void)
{
NoDepB_func();
}
diff --git a/Tests/LinkLineOrder/NoDepB.c b/Tests/LinkLineOrder/NoDepB.c
index fa89ae9..a5c30e5 100644
--- a/Tests/LinkLineOrder/NoDepB.c
+++ b/Tests/LinkLineOrder/NoDepB.c
@@ -1,4 +1,4 @@
/* No dependencies */
-void NoDepB_func()
+void NoDepB_func(void)
{
}
diff --git a/Tests/LinkLineOrder/NoDepC.c b/Tests/LinkLineOrder/NoDepC.c
index f05d962..cafb3fd 100644
--- a/Tests/LinkLineOrder/NoDepC.c
+++ b/Tests/LinkLineOrder/NoDepC.c
@@ -1,7 +1,7 @@
/* depends on NoDepA */
-void NoDepA_func();
+void NoDepA_func(void);
-void NoDepC_func()
+void NoDepC_func(void)
{
NoDepA_func();
}
diff --git a/Tests/LinkLineOrder/NoDepE.c b/Tests/LinkLineOrder/NoDepE.c
index c47bb85..6e33c7b 100644
--- a/Tests/LinkLineOrder/NoDepE.c
+++ b/Tests/LinkLineOrder/NoDepE.c
@@ -1,7 +1,7 @@
/* depends on NoDepF */
-void NoDepF_func();
+void NoDepF_func(void);
-void NoDepE_func()
+void NoDepE_func(void)
{
static int firstcall = 1;
if (firstcall) {
diff --git a/Tests/LinkLineOrder/NoDepF.c b/Tests/LinkLineOrder/NoDepF.c
index a814310..f4afcb5 100644
--- a/Tests/LinkLineOrder/NoDepF.c
+++ b/Tests/LinkLineOrder/NoDepF.c
@@ -1,7 +1,7 @@
/* depends on NoDepE */
-void NoDepE_func();
+void NoDepE_func(void);
-void NoDepF_func()
+void NoDepF_func(void)
{
static int firstcall = 1;
if (firstcall) {
diff --git a/Tests/LinkLineOrder/NoDepX.c b/Tests/LinkLineOrder/NoDepX.c
index c895dd1..c8de222 100644
--- a/Tests/LinkLineOrder/NoDepX.c
+++ b/Tests/LinkLineOrder/NoDepX.c
@@ -1,7 +1,7 @@
/* depends on NoDepY*/
-void NoDepY_func();
+void NoDepY_func(void);
-void NoDepX_func()
+void NoDepX_func(void)
{
NoDepY_func();
}
diff --git a/Tests/LinkLineOrder/NoDepY.c b/Tests/LinkLineOrder/NoDepY.c
index 1e6a4ae..dc492d5 100644
--- a/Tests/LinkLineOrder/NoDepY.c
+++ b/Tests/LinkLineOrder/NoDepY.c
@@ -1,4 +1,4 @@
/* No dependencies */
-void NoDepY_func()
+void NoDepY_func(void)
{
}
diff --git a/Tests/LinkLineOrder/NoDepZ.c b/Tests/LinkLineOrder/NoDepZ.c
index 045e570..c866667 100644
--- a/Tests/LinkLineOrder/NoDepZ.c
+++ b/Tests/LinkLineOrder/NoDepZ.c
@@ -1,7 +1,7 @@
/* depends on NoDepX */
-void NoDepX_func();
+void NoDepX_func(void);
-void NoDepZ_func()
+void NoDepZ_func(void)
{
NoDepX_func();
}
diff --git a/Tests/LinkLineOrder/One.c b/Tests/LinkLineOrder/One.c
index b23b1ec..b95fa6d 100644
--- a/Tests/LinkLineOrder/One.c
+++ b/Tests/LinkLineOrder/One.c
@@ -1,9 +1,9 @@
/* depends on NoDepC and NoDepE (and hence on NoDepA, NoDepB and */
/* NoDepF) */
-void NoDepC_func();
-void NoDepE_func();
+void NoDepC_func(void);
+void NoDepE_func(void);
-void OneFunc()
+void OneFunc(void)
{
NoDepC_func();
NoDepE_func();
diff --git a/Tests/LinkLineOrder/Two.c b/Tests/LinkLineOrder/Two.c
index 6bffaa8..9955d67 100644
--- a/Tests/LinkLineOrder/Two.c
+++ b/Tests/LinkLineOrder/Two.c
@@ -1,7 +1,7 @@
-void OneFunc();
-void NoDepZ_func();
+void OneFunc(void);
+void NoDepZ_func(void);
-void TwoFunc()
+void TwoFunc(void)
{
OneFunc();
NoDepZ_func();
diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
index 7176ebe..ba13727 100644
--- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
@@ -16,14 +16,14 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
{
char* file;
char* str;
- char* srcs;
+ const char* srcs;
const char* cstr;
char buffer[1024];
void* source_file;
char* args[2];
- char* ccArgs[4];
- char* ccDep[1];
- char* ccOut[1];
+ const char* ccArgs[4];
+ const char* ccDep[1];
+ const char* ccOut[1];
cmLoadedCommandInfo* info = (cmLoadedCommandInfo*)inf;
cmVTKWrapTclData* cdata =
@@ -148,7 +148,10 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
if (info->CAPI->GetTotalArgumentSize(2, args) != 13) {
return 0;
}
- info->CAPI->ExecuteCommand(mf, "SET", 2, args);
+
+ ccArgs[0] = "TEST_EXEC";
+ ccArgs[1] = "TRUE";
+ info->CAPI->ExecuteCommand(mf, "SET", 2, ccArgs);
/* make sure we can find the source file */
if (!info->CAPI->GetSource(mf, argv[1])) {
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
index 7176ebe..e3b332c 100644
--- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
@@ -16,14 +16,14 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
{
char* file;
char* str;
- char* srcs;
- const char* cstr;
+ const char* srcs;
+ char* cstr;
char buffer[1024];
void* source_file;
char* args[2];
- char* ccArgs[4];
- char* ccDep[1];
- char* ccOut[1];
+ const char* ccArgs[4];
+ const char* ccDep[1];
+ const char* ccOut[1];
cmLoadedCommandInfo* info = (cmLoadedCommandInfo*)inf;
cmVTKWrapTclData* cdata =
@@ -148,7 +148,10 @@ static int CCONV InitialPass(void* inf, void* mf, int argc, char* argv[])
if (info->CAPI->GetTotalArgumentSize(2, args) != 13) {
return 0;
}
- info->CAPI->ExecuteCommand(mf, "SET", 2, args);
+
+ ccArgs[0] = "TEST_EXEC";
+ ccArgs[1] = "TRUE";
+ info->CAPI->ExecuteCommand(mf, "SET", 2, ccArgs);
/* make sure we can find the source file */
if (!info->CAPI->GetSource(mf, argv[1])) {
diff --git a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
index 2a8a152..4cd200a 100644
--- a/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
+++ b/Tests/MSVCRuntimeLibrary/Fortran/CMakeLists.txt
@@ -21,14 +21,16 @@ foreach(t MultiThreaded SingleThreaded)
endforeach()
endforeach()
endforeach()
-if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
- # LLVMFlang does not actually define these, so inject them
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
+ # LLVMFlang < 18.0 does not define these, so inject them.
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded "-D_MT")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL "-D_MT;-D_DLL")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "-D_MT;-D_DEBUG")
set(CMAKE_Fortran_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "-D_MT;-D_DEBUG;-D_DLL")
endif()
-string(APPEND CMAKE_Fortran_FLAGS " -w")
+if(NOT CMAKE_Fortran_SIMULATE_ID STREQUAL "MSVC")
+ string(APPEND CMAKE_Fortran_FLAGS " -w")
+endif()
function(verify_combinations threads lang src)
set(verify_tc_config_ Release)
diff --git a/Tests/Module/CheckIPOSupported-C/bar.c b/Tests/Module/CheckIPOSupported-C/bar.c
index 680f213..728d8fb 100644
--- a/Tests/Module/CheckIPOSupported-C/bar.c
+++ b/Tests/Module/CheckIPOSupported-C/bar.c
@@ -1,4 +1,4 @@
-int bar()
+int bar(void)
{
return 0x42;
}
diff --git a/Tests/Module/CheckIPOSupported-C/foo.c b/Tests/Module/CheckIPOSupported-C/foo.c
index 1e56597..6a64a99 100644
--- a/Tests/Module/CheckIPOSupported-C/foo.c
+++ b/Tests/Module/CheckIPOSupported-C/foo.c
@@ -1,4 +1,4 @@
-int foo()
+int foo(void)
{
return 0x42;
}
diff --git a/Tests/Module/CheckIPOSupported-C/main.c b/Tests/Module/CheckIPOSupported-C/main.c
index 28ab26f..7d8ad9a 100644
--- a/Tests/Module/CheckIPOSupported-C/main.c
+++ b/Tests/Module/CheckIPOSupported-C/main.c
@@ -1,7 +1,7 @@
int foo();
int bar();
-int main()
+int main(void)
{
if (foo() != bar()) {
return 1;
diff --git a/Tests/Module/CheckTypeSize/CheckTypeSize.c b/Tests/Module/CheckTypeSize/CheckTypeSize.c
index adfd2fc..eb1aa94 100644
--- a/Tests/Module/CheckTypeSize/CheckTypeSize.c
+++ b/Tests/Module/CheckTypeSize/CheckTypeSize.c
@@ -28,7 +28,7 @@
result = 1; \
} while (0)
-int main()
+int main(void)
{
int result = 0;
struct somestruct x;
diff --git a/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c b/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c
index 487e66d..34c373c 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c
+++ b/Tests/Module/WriteCompilerDetectionHeader/c_undefined.c
@@ -1,7 +1,7 @@
#include "test_compiler_detection.h"
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/Module/WriteCompilerDetectionHeader/main.c b/Tests/Module/WriteCompilerDetectionHeader/main.c
index 3420c67..1253563 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/main.c
+++ b/Tests/Module/WriteCompilerDetectionHeader/main.c
@@ -24,7 +24,7 @@
# error Expect no CXX features defined
#endif
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/Module/WriteCompilerDetectionHeader/main_multi.c b/Tests/Module/WriteCompilerDetectionHeader/main_multi.c
index 28f9dae..3853671 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/main_multi.c
+++ b/Tests/Module/WriteCompilerDetectionHeader/main_multi.c
@@ -24,7 +24,7 @@
# error Expect no CXX features defined
#endif
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/OutOfBinary/outlib.c b/Tests/OutOfBinary/outlib.c
index d309ebe..3eaedea 100644
--- a/Tests/OutOfBinary/outlib.c
+++ b/Tests/OutOfBinary/outlib.c
@@ -1,4 +1,4 @@
-int outlib()
+int outlib(void)
{
return 456;
}
diff --git a/Tests/PDBDirectoryAndName/myexe.c b/Tests/PDBDirectoryAndName/myexe.c
index fdb8b09..3d66794 100644
--- a/Tests/PDBDirectoryAndName/myexe.c
+++ b/Tests/PDBDirectoryAndName/myexe.c
@@ -1,8 +1,8 @@
-extern int mylibA();
-extern int mylibB();
-extern int mylibC();
-extern int mylibD();
-int main()
+extern int mylibA(void);
+extern int mylibB(void);
+extern int mylibC(void);
+extern int mylibD(void);
+int main(void)
{
return mylibA() + mylibB() + mylibC() + mylibD();
}
diff --git a/Tests/PDBDirectoryAndName/myexe2.c b/Tests/PDBDirectoryAndName/myexe2.c
index 250d651..b32e0b1 100644
--- a/Tests/PDBDirectoryAndName/myexe2.c
+++ b/Tests/PDBDirectoryAndName/myexe2.c
@@ -1,6 +1,6 @@
-extern int mylibA();
-extern int mylibD();
-int main()
+extern int mylibA(void);
+extern int mylibD(void);
+int main(void)
{
return mylibA() + mylibD();
}
diff --git a/Tests/PDBDirectoryAndName/mylibA.c b/Tests/PDBDirectoryAndName/mylibA.c
index 5bc279b..58ff123 100644
--- a/Tests/PDBDirectoryAndName/mylibA.c
+++ b/Tests/PDBDirectoryAndName/mylibA.c
@@ -1,4 +1,4 @@
-__declspec(dllexport) int mylibA()
+__declspec(dllexport) int mylibA(void)
{
return 1;
}
diff --git a/Tests/PDBDirectoryAndName/mylibB.c b/Tests/PDBDirectoryAndName/mylibB.c
index 3a95845..8be2aa0 100644
--- a/Tests/PDBDirectoryAndName/mylibB.c
+++ b/Tests/PDBDirectoryAndName/mylibB.c
@@ -1,4 +1,4 @@
-int mylibB()
+int mylibB(void)
{
return -1;
}
diff --git a/Tests/PDBDirectoryAndName/mylibC.c b/Tests/PDBDirectoryAndName/mylibC.c
index 8982849..64dde72 100644
--- a/Tests/PDBDirectoryAndName/mylibC.c
+++ b/Tests/PDBDirectoryAndName/mylibC.c
@@ -1,4 +1,4 @@
-__declspec(dllexport) int mylibC()
+__declspec(dllexport) int mylibC(void)
{
return 1;
}
diff --git a/Tests/PDBDirectoryAndName/mylibD.c b/Tests/PDBDirectoryAndName/mylibD.c
index a53b7a2..c9c04d8 100644
--- a/Tests/PDBDirectoryAndName/mylibD.c
+++ b/Tests/PDBDirectoryAndName/mylibD.c
@@ -1,4 +1,4 @@
-int mylibD()
+int mylibD(void)
{
return -1;
}
diff --git a/Tests/PerConfig/perconfig.c b/Tests/PerConfig/perconfig.c
index d942d45..5162ae0 100644
--- a/Tests/PerConfig/perconfig.c
+++ b/Tests/PerConfig/perconfig.c
@@ -1,6 +1,6 @@
#include "pcShared.h"
extern const char* pcStatic(void);
-int main()
+int main(void)
{
pcStatic();
pcShared();
diff --git a/Tests/PolicyScope/main.c b/Tests/PolicyScope/main.c
index f8b643a..8488f4e 100644
--- a/Tests/PolicyScope/main.c
+++ b/Tests/PolicyScope/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/PrecompiledHeader/foo1.c b/Tests/PrecompiledHeader/foo1.c
index fef2586..e743f8b 100644
--- a/Tests/PrecompiledHeader/foo1.c
+++ b/Tests/PrecompiledHeader/foo1.c
@@ -2,7 +2,7 @@
# error "Precompiled header foo_precompiled.h has not been loaded."
#endif
-int main()
+int main(void)
{
return foo();
}
diff --git a/Tests/PrecompiledHeader/foo2.c b/Tests/PrecompiledHeader/foo2.c
index 3ed04ed..5211f3e 100644
--- a/Tests/PrecompiledHeader/foo2.c
+++ b/Tests/PrecompiledHeader/foo2.c
@@ -3,7 +3,7 @@
# error "Precompiled header foo_precompiled.h has not been loaded."
#endif
-int foo()
+int foo(void)
{
return 0;
}
diff --git a/Tests/RunCMake/AppleTextStubs/foo.c b/Tests/RunCMake/AppleTextStubs/foo.c
index 7f39d71..f669327 100644
--- a/Tests/RunCMake/AppleTextStubs/foo.c
+++ b/Tests/RunCMake/AppleTextStubs/foo.c
@@ -1,5 +1,5 @@
-int foo()
+int foo(void)
{
return 0;
}
diff --git a/Tests/RunCMake/AppleTextStubs/main.c b/Tests/RunCMake/AppleTextStubs/main.c
index dc5ce3d..390f7d1 100644
--- a/Tests/RunCMake/AppleTextStubs/main.c
+++ b/Tests/RunCMake/AppleTextStubs/main.c
@@ -1,7 +1,7 @@
extern int foo(void);
-int main()
+int main(void)
{
return foo();
}
diff --git a/Tests/RunCMake/AutoExportDll/foo.c b/Tests/RunCMake/AutoExportDll/foo.c
index d13bc3e..b4f3ae0 100644
--- a/Tests/RunCMake/AutoExportDll/foo.c
+++ b/Tests/RunCMake/AutoExportDll/foo.c
@@ -4,12 +4,12 @@
# define WINAPI
#endif
-int WINAPI foo()
+int WINAPI foo(void)
{
return 10;
}
-int bar()
+int bar(void)
{
return 5;
}
diff --git a/Tests/RunCMake/AutoExportDll/hello2.c b/Tests/RunCMake/AutoExportDll/hello2.c
index d4d6b72..66e7caf 100644
--- a/Tests/RunCMake/AutoExportDll/hello2.c
+++ b/Tests/RunCMake/AutoExportDll/hello2.c
@@ -2,7 +2,7 @@
extern int own_auto_export_function(int i);
-void hello2()
+void hello2(void)
{
printf("hello exec:%i", own_auto_export_function(41));
}
diff --git a/Tests/RunCMake/AutoExportDll/objlib.c b/Tests/RunCMake/AutoExportDll/objlib.c
index 54a9658..4e580c3 100644
--- a/Tests/RunCMake/AutoExportDll/objlib.c
+++ b/Tests/RunCMake/AutoExportDll/objlib.c
@@ -1,4 +1,4 @@
-int objlib()
+int objlib(void)
{
return 7;
}
diff --git a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.c b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.c
index 0795aaa..bd54d76 100644
--- a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.c
+++ b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.c
@@ -1,5 +1,5 @@
#include <MakeInProjectOnly.h>
-int main()
+int main(void)
{
return MakeInProjectOnly();
}
diff --git a/Tests/RunCMake/BuiltinTargets/CMakeLists.txt b/Tests/RunCMake/BuiltinTargets/CMakeLists.txt
new file mode 100644
index 0000000..6a9ce76
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake b/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake
new file mode 100644
index 0000000..6a74f57
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/RunCMakeTest.cmake
@@ -0,0 +1,19 @@
+include(RunCMake)
+
+if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ set(test_target "test")
+else()
+ set(test_target "RUN_TESTS")
+endif()
+
+function(run_BuiltinTarget case target)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ run_cmake(${case})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug --target ${${target}_target})
+endfunction()
+
+run_BuiltinTarget(TestDependsAll-Default test)
+run_BuiltinTarget(TestDependsAll-No test)
+run_BuiltinTarget(TestDependsAll-Yes test)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default-build-check.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default-build-check.cmake
new file mode 100644
index 0000000..5ef321a
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default-build-check.cmake
@@ -0,0 +1 @@
+include(${CMAKE_CURRENT_LIST_DIR}/TestDependsAll-No-build-check.cmake)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default.cmake
new file mode 100644
index 0000000..6abd56c
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Default.cmake
@@ -0,0 +1 @@
+include(TestDependsAll-common.cmake)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-No-build-check.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No-build-check.cmake
new file mode 100644
index 0000000..f42244e
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No-build-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${RunCMake_TEST_BINARY_DIR}/custom-output.txt)
+ set(RunCMake_TEST_FAILED "Building 'test' target incorrectly built 'all' target.")
+endif()
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake
new file mode 100644
index 0000000..50ec3b9
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-No.cmake
@@ -0,0 +1,2 @@
+include(TestDependsAll-common.cmake)
+set(CMAKE_SKIP_TEST_ALL_DEPENDENCY ON)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake
new file mode 100644
index 0000000..ed175d4
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes-build-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${RunCMake_TEST_BINARY_DIR}/custom-output.txt)
+ set(RunCMake_TEST_FAILED "Building 'test' target did not build 'all' target:\n ${RunCMake_TEST_BINARY_DIR}/custom-output.txt")
+endif()
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake
new file mode 100644
index 0000000..c35c98d
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-Yes.cmake
@@ -0,0 +1,2 @@
+include(TestDependsAll-common.cmake)
+set(CMAKE_SKIP_TEST_ALL_DEPENDENCY OFF)
diff --git a/Tests/RunCMake/BuiltinTargets/TestDependsAll-common.cmake b/Tests/RunCMake/BuiltinTargets/TestDependsAll-common.cmake
new file mode 100644
index 0000000..bbe7c75
--- /dev/null
+++ b/Tests/RunCMake/BuiltinTargets/TestDependsAll-common.cmake
@@ -0,0 +1,3 @@
+enable_testing()
+add_custom_target(custom ALL COMMAND ${CMAKE_COMMAND} -E touch custom-output.txt)
+add_test(NAME test COMMAND ${CMAKE_COMMAND} -E echo)
diff --git a/Tests/RunCMake/CMP0126/CMP0126-OLD-stderr.txt b/Tests/RunCMake/CMP0126/CMP0126-OLD-stderr.txt
new file mode 100644
index 0000000..7d2608b
--- /dev/null
+++ b/Tests/RunCMake/CMP0126/CMP0126-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0126-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0126 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/CMP0126/CMP0126-OLD_CL-stderr.txt b/Tests/RunCMake/CMP0126/CMP0126-OLD_CL-stderr.txt
new file mode 100644
index 0000000..1f2179c
--- /dev/null
+++ b/Tests/RunCMake/CMP0126/CMP0126-OLD_CL-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0126-OLD_CL\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0126 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/CMP0156/CMP0156-Common.cmake b/Tests/RunCMake/CMP0156/CMP0156-Common.cmake
new file mode 100644
index 0000000..a382c77
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-Common.cmake
@@ -0,0 +1,27 @@
+
+enable_language(C)
+
+# ensure link is successful in case of circular dependency
+add_library(lib1 STATIC lib1.c)
+add_library(lib2 STATIC lib2.c)
+
+target_link_libraries(lib1 PRIVATE lib2)
+target_link_libraries(lib2 PRIVATE lib1)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib1)
+if (APPLE_TEST)
+ target_link_options(main PRIVATE "LINKER:-fatal_warnings")
+else()
+ target_link_options(main PRIVATE "$<$<AND:$<NOT:$<TARGET_POLICY:CMP0156>>,$<C_COMPILER_ID:AppleClang>,$<VERSION_GREATER_EQUAL:$<C_COMPILER_VERSION>,15.0>>:LINKER:-no_warn_duplicate_libraries>")
+endif()
+
+
+add_library(lib3 SHARED lib3.c)
+add_library(lib4 STATIC lib4.c)
+target_link_libraries(lib4 PRIVATE lib3)
+
+# link specifying a shared library not directly used by the target
+# on Windows, with CMP0156=NEW, lib3 is specified before lib4 on link step
+add_executable(main2 main2.c)
+target_link_libraries(main2 PRIVATE lib3 lib4)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-NEW-AppleClang.cmake b/Tests/RunCMake/CMP0156/CMP0156-NEW-AppleClang.cmake
new file mode 100644
index 0000000..59f5ecd
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-NEW-AppleClang.cmake
@@ -0,0 +1,5 @@
+
+cmake_policy(SET CMP0156 NEW)
+set(APPLE_TEST TRUE)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-NEW.cmake b/Tests/RunCMake/CMP0156/CMP0156-NEW.cmake
new file mode 100644
index 0000000..4387b37
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0156 NEW)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-result.txt b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-result.txt
new file mode 100644
index 0000000..b18168c
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-result.txt
@@ -0,0 +1 @@
+.+
diff --git a/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-stdout.txt b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-stdout.txt
new file mode 100644
index 0000000..b4afc27
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang-build-stdout.txt
@@ -0,0 +1,3 @@
+ld: warning: ignoring duplicate libraries: '.*liblib1.a', '.*liblib2.a'
+ld: fatal warning\(s\) induced error \(-fatal_warnings\)
+clang: error: linker command failed with exit code 1 \(use -v to see invocation\)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang.cmake b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang.cmake
new file mode 100644
index 0000000..33e1287
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-OLD-AppleClang.cmake
@@ -0,0 +1,5 @@
+
+cmake_policy(SET CMP0156 OLD)
+set(APPLE_TEST TRUE)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-OLD.cmake b/Tests/RunCMake/CMP0156/CMP0156-OLD.cmake
new file mode 100644
index 0000000..b012a1a
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0156 OLD)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMP0156-WARN-stderr.txt b/Tests/RunCMake/CMP0156/CMP0156-WARN-stderr.txt
new file mode 100644
index 0000000..f52d7d8
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-WARN-stderr.txt
@@ -0,0 +1,35 @@
+CMake Warning \(dev\) at CMP0156-Common.cmake:[0-9]+ \(add_library\):
+ Policy CMP0156 is not set: De-duplicate libraries on link lines based on
+ linker capabilities. Run "cmake --help-policy CMP0156" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ Since the policy is not set, legacy libraries de-duplication strategy will
+ be applied.
+Call Stack \(most recent call first\):
+ CMP0156-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 CMP0156-Common.cmake:[0-9]+ \(add_library\):
+ Policy CMP0156 is not set: De-duplicate libraries on link lines based on
+ linker capabilities. Run "cmake --help-policy CMP0156" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ Since the policy is not set, legacy libraries de-duplication strategy will
+ be applied.
+Call Stack \(most recent call first\):
+ CMP0156-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 CMP0156-Common.cmake:[0-9]+ \(add_executable\):
+ Policy CMP0156 is not set: De-duplicate libraries on link lines based on
+ linker capabilities. Run "cmake --help-policy CMP0156" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ Since the policy is not set, legacy libraries de-duplication strategy will
+ be applied.
+Call Stack \(most recent call first\):
+ CMP0156-WARN.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/CMP0156/CMP0156-WARN.cmake b/Tests/RunCMake/CMP0156/CMP0156-WARN.cmake
new file mode 100644
index 0000000..5f469ef
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMP0156-WARN.cmake
@@ -0,0 +1,4 @@
+
+set(CMAKE_POLICY_WARNING_CMP0156 TRUE)
+
+include (CMP0156-Common.cmake)
diff --git a/Tests/RunCMake/CMP0156/CMakeLists.txt b/Tests/RunCMake/CMP0156/CMakeLists.txt
new file mode 100644
index 0000000..922aad6
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.27)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMP0156/RunCMakeTest.cmake b/Tests/RunCMake/CMP0156/RunCMakeTest.cmake
new file mode 100644
index 0000000..bd51830
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/RunCMakeTest.cmake
@@ -0,0 +1,26 @@
+include(RunCMake)
+
+# CMP0156 control how libraries are specified for the link step
+# a sensible configuration is how circular dependency is handled
+
+macro(run_cmake_and_build test)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ run_cmake(${test})
+ set(RunCMake_TEST_NO_CLEAN TRUE)
+ run_cmake_command(${test}-build ${CMAKE_COMMAND} --build . --config Release)
+ unset(RunCMake_TEST_NO_CLEAN)
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+endmacro()
+
+run_cmake(CMP0156-WARN)
+run_cmake_and_build(CMP0156-OLD)
+run_cmake_and_build(CMP0156-NEW)
+
+if (CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
+ AND CMAKE_C_COMPILER_VERSION GREATER_EQUAL "15.0")
+ # special case for Apple: with CMP0156=OLD, linker will warning on duplicate libraries
+ run_cmake_and_build(CMP0156-OLD-AppleClang)
+ run_cmake_and_build(CMP0156-NEW-AppleClang)
+endif()
diff --git a/Tests/RunCMake/CMP0156/lib1.c b/Tests/RunCMake/CMP0156/lib1.c
new file mode 100644
index 0000000..faad375
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/lib1.c
@@ -0,0 +1,7 @@
+
+extern void lib2(void);
+
+void lib1(void)
+{
+ lib2();
+}
diff --git a/Tests/RunCMake/CMP0156/lib2.c b/Tests/RunCMake/CMP0156/lib2.c
new file mode 100644
index 0000000..9db7914
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/lib2.c
@@ -0,0 +1,7 @@
+
+extern void lib1(void);
+
+void lib2(void)
+{
+ lib1();
+}
diff --git a/Tests/RunCMake/CMP0156/lib3.c b/Tests/RunCMake/CMP0156/lib3.c
new file mode 100644
index 0000000..e63e456
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/lib3.c
@@ -0,0 +1,7 @@
+
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ void lib3(void)
+{
+}
diff --git a/Tests/RunCMake/CMP0156/lib4.c b/Tests/RunCMake/CMP0156/lib4.c
new file mode 100644
index 0000000..a992168
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/lib4.c
@@ -0,0 +1,9 @@
+
+#if defined(_WIN32)
+__declspec(dllimport)
+#endif
+ void lib3(void);
+
+void lib4(void)
+{
+}
diff --git a/Tests/RunCMake/CMP0156/main.c b/Tests/RunCMake/CMP0156/main.c
new file mode 100644
index 0000000..06edfd5
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/main.c
@@ -0,0 +1,9 @@
+
+extern void lib1(void);
+
+int main(void)
+{
+ lib1();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/CMP0156/main2.c b/Tests/RunCMake/CMP0156/main2.c
new file mode 100644
index 0000000..9fc2838
--- /dev/null
+++ b/Tests/RunCMake/CMP0156/main2.c
@@ -0,0 +1,9 @@
+
+extern void lib4(void);
+
+int main(void)
+{
+ lib4();
+
+ return 0;
+}
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 57034e5..dbcb94e 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -87,10 +87,6 @@ endfunction()
# Some tests use python for extra checks.
find_package(Python QUIET)
-if(XCODE_VERSION AND "${XCODE_VERSION}" VERSION_LESS 6.1)
- set(Swift_ARGS -DXCODE_BELOW_6_1=1)
-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")
@@ -170,6 +166,8 @@ if(NOT WIN32 OR CYGWIN)
endif()
add_RunCMake_test(CMP0153)
+add_RunCMake_test(CMP0156 -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION})
# The test for Policy 65 requires the use of the
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
@@ -322,10 +320,18 @@ add_RunCMake_test(BuildDepends
-DCMAKE_C_LINK_DEPENDS_USE_COMPILER=${CMAKE_C_LINK_DEPENDS_USE_COMPILER}
-DCMake_TEST_BuildDepends_GNU_AS=${CMake_TEST_BuildDepends_GNU_AS}
)
+add_RunCMake_test(BuiltinTargets)
if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(Byproducts)
endif()
add_RunCMake_test(CMakeDependentOption)
+if(APPLE # Remove these conditions when the test has non-Apple cases
+ AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+ add_RunCMake_test(CMakePackage
+ -DCMake_TEST_XCODE_VERSION=${CMake_TEST_XCODE_VERSION}
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ )
+endif()
add_RunCMake_test(CMakeRoleGlobalProperty)
add_RunCMake_test(CMakeRelease -DCMake_TEST_JQ=${CMake_TEST_JQ})
if(CMAKE_GENERATOR MATCHES "Make|Ninja")
@@ -432,7 +438,9 @@ if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STRE
add_RunCMake_test(RuntimePath)
endif()
add_RunCMake_test(ScriptMode)
-add_RunCMake_test(Swift -DCMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER} -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
+add_RunCMake_test(Swift -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMake_TEST_Swift=${CMake_TEST_Swift}
+ -DXCODE_VERSION=${XCODE_VERSION})
add_RunCMake_test(TargetArtifacts -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(TargetObjects)
add_RunCMake_test(TargetProperties)
@@ -512,6 +520,7 @@ add_RunCMake_test(ctest_skipped_test)
add_RunCMake_test(ctest_update)
add_RunCMake_test(ctest_upload)
add_RunCMake_test(ctest_environment)
+add_RunCMake_test(ctest_empty_binary_directory)
add_RunCMake_test(ctest_fixtures)
add_RunCMake_test(define_property)
add_RunCMake_test(file -DCYGWIN=${CYGWIN} -DMSYS=${MSYS})
@@ -527,7 +536,7 @@ endforeach()
add_RunCMake_test(file-DOWNLOAD)
add_RunCMake_test(file-RPATH -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(find_file -DMINGW=${MINGW})
-add_RunCMake_test(find_library -DMINGW=${MINGW} -DCYGWIN=${CYGWIN} -DMSYS=${MSYS})
+add_RunCMake_test(find_library -DMINGW=${MINGW} -DCYGWIN=${CYGWIN} -DMSYS=${MSYS} -DMSVC=${MSVC})
add_RunCMake_test(find_package -DMINGW=${MINGW} -DMSYS=${MSYS})
add_RunCMake_test(find_path -DMINGW=${MINGW})
add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
@@ -536,7 +545,7 @@ add_RunCMake_test(function)
add_RunCMake_test(block)
add_RunCMake_test(get_filename_component)
add_RunCMake_test(get_property)
-add_RunCMake_test(if)
+add_RunCMake_test(if -DMSYS=${MSYS})
add_RunCMake_test(include)
add_RunCMake_test(include_directories)
add_RunCMake_test(include_guard)
@@ -583,8 +592,10 @@ function(add_RunCMake_test_try_compile)
endfunction()
add_RunCMake_test_try_compile()
-add_RunCMake_test(try_run -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
- -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
+if(CMAKE_Fortran_COMPILER)
+ list(APPEND try_run_ARGS -DCMake_TEST_Fortran=1)
+endif()
+add_RunCMake_test(try_run)
add_RunCMake_test(set)
add_RunCMake_test(variable_watch)
add_RunCMake_test(while)
@@ -738,6 +749,15 @@ if((CMAKE_C_COMPILER_ID STREQUAL "AppleClang"
endif()
endif()
+if (CMAKE_SYSTEM_NAME MATCHES "(Linux|Darwin|Windows)"
+ AND CMAKE_C_COMPILER_ID MATCHES "^(AppleClang|Clang|GNU|MSVC|NVIDIA)$"
+ AND NOT CMAKE_GENERATOR STREQUAL "Green Hills MULTI")
+ add_RunCMake_test(LinkerSelection -DCMake_TEST_CUDA=${CMake_TEST_CUDA}
+ -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION})
+endif()
+
+add_RunCMake_test(LinkLibrariesProcessing)
add_RunCMake_test(File_Archive)
add_RunCMake_test(File_Configure)
add_RunCMake_test(File_Generate)
@@ -961,6 +981,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
endif()
set(cpack_tests
+ DEB.AUTO_SUFFIXES
DEB.CUSTOM_NAMES
DEB.DEBUGINFO
DEB.DEFAULT_PERMISSIONS
@@ -979,6 +1000,7 @@ set(cpack_tests
DEB.DEB_DESCRIPTION
DEB.PROJECT_META
+ RPM.AUTO_SUFFIXES
RPM.CUSTOM_BINARY_SPEC_FILE
RPM.CUSTOM_NAMES
RPM.DEBUGINFO
@@ -1056,7 +1078,7 @@ add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
-DCMAKE_C_SIMULATE_ID=${CMAKE_C_SIMULATE_ID}
-DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION})
-add_RunCMake_test("UnityBuild")
+add_RunCMake_test(UnityBuild -DCMake_TEST_OBJC=${CMake_TEST_OBJC})
add_RunCMake_test(CMakePresets
-DPython_EXECUTABLE=${Python_EXECUTABLE}
-DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}
@@ -1089,3 +1111,8 @@ endif()
if(WIN32)
add_RunCMake_test(Win32GenEx)
endif()
+
+if(CMake_TEST_IAR_TOOLCHAINS)
+ add_RunCMake_test(IAR -DCMake_TEST_IAR_TOOLCHAINS=${CMake_TEST_IAR_TOOLCHAINS})
+ set_property(TEST RunCMake.IAR APPEND PROPERTY LABELS "IAR")
+endif()
diff --git a/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-result.txt b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-stderr.txt b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-stderr.txt
new file mode 100644
index 0000000..03be015
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest-stderr.txt
@@ -0,0 +1,6 @@
+^CMake Error at [^
+]*/Modules/CMakePackageConfigHelpers\.cmake:[0-9]+ \(message\):
+ No INSTALL_DESTINATION given to generate_apple_platform_selection_file\(\)
+Call Stack \(most recent call first\):
+ ApplePlatformMissingDest\.cmake:[0-9]+ \(generate_apple_platform_selection_file\)
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest.cmake b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest.cmake
new file mode 100644
index 0000000..e47b595
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/ApplePlatformMissingDest.cmake
@@ -0,0 +1,4 @@
+include(CMakePackageConfigHelpers)
+generate_apple_platform_selection_file(mylib-config-install.cmake
+ #missing: INSTALL_DESTINATION lib/cmake/mylib
+ )
diff --git a/Tests/RunCMake/CMakePackage/CMakeLists.txt b/Tests/RunCMake/CMakePackage/CMakeLists.txt
new file mode 100644
index 0000000..6a9ce76
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake b/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake
new file mode 100644
index 0000000..4145ccc
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/RunCMakeTest.cmake
@@ -0,0 +1,110 @@
+include(RunCMake)
+
+if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(maybe_CMAKE_BUILD_TYPE -DCMAKE_BUILD_TYPE=Release)
+endif()
+
+function(apple_export platform system_name archs sysroot)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/apple-export-${platform}-build)
+ string(REPLACE ";" "\\;" archs "${archs}")
+ if(select_archs)
+ string(REPLACE ";" "\\\\;" maybe_IOS_SIMULATOR_SELECT_ARCHS "-DIOS_SIMULATOR_SELECT_ARCHS=${select_archs}")
+ endif()
+ run_cmake_with_options(apple-export-${platform}
+ "-DCMAKE_SYSTEM_NAME=${system_name}"
+ "-DCMAKE_OSX_ARCHITECTURES=${archs}"
+ "-DCMAKE_OSX_SYSROOT=${sysroot}"
+ "-DCMAKE_INSTALL_PREFIX=${apple_install}"
+ ${maybe_CMAKE_BUILD_TYPE}
+ ${maybe_IOS_SIMULATOR_SELECT_ARCHS}
+ )
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(apple-export-${platform}-build ${CMAKE_COMMAND} --build . --config Release)
+ run_cmake_command(apple-export-${platform}-install ${CMAKE_COMMAND} --install . --config Release)
+ file(APPEND "${apple_install}/lib/${platform}/cmake/mylib/mylib-targets.cmake" "\n"
+ "message(STATUS \"loaded: '\${CMAKE_CURRENT_LIST_FILE}'\")\n"
+ )
+endfunction()
+
+function(apple_import platform system_name archs sysroot)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/apple-import-${platform}-build)
+ string(REPLACE ";" "\\;" archs "${archs}")
+ run_cmake_with_options(apple-import-${platform}
+ "-DCMAKE_SYSTEM_NAME=${system_name}"
+ "-DCMAKE_OSX_ARCHITECTURES=${archs}"
+ "-DCMAKE_OSX_SYSROOT=${sysroot}"
+ "-DCMAKE_PREFIX_PATH=${apple_install}"
+ ${maybe_CMAKE_BUILD_TYPE}
+ )
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(apple-import-${platform}-build ${CMAKE_COMMAND} --build . --config Release)
+endfunction()
+
+if(APPLE)
+ run_cmake(ApplePlatformMissingDest)
+endif()
+
+if(APPLE AND CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
+ set(apple_install ${RunCMake_BINARY_DIR}/apple-install)
+ file(REMOVE_RECURSE "${apple_install}")
+
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 12)
+ set(macos_archs "x86_64;arm64")
+ set(watch_sim_archs "x86_64")
+ set(select_archs "arm64;x86_64")
+ else()
+ set(macos_archs "x86_64")
+ set(watch_sim_archs "i386")
+ set(select_archs "")
+ endif()
+
+ if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 9)
+ set(watch_archs "armv7k;arm64_32")
+ else()
+ set(watch_archs "armv7k")
+ endif()
+
+ #FIXME(#25266): Xcode 15.0 does not have visionOS. Improve this condition.
+ #if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15)
+ # set(enable_visionos 1)
+ #endif()
+
+ apple_export(macos Darwin "${macos_archs}" macosx)
+ apple_export(ios iOS "arm64" iphoneos)
+ apple_export(tvos tvOS "arm64" appletvos)
+ if(enable_visionos)
+ apple_export(visionos visionOS "arm64" xros)
+ endif()
+ apple_export(watchos watchOS "${watch_archs}" watchos)
+ apple_export(ios-simulator iOS "${macos_archs}" iphonesimulator)
+ if(select_archs)
+ foreach(arch IN LISTS macos_archs)
+ apple_export(ios-simulator-${arch} iOS "${arch}" iphonesimulator)
+ endforeach()
+ endif()
+
+ apple_export(tvos-simulator tvOS "${macos_archs}" appletvsimulator)
+ if(enable_visionos)
+ apple_export(visionos-simulator visionOS "${macos_archs}" xrsimulator)
+ endif()
+ apple_export(watchos-simulator watchOS "${watch_sim_archs}" watchsimulator)
+
+ apple_import(macos Darwin "${macos_archs}" macosx)
+ apple_import(ios iOS "arm64" iphoneos)
+ apple_import(tvos tvOS "arm64" appletvos)
+ if(enable_visionos)
+ apple_import(visionos visionOS "arm64" xros)
+ endif()
+ apple_import(watchos watchOS "${watch_archs}" watchos)
+ apple_import(ios-simulator iOS "${macos_archs}" iphonesimulator)
+ if(select_archs)
+ foreach(arch IN LISTS macos_archs)
+ apple_import(ios-simulator-${arch} iOS "${arch}" iphonesimulator)
+ endforeach()
+ endif()
+ apple_import(tvos-simulator tvOS "${macos_archs}" appletvsimulator)
+ if(enable_visionos)
+ apple_import(visionos-simulator visionOS "${macos_archs}" xrsimulator)
+ endif()
+ apple_import(watchos-simulator watchOS "${watch_sim_archs}" watchsimulator)
+endif()
diff --git a/Tests/RunCMake/CMakePackage/apple-common.cmake b/Tests/RunCMake/CMakePackage/apple-common.cmake
new file mode 100644
index 0000000..f854f34
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-common.cmake
@@ -0,0 +1,15 @@
+enable_language(C)
+
+if(CMAKE_SYSTEM_NAME MATCHES "^(iOS)$")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
+endif()
+
+if(CMAKE_SYSTEM_NAME MATCHES "^(tvOS|watchOS|visionOS)$")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
+endif()
diff --git a/Tests/RunCMake/CMakePackage/apple-export-common.cmake b/Tests/RunCMake/CMakePackage/apple-export-common.cmake
new file mode 100644
index 0000000..d334f75
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-common.cmake
@@ -0,0 +1,29 @@
+include(apple-common.cmake)
+
+add_library(mylib STATIC src/mylib.c)
+target_sources(mylib PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include FILES include/mylib.h)
+install(TARGETS mylib EXPORT mylib-targets FILE_SET HEADERS ARCHIVE DESTINATION lib/${platform_name})
+
+install(EXPORT mylib-targets DESTINATION lib/${platform_name}/cmake/mylib)
+
+if(IOS_SIMULATOR_SELECT_ARCHS)
+ set(IOS_SIMULATOR_CONFIG_FILE lib/ios-simulator/cmake/mylib/mylib-select-arch.cmake)
+else()
+ set(IOS_SIMULATOR_CONFIG_FILE lib/ios-simulator/cmake/mylib/mylib-targets.cmake)
+endif()
+
+include(CMakePackageConfigHelpers)
+generate_apple_platform_selection_file(mylib-config-install.cmake
+ INSTALL_DESTINATION lib/cmake/mylib
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
+ MACOS_CONFIG_FILE lib/macos/cmake/mylib/mylib-targets.cmake
+ IOS_CONFIG_FILE lib/ios/cmake/mylib/mylib-targets.cmake
+ IOS_SIMULATOR_CONFIG_FILE ${IOS_SIMULATOR_CONFIG_FILE}
+ TVOS_CONFIG_FILE lib/tvos/cmake/mylib/mylib-targets.cmake
+ TVOS_SIMULATOR_CONFIG_FILE lib/tvos-simulator/cmake/mylib/mylib-targets.cmake
+ VISIONOS_CONFIG_FILE lib/watchos/cmake/mylib/mylib-targets.cmake
+ VISIONOS_SIMULATOR_CONFIG_FILE lib/watchos-simulator/cmake/mylib/mylib-targets.cmake
+ WATCHOS_CONFIG_FILE lib/watchos/cmake/mylib/mylib-targets.cmake
+ WATCHOS_SIMULATOR_CONFIG_FILE lib/watchos-simulator/cmake/mylib/mylib-targets.cmake
+ )
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mylib-config-install.cmake DESTINATION lib/cmake/mylib RENAME mylib-config.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-arm64.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-arm64.cmake
new file mode 100644
index 0000000..6984df2
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-arm64.cmake
@@ -0,0 +1,2 @@
+set(platform_name ios-simulator-arm64)
+include(apple-export-ios-simulator-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake
new file mode 100644
index 0000000..ac09d65
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-common.cmake
@@ -0,0 +1,13 @@
+include(apple-export-common.cmake)
+
+if(IOS_SIMULATOR_SELECT_ARCHS)
+ generate_apple_architecture_selection_file(mylib-select-arch-install.cmake
+ INSTALL_DESTINATION lib/ios-simulator/cmake/mylib
+ INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}
+ SINGLE_ARCHITECTURES "${IOS_SIMULATOR_SELECT_ARCHS}"
+ SINGLE_ARCHITECTURE_CONFIG_FILES "lib/ios-simulator-arm64/cmake/mylib/mylib-targets.cmake;lib/ios-simulator-x86_64/cmake/mylib/mylib-targets.cmake"
+ UNIVERSAL_ARCHITECTURES "${IOS_SIMULATOR_SELECT_ARCHS}"
+ UNIVERSAL_CONFIG_FILE "lib/ios-simulator/cmake/mylib/mylib-targets.cmake"
+ )
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mylib-select-arch-install.cmake DESTINATION lib/ios-simulator/cmake/mylib RENAME mylib-select-arch.cmake)
+endif()
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-x86_64.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-x86_64.cmake
new file mode 100644
index 0000000..290cfa7
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator-x86_64.cmake
@@ -0,0 +1,2 @@
+set(platform_name ios-simulator-x86_64)
+include(apple-export-ios-simulator-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator.cmake
new file mode 100644
index 0000000..bc3deb3
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios-simulator.cmake
@@ -0,0 +1,2 @@
+set(platform_name ios-simulator)
+include(apple-export-ios-simulator-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-ios.cmake b/Tests/RunCMake/CMakePackage/apple-export-ios.cmake
new file mode 100644
index 0000000..33daa40
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-ios.cmake
@@ -0,0 +1,2 @@
+set(platform_name ios)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-macos.cmake b/Tests/RunCMake/CMakePackage/apple-export-macos.cmake
new file mode 100644
index 0000000..d845d5c
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-macos.cmake
@@ -0,0 +1,2 @@
+set(platform_name macos)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-tvos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-export-tvos-simulator.cmake
new file mode 100644
index 0000000..d44d663
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-tvos-simulator.cmake
@@ -0,0 +1,2 @@
+set(platform_name tvos-simulator)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-tvos.cmake b/Tests/RunCMake/CMakePackage/apple-export-tvos.cmake
new file mode 100644
index 0000000..c58144b
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-tvos.cmake
@@ -0,0 +1,2 @@
+set(platform_name tvos)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-visionos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-export-visionos-simulator.cmake
new file mode 100644
index 0000000..e783d80
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-visionos-simulator.cmake
@@ -0,0 +1,2 @@
+set(platform_name visionos-simulator)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-visionos.cmake b/Tests/RunCMake/CMakePackage/apple-export-visionos.cmake
new file mode 100644
index 0000000..73e1b2e
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-visionos.cmake
@@ -0,0 +1,2 @@
+set(platform_name visionos)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-watchos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-export-watchos-simulator.cmake
new file mode 100644
index 0000000..f4f95a6
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-watchos-simulator.cmake
@@ -0,0 +1,2 @@
+set(platform_name watchos-simulator)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-export-watchos.cmake b/Tests/RunCMake/CMakePackage/apple-export-watchos.cmake
new file mode 100644
index 0000000..59fc572
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-export-watchos.cmake
@@ -0,0 +1,2 @@
+set(platform_name watchos)
+include(apple-export-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-common.cmake b/Tests/RunCMake/CMakePackage/apple-import-common.cmake
new file mode 100644
index 0000000..ce79541
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-common.cmake
@@ -0,0 +1,7 @@
+include(apple-common.cmake)
+
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE NEVER)
+find_package(mylib CONFIG REQUIRED)
+
+add_executable(myexe src/myexe.c)
+target_link_libraries(myexe PRIVATE mylib)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64-stdout.txt
new file mode 100644
index 0000000..7999474
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios-simulator-arm64/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-arm64.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-stdout.txt
new file mode 100644
index 0000000..4ca925d
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64-stdout.txt
new file mode 100644
index 0000000..ec52735
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios-simulator-x86_64/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator-x86_64.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-simulator.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-ios-stdout.txt
new file mode 100644
index 0000000..eabb96a
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/ios/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-ios.cmake b/Tests/RunCMake/CMakePackage/apple-import-ios.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-ios.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-macos-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-macos-stdout.txt
new file mode 100644
index 0000000..2c3d87d
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-macos-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/macos/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-macos.cmake b/Tests/RunCMake/CMakePackage/apple-import-macos.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-macos.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator-stdout.txt
new file mode 100644
index 0000000..544f90f
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/tvos-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-tvos-simulator.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-tvos-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-tvos-stdout.txt
new file mode 100644
index 0000000..eccad6a
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-tvos-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/tvos/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-tvos.cmake b/Tests/RunCMake/CMakePackage/apple-import-tvos.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-tvos.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator-stdout.txt
new file mode 100644
index 0000000..c4cc068
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/visionos-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-visionos-simulator.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-visionos-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-visionos-stdout.txt
new file mode 100644
index 0000000..410eda2
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-visionos-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/visionos/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-visionos.cmake b/Tests/RunCMake/CMakePackage/apple-import-visionos.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-visionos.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator-stdout.txt
new file mode 100644
index 0000000..752e2be
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/watchos-simulator/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator.cmake b/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-watchos-simulator.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/apple-import-watchos-stdout.txt b/Tests/RunCMake/CMakePackage/apple-import-watchos-stdout.txt
new file mode 100644
index 0000000..5654fe8
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-watchos-stdout.txt
@@ -0,0 +1 @@
+loaded: '[^']*/Tests/RunCMake/CMakePackage/apple-install/lib/watchos/cmake/mylib/mylib-targets.cmake'
diff --git a/Tests/RunCMake/CMakePackage/apple-import-watchos.cmake b/Tests/RunCMake/CMakePackage/apple-import-watchos.cmake
new file mode 100644
index 0000000..fa7ba53
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/apple-import-watchos.cmake
@@ -0,0 +1 @@
+include(apple-import-common.cmake)
diff --git a/Tests/RunCMake/CMakePackage/include/mylib.h b/Tests/RunCMake/CMakePackage/include/mylib.h
new file mode 100644
index 0000000..4955e74
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/include/mylib.h
@@ -0,0 +1,3 @@
+#pragma once
+
+extern int mylib(void);
diff --git a/Tests/RunCMake/CMakePackage/src/myexe.c b/Tests/RunCMake/CMakePackage/src/myexe.c
new file mode 100644
index 0000000..c1182a2
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/src/myexe.c
@@ -0,0 +1,6 @@
+#include <mylib.h> /* include by angle-bracket to find installed copy */
+
+int main(void)
+{
+ return mylib();
+}
diff --git a/Tests/RunCMake/CMakePackage/src/mylib.c b/Tests/RunCMake/CMakePackage/src/mylib.c
new file mode 100644
index 0000000..f4c047e
--- /dev/null
+++ b/Tests/RunCMake/CMakePackage/src/mylib.c
@@ -0,0 +1,4 @@
+int mylib(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index ca02b76..258f6a6 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -9,6 +9,7 @@ find_program(DEBUGEDIT debugedit)
# run_cpack_test args: TEST_NAME "GENERATORS" RUN_CMAKE_BUILD_STEP "PACKAGING_TYPES"
run_cpack_test(CUSTOM_BINARY_SPEC_FILE "RPM.CUSTOM_BINARY_SPEC_FILE" false "MONOLITHIC;COMPONENT")
run_cpack_test(CUSTOM_NAMES "RPM.CUSTOM_NAMES;DEB.CUSTOM_NAMES;TGZ;DragNDrop" true "COMPONENT")
+run_cpack_test(AUTO_SUFFIXES "RPM.AUTO_SUFFIXES;DEB.AUTO_SUFFIXES" false "MONOLITHIC")
run_cpack_test(DEBUGINFO "DEB.DEBUGINFO" true "COMPONENT")
if(NOT "${DEBUGEDIT}" STREQUAL "DEBUGEDIT-NOTFOUND")
run_cpack_test(DEBUGINFO "RPM.DEBUGINFO" true "COMPONENT")
@@ -69,3 +70,4 @@ run_cpack_test_subtests(
)
run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT")
run_cpack_test_package_target(PRE_POST_SCRIPTS "ZIP" false "MONOLITHIC;COMPONENT")
+run_cpack_test_subtests(DUPLICATE_FILE "success;conflict_file;conflict_symlink" "TGZ" false "COMPONENT;GROUP")
diff --git a/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake
new file mode 100644
index 0000000..1ca48d8
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/ExpectedFiles.cmake
@@ -0,0 +1,8 @@
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILES_NAME_GENERATOR_SPECIFIC_FORMAT TRUE)
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
+
+if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM")
+ string(TOLOWER "${GENERATOR_TYPE}" file_extension_)
+ set(EXPECTED_FILE_1 "autosuffixpackage.${file_extension_}")
+endif()
diff --git a/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake
new file mode 100644
index 0000000..84c9bec
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/AUTO_SUFFIXES/test.cmake
@@ -0,0 +1,5 @@
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
+
+# if the filename doesn't have the expected deb/rpm suffix, test that it is appended automatically
+set(CPACK_DEBIAN_FILE_NAME "autosuffixpackage")
+set(CPACK_RPM_FILE_NAME "autosuffixpackage")
diff --git a/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/ExpectedFiles.cmake
new file mode 100644
index 0000000..5341ecd
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/ExpectedFiles.cmake
@@ -0,0 +1,16 @@
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "success")
+ if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(EXPECTED_FILES_COUNT "1")
+ set(EXPECTED_FILE_CONTENT_1_LIST "/files;/files/1.txt;/files/2.txt;/files/3.txt;/files/4.txt;/files/5.txt;/files/6.txt;/files/7.txt;/files/8.txt;/files/symlink2")
+ elseif(PACKAGING_TYPE STREQUAL "GROUP")
+ set(EXPECTED_FILES_COUNT "3")
+ set(EXPECTED_FILE_1 "duplicate_file-0.1.1-*-g1.${cpack_archive_extension_}")
+ set(EXPECTED_FILE_CONTENT_1_LIST "/files;/files/1.txt;/files/2.txt;/files/3.txt;/files/4.txt;/files/5.txt;/files/6.txt;/files/symlink2")
+ set(EXPECTED_FILE_2 "duplicate_file-0.1.1-*-g2.${cpack_archive_extension_}")
+ set(EXPECTED_FILE_CONTENT_2_LIST "/files;/files/3.txt;/files/4.txt;/files/5.txt;/files/6.txt;/files/7.txt;/files/8.txt")
+ set(EXPECTED_FILE_3 "duplicate_file-0.1.1-*-c5.${cpack_archive_extension_}")
+ set(EXPECTED_FILE_CONTENT_3_LIST "/files;/files/5.txt;/files/6.txt;/files/7.txt;/files/8.txt;/files/9.txt")
+ endif ()
+else()
+ set(EXPECTED_FILES_COUNT "0")
+endif ()
diff --git a/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_file-stderr.txt b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_file-stderr.txt
new file mode 100644
index 0000000..5544885
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_file-stderr.txt
@@ -0,0 +1 @@
+CPack Error: ERROR The data in files with the same filename is different.*
diff --git a/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_symlink-stderr.txt b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_symlink-stderr.txt
new file mode 100644
index 0000000..5544885
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/conflict_symlink-stderr.txt
@@ -0,0 +1 @@
+CPack Error: ERROR The data in files with the same filename is different.*
diff --git a/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/test.cmake b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/test.cmake
new file mode 100644
index 0000000..89d6784
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DUPLICATE_FILE/test.cmake
@@ -0,0 +1,74 @@
+# Create files named 1 to 9
+foreach(i RANGE 1 9)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${i}.txt" "This is file ${i}")
+endforeach()
+
+set(COMPONENT_NAMES c1 c2 c3 c4 c5)
+foreach(j RANGE 1 5)
+ # Select 4 file and install to the component
+ math(EXPR COMPONENT_IDX "${j} - 1")
+ list(GET COMPONENT_NAMES "${COMPONENT_IDX}" SELECTED_COMPONENT)
+ math(EXPR END_FILE "${j} + 4")
+ foreach(k RANGE ${j} ${END_FILE})
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${k}.txt" DESTINATION "files" COMPONENT ${SELECTED_COMPONENT})
+ endforeach()
+endforeach()
+
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "conflict_file")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conflict/1.txt" "This should create a conflict.")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/conflict/1.txt" DESTINATION "files" COMPONENT c2)
+endif ()
+
+# You cannot create symlink in Windows test environment. Instead mock the symlink.
+if(NOT CMAKE_HOST_WIN32)
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/2.txt" "${CMAKE_CURRENT_BINARY_DIR}/symlink2" SYMBOLIC)
+else()
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/symlink2" "This is file 2")
+endif()
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/symlink2" DESTINATION "files" COMPONENT c1)
+
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "conflict_symlink" AND NOT CMAKE_HOST_WIN32)
+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/conflict)
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/1.txt" "${CMAKE_CURRENT_BINARY_DIR}/conflict/symlink2" SYMBOLIC)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/conflict/symlink2" DESTINATION "files" COMPONENT c2)
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "conflict_symlink" AND CMAKE_HOST_WIN32)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conflict/symlink2" "This should create a conflict.")
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/conflict/symlink2" DESTINATION "files" COMPONENT c2)
+else()
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/symlink2" DESTINATION "files" COMPONENT c2)
+endif ()
+
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON)
+ set(CPACK_COMPONENTS_ALL "c1;c2;c3;c4")
+elseif(PACKAGING_TYPE STREQUAL "GROUP")
+ set(CPACK_COMPONENTS_ONE_PACKAGE_PER_GROUP ON)
+ set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
+ include(CPackComponent)
+
+ cpack_add_component_group(g1 DISPLAY_NAME "Group 1")
+ cpack_add_component_group(g2 DISPLAY_NAME "Group 2")
+ cpack_add_component(c1
+ DISPLAY_NAME "Group 1"
+ DESCRIPTION "Component for Group 1"
+ GROUP g1
+ )
+ cpack_add_component(c2
+ DISPLAY_NAME "Group 1"
+ DESCRIPTION "Component for Group 1"
+ GROUP g1
+ )
+ cpack_add_component(c3
+ DISPLAY_NAME "Group 2"
+ DESCRIPTION "Component for Group 2"
+ GROUP g2
+ )
+ cpack_add_component(c4
+ DISPLAY_NAME "Group 2"
+ DESCRIPTION "Component for Group 2"
+ GROUP g2
+ )
+
+ set(CPACK_${GENERATOR_TYPE}_PACKAGE_GROUP g1 g2)
+endif ()
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 223a61c..1b8d0d9 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -229,19 +229,22 @@ function(run_TestLoad name load)
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
add_test(TestLoad1 \"${CMAKE_COMMAND}\" -E echo \"test of --test-load\")
+ set_tests_properties(TestLoad1 PROPERTIES PROCESSORS 2)
add_test(TestLoad2 \"${CMAKE_COMMAND}\" -E echo \"test of --test-load\")
+ set_tests_properties(TestLoad2 PROPERTIES PROCESSORS 2)
")
- run_cmake_command(${name} ${CMAKE_CTEST_COMMAND} -VV -j2 --test-load ${load})
+ run_cmake_command(${name} ${CMAKE_CTEST_COMMAND} -VV -j8 --test-load ${load})
endfunction()
# Tests for the --test-load feature of ctest
#
# Spoof a load average value to make these tests more reliable.
-set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5)
+set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 7)
# Verify that new tests are not started when the load average exceeds
# our threshold and that they then run once the load average drops.
-run_TestLoad(test-load-wait 3)
+run_TestLoad(test-load-wait0 5)
+run_TestLoad(test-load-wait1 8)
# Verify that warning message is displayed but tests still start when
# an invalid argument is given.
@@ -249,7 +252,7 @@ run_TestLoad(test-load-invalid 'two')
# Verify that new tests are started when the load average falls below
# our threshold.
-run_TestLoad(test-load-pass 10)
+run_TestLoad(test-load-pass 12)
unset(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING})
diff --git a/Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt b/Tests/RunCMake/CTestCommandLine/test-load-wait0-stdout.txt
index db7d7f3..d112fde 100644
--- a/Tests/RunCMake/CTestCommandLine/test-load-wait-stdout.txt
+++ b/Tests/RunCMake/CTestCommandLine/test-load-wait0-stdout.txt
@@ -2,7 +2,7 @@ Test project [^
]*/Tests/RunCMake/CTestCommandLine/TestLoad(
[^*][^
]*)*
-\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 3, Smallest test TestLoad[1-2] requires 1\*\*\*\*\*
+\*\*\*\*\* WAITING, System Load: 7, Max Allowed Load: 5\*\*\*\*\*
test 1
Start 1: TestLoad1
+(
diff --git a/Tests/RunCMake/CTestCommandLine/test-load-wait1-stdout.txt b/Tests/RunCMake/CTestCommandLine/test-load-wait1-stdout.txt
new file mode 100644
index 0000000..aa91950
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test-load-wait1-stdout.txt
@@ -0,0 +1,21 @@
+Test project [^
+]*/Tests/RunCMake/CTestCommandLine/TestLoad(
+[^*][^
+]*)*
+\*\*\*\*\* WAITING, System Load: 7, Max Allowed Load: 8, Smallest test TestLoad[1-2] requires 2\*\*\*\*\*
+test 1
+ Start 1: TestLoad1
++(
+[^*][^
+]*)*
+test 2
+ Start 2: TestLoad2
++(
+[^*][^
+]*)*
+1/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec(
+[^*][^
+]*)*
+2/2 Test #[1-2]: TestLoad[1-2] ........................ Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 2
diff --git a/Tests/RunCMake/CXXModules/sources/c-anchor.c b/Tests/RunCMake/CXXModules/sources/c-anchor.c
index c782188..8adfcbb 100644
--- a/Tests/RunCMake/CXXModules/sources/c-anchor.c
+++ b/Tests/RunCMake/CXXModules/sources/c-anchor.c
@@ -1,4 +1,4 @@
-int c_anchor()
+int c_anchor(void)
{
return 0;
}
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake
index 23b3006..c85783d 100644
--- a/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake
+++ b/Tests/RunCMake/CheckCompilerFlag/CheckCompilerFlagSwift.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
enable_language (Swift)
include(CheckCompilerFlag)
diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake
index 767fa69..8edff2c 100644
--- a/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake
+++ b/Tests/RunCMake/CheckSourceCompiles/CheckSourceCompilesSwift.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
enable_language(Swift)
include(CheckSourceCompiles)
diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
index c01f414..2bbe1c8 100644
--- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
+++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt
@@ -1 +1 @@
-^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":6}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
+^{"debugger":(true|false),"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":7}]},{"kind":"configureLog","version":\[{"major":1,"minor":0}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$
diff --git a/Tests/RunCMake/CommandLine/E_cat-stdin-stdout.txt b/Tests/RunCMake/CommandLine/E_cat-stdin-stdout.txt
new file mode 100644
index 0000000..8210d59
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_cat-stdin-stdout.txt
@@ -0,0 +1 @@
+^Hello world$
diff --git a/Tests/RunCMake/CommandLine/E_cat-stdin.cmake b/Tests/RunCMake/CommandLine/E_cat-stdin.cmake
new file mode 100644
index 0000000..e83e619
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_cat-stdin.cmake
@@ -0,0 +1,10 @@
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ell.txt" "ell")
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/rld.txt" "rld")
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E echo_append "H"
+ COMMAND ${CMAKE_COMMAND} -E cat -
+ )
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E echo_append "o wo"
+ COMMAND ${CMAKE_COMMAND} -E cat "${CMAKE_CURRENT_BINARY_DIR}/ell.txt" - "${CMAKE_CURRENT_BINARY_DIR}/rld.txt"
+ )
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index b29e50a..03b9301 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -782,6 +782,8 @@ run_cmake_command(E_cat-without-double-dash ${CMAKE_COMMAND} -E cat "-file-start
unset(RunCMake_TEST_COMMAND_WORKING_DIRECTORY)
unset(out)
+run_cmake_command(E_cat-stdin ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_cat-stdin.cmake)
+
# Unset environment variables that are used for testing cmake -E
unset(ENV{TEST_ENV})
unset(ENV{TEST_ENV_EXPECTED})
diff --git a/Tests/RunCMake/CompileDefinitions/foo.c b/Tests/RunCMake/CompileDefinitions/foo.c
index 74a86e1..7d75e37 100644
--- a/Tests/RunCMake/CompileDefinitions/foo.c
+++ b/Tests/RunCMake/CompileDefinitions/foo.c
@@ -1,4 +1,4 @@
-void foo()
+void foo(void)
{
}
diff --git a/Tests/RunCMake/CompileWarningAsError/warn.c b/Tests/RunCMake/CompileWarningAsError/warn.c
index cd0c2ba..4041167 100644
--- a/Tests/RunCMake/CompileWarningAsError/warn.c
+++ b/Tests/RunCMake/CompileWarningAsError/warn.c
@@ -1,4 +1,4 @@
-static void unused_function();
+static void unused_function(void);
#ifdef __SUNPRO_C
KandR(x) int x;
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt
index b7db7eb..bc5d9ea 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-JOM.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerC.cmake:2 \(enable_language\):
no-C-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
To use the JOM generator with Visual C\+\+, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt
index 03c5933..80d8a21 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr-NMake.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerC.cmake:2 \(enable_language\):
no-C-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
To use the NMake generator with Visual C\+\+, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt
index c98842d..96d02de 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerC-stderr.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerC.cmake:2 \(enable_language\):
no-C-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt
index 4b42ea6..d108787 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-JOM.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerCXX.cmake:2 \(enable_language\):
no-CXX-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
To use the JOM generator with Visual C\+\+, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt
index 1bfcdcc..d3c0ccd 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr-NMake.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerCXX.cmake:2 \(enable_language\):
no-CXX-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
To use the NMake generator with Visual C\+\+, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt
index 7ef4f5e..79db41d 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCXX-stderr.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerCXX.cmake:2 \(enable_language\):
no-CXX-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt
index f25a267..360a8c2 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-JOM.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\):
no-C-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
To use the JOM generator with Visual C\+\+, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
@@ -21,7 +22,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\):
no-CXX-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
To use the JOM generator with Visual C\+\+, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt
index ffcdce8..8438d0e 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr-NMake.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\):
no-C-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
To use the NMake generator with Visual C\+\+, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
@@ -21,7 +22,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\):
no-CXX-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
To use the NMake generator with Visual C\+\+, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
diff --git a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt
index eecff54..cba0db2 100644
--- a/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt
+++ b/Tests/RunCMake/CompilerNotFound/BadCompilerCandCXX-stderr.txt
@@ -3,7 +3,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\):
no-C-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
@@ -16,7 +17,8 @@ CMake Error at BadCompilerCandCXX.cmake:3 \(project\):
no-CXX-compiler
- is not a full path and was not found in the PATH.
+ is not a full path and was not found in the PATH.( Perhaps the extension is
+ missing\?)?
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
diff --git a/Tests/RunCMake/Configure/ReadOnly-result.txt b/Tests/RunCMake/Configure/ReadOnly-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Configure/ReadOnly-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Configure/ReadOnly-stderr.txt b/Tests/RunCMake/Configure/ReadOnly-stderr.txt
new file mode 100644
index 0000000..fb00ae9
--- /dev/null
+++ b/Tests/RunCMake/Configure/ReadOnly-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error: Unable to \(re\)create the private pkgRedirects directory:
+ [^
+]*/Tests/RunCMake/Configure/ReadOnly-build/CMakeFiles/pkgRedirects
+This may be caused by not having read/write access to the build directory.
+Try specifying a location with read/write access like:
+ cmake -B build
+If using a CMake presets file, ensure that preset parameter
+'binaryDir' expands to a writable directory.
diff --git a/Tests/RunCMake/Configure/ReadOnly.cmake b/Tests/RunCMake/Configure/ReadOnly.cmake
new file mode 100644
index 0000000..2fc38e5
--- /dev/null
+++ b/Tests/RunCMake/Configure/ReadOnly.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
index df6849e..842a005 100644
--- a/Tests/RunCMake/Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -55,3 +55,19 @@ if(NOT RunCMake_GENERATOR MATCHES "^Ninja Multi-Config$")
run_cmake(NoCMAKE_DEFAULT_BUILD_TYPE)
run_cmake(NoCMAKE_DEFAULT_CONFIGS)
endif()
+
+if(NOT CMAKE_HOST_WIN32)
+ block()
+ # Test a non-writable build directory.
+ # Exclude when running as root because directories are always writable.
+ get_unix_uid(uid)
+ if(NOT uid STREQUAL "0")
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ReadOnly-build)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(CHMOD "${RunCMake_TEST_BINARY_DIR}" PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake(ReadOnly)
+ endif()
+ endblock()
+endif()
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW-check.cmake
new file mode 100644
index 0000000..8a6a702
--- /dev/null
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW-check.cmake
@@ -0,0 +1,28 @@
+set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake")
+if(EXISTS "${testfile}")
+ file(READ "${testfile}" testfile_contents)
+else()
+ message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.")
+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")
+ message(SEND_ERROR "Used emulator when it should not be used. ${error_details}")
+endif()
+
+if(testfile_contents MATCHES "add_test[(]ShouldNotUseEmulator [^\n]+pseudo_emulator[^\n]+\n")
+ message(SEND_ERROR "Used emulator when it should be used. ${error_details}")
+endif()
+
+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(testfile_contents MATCHES "add_test[(]ShouldNotUseEmulatorWithExecTargetFromSubdirAddedWithoutGenex [^\n]+pseudo_emulator[^\n]+\n")
+ message(SEND_ERROR "Used emulator when it should be used. ${error_details}")
+endif()
+
+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/CrosscompilingEmulator/AddTest-CMP0158-NEW.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW.cmake
new file mode 100644
index 0000000..9f9547c
--- /dev/null
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-NEW.cmake
@@ -0,0 +1,25 @@
+if(CMAKE_CROSSCOMPILING)
+ message(FATAL_ERROR "cross compiling")
+endif()
+
+cmake_policy(SET CMP0158 NEW)
+
+enable_testing()
+add_test(NAME DoesNotUseEmulator
+ COMMAND ${CMAKE_COMMAND} -E echo "Hi")
+
+add_executable(generated_exe simple_src_exiterror.cxx)
+
+add_test(NAME ShouldNotUseEmulator
+ COMMAND generated_exe)
+
+add_test(NAME DoesNotUseEmulatorWithGenex
+ COMMAND $<TARGET_FILE:generated_exe>)
+
+add_subdirectory(AddTest)
+
+add_test(NAME ShouldNotUseEmulatorWithExecTargetFromSubdirAddedWithoutGenex
+ COMMAND generated_exe_in_subdir_added_to_test_without_genex)
+
+add_test(NAME DoesNotUseEmulatorWithExecTargetFromSubdirAddedWithGenex
+ COMMAND $<TARGET_FILE:generated_exe_in_subdir_added_to_test_with_genex>)
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD-check.cmake
new file mode 100644
index 0000000..588b77b
--- /dev/null
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD-check.cmake
@@ -0,0 +1,28 @@
+set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake")
+if(EXISTS "${testfile}")
+ file(READ "${testfile}" testfile_contents)
+else()
+ message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.")
+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")
+ 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")
+ 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")
+ 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")
+ 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")
+ message(SEND_ERROR "Used emulator when it should not be used. ${error_details}")
+endif()
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD.cmake
new file mode 100644
index 0000000..910f1b4
--- /dev/null
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-CMP0158-OLD.cmake
@@ -0,0 +1,25 @@
+if(CMAKE_CROSSCOMPILING)
+ message(FATAL_ERROR "cross compiling")
+endif()
+
+cmake_policy(SET CMP0158 OLD)
+
+enable_testing()
+add_test(NAME DoesNotUseEmulator
+ COMMAND ${CMAKE_COMMAND} -E echo "Hi")
+
+add_executable(generated_exe simple_src_exiterror.cxx)
+
+add_test(NAME UsesEmulator
+ COMMAND generated_exe)
+
+add_test(NAME DoesNotUseEmulatorWithGenex
+ COMMAND $<TARGET_FILE:generated_exe>)
+
+add_subdirectory(AddTest)
+
+add_test(NAME UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex
+ COMMAND generated_exe_in_subdir_added_to_test_without_genex)
+
+add_test(NAME DoesNotUseEmulatorWithExecTargetFromSubdirAddedWithGenex
+ COMMAND $<TARGET_FILE:generated_exe_in_subdir_added_to_test_with_genex>)
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
index 588b77b..459e922 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest-check.cmake
@@ -26,3 +26,7 @@ endif()
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()
+
+if(NOT testfile_contents MATCHES "add_test[(]UsesTestLauncherAndEmulator[^\n]+pseudo_test_launcher.*pseudo_emulator[^\n]+\n")
+ message(SEND_ERROR "Did not use test launcher and emulator when they should be used. ${error_details}")
+endif()
diff --git a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
index 23e2e8d..4bcb2cf 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/AddTest.cmake
@@ -18,3 +18,9 @@ add_test(NAME UsesEmulatorWithExecTargetFromSubdirAddedWithoutGenex
add_test(NAME DoesNotUseEmulatorWithExecTargetFromSubdirAddedWithGenex
COMMAND $<TARGET_FILE:generated_exe_in_subdir_added_to_test_with_genex>)
+
+add_executable(generated_exe_test_launcher simple_src_exiterror.cxx)
+set_property(TARGET generated_exe_test_launcher PROPERTY TEST_LAUNCHER "pseudo_test_launcher")
+
+add_test(NAME UsesTestLauncherAndEmulator
+ COMMAND generated_exe_test_launcher)
diff --git a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake
index 1ffd91c..c595f1a 100644
--- a/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CrosscompilingEmulator/RunCMakeTest.cmake
@@ -6,6 +6,8 @@ set(RunCMake_TEST_OPTIONS
run_cmake(CrosscompilingEmulatorProperty)
run_cmake(TryRun)
run_cmake(AddTest)
+run_cmake(AddTest-CMP0158-OLD)
+run_cmake(AddTest-CMP0158-NEW)
function(CustomCommandGenerator_run_and_build case)
# Use a single build tree for a few tests without cleaning.
diff --git a/Tests/RunCMake/DependencyProviders/ProviderFirst-stdout.txt b/Tests/RunCMake/DependencyProviders/ProviderFirst-stdout.txt
new file mode 100644
index 0000000..53e554b
--- /dev/null
+++ b/Tests/RunCMake/DependencyProviders/ProviderFirst-stdout.txt
@@ -0,0 +1,6 @@
+-- Before cmake_language
+-- After cmake_language
+-- Intercepted FetchContent_MakeAvailable\(SomeDep\)
+-- Provider invoked for method FETCHCONTENT_MAKEAVAILABLE_SERIAL with args: SOURCE_DIR;.*/Tests/RunCMake/DependencyProviders;BINARY_DIR;.*/Tests/RunCMake/DependencyProviders/ProviderFirst-build/_deps/somedep-build;EXTERNALPROJECT_INTERNAL_ARGUMENT_SEPARATOR;SOURCE_SUBDIR;DoesNotExist;FIND_PACKAGE_ARGS;QUIET;NO_DEFAULT_PATH;COMPONENTS;abc
+-- FetchContent_MakeAvailable\(\) succeeded
+-- Configuring done
diff --git a/Tests/RunCMake/DependencyProviders/ProviderFirst.cmake b/Tests/RunCMake/DependencyProviders/ProviderFirst.cmake
new file mode 100644
index 0000000..b27c841
--- /dev/null
+++ b/Tests/RunCMake/DependencyProviders/ProviderFirst.cmake
@@ -0,0 +1,8 @@
+include(FetchContent)
+FetchContent_Declare(SomeDep
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
+ SOURCE_SUBDIR DoesNotExist
+ FIND_PACKAGE_ARGS NO_DEFAULT_PATH COMPONENTS abc
+)
+FetchContent_MakeAvailable(SomeDep)
+message(STATUS "FetchContent_MakeAvailable() succeeded")
diff --git a/Tests/RunCMake/DependencyProviders/RunCMakeTest.cmake b/Tests/RunCMake/DependencyProviders/RunCMakeTest.cmake
index 42893d2..300bbc1 100644
--- a/Tests/RunCMake/DependencyProviders/RunCMakeTest.cmake
+++ b/Tests/RunCMake/DependencyProviders/RunCMakeTest.cmake
@@ -61,6 +61,11 @@ run_cmake_with_options(RedirectFetchContentSerial
-D "provider_command=redirect_FetchContentSerial_provider"
-D "provider_methods=FETCHCONTENT_MAKEAVAILABLE_SERIAL"
)
+run_cmake_with_options(ProviderFirst
+ -D "CMAKE_PROJECT_TOP_LEVEL_INCLUDES=set_provider.cmake"
+ -D "provider_command=FetchContentSerial_provider"
+ -D "provider_methods=FETCHCONTENT_MAKEAVAILABLE_SERIAL"
+)
run_cmake_with_options(Bypass
-D "CMAKE_PROJECT_TOP_LEVEL_INCLUDES=set_provider.cmake"
-D "provider_command=forward_find_package"
diff --git a/Tests/RunCMake/ExcludeFromAll/main.c b/Tests/RunCMake/ExcludeFromAll/main.c
index f8b643a..8488f4e 100644
--- a/Tests/RunCMake/ExcludeFromAll/main.c
+++ b/Tests/RunCMake/ExcludeFromAll/main.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/RunCMake/FetchContent/CMake/FindFDE-S.cmake b/Tests/RunCMake/FetchContent/CMake/FindFDE-S.cmake
new file mode 100644
index 0000000..e6f4e16
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/CMake/FindFDE-S.cmake
@@ -0,0 +1,6 @@
+if(NOT CMAKE_EXPORT_FIND_PACKAGE_NAME STREQUAL "SomeOtherValue")
+ message(FATAL_ERROR "Expected value of CMAKE_EXPORT_FIND_PACKAGE_NAME:\n SomeOtherValue\nActual value:\n ${CMAKE_EXPORT_FIND_PACKAGE_NAME}")
+endif()
+
+set(fp_called TRUE)
+set(FDE-S_FOUND TRUE)
diff --git a/Tests/RunCMake/FetchContent/CMake/FindFDE-U.cmake b/Tests/RunCMake/FetchContent/CMake/FindFDE-U.cmake
new file mode 100644
index 0000000..ef91cc3
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/CMake/FindFDE-U.cmake
@@ -0,0 +1,6 @@
+if(DEFINED CMAKE_EXPORT_FIND_PACKAGE_NAME)
+ message(FATAL_ERROR "CMAKE_EXPORT_FIND_PACKAGE_NAME should not be defined")
+endif()
+
+set(fp_called TRUE)
+set(FDE-U_FOUND TRUE)
diff --git a/Tests/RunCMake/FetchContent/FindDependencyExport.cmake b/Tests/RunCMake/FetchContent/FindDependencyExport.cmake
new file mode 100644
index 0000000..c79c357
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/FindDependencyExport.cmake
@@ -0,0 +1,78 @@
+include(FetchContent)
+
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
+
+unset(dp_called)
+unset(fp_called)
+set(_expected_export_find_package_name_dp FDE-U)
+FetchContent_Declare(
+ FDE-U
+ FIND_PACKAGE_ARGS
+ )
+FetchContent_MakeAvailable(FDE-U)
+
+if(NOT dp_called)
+ message(FATAL_ERROR "FetchContent_MakeAvailable did not call dependency provider")
+endif()
+if(NOT fp_called)
+ message(FATAL_ERROR "FetchContent_MakeAvailable did not call find_package()")
+endif()
+
+if(DEFINED CMAKE_EXPORT_FIND_PACKAGE_NAME)
+ message(FATAL_ERROR "CMAKE_EXPORT_FIND_PACKAGE_NAME should have been unset after FetchContent_MakeAvailable().\nActual value:\n ${CMAKE_EXPORT_FIND_PACKAGE_NAME}")
+endif()
+
+unset(sub_called)
+set(_expected_export_find_package_name_dp FDE-U-Sub)
+set(_expected_export_find_package_name_sub FDE-U-Sub)
+FetchContent_Declare(
+ FDE-U-Sub
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/FindDependencyExport
+ )
+FetchContent_MakeAvailable(FDE-U-Sub)
+
+if(NOT sub_called)
+ message(FATAL_ERROR "FetchContent_MakeAvailable did not call add_subdirectory()")
+endif()
+
+if(DEFINED CMAKE_EXPORT_FIND_PACKAGE_NAME)
+ message(FATAL_ERROR "CMAKE_EXPORT_FIND_PACKAGE_NAME should have been unset after FetchContent_MakeAvailable()")
+endif()
+
+unset(dp_called)
+unset(fp_called)
+set(CMAKE_EXPORT_FIND_PACKAGE_NAME SomeOtherValue)
+set(_expected_export_find_package_name_dp FDE-S)
+FetchContent_Declare(
+ FDE-S
+ FIND_PACKAGE_ARGS
+ )
+FetchContent_MakeAvailable(FDE-S)
+
+if(NOT dp_called)
+ message(FATAL_ERROR "FetchContent_MakeAvailable did not call dependency provider")
+endif()
+if(NOT fp_called)
+ message(FATAL_ERROR "FetchContent_MakeAvailable did not call find_package()")
+endif()
+
+if(NOT CMAKE_EXPORT_FIND_PACKAGE_NAME STREQUAL "SomeOtherValue")
+ message(FATAL_ERROR "Expected value of CMAKE_EXPORT_FIND_PACKAGE_NAME:\n SomeOtherValue\nActual value:\n ${CMAKE_EXPORT_FIND_PACKAGE_NAME}")
+endif()
+
+unset(sub_called)
+set(_expected_export_find_package_name_dp FDE-S-Sub)
+set(_expected_export_find_package_name_sub FDE-S-Sub)
+FetchContent_Declare(
+ FDE-S-Sub
+ SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/FindDependencyExport
+ )
+FetchContent_MakeAvailable(FDE-S-Sub)
+
+if(NOT sub_called)
+ message(FATAL_ERROR "FetchContent_MakeAvailable did not call add_subdirectory()")
+endif()
+
+if(NOT CMAKE_EXPORT_FIND_PACKAGE_NAME STREQUAL "SomeOtherValue")
+ message(FATAL_ERROR "Expected value of CMAKE_EXPORT_FIND_PACKAGE_NAME:\n SomeOtherValue\nActual value:\n ${CMAKE_EXPORT_FIND_PACKAGE_NAME}")
+endif()
diff --git a/Tests/RunCMake/FetchContent/FindDependencyExport/CMakeLists.txt b/Tests/RunCMake/FetchContent/FindDependencyExport/CMakeLists.txt
new file mode 100644
index 0000000..8bd4036
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/FindDependencyExport/CMakeLists.txt
@@ -0,0 +1,5 @@
+if(NOT CMAKE_EXPORT_FIND_PACKAGE_NAME STREQUAL _expected_export_find_package_name_sub)
+ message(FATAL_ERROR "Expected value of CMAKE_EXPORT_FIND_PACKAGE_NAME:\n ${_expected_export_find_package_name_sub}\nActual value:\n ${CMAKE_EXPORT_FIND_PACKAGE_NAME}")
+endif()
+
+set(sub_called TRUE PARENT_SCOPE)
diff --git a/Tests/RunCMake/FetchContent/FindDependencyExportDP.cmake b/Tests/RunCMake/FetchContent/FindDependencyExportDP.cmake
new file mode 100644
index 0000000..7cabe51
--- /dev/null
+++ b/Tests/RunCMake/FetchContent/FindDependencyExportDP.cmake
@@ -0,0 +1,11 @@
+function(fde_provide_dependency method name)
+ if(NOT CMAKE_EXPORT_FIND_PACKAGE_NAME STREQUAL _expected_export_find_package_name_dp)
+ message(FATAL_ERROR "Expected value of CMAKE_EXPORT_FIND_PACKAGE_NAME:\n ${_expected_export_find_package_name_dp}\nActual value:\n ${CMAKE_EXPORT_FIND_PACKAGE_NAME}")
+ endif()
+
+ set(dp_called TRUE PARENT_SCOPE)
+endfunction()
+
+cmake_language(SET_DEPENDENCY_PROVIDER fde_provide_dependency
+ SUPPORTED_METHODS FETCHCONTENT_MAKEAVAILABLE_SERIAL
+ )
diff --git a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
index d0790eb..0f443a7 100644
--- a/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FetchContent/RunCMakeTest.cmake
@@ -19,6 +19,10 @@ run_cmake(MakeAvailableTwice)
run_cmake(MakeAvailableUndeclared)
run_cmake(VerifyHeaderSet)
+run_cmake_with_options(FindDependencyExport
+ -D "CMAKE_PROJECT_TOP_LEVEL_INCLUDES=${CMAKE_CURRENT_LIST_DIR}/FindDependencyExportDP.cmake"
+)
+
run_cmake_with_options(ManualSourceDirectory
-D "FETCHCONTENT_SOURCE_DIR_WITHPROJECT=${CMAKE_CURRENT_LIST_DIR}/WithProject"
)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 807d92b..5f41ad9 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -12,7 +12,7 @@ def read_codemodel_json_data(filename):
def check_objects(o, g):
assert is_list(o)
assert len(o) == 1
- check_index_object(o[0], "codemodel", 2, 6, check_object_codemodel(g))
+ check_index_object(o[0], "codemodel", 2, 7, check_object_codemodel(g))
def check_backtrace(t, b, backtrace):
btg = t["backtraceGraph"]
@@ -405,6 +405,30 @@ def check_target(c):
missing_exception=lambda e: "Install path: %s" % e["path"],
extra_exception=lambda a: "Install path: %s" % a["path"])
+ if "launchers" in expected:
+ if expected["launchers"] is not None:
+ expected_keys.append("launchers")
+ def check_launcher(actual, expected):
+ assert is_dict(actual)
+ launcher_keys = ["command", "type"]
+ if "arguments" in expected:
+ launcher_keys.append("arguments")
+ assert sorted(actual.keys()) == sorted(launcher_keys)
+ assert matches(actual["command"], expected["command"])
+ assert matches(actual["type"], expected["type"])
+ if "arguments" in expected:
+ if expected["arguments"] is not None:
+ check_list_match(lambda a, e: matches(a, e),
+ actual["arguments"], expected["arguments"],
+ missing_exception=lambda e: "argument: %s" % e,
+ extra_exception=lambda a: "argument: %s" % actual["arguments"])
+ check_list_match(lambda a, e: matches(a["type"], e["type"]),
+ obj["launchers"], expected["launchers"],
+ check=check_launcher,
+ check_exception=lambda a, e: "launchers: %s" % a,
+ missing_exception=lambda e: "launchers: %s" % e,
+ extra_exception=lambda a: "launchers: %s" % a)
+
if expected["link"] is not None:
expected_keys.append("link")
assert is_dict(obj["link"])
@@ -709,6 +733,7 @@ def gen_check_directories(c, g):
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/cxx.cross.json"),
read_codemodel_json_data("directories/imported.json"),
read_codemodel_json_data("directories/interface.json"),
read_codemodel_json_data("directories/object.json"),
@@ -782,6 +807,10 @@ def gen_check_targets(c, g, inSource):
read_codemodel_json_data("targets/zero_check_cxx.json"),
read_codemodel_json_data("targets/cxx_lib.json"),
read_codemodel_json_data("targets/cxx_exe.json"),
+ read_codemodel_json_data("targets/cxx_exe_cross_emulator.json"),
+ read_codemodel_json_data("targets/cxx_exe_cross_emulator_args.json"),
+ read_codemodel_json_data("targets/cxx_exe_test_launcher_and_cross_emulator.json"),
+ read_codemodel_json_data("targets/cxx_exe_test_launcher.json"),
read_codemodel_json_data("targets/cxx_standard_compile_feature_exe.json"),
read_codemodel_json_data("targets/cxx_standard_exe.json"),
read_codemodel_json_data("targets/cxx_shared_lib.json"),
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.cross.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.cross.json
new file mode 100644
index 0000000..8f6ded5
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.cross.json
@@ -0,0 +1,16 @@
+{
+ "source": "^cxx/cross$",
+ "build": "^cxx/cross$",
+ "parentSource": "^cxx$",
+ "parentIndex": 2,
+ "childSources": null,
+ "targetIds": [
+ "^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
+ "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$"
+ ],
+ "projectName": "Cxx",
+ "minimumCMakeVersion": "3.13",
+ "hasInstallRule": null,
+ "installers": []
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
index 22dfabd..912d664 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/directories/cxx.json
@@ -2,11 +2,14 @@
"source": "^cxx$",
"build": "^cxx$",
"parentSource": "^\\.$",
- "childSources": null,
+ "childSources": [
+ "^cxx/cross$"
+ ],
"targetIds": [
"^ALL_BUILD::@a56b12a3f5c0529fb296$",
"^ZERO_CHECK::@a56b12a3f5c0529fb296$",
"^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
"^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
"^cxx_standard_exe::@a56b12a3f5c0529fb296$",
"^cxx_lib::@a56b12a3f5c0529fb296$",
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json
index 363e853..c8a1a83 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/projects/cxx.json
@@ -3,13 +3,18 @@
"parentName": "codemodel-v2",
"childNames": null,
"directorySources": [
- "^cxx$"
+ "^cxx$",
+ "^cxx/cross$"
],
"targetIds": [
"^ALL_BUILD::@a56b12a3f5c0529fb296$",
"^ZERO_CHECK::@a56b12a3f5c0529fb296$",
"^cxx_lib::@a56b12a3f5c0529fb296$",
"^cxx_exe::@a56b12a3f5c0529fb296$",
+ "^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
+ "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
"^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
"^cxx_standard_exe::@a56b12a3f5c0529fb296$",
"^cxx_shared_lib::@a56b12a3f5c0529fb296$",
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
index bf36bfe..3a83d29 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_cxx.json
@@ -83,6 +83,22 @@
"backtrace": null
},
{
+ "id": "^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
"id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
"backtrace": null
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
index 9d0007f..ec72eb8 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/all_build_top.json
@@ -123,6 +123,22 @@
"backtrace": null
},
{
+ "id": "^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "backtrace": null
+ },
+ {
+ "id": "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ },
+ {
"id": "^cxx_standard_compile_feature_exe::@a56b12a3f5c0529fb296$",
"backtrace": null
},
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator.json
new file mode 100644
index 0000000..bbd973b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator.json
@@ -0,0 +1,105 @@
+{
+ "name": "cxx_exe_cross_emulator",
+ "id": "^cxx_exe_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "directorySource": "^cxx/cross$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "fileSets": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "fileSetName": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "frameworks": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": 3,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_exe_cross_emulator(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/cross/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_cross_emulator(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/cross/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_cross_emulator\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx/cross$",
+ "source": "^cxx/cross$",
+ "install": null,
+ "launchers" : [
+ {
+ "command": "^no-such-emulator(\\.exe)?$",
+ "type" : "emulator"
+ }
+ ],
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": [
+ {
+ "fragment" : ".*",
+ "role" : "flags",
+ "backtrace": null
+ }
+ ]
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator_args.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator_args.json
new file mode 100644
index 0000000..c1a8b0c
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_cross_emulator_args.json
@@ -0,0 +1,109 @@
+{
+ "name": "cxx_exe_cross_emulator_args",
+ "id": "^cxx_exe_cross_emulator_args::@ee4a268216d1f53c4e2e$",
+ "directorySource": "^cxx/cross$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "fileSets": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "fileSetName": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "frameworks": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_exe_cross_emulator_args(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/cross/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_cross_emulator_args(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/cross/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_cross_emulator_args\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx/cross$",
+ "source": "^cxx/cross$",
+ "install": null,
+ "launchers" : [
+ {
+ "arguments" : [
+ "arg1",
+ "arg2 with space"
+ ],
+ "command": "^no-such-emulator(\\.exe)?$",
+ "type" : "emulator"
+ }
+ ],
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": [
+ {
+ "fragment" : ".*",
+ "role" : "flags",
+ "backtrace": null
+ }
+ ]
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json
new file mode 100644
index 0000000..9002368
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher.json
@@ -0,0 +1,105 @@
+{
+ "name": "cxx_exe_test_launcher",
+ "id": "^cxx_exe_test_launcher::@a56b12a3f5c0529fb296$",
+ "directorySource": "^cxx$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "fileSets": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "fileSetName": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 49,
+ "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,
+ "frameworks": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 49,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_exe_test_launcher(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_test_launcher(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_test_launcher\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx$",
+ "source": "^cxx$",
+ "install": null,
+ "launchers" : [
+ {
+ "command": "^no-such-launcher(\\.exe)?$",
+ "type" : "test"
+ }
+ ],
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": [
+ {
+ "fragment" : ".*",
+ "role" : "flags",
+ "backtrace": null
+ }
+ ]
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@a56b12a3f5c0529fb296$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher_and_cross_emulator.json b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher_and_cross_emulator.json
new file mode 100644
index 0000000..06e7a7b
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-data/targets/cxx_exe_test_launcher_and_cross_emulator.json
@@ -0,0 +1,109 @@
+{
+ "name": "cxx_exe_test_launcher_and_cross_emulator",
+ "id": "^cxx_exe_test_launcher_and_cross_emulator::@ee4a268216d1f53c4e2e$",
+ "directorySource": "^cxx/cross$",
+ "projectName": "Cxx",
+ "type": "EXECUTABLE",
+ "isGeneratorProvided": null,
+ "fileSets": null,
+ "sources": [
+ {
+ "path": "^empty\\.cxx$",
+ "isGenerated": null,
+ "fileSetName": null,
+ "sourceGroupName": "Source Files",
+ "compileGroupLanguage": "CXX",
+ "backtrace": [
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ]
+ }
+ ],
+ "sourceGroups": [
+ {
+ "name": "Source Files",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ]
+ }
+ ],
+ "compileGroups": [
+ {
+ "language": "CXX",
+ "sourcePaths": [
+ "^empty\\.cxx$"
+ ],
+ "includes": null,
+ "frameworks": null,
+ "defines": null,
+ "compileCommandFragments": null
+ }
+ ],
+ "backtrace": [
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "add_executable",
+ "hasParent": true
+ },
+ {
+ "file": "^cxx/cross/CMakeLists\\.txt$",
+ "line": null,
+ "command": null,
+ "hasParent": false
+ }
+ ],
+ "folder": null,
+ "nameOnDisk": "^cxx_exe_test_launcher_and_cross_emulator(\\.exe)?$",
+ "artifacts": [
+ {
+ "path": "^cxx/cross/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_test_launcher_and_cross_emulator(\\.exe)?$",
+ "_dllExtra": false
+ },
+ {
+ "path": "^cxx/cross/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?cxx_exe_test_launcher_and_cross_emulator\\.pdb$",
+ "_dllExtra": true
+ }
+ ],
+ "build": "^cxx/cross$",
+ "source": "^cxx/cross$",
+ "install": null,
+ "launchers" : [
+ {
+ "command": "^no-such-launcher(\\.exe)?$",
+ "type" : "test"
+ },
+ {
+ "command": "^no-such-emulator(\\.exe)?$",
+ "type" : "emulator"
+ }
+ ],
+ "link": {
+ "language": "CXX",
+ "lto": null,
+ "commandFragments": [
+ {
+ "fragment" : ".*",
+ "role" : "flags",
+ "backtrace": null
+ }
+ ]
+ },
+ "archive": null,
+ "dependencies": [
+ {
+ "id": "^ZERO_CHECK::@6890427a1f51a3e7e1df$",
+ "backtrace": null
+ }
+ ]
+}
diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
index 3ae3b60..c465297 100644
--- a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
+++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
@@ -45,3 +45,8 @@ if(_rdeps)
FRAMEWORK DESTINATION fw
)
endif()
+
+add_executable(cxx_exe_test_launcher ../empty.cxx)
+set_property(TARGET cxx_exe_test_launcher PROPERTY TEST_LAUNCHER no-such-launcher)
+
+add_subdirectory(cross)
diff --git a/Tests/RunCMake/FileAPI/cxx/cross/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/cross/CMakeLists.txt
new file mode 100644
index 0000000..2f2594f
--- /dev/null
+++ b/Tests/RunCMake/FileAPI/cxx/cross/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Cross-compiling is normally global. Cover it without duplicating everything.
+set(CMAKE_CROSSCOMPILING 1)
+add_executable(cxx_exe_cross_emulator ../../empty.cxx)
+set_property(TARGET cxx_exe_cross_emulator PROPERTY CROSSCOMPILING_EMULATOR no-such-emulator)
+
+add_executable(cxx_exe_cross_emulator_args ../../empty.cxx)
+set_property(TARGET cxx_exe_cross_emulator_args PROPERTY CROSSCOMPILING_EMULATOR "no-such-emulator;arg1;arg2 with space")
+
+add_executable(cxx_exe_test_launcher_and_cross_emulator ../../empty.cxx)
+set_property(TARGET cxx_exe_test_launcher_and_cross_emulator PROPERTY TEST_LAUNCHER "no-such-launcher")
+set_property(TARGET cxx_exe_test_launcher_and_cross_emulator PROPERTY CROSSCOMPILING_EMULATOR "no-such-emulator")
diff --git a/Tests/RunCMake/File_Generate/empty.c b/Tests/RunCMake/File_Generate/empty.c
index f097d0a..05ffe2d 100644
--- a/Tests/RunCMake/File_Generate/empty.c
+++ b/Tests/RunCMake/File_Generate/empty.c
@@ -2,7 +2,7 @@
#ifdef _WIN32
__declspec(dllexport)
#endif
- int empty_c()
+ int empty_c(void)
{
return 0;
}
diff --git a/Tests/RunCMake/Framework/consumer.c b/Tests/RunCMake/Framework/consumer.c
index a578976..4208a73 100644
--- a/Tests/RunCMake/Framework/consumer.c
+++ b/Tests/RunCMake/Framework/consumer.c
@@ -1,7 +1,7 @@
#include <Gui2/Gui.h>
-int consumer()
+int consumer(void)
{
foo();
diff --git a/Tests/RunCMake/Framework/foo.c b/Tests/RunCMake/Framework/foo.c
index b85b60d..6c1d727 100644
--- a/Tests/RunCMake/Framework/foo.c
+++ b/Tests/RunCMake/Framework/foo.c
@@ -1,4 +1,4 @@
-int foo()
+int foo(void)
{
return 42;
}
diff --git a/Tests/RunCMake/Framework/foo.h b/Tests/RunCMake/Framework/foo.h
index 5d5f8f0..5a2ca62 100644
--- a/Tests/RunCMake/Framework/foo.h
+++ b/Tests/RunCMake/Framework/foo.h
@@ -1 +1 @@
-int foo();
+int foo(void);
diff --git a/Tests/RunCMake/Framework/main.c b/Tests/RunCMake/Framework/main.c
index fc09922..74ae236 100644
--- a/Tests/RunCMake/Framework/main.c
+++ b/Tests/RunCMake/Framework/main.c
@@ -1,7 +1,7 @@
#include <Gui/Gui.h>
-int main()
+int main(void)
{
foo();
diff --git a/Tests/RunCMake/Framework/main2.c b/Tests/RunCMake/Framework/main2.c
index 11f4e4d..26908d7 100644
--- a/Tests/RunCMake/Framework/main2.c
+++ b/Tests/RunCMake/Framework/main2.c
@@ -1,7 +1,7 @@
#include <Gui2/Gui.h>
-int main()
+int main(void)
{
foo();
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetFortran-result.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetFortran-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetFortran-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetFortran-stderr.txt b/Tests/RunCMake/GeneratorToolset/BadToolsetFortran-stderr.txt
new file mode 100644
index 0000000..acb13da
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetFortran-stderr.txt
@@ -0,0 +1,11 @@
+CMake Error at CMakeLists.txt:[0-9]+ \(project\):
+ Generator
+
+ [^
+]*
+
+ given toolset
+
+ fortran=bad
+
+ but the value is not "ifx" or "ifort"\.
diff --git a/Tests/RunCMake/GeneratorToolset/BadToolsetFortran.cmake b/Tests/RunCMake/GeneratorToolset/BadToolsetFortran.cmake
new file mode 100644
index 0000000..2fc38e5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/BadToolsetFortran.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index 71cc2d4..b86c481 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -43,6 +43,12 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[0124567]")
set(RunCMake_GENERATOR_TOOLSET "${VsNormal_Toolset},customFlagTableDir=does_not_exist")
run_cmake(BadToolsetCustomFlagTableDir)
endif()
+ set(RunCMake_GENERATOR_TOOLSET "fortran=ifort")
+ run_cmake(TestToolsetFortranIFORT)
+ set(RunCMake_GENERATOR_TOOLSET "fortran=ifx")
+ run_cmake(TestToolsetFortranIFX)
+ set(RunCMake_GENERATOR_TOOLSET "fortran=bad")
+ run_cmake(BadToolsetFortran)
if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[24567]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64")
run_cmake(TestToolsetHostArchBoth)
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT-stdout.txt
new file mode 100644
index 0000000..9fa8c21
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT-stdout.txt
@@ -0,0 +1 @@
+-- CMAKE_VS_PLATFORM_TOOLSET_FORTRAN='ifort'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT.cmake
new file mode 100644
index 0000000..7f18fbc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFORT.cmake
@@ -0,0 +1 @@
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_FORTRAN='${CMAKE_VS_PLATFORM_TOOLSET_FORTRAN}'")
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX-stdout.txt
new file mode 100644
index 0000000..56a0c30
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX-stdout.txt
@@ -0,0 +1 @@
+-- CMAKE_VS_PLATFORM_TOOLSET_FORTRAN='ifx'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX.cmake
new file mode 100644
index 0000000..7f18fbc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetFortranIFX.cmake
@@ -0,0 +1 @@
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_FORTRAN='${CMAKE_VS_PLATFORM_TOOLSET_FORTRAN}'")
diff --git a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt
index 3a6572c..84bbe9f 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-POST_BUILD-timeout-build-stdout.txt
@@ -2,6 +2,7 @@
( *|[0-9]+>) Error running test executable.
?( *|[0-9]+>)
( *|[0-9]+>) Path: '.*discovery_timeout_test(\.exe)?'
+( *|[0-9]+>) Working directory: '[^']*/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout'
( *|[0-9]+>) Result: Process terminated due to timeout
( *|[0-9]+>) Output:
( *|[0-9]+>) +
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
index 75afe4a..03d73ee 100644
--- a/Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stderr.txt
+++ b/Tests/RunCMake/GoogleTest/GoogleTest-discovery-PRE_TEST-timeout-test-stderr.txt
@@ -2,6 +2,7 @@ CMake Error at .*GoogleTestAddTests.cmake:[0-9]+ \(message\):
[ \t]*Error running test executable.
+
[ \t]*Path: '.*discovery_timeout_test(\.exe)?'
+[ \t]*Working directory: '[^']*/Tests/RunCMake/GoogleTest/GoogleTest-discovery-timeout'
[ \t]*Result: Process terminated due to timeout
[ \t]*Output:
[ \t]*timeout.
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped.cmake b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped.cmake
new file mode 100644
index 0000000..d65fae8
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped.cmake
@@ -0,0 +1,13 @@
+enable_language(CXX)
+
+# 'GoogleTest' module is NOT included here by design to validate that including
+# it in a subdirectory will still result in test discovery working correctly if
+# 'gtest_discover_tests()' is invoked from a different scope.
+
+enable_testing()
+
+include(xcode_sign_adhoc.cmake)
+
+add_subdirectory(GoogleTestDiscoveryTestListScoped)
+
+add_gtest_executable(test_list_scoped_test test_list_test.cpp)
diff --git a/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped/CMakeLists.txt b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped/CMakeLists.txt
new file mode 100644
index 0000000..762a537
--- /dev/null
+++ b/Tests/RunCMake/GoogleTest/GoogleTestDiscoveryTestListScoped/CMakeLists.txt
@@ -0,0 +1,13 @@
+# This file mimics one containing GoogleTest-related helper functions. It
+# includes the GoogleTest module that (in this test) is NOT included in the
+# top-level CMake file.
+
+include(GoogleTest)
+
+function(add_gtest_executable TARGET SOURCE)
+ add_executable(${TARGET} ${SOURCE})
+ xcode_sign_adhoc(${TARGET})
+ gtest_discover_tests(
+ ${TARGET}
+ )
+endfunction()
diff --git a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
index b494cef..56bbfc9 100644
--- a/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GoogleTest/RunCMakeTest.cmake
@@ -292,6 +292,32 @@ function(run_GoogleTest_discovery_flush_script DISCOVERY_MODE)
)
endfunction()
+function(run_GoogleTest_discovery_test_list_scoped DISCOVERY_MODE)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/GoogleTest-discovery-test-list-scoped-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(GoogleTestDiscoveryTestListScoped -DCMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE=${DISCOVERY_MODE})
+
+ run_cmake_command(GoogleTest-discovery-test-list-scoped-build
+ ${CMAKE_COMMAND}
+ --build .
+ --config Debug
+ --target test_list_scoped_test
+ )
+
+ run_cmake_command(GoogleTest-discovery-test-list-scoped-test
+ ${CMAKE_CTEST_COMMAND}
+ -C Debug
+ --no-label-summary
+ )
+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})
@@ -303,6 +329,7 @@ foreach(DISCOVERY_MODE POST_BUILD PRE_TEST)
run_GoogleTest_discovery_arg_change(${DISCOVERY_MODE})
endif()
run_GoogleTest_discovery_test_list(${DISCOVERY_MODE})
+ run_GoogleTest_discovery_test_list_scoped(${DISCOVERY_MODE})
run_GoogleTest_discovery_flush_script(${DISCOVERY_MODE})
endforeach()
diff --git a/Tests/RunCMake/Graphviz/test_project/core_library.c b/Tests/RunCMake/Graphviz/test_project/core_library.c
index e8a8844..ce390ce 100644
--- a/Tests/RunCMake/Graphviz/test_project/core_library.c
+++ b/Tests/RunCMake/Graphviz/test_project/core_library.c
@@ -1,3 +1,3 @@
-void log_something()
+void log_something(void)
{
}
diff --git a/Tests/RunCMake/Graphviz/test_project/graphic_library.c b/Tests/RunCMake/Graphviz/test_project/graphic_library.c
index 958c8ab..7a31ad4 100644
--- a/Tests/RunCMake/Graphviz/test_project/graphic_library.c
+++ b/Tests/RunCMake/Graphviz/test_project/graphic_library.c
@@ -1,3 +1,3 @@
-void initialize_graphics()
+void initialize_graphics(void)
{
}
diff --git a/Tests/RunCMake/Graphviz/test_project/module.c b/Tests/RunCMake/Graphviz/test_project/module.c
index a508b09..56e833d 100644
--- a/Tests/RunCMake/Graphviz/test_project/module.c
+++ b/Tests/RunCMake/Graphviz/test_project/module.c
@@ -1,3 +1,3 @@
-static void some_function()
+static void some_function(void)
{
}
diff --git a/Tests/RunCMake/Graphviz/test_project/system_library.c b/Tests/RunCMake/Graphviz/test_project/system_library.c
index 5d67079..896bca4 100644
--- a/Tests/RunCMake/Graphviz/test_project/system_library.c
+++ b/Tests/RunCMake/Graphviz/test_project/system_library.c
@@ -1,3 +1,3 @@
-void initialize_system()
+void initialize_system(void)
{
}
diff --git a/Tests/RunCMake/IAR/CMakeLists.txt b/Tests/RunCMake/IAR/CMakeLists.txt
new file mode 100644
index 0000000..6a9ce76
--- /dev/null
+++ b/Tests/RunCMake/IAR/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/IAR/RunCMakeTest.cmake b/Tests/RunCMake/IAR/RunCMakeTest.cmake
new file mode 100644
index 0000000..2049740
--- /dev/null
+++ b/Tests/RunCMake/IAR/RunCMakeTest.cmake
@@ -0,0 +1,64 @@
+include(RunCMake)
+
+if(RunCMake_GENERATOR MATCHES "Makefile|Ninja")
+ file(GLOB _iar_toolchains
+ "${CMake_TEST_IAR_TOOLCHAINS}/bx*-*/*/bin/icc*" )
+ if(_iar_toolchains STREQUAL "")
+ message(FATAL_ERROR "Could not find any IAR toolchains at: ${CMake_TEST_IAR_TOOLCHAINS}.")
+ endif()
+endif()
+
+foreach(_iar_toolchain IN LISTS _iar_toolchains)
+ message(STATUS "Found IAR toolchain: ${_iar_toolchain}")
+ cmake_path(GET _iar_toolchain PARENT_PATH BIN_DIR)
+ cmake_path(GET BIN_DIR PARENT_PATH TOOLKIT_DIR)
+ cmake_path(GET TOOLKIT_DIR FILENAME ARCH)
+
+ # Sets the minimal requirements for linking each target architecture
+ if(ARCH STREQUAL rl78)
+ set(LINK_OPTS
+"--config_def _STACK_SIZE=256 \
+--config_def _NEAR_HEAP_SIZE=0x400 \
+--config_def _FAR_HEAP_SIZE=4096 \
+--config_def _HUGE_HEAP_SIZE=0 \
+--config_def _NEAR_CONST_LOCATION_START=0x2000 \
+--config_def _NEAR_CONST_LOCATION_SIZE=0x6F00 \
+--define_symbol _NEAR_CONST_LOCATION=0 \
+--config ${TOOLKIT_DIR}/config/lnkrl78_s3.icf" )
+ else()
+ set(LINK_OPTS "")
+ endif()
+
+ # Set IAR Assembler (ILINK || XLINK)
+ find_program(IAR_ASSEMBLER
+ NAMES iasm${ARCH} a${ARCH}
+ PATHS ${BIN_DIR}
+ REQUIRED )
+
+ set(RunCMake_TEST_OPTIONS
+ -DCMAKE_SYSTEM_NAME=Generic
+ -DCMAKE_C_COMPILER=${_iar_toolchain}
+ -DCMAKE_EXE_LINKER_FLAGS=${LINK_OPTS}
+ )
+ run_cmake(iar-c)
+
+ set(RunCMake_TEST_OPTIONS
+ -DCMAKE_SYSTEM_NAME=Generic
+ -DCMAKE_CXX_COMPILER=${_iar_toolchain}
+ -DCMAKE_EXE_LINKER_FLAGS=${LINK_OPTS}
+ )
+ run_cmake(iar-cxx)
+
+ set(RunCMake_TEST_OPTIONS
+ -DCMAKE_SYSTEM_NAME=Generic
+ -DCMAKE_ASM_COMPILER=${IAR_ASSEMBLER}
+ )
+ run_cmake(iar-asm)
+
+ set(RunCMake_TEST_OPTIONS
+ -DCMAKE_SYSTEM_NAME=Generic
+ -DCMAKE_C_COMPILER=${_iar_toolchain}
+ -DCMAKE_EXE_LINKER_FLAGS=${LINK_OPTS}
+ )
+ run_cmake(iar-lib)
+endforeach()
diff --git a/Tests/RunCMake/IAR/iar-asm.cmake b/Tests/RunCMake/IAR/iar-asm.cmake
new file mode 100644
index 0000000..7ff64f6
--- /dev/null
+++ b/Tests/RunCMake/IAR/iar-asm.cmake
@@ -0,0 +1,5 @@
+enable_language(ASM)
+
+add_executable(exec-asm)
+target_sources(exec-asm PRIVATE module.asm)
+target_link_options(exec-asm PRIVATE ${LINKER_OPTS})
diff --git a/Tests/RunCMake/IAR/iar-c.cmake b/Tests/RunCMake/IAR/iar-c.cmake
new file mode 100644
index 0000000..a36f096
--- /dev/null
+++ b/Tests/RunCMake/IAR/iar-c.cmake
@@ -0,0 +1,5 @@
+enable_language(C)
+
+add_executable(exec-c)
+target_sources(exec-c PRIVATE module.c)
+target_link_options(exec-c PRIVATE ${LINKER_OPTS})
diff --git a/Tests/RunCMake/IAR/iar-cxx.cmake b/Tests/RunCMake/IAR/iar-cxx.cmake
new file mode 100644
index 0000000..6b005b5
--- /dev/null
+++ b/Tests/RunCMake/IAR/iar-cxx.cmake
@@ -0,0 +1,5 @@
+enable_language(CXX)
+
+add_executable(exec-cxx)
+target_sources(exec-cxx PRIVATE module.cxx)
+target_link_options(exec-cxx PRIVATE ${LINKER_OPTS})
diff --git a/Tests/RunCMake/IAR/iar-lib.cmake b/Tests/RunCMake/IAR/iar-lib.cmake
new file mode 100644
index 0000000..78b3136
--- /dev/null
+++ b/Tests/RunCMake/IAR/iar-lib.cmake
@@ -0,0 +1,10 @@
+enable_language(C)
+
+add_library(iar-test-lib)
+target_sources(iar-test-lib PRIVATE libmod.c)
+
+add_executable(exec-lib-c)
+target_sources(exec-lib-c PRIVATE module.c)
+target_compile_definitions(exec-lib-c PRIVATE __USE_LIBFUN)
+target_link_libraries(exec-lib-c LINK_PUBLIC iar-test-lib)
+target_link_options(exec-lib-c PRIVATE ${LINKER_OPTS})
diff --git a/Tests/RunCMake/IAR/libmod.c b/Tests/RunCMake/IAR/libmod.c
new file mode 100644
index 0000000..d6c3b73
--- /dev/null
+++ b/Tests/RunCMake/IAR/libmod.c
@@ -0,0 +1,4 @@
+int iar_libfun()
+{
+ return 42;
+}
diff --git a/Tests/RunCMake/IAR/module.asm b/Tests/RunCMake/IAR/module.asm
new file mode 100644
index 0000000..1e08236
--- /dev/null
+++ b/Tests/RunCMake/IAR/module.asm
@@ -0,0 +1,41 @@
+#if defined(__IASM8051__) || defined(__IASM430__)
+ NAME main
+#else
+ MODULE main
+#endif
+
+ PUBLIC main
+ PUBLIC __iar_program_start
+ PUBLIC __program_start
+
+#if defined(__IASMSTM8__)
+ EXTERN CSTACK$$Limit
+ SECTION `.near_func.text`:CODE:NOROOT(0)
+#elif defined(__IASMAVR__)
+ ORG $0
+ RJMP main
+ RSEG CODE
+#elif defined(__IASM8051__)
+ ORG 0FFFEh
+ DC16 main
+ RSEG RCODE
+?cmain:
+#elif defined(__IASM430__)
+ ORG 0FFFEh
+ DC16 init
+ RSEG CSTACK
+ RSEG CODE
+init:
+ MOV #SFE(CSTACK), SP
+#else
+ EXTERN __iar_static_base$$GPREL
+ SECTION CSTACK:DATA:NOROOT(4)
+ SECTION `.cstartup`:CODE(2)
+ CODE
+#endif
+
+__program_start:
+__iar_program_start:
+main:
+ NOP
+ END
diff --git a/Tests/RunCMake/IAR/module.c b/Tests/RunCMake/IAR/module.c
new file mode 100644
index 0000000..2f72a42
--- /dev/null
+++ b/Tests/RunCMake/IAR/module.c
@@ -0,0 +1,14 @@
+#include "module.h"
+#if defined(__USE_LIBFUN)
+extern int iar_libfun();
+#endif
+__root int i;
+__root int main()
+{
+#if defined(__USE_LIBFUN)
+ i = iar_libfun();
+#else
+ i = INTERNAL;
+#endif
+ return i;
+}
diff --git a/Tests/RunCMake/IAR/module.cxx b/Tests/RunCMake/IAR/module.cxx
new file mode 100644
index 0000000..5604435
--- /dev/null
+++ b/Tests/RunCMake/IAR/module.cxx
@@ -0,0 +1,7 @@
+#include "module.h"
+__root int i;
+__root int main()
+{
+ i = INTERNAL;
+ return i;
+}
diff --git a/Tests/RunCMake/IAR/module.h b/Tests/RunCMake/IAR/module.h
new file mode 100644
index 0000000..5f9c87b
--- /dev/null
+++ b/Tests/RunCMake/IAR/module.h
@@ -0,0 +1,14 @@
+#ifndef __MODULE_H__
+#define __MODULE_H__
+
+#if defined(__cplusplus)
+# define INTERNAL 64
+#elif !defined(__cplusplus) && defined(__IAR_SYSTEMS_ICC__)
+# define INTERNAL 32
+#elif defined(__IAR_SYSTEMS_ASM__)
+# define INTERNAL 16
+#else
+# error "Unable to determine INTERNAL symbol."
+#endif /* __IAR_SYSTEMS_ICC */
+
+#endif /* __MODULE_H__ */
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/CMakeLists.txt b/Tests/RunCMake/LinkLibrariesProcessing/CMakeLists.txt
new file mode 100644
index 0000000..5773ae3
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28...3.29)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-result.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-stderr.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-stderr.txt
new file mode 100644
index 0000000..2566d8f
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at InvalidConfiguration1.cmake:[0-9]+ \(add_executable\):
+ Erroneous option\(s\) for 'CMAKE_C_LINK_LIBRARIES_PROCESSING':
+
+ ORDER=
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake
new file mode 100644
index 0000000..e79eb45
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration1.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER= UNICITY=ALL)
+
+add_library(lib STATIC lib.c)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-result.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-stderr.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-stderr.txt
new file mode 100644
index 0000000..933031d
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at InvalidConfiguration2.cmake:[0-9]+ \(add_executable\):
+ Erroneous option\(s\) for 'CMAKE_C_LINK_LIBRARIES_PROCESSING':
+
+ ORDER
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake
new file mode 100644
index 0000000..c9da734
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration2.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING UNICITY=ALL ORDER)
+
+add_library(lib STATIC lib.c)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-result.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-stderr.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-stderr.txt
new file mode 100644
index 0000000..eba1eb2
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at InvalidConfiguration3.cmake:[0-9]+ \(add_executable\):
+ Erroneous option\(s\) for 'CMAKE_C_LINK_LIBRARIES_PROCESSING':
+
+ WRONG=REVERSE
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake
new file mode 100644
index 0000000..a1311fe
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration3.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING WRONG=REVERSE UNICITY=ALL)
+
+add_library(lib STATIC lib.c)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-result.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt
new file mode 100644
index 0000000..46d5513
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at InvalidConfiguration4.cmake:[0-9]+ \(add_executable\):
+ Erroneous option\(s\) for 'CMAKE_C_LINK_LIBRARIES_PROCESSING':
+
+ WRONG=REVERSE
+ UNICITY=WRONG
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake
new file mode 100644
index 0000000..9d48f4f
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/InvalidConfiguration4.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING WRONG=REVERSE UNICITY=WRONG)
+
+add_library(lib STATIC lib.c)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-result.txt b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-stderr.txt b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-stderr.txt
new file mode 100644
index 0000000..33a7552
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at Invalid_ORDER.cmake:[0-9]+ \(add_executable\):
+ Erroneous option\(s\) for 'CMAKE_C_LINK_LIBRARIES_PROCESSING':
+
+ ORDER=WRONG
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake
new file mode 100644
index 0000000..72a7e02
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_ORDER.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER=WRONG UNICITY=ALL)
+
+add_library(lib STATIC lib.c)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-result.txt b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-stderr.txt b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-stderr.txt
new file mode 100644
index 0000000..4d759b7
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at Invalid_UNICITY.cmake:[0-9]+ \(add_executable\):
+ Erroneous option\(s\) for 'CMAKE_C_LINK_LIBRARIES_PROCESSING':
+
+ UNICITY=WRONG
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY.cmake b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY.cmake
new file mode 100644
index 0000000..f423eef
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/Invalid_UNICITY.cmake
@@ -0,0 +1,9 @@
+
+enable_language(C)
+
+set(CMAKE_C_LINK_LIBRARIES_PROCESSING ORDER=REVERSE UNICITY=WRONG)
+
+add_library(lib STATIC lib.c)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake b/Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake
new file mode 100644
index 0000000..763f48b
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/RunCMakeTest.cmake
@@ -0,0 +1,8 @@
+include(RunCMake)
+
+run_cmake(Invalid_ORDER)
+run_cmake(Invalid_UNICITY)
+run_cmake(InvalidConfiguration1)
+run_cmake(InvalidConfiguration2)
+run_cmake(InvalidConfiguration3)
+run_cmake(InvalidConfiguration4)
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/lib.c b/Tests/RunCMake/LinkLibrariesProcessing/lib.c
new file mode 100644
index 0000000..17a4148
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/lib.c
@@ -0,0 +1,4 @@
+
+void lib(void)
+{
+}
diff --git a/Tests/RunCMake/LinkLibrariesProcessing/main.c b/Tests/RunCMake/LinkLibrariesProcessing/main.c
new file mode 100644
index 0000000..402eac3
--- /dev/null
+++ b/Tests/RunCMake/LinkLibrariesProcessing/main.c
@@ -0,0 +1,5 @@
+
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/LinkerSelection/AppleClassic.cmake b/Tests/RunCMake/LinkerSelection/AppleClassic.cmake
new file mode 100644
index 0000000..62a12ad
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/AppleClassic.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+set(CMAKE_LINKER_TYPE APPLE_CLASSIC)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE m m)
diff --git a/Tests/RunCMake/LinkerSelection/CMakeLists.txt b/Tests/RunCMake/LinkerSelection/CMakeLists.txt
new file mode 100644
index 0000000..6a9ce76
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/LinkerSelection/CustomLinkerType-build-check.cmake b/Tests/RunCMake/LinkerSelection/CustomLinkerType-build-check.cmake
new file mode 100644
index 0000000..235c38e
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/CustomLinkerType-build-check.cmake
@@ -0,0 +1,2 @@
+
+include("${CMAKE_CURRENT_LIST_DIR}/LinkerType-validation.cmake")
diff --git a/Tests/RunCMake/LinkerSelection/CustomLinkerType.cmake b/Tests/RunCMake/LinkerSelection/CustomLinkerType.cmake
new file mode 100644
index 0000000..4bf98b0
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/CustomLinkerType.cmake
@@ -0,0 +1,36 @@
+
+enable_language(C)
+
+set(CMAKE_C_USING_LINKER_FOO_C "${CMAKE_C_USING_LINKER_LLD}")
+
+add_executable(main main.c)
+set_property(TARGET main PROPERTY LINKER_TYPE "$<$<LINK_LANGUAGE:C>:FOO_C>$<$<LINK_LANGUAGE:CUDA>:FOO_CUDA>")
+
+if(CMake_TEST_CUDA)
+ enable_language(CUDA)
+
+ set(CMAKE_CUDA_USING_LINKER_FOO_CUDA "${CMAKE_CUDA_USING_LINKER_LLD}")
+
+ add_executable(mainCU main.cu)
+ set_property(TARGET mainCU PROPERTY LINKER_TYPE "$<$<LINK_LANGUAGE:C>:FOO_C>$<$<LINK_LANGUAGE:CUDA>:FOO_CUDA>")
+endif()
+
+#
+# Generate file for validation
+#
+if (CMAKE_C_USING_LINKER_MODE STREQUAL "TOOL")
+ cmake_path(GET CMAKE_C_USING_LINKER_FOO_C FILENAME LINKER_TYPE_OPTION)
+else()
+ set(LINKER_TYPE_OPTION "${CMAKE_C_USING_LINKER_FOO_C}")
+endif()
+if(CMake_TEST_CUDA)
+ if (CMAKE_CUDA_USING_LINKER_MODE STREQUAL "TOOL")
+ cmake_path(GET CMAKE_CUDA_USING_LINKER_FOO_CUDA FILENAME CUDA_LINKER)
+ else()
+ set(CUDA_LINKER "${CMAKE_CUDA_USING_LINKER_FOO_CUDA}")
+ endif()
+ string(APPEND LINKER_TYPE_OPTION "|${CUDA_LINKER}")
+endif()
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LINKER_TYPE_OPTION.cmake"
+ "set(LINKER_TYPE_OPTION \"${LINKER_TYPE_OPTION}\")\n")
diff --git a/Tests/RunCMake/LinkerSelection/InvalidLinkerType-result.txt b/Tests/RunCMake/LinkerSelection/InvalidLinkerType-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/InvalidLinkerType-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/LinkerSelection/InvalidLinkerType-stderr.txt b/Tests/RunCMake/LinkerSelection/InvalidLinkerType-stderr.txt
new file mode 100644
index 0000000..11aea7a
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/InvalidLinkerType-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error in CMakeLists.txt:
+ LINKER_TYPE 'FOO' is unknown. Did you forgot to define
+ 'CMAKE_C_USING_LINKER_FOO' variable\?
diff --git a/Tests/RunCMake/LinkerSelection/InvalidLinkerType.cmake b/Tests/RunCMake/LinkerSelection/InvalidLinkerType.cmake
new file mode 100644
index 0000000..bbe398c
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/InvalidLinkerType.cmake
@@ -0,0 +1,5 @@
+
+enable_language(C)
+
+set(CMAKE_LINKER_TYPE FOO)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/LinkerSelection/LinkerType-validation.cmake b/Tests/RunCMake/LinkerSelection/LinkerType-validation.cmake
new file mode 100644
index 0000000..3f82479
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/LinkerType-validation.cmake
@@ -0,0 +1,9 @@
+
+include ("${RunCMake_TEST_BINARY_DIR}/LINKER_TYPE_OPTION.cmake")
+
+# In some environment, `=` character is escaped
+string(REPLACE "=" "\\\\?=" LINKER_TYPE_OPTION "${LINKER_TYPE_OPTION}")
+
+if (NOT actual_stdout MATCHES "${LINKER_TYPE_OPTION}")
+ set (RunCMake_TEST_FAILED "Not found expected '${LINKER_TYPE_OPTION}'.")
+endif()
diff --git a/Tests/RunCMake/LinkerSelection/RunCMakeTest.cmake b/Tests/RunCMake/LinkerSelection/RunCMakeTest.cmake
new file mode 100644
index 0000000..cae4ca4
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/RunCMakeTest.cmake
@@ -0,0 +1,44 @@
+include(RunCMake)
+
+if (RunCMake_GENERATOR MATCHES "Visual Studio 9 2008")
+ run_cmake(UnsupportedLinkerType)
+ return()
+endif()
+
+run_cmake(InvalidLinkerType)
+
+# look-up for LLVM linker
+if (WIN32)
+ set (LINKER_NAMES lld-link)
+else()
+ set(LINKER_NAMES ld.lld ld64.lld)
+endif()
+find_program(LLD_LINKER NAMES ${LINKER_NAMES})
+
+macro(run_cmake_and_build test)
+ run_cmake_with_options(${test} -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ if(CMake_TEST_CUDA)
+ string(APPEND "|${CMAKE_CUDA_USING_LINKER_LLD}")
+ endif()
+ run_cmake_command(${test}-build ${CMAKE_COMMAND} --build . --config Release --verbose ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endmacro()
+
+if(LLD_LINKER)
+ block(SCOPE_FOR VARIABLES)
+ set(CMAKE_VERBOSE_MAKEFILE TRUE)
+ set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+
+ run_cmake_and_build(ValidLinkerType)
+ run_cmake_and_build(CustomLinkerType)
+ endblock()
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "15.0")
+ run_cmake_and_build(AppleClassic)
+endif()
diff --git a/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-result.txt b/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-stderr.txt b/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-stderr.txt
new file mode 100644
index 0000000..6473451
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error at UnsupportedLinkerType.cmake:[0-9]+ \(add_executable\):
+ 'LINKER_TYPE' property, specified on target 'main', is not supported by
+ this generator.
diff --git a/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType.cmake b/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType.cmake
new file mode 100644
index 0000000..1b0703c
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/UnsupportedLinkerType.cmake
@@ -0,0 +1,5 @@
+
+enable_language(C)
+
+set(CMAKE_LINKER_TYPE LDD)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/LinkerSelection/ValidLinkerType-build-check.cmake b/Tests/RunCMake/LinkerSelection/ValidLinkerType-build-check.cmake
new file mode 100644
index 0000000..235c38e
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/ValidLinkerType-build-check.cmake
@@ -0,0 +1,2 @@
+
+include("${CMAKE_CURRENT_LIST_DIR}/LinkerType-validation.cmake")
diff --git a/Tests/RunCMake/LinkerSelection/ValidLinkerType.cmake b/Tests/RunCMake/LinkerSelection/ValidLinkerType.cmake
new file mode 100644
index 0000000..a685ac1
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/ValidLinkerType.cmake
@@ -0,0 +1,32 @@
+
+enable_language(C)
+
+set(CMAKE_LINKER_TYPE LLD)
+
+add_executable(main main.c)
+
+if(CMake_TEST_CUDA)
+ enable_language(CUDA)
+
+ add_executable(mainCU main.cu)
+endif()
+
+#
+# Generate file for validation
+#
+if (CMAKE_C_USING_LINKER_MODE STREQUAL "TOOL")
+ cmake_path(GET CMAKE_C_USING_LINKER_LLD FILENAME LINKER_TYPE_OPTION)
+else()
+ set(LINKER_TYPE_OPTION "${CMAKE_C_USING_LINKER_LLD}")
+endif()
+if(CMake_TEST_CUDA)
+ if (CMAKE_CUDA_USING_LINKER_MODE STREQUAL "TOOL")
+ cmake_path(GET CMAKE_CUDA_USING_LINKER_LLD FILENAME CUDA_LINKER)
+ else()
+ set(CUDA_LINKER "${CMAKE_CUDA_USING_LINKER_LLD}")
+ endif()
+ string(APPEND LINKER_TYPE_OPTION "|${CUDA_LINKER}")
+endif()
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LINKER_TYPE_OPTION.cmake"
+ "set(LINKER_TYPE_OPTION \"${LINKER_TYPE_OPTION}\")\n")
diff --git a/Tests/RunCMake/LinkerSelection/main.c b/Tests/RunCMake/LinkerSelection/main.c
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/main.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/LinkerSelection/main.cu b/Tests/RunCMake/LinkerSelection/main.cu
new file mode 100644
index 0000000..766b775
--- /dev/null
+++ b/Tests/RunCMake/LinkerSelection/main.cu
@@ -0,0 +1,5 @@
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/Make/CTestJobServer-NoPipe-j2-stdout.txt b/Tests/RunCMake/Make/CTestJobServer-NoPipe-j2-stdout.txt
new file mode 100644
index 0000000..579c722
--- /dev/null
+++ b/Tests/RunCMake/Make/CTestJobServer-NoPipe-j2-stdout.txt
@@ -0,0 +1,9 @@
+Test project [^
+]*/Tests/RunCMake/Make/CTestJobServer-build
+ Start [0-9]+: test[0-9]+
+ Start [0-9]+: test[0-9]+
+ Start [0-9]+: test[0-9]+
+ Start [0-9]+: test[0-9]+
+ Start [0-9]+: test[0-9]+
+ Start [0-9]+: test[0-9]+
+1/6 Test #[0-9]+: test[0-9]+ ............................ Passed +[0-9.]+ sec
diff --git a/Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stderr.txt b/Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stderr.txt
new file mode 100644
index 0000000..eafba1c
--- /dev/null
+++ b/Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stderr.txt
@@ -0,0 +1 @@
+No tests were found!!!
diff --git a/Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stdout.txt b/Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stdout.txt
new file mode 100644
index 0000000..0547dc7
--- /dev/null
+++ b/Tests/RunCMake/Make/CTestJobServer-NoTests-j2-stdout.txt
@@ -0,0 +1,3 @@
+Test project [^
+]*/Tests/RunCMake/Make/CTestJobServer-build
+Connected to MAKE jobserver
diff --git a/Tests/RunCMake/Make/CTestJobServer-Tests-j2-stdout.txt b/Tests/RunCMake/Make/CTestJobServer-Tests-j2-stdout.txt
new file mode 100644
index 0000000..a700999
--- /dev/null
+++ b/Tests/RunCMake/Make/CTestJobServer-Tests-j2-stdout.txt
@@ -0,0 +1,6 @@
+Test project [^
+]*/Tests/RunCMake/Make/CTestJobServer-build
+Connected to MAKE jobserver
+ Start [0-9]+: test[0-9]+
+ Start [0-9]+: test[0-9]+
+1/6 Test #[0-9]+: test[0-9]+ ............................ Passed +[0-9.]+ sec
diff --git a/Tests/RunCMake/Make/CTestJobServer-Tests-j3-stdout.txt b/Tests/RunCMake/Make/CTestJobServer-Tests-j3-stdout.txt
new file mode 100644
index 0000000..5a76bdc
--- /dev/null
+++ b/Tests/RunCMake/Make/CTestJobServer-Tests-j3-stdout.txt
@@ -0,0 +1,7 @@
+Test project [^
+]*/Tests/RunCMake/Make/CTestJobServer-build
+Connected to MAKE jobserver
+ Start [0-9]+: test[0-9]+
+ Start [0-9]+: test[0-9]+
+ Start [0-9]+: test[0-9]+
+1/6 Test #[0-9]+: test[0-9]+ ............................ Passed +[0-9.]+ sec
diff --git a/Tests/RunCMake/Make/CTestJobServer.cmake b/Tests/RunCMake/Make/CTestJobServer.cmake
new file mode 100644
index 0000000..2ca3d54
--- /dev/null
+++ b/Tests/RunCMake/Make/CTestJobServer.cmake
@@ -0,0 +1,4 @@
+enable_testing()
+foreach(i RANGE 1 6)
+ add_test(NAME test${i} COMMAND ${CMAKE_COMMAND} -E true)
+endforeach()
diff --git a/Tests/RunCMake/Make/CTestJobServer.make b/Tests/RunCMake/Make/CTestJobServer.make
new file mode 100644
index 0000000..7fc5e28
--- /dev/null
+++ b/Tests/RunCMake/Make/CTestJobServer.make
@@ -0,0 +1,11 @@
+NoPipe:
+ env MAKEFLAGS= $(CMAKE_CTEST_COMMAND) -j6
+.PHONY: NoPipe
+
+NoTests:
+ +$(CMAKE_CTEST_COMMAND) -j6 -R NoTests
+.PHONY: NoTests
+
+Tests:
+ +$(CMAKE_CTEST_COMMAND) -j6
+.PHONY: Tests
diff --git a/Tests/RunCMake/Make/RunCMakeTest.cmake b/Tests/RunCMake/Make/RunCMakeTest.cmake
index 5d1ba48..cfaf759 100644
--- a/Tests/RunCMake/Make/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Make/RunCMakeTest.cmake
@@ -79,9 +79,29 @@ function(detect_jobserver_present)
run_cmake_command(DetectJobServer-present-parallel-build ${CMAKE_COMMAND} --build . -j4)
endfunction()
+function(run_make_rule case rule job_count)
+ run_cmake_command(${case}-${rule}-j${job_count}
+ ${RunCMake_MAKE_PROGRAM} -f "${RunCMake_SOURCE_DIR}/${case}.make" ${rule} -j${job_count}
+ CMAKE_COMMAND="${CMAKE_COMMAND}" CMAKE_CTEST_COMMAND="${CMAKE_CTEST_COMMAND}"
+ )
+endfunction()
+
+function(run_CTestJobServer)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CTestJobServer-build)
+ run_cmake(CTestJobServer)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_make_rule(CTestJobServer NoPipe 2)
+ run_make_rule(CTestJobServer NoTests 2)
+ run_make_rule(CTestJobServer Tests 2)
+ run_make_rule(CTestJobServer Tests 3)
+endfunction()
+
# Jobservers are currently only supported by GNU makes, except MSYS2 make
if(MAKE_IS_GNU AND NOT RunCMake_GENERATOR MATCHES "MSYS Makefiles")
detect_jobserver_present()
+ if(UNIX)
+ run_CTestJobServer()
+ endif()
endif()
if(MAKE_IS_GNU)
diff --git a/Tests/RunCMake/Ninja/CheckNoPrefixSubDirScript.cmake b/Tests/RunCMake/Ninja/CheckNoPrefixSubDirScript.cmake
index 5a03fcb..09fd7e9 100644
--- a/Tests/RunCMake/Ninja/CheckNoPrefixSubDirScript.cmake
+++ b/Tests/RunCMake/Ninja/CheckNoPrefixSubDirScript.cmake
@@ -1,6 +1,6 @@
# Check that the prefix sub-directory is not repeated.
-if(EXISTS "${CUR_BIN_DIR}/${NINJA_OUTPUT_PATH_PREFIX}")
+if(NINJA_OUTPUT_PATH_PREFIX AND EXISTS "${CUR_BIN_DIR}/${NINJA_OUTPUT_PATH_PREFIX}")
message(FATAL_ERROR
"no sub directory named after the CMAKE_NINJA_OUTPUT_PATH_PREFIX "
"should be in the binary directory."
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake
index edde0c0..3016816 100644
--- a/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake
+++ b/Tests/RunCMake/Ninja/CustomCommandDepfile-check.cmake
@@ -10,3 +10,38 @@ if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d")
string(CONCAT no_test_Debug_d "\nLog file:\n ${log}\n" "does not have expected line: depfile = test_Debug.d")
list(APPEND RunCMake_TEST_FAILED "${no_test_Debug_d}")
endif()
+
+function(_run_ninja dir)
+ execute_process(
+ COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN}
+ WORKING_DIRECTORY "${dir}"
+ OUTPUT_VARIABLE ninja_stdout
+ ERROR_VARIABLE ninja_stderr
+ RESULT_VARIABLE ninja_result
+ )
+ if(NOT ninja_result EQUAL 0)
+ message(STATUS "
+============ beginning of ninja's stdout ============
+${ninja_stdout}
+=============== end of ninja's stdout ===============
+")
+ message(STATUS "
+============ beginning of ninja's stderr ============
+${ninja_stderr}
+=============== end of ninja's stderr ===============
+")
+ message(FATAL_ERROR
+ "top ninja build failed exited with status ${ninja_result}")
+ endif()
+ set(ninja_stdout "${ninja_stdout}" PARENT_SCOPE)
+endfunction()
+
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfile-build")
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfile-build" -t deps hello.copy.c)
+if (ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja did not track the deps of hello.copy.c in the database")
+endif ()
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfile-build" -t deps hello.copy2.c)
+if (ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja did not track the deps of hello.copy2.c in the database")
+endif ()
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct-check.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct-check.cmake
new file mode 100644
index 0000000..b2a553b
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct-check.cmake
@@ -0,0 +1,47 @@
+set(log "${RunCMake_BINARY_DIR}/CustomCommandDepfileAsByproduct-build/build.ninja")
+file(READ "${log}" build_file)
+
+set(RunCMake_TEST_FAILED)
+if(NOT "${build_file}" MATCHES "depfile = test\\.d")
+ string(CONCAT no_test_d "Log file:\n ${log}\n" "does not have expected line: depfile = test.d")
+ list(APPEND RunCMake_TEST_FAILED "${no_test_d}")
+endif()
+if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d")
+ string(CONCAT no_test_Debug_d "\nLog file:\n ${log}\n" "does not have expected line: depfile = test_Debug.d")
+ list(APPEND RunCMake_TEST_FAILED "${no_test_Debug_d}")
+endif()
+
+function(_run_ninja dir)
+ execute_process(
+ COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN}
+ WORKING_DIRECTORY "${dir}"
+ OUTPUT_VARIABLE ninja_stdout
+ ERROR_VARIABLE ninja_stderr
+ RESULT_VARIABLE ninja_result
+ )
+ if(NOT ninja_result EQUAL 0)
+ message(STATUS "
+============ beginning of ninja's stdout ============
+${ninja_stdout}
+=============== end of ninja's stdout ===============
+")
+ message(STATUS "
+============ beginning of ninja's stderr ============
+${ninja_stderr}
+=============== end of ninja's stderr ===============
+")
+ message(FATAL_ERROR
+ "top ninja build failed exited with status ${ninja_result}")
+ endif()
+ set(ninja_stdout "${ninja_stdout}" PARENT_SCOPE)
+endfunction()
+
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsByproduct-build")
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsByproduct-build" -t deps hello.copy.c)
+if (NOT ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja tracked the deps of hello.copy.c in the database")
+endif ()
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsByproduct-build" -t deps hello.copy2.c)
+if (NOT ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja tracked the deps of hello.copy2.c in the database")
+endif ()
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct.cmake
new file mode 100644
index 0000000..cf3b35d
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CustomCommandDepfileAsByproduct.cmake
@@ -0,0 +1,24 @@
+add_custom_command(
+ OUTPUT hello.copy.c
+ BYPRODUCTS "test.d"
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/hello.c"
+ hello.copy.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test.d"
+ )
+
+add_custom_command(
+ OUTPUT hello.copy2.c
+ BYPRODUCTS "test_$<CONFIG>.d"
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/hello.c"
+ hello.copy2.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test_$<CONFIG>.d"
+ )
+
+add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hello.copy.c"
+ "${CMAKE_CURRENT_BINARY_DIR}/hello.copy2.c")
+
+include(CheckNoPrefixSubDir.cmake)
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput-check.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput-check.cmake
new file mode 100644
index 0000000..4d738c8
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput-check.cmake
@@ -0,0 +1,47 @@
+set(log "${RunCMake_BINARY_DIR}/CustomCommandDepfileAsOutput-build/build.ninja")
+file(READ "${log}" build_file)
+
+set(RunCMake_TEST_FAILED)
+if(NOT "${build_file}" MATCHES "depfile = test\\.d")
+ string(CONCAT no_test_d "Log file:\n ${log}\n" "does not have expected line: depfile = test.d")
+ list(APPEND RunCMake_TEST_FAILED "${no_test_d}")
+endif()
+if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d")
+ string(CONCAT no_test_Debug_d "\nLog file:\n ${log}\n" "does not have expected line: depfile = test_Debug.d")
+ list(APPEND RunCMake_TEST_FAILED "${no_test_Debug_d}")
+endif()
+
+function(_run_ninja dir)
+ execute_process(
+ COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN}
+ WORKING_DIRECTORY "${dir}"
+ OUTPUT_VARIABLE ninja_stdout
+ ERROR_VARIABLE ninja_stderr
+ RESULT_VARIABLE ninja_result
+ )
+ if(NOT ninja_result EQUAL 0)
+ message(STATUS "
+============ beginning of ninja's stdout ============
+${ninja_stdout}
+=============== end of ninja's stdout ===============
+")
+ message(STATUS "
+============ beginning of ninja's stderr ============
+${ninja_stderr}
+=============== end of ninja's stderr ===============
+")
+ message(FATAL_ERROR
+ "top ninja build failed exited with status ${ninja_result}")
+ endif()
+ set(ninja_stdout "${ninja_stdout}" PARENT_SCOPE)
+endfunction()
+
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsOutput-build")
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsOutput-build" -t deps hello.copy.c)
+if (NOT ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja tracked the deps of hello.copy.c in the database")
+endif ()
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsOutput-build" -t deps hello.copy2.c)
+if (NOT ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja tracked the deps of hello.copy2.c in the database")
+endif ()
diff --git a/Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput.cmake b/Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput.cmake
new file mode 100644
index 0000000..07a12b7
--- /dev/null
+++ b/Tests/RunCMake/Ninja/CustomCommandDepfileAsOutput.cmake
@@ -0,0 +1,24 @@
+add_custom_command(
+ OUTPUT hello.copy.c
+ "test.d"
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/hello.c"
+ hello.copy.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test.d"
+ )
+
+add_custom_command(
+ OUTPUT hello.copy2.c
+ "test_$<CONFIG>.d"
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/hello.c"
+ hello.copy2.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test_$<CONFIG>.d"
+ )
+
+add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hello.copy.c"
+ "${CMAKE_CURRENT_BINARY_DIR}/hello.copy2.c")
+
+include(CheckNoPrefixSubDir.cmake)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 13d9620..f020f0d 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -100,6 +100,8 @@ run_CMP0058(NEW-no)
run_CMP0058(NEW-by)
run_cmake_with_options(CustomCommandDepfile -DCMAKE_BUILD_TYPE=Debug)
+run_cmake_with_options(CustomCommandDepfileAsOutput -DCMAKE_BUILD_TYPE=Debug)
+run_cmake_with_options(CustomCommandDepfileAsByproduct -DCMAKE_BUILD_TYPE=Debug)
run_cmake(CustomCommandJobPool)
run_cmake(JobPoolUsesTerminal)
diff --git a/Tests/RunCMake/Ninja/dep.c b/Tests/RunCMake/Ninja/dep.c
index 728f031..a576b6e 100644
--- a/Tests/RunCMake/Ninja/dep.c
+++ b/Tests/RunCMake/Ninja/dep.c
@@ -1,4 +1,4 @@
-int dep()
+int dep(void)
{
return 0;
}
diff --git a/Tests/RunCMake/Ninja/top.c b/Tests/RunCMake/Ninja/top.c
index 4a88eb2..0358244 100644
--- a/Tests/RunCMake/Ninja/top.c
+++ b/Tests/RunCMake/Ninja/top.c
@@ -1,7 +1,7 @@
#include "command.h"
#include "target.h"
-int top()
+int top(void)
{
return 0;
}
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake
index 3674aba..673391c 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfile-check.cmake
@@ -10,3 +10,38 @@ if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d")
string(CONCAT no_test_Debug_d "\nLog file:\n ${log}\n" "does not have expected line: depfile = test_Debug.d")
list(APPEND RunCMake_TEST_FAILED "${no_test_Debug_d}")
endif()
+
+function(_run_ninja dir)
+ execute_process(
+ COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN}
+ WORKING_DIRECTORY "${dir}"
+ OUTPUT_VARIABLE ninja_stdout
+ ERROR_VARIABLE ninja_stderr
+ RESULT_VARIABLE ninja_result
+ )
+ if(NOT ninja_result EQUAL 0)
+ message(STATUS "
+============ beginning of ninja's stdout ============
+${ninja_stdout}
+=============== end of ninja's stdout ===============
+")
+ message(STATUS "
+============ beginning of ninja's stderr ============
+${ninja_stderr}
+=============== end of ninja's stderr ===============
+")
+ message(FATAL_ERROR
+ "top ninja build failed exited with status ${ninja_result}")
+ endif()
+ set(ninja_stdout "${ninja_stdout}" PARENT_SCOPE)
+endfunction()
+
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfile-build")
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfile-build" -t deps main.copy.c)
+if (ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja did not track the deps of main.copy.c in the database")
+endif ()
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfile-build" -t deps main.copy2.c)
+if (ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja did not track the deps of main.copy2.c in the database")
+endif ()
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct-check.cmake
new file mode 100644
index 0000000..ced40ab
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct-check.cmake
@@ -0,0 +1,47 @@
+set(log "${RunCMake_BINARY_DIR}/CustomCommandDepfileAsByproduct-build/CMakeFiles/impl-Debug.ninja")
+file(READ "${log}" build_file)
+
+set(RunCMake_TEST_FAILED)
+if(NOT "${build_file}" MATCHES "depfile = test\\.d")
+ string(CONCAT no_test_d "Log file:\n ${log}\n" "does not have expected line: depfile = test.d")
+ list(APPEND RunCMake_TEST_FAILED "${no_test_d}")
+endif()
+if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d")
+ string(CONCAT no_test_Debug_d "\nLog file:\n ${log}\n" "does not have expected line: depfile = test_Debug.d")
+ list(APPEND RunCMake_TEST_FAILED "${no_test_Debug_d}")
+endif()
+
+function(_run_ninja dir)
+ execute_process(
+ COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN}
+ WORKING_DIRECTORY "${dir}"
+ OUTPUT_VARIABLE ninja_stdout
+ ERROR_VARIABLE ninja_stderr
+ RESULT_VARIABLE ninja_result
+ )
+ if(NOT ninja_result EQUAL 0)
+ message(STATUS "
+============ beginning of ninja's stdout ============
+${ninja_stdout}
+=============== end of ninja's stdout ===============
+")
+ message(STATUS "
+============ beginning of ninja's stderr ============
+${ninja_stderr}
+=============== end of ninja's stderr ===============
+")
+ message(FATAL_ERROR
+ "top ninja build failed exited with status ${ninja_result}")
+ endif()
+ set(ninja_stdout "${ninja_stdout}" PARENT_SCOPE)
+endfunction()
+
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsByproduct-build")
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsByproduct-build" -t deps main.copy.c)
+if (NOT ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja tracked the deps of main.copy.c in the database")
+endif ()
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsByproduct-build" -t deps main.copy2.c)
+if (NOT ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja tracked the deps of main.copy2.c in the database")
+endif ()
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct.cmake
new file mode 100644
index 0000000..e1e49cb
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsByproduct.cmake
@@ -0,0 +1,22 @@
+add_custom_command(
+ OUTPUT main.copy.c
+ BYPRODUCTS "test.d"
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/main.c"
+ main.copy.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test.d"
+ )
+
+add_custom_command(
+ OUTPUT main.copy2.c
+ BYPRODUCTS "test_$<CONFIG>.d"
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/main.c"
+ main.copy2.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test_$<CONFIG>.d"
+ )
+
+add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/main.copy.c"
+ "${CMAKE_CURRENT_BINARY_DIR}/main.copy2.c")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput-check.cmake
new file mode 100644
index 0000000..d4a87ba
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput-check.cmake
@@ -0,0 +1,47 @@
+set(log "${RunCMake_BINARY_DIR}/CustomCommandDepfileAsOutput-build/CMakeFiles/impl-Debug.ninja")
+file(READ "${log}" build_file)
+
+set(RunCMake_TEST_FAILED)
+if(NOT "${build_file}" MATCHES "depfile = test\\.d")
+ string(CONCAT no_test_d "Log file:\n ${log}\n" "does not have expected line: depfile = test.d")
+ list(APPEND RunCMake_TEST_FAILED "${no_test_d}")
+endif()
+if(NOT "${build_file}" MATCHES "depfile = test_Debug\\.d")
+ string(CONCAT no_test_Debug_d "\nLog file:\n ${log}\n" "does not have expected line: depfile = test_Debug.d")
+ list(APPEND RunCMake_TEST_FAILED "${no_test_Debug_d}")
+endif()
+
+function(_run_ninja dir)
+ execute_process(
+ COMMAND "${RunCMake_MAKE_PROGRAM}" ${ARGN}
+ WORKING_DIRECTORY "${dir}"
+ OUTPUT_VARIABLE ninja_stdout
+ ERROR_VARIABLE ninja_stderr
+ RESULT_VARIABLE ninja_result
+ )
+ if(NOT ninja_result EQUAL 0)
+ message(STATUS "
+============ beginning of ninja's stdout ============
+${ninja_stdout}
+=============== end of ninja's stdout ===============
+")
+ message(STATUS "
+============ beginning of ninja's stderr ============
+${ninja_stderr}
+=============== end of ninja's stderr ===============
+")
+ message(FATAL_ERROR
+ "top ninja build failed exited with status ${ninja_result}")
+ endif()
+ set(ninja_stdout "${ninja_stdout}" PARENT_SCOPE)
+endfunction()
+
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsOutput-build")
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsOutput-build" -t deps main.copy.c)
+if (NOT ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja tracked the deps of main.copy.c in the database")
+endif ()
+_run_ninja("${RunCMake_BINARY_DIR}/CustomCommandDepfileAsOutput-build" -t deps main.copy2.c)
+if (NOT ninja_stdout MATCHES "deps not found")
+ list(APPEND RunCMake_TEST_FAILED "Ninja tracked the deps of main.copy2.c in the database")
+endif ()
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput.cmake
new file mode 100644
index 0000000..0617970
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandDepfileAsOutput.cmake
@@ -0,0 +1,22 @@
+add_custom_command(
+ OUTPUT main.copy.c
+ "test.d"
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/main.c"
+ main.copy.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test.d"
+ )
+
+add_custom_command(
+ OUTPUT main.copy2.c
+ "test_$<CONFIG>.d"
+ COMMAND "${CMAKE_COMMAND}" -E copy
+ "${CMAKE_CURRENT_SOURCE_DIR}/main.c"
+ main.copy2.c
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+ DEPFILE "test_$<CONFIG>.d"
+ )
+
+add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/main.copy.c"
+ "${CMAKE_CURRENT_BINARY_DIR}/main.copy2.c")
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 0ccf8e8..5c6a22d 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -388,6 +388,8 @@ unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_BINARY_DIR)
run_cmake(CustomCommandDepfile)
+run_cmake(CustomCommandDepfileAsOutput)
+run_cmake(CustomCommandDepfileAsByproduct)
set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all")
run_cmake(PerConfigSources)
diff --git a/Tests/RunCMake/ObjectLibrary/exe.c b/Tests/RunCMake/ObjectLibrary/exe.c
index 2e08700..25d7784 100644
--- a/Tests/RunCMake/ObjectLibrary/exe.c
+++ b/Tests/RunCMake/ObjectLibrary/exe.c
@@ -5,7 +5,7 @@
#endif
extern IMPORT int b(void);
-int main()
+int main(void)
{
return b();
}
diff --git a/Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input b/Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input
new file mode 100644
index 0000000..c567f06
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.input
@@ -0,0 +1,20 @@
+CMAKE_LANG=Fortran
+CMAKE_LINKER=
+CMAKE_Fortran_COMPILER_ABI=
+CMAKE_Fortran_COMPILER_AR=
+CMAKE_Fortran_COMPILER_ARCHITECTURE_ID=x64
+CMAKE_Fortran_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_Fortran_COMPILER_ID=LLVMFlang
+CMAKE_Fortran_COMPILER_LAUNCHER=
+CMAKE_Fortran_COMPILER_LOADED=1
+CMAKE_Fortran_COMPILER_RANLIB=
+CMAKE_Fortran_COMPILER_TARGET=
+CMAKE_Fortran_COMPILER_VERSION=18.0.0
+CMAKE_Fortran_COMPILER_VERSION_INTERAL=
+CMAKE_Fortran_SIMULATE_ID=MSVC
+flang-new version 18.0.0
+Target: x86_64-pc-windows-msvc
+Thread model: posix
+InstalledDir: C:\DoesNotExist\LLVM\bin
+ "C:\\DoesNotExist\\LLVM\\bin\\flang-new" -fc1 -triple x86_64-pc-windows-msvc19.36.32543 -emit-obj -mrelocation-model pic -pic-level 2 -target-cpu x86-64 --dependent-lib=clang_rt.builtins-x86_64.lib -D_MT --dependent-lib=libcmt --dependent-lib=Fortran_main.static.lib --dependent-lib=FortranRuntime.static.lib --dependent-lib=FortranDecimal.static.lib -D_MSC_VER=1936 -D_MSC_FULL_VER=193632543 -D_WIN32 -D_M_X64=100 -mframe-pointer=none -o "C:\\DoesNotExist\\Temp\\CMakeFortranCompilerABI-e91f95.o" -x f95-cpp-input CMakeFortranCompilerABI.F
+ "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Tools\\MSVC\\14.36.32532\\bin\\Hostx64\\x64\\link.exe" -out:a.exe "-libpath:C:\\DoesNotExist\\LLVM\\lib" /WHOLEARCHIVE:Fortran_main.static.lib /subsystem:console "-libpath:C:\\DoesNotExist\\LLVM\\lib\\clang\\18\\lib\\windows" -nologo "C:\\DoesNotExist\\Temp\\CMakeFortranCompilerABI-e91f95.o"
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
index 04998a2..0ede9ee 100644
--- a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
@@ -43,6 +43,7 @@ set(targets
openbsd-C-Clang-5.0.1 openbsd-CXX-Clang-5.0.1
sunos-C-SunPro-5.13.0 sunos-CXX-SunPro-5.13.0 sunos-Fortran-SunPro-8.8.0
windows_x86_64-C-Clang-17.0.1-MSVC windows_x86_64-CXX-Clang-17.0.1-MSVC windows_x86_64-Fortran-LLVMFlang-17.0.1-MSVC
+ windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC
windows_arm64-C-Clang-17.0.1-MSVC windows_arm64-CXX-Clang-17.0.1-MSVC windows_arm64-Fortran-LLVMFlang-17.0.1-MSVC
)
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output
new file mode 100644
index 0000000..c8266a5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/windows_x86_64-Fortran-LLVMFlang-18.0.0-MSVC.output
@@ -0,0 +1,2 @@
+libs=
+dirs=C:/DoesNotExist/LLVM/lib;C:/DoesNotExist/LLVM/lib/clang/18/lib/windows
diff --git a/Tests/RunCMake/PrecompileHeaders/foo.c b/Tests/RunCMake/PrecompileHeaders/foo.c
index eb88726..a4710fd 100644
--- a/Tests/RunCMake/PrecompileHeaders/foo.c
+++ b/Tests/RunCMake/PrecompileHeaders/foo.c
@@ -2,12 +2,12 @@
#include "foo2.h"
-int foo()
+int foo(void)
{
return 0;
}
-int foo2()
+int foo2(void)
{
return 0;
}
diff --git a/Tests/RunCMake/PrecompileHeaders/foobar.c b/Tests/RunCMake/PrecompileHeaders/foobar.c
index 97d465c..71ebe37 100644
--- a/Tests/RunCMake/PrecompileHeaders/foobar.c
+++ b/Tests/RunCMake/PrecompileHeaders/foobar.c
@@ -2,7 +2,7 @@
#include "foo.h"
#include "foo2.h"
-int main()
+int main(void)
{
int zeroSize = 0;
diff --git a/Tests/RunCMake/PrecompileHeaders/include/bar.h b/Tests/RunCMake/PrecompileHeaders/include/bar.h
index 5feb983..89a156c 100644
--- a/Tests/RunCMake/PrecompileHeaders/include/bar.h
+++ b/Tests/RunCMake/PrecompileHeaders/include/bar.h
@@ -1,7 +1,7 @@
#ifndef bar_h
#define bar_h
-static int bar()
+static int bar(void)
{
return 0;
}
diff --git a/Tests/RunCMake/PrintHelpers/nothing.c b/Tests/RunCMake/PrintHelpers/nothing.c
index 32b7b39..1d11f33 100644
--- a/Tests/RunCMake/PrintHelpers/nothing.c
+++ b/Tests/RunCMake/PrintHelpers/nothing.c
@@ -1,6 +1,6 @@
#include "nothing.h"
-void nothing()
+void nothing(void)
{
(void*)0;
}
diff --git a/Tests/RunCMake/PrintHelpers/something.c b/Tests/RunCMake/PrintHelpers/something.c
index a2bc425..90482c9 100644
--- a/Tests/RunCMake/PrintHelpers/something.c
+++ b/Tests/RunCMake/PrintHelpers/something.c
@@ -1,6 +1,6 @@
#include "something.h"
-int main()
+int main(void)
{
nothing();
return 0;
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index fcf904e..179c80e 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -323,5 +323,21 @@ function(ensure_files_match expected_file actual_file)
endif()
endfunction()
+# Get the user id on unix if possible.
+function(get_unix_uid var)
+ set("${var}" "" PARENT_SCOPE)
+ if(UNIX)
+ set(ID "id")
+ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND EXISTS "/usr/xpg4/bin/id")
+ set (ID "/usr/xpg4/bin/id")
+ endif()
+ execute_process(COMMAND ${ID} -u $ENV{USER} OUTPUT_VARIABLE uid ERROR_QUIET
+ RESULT_VARIABLE status OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(status EQUAL 0)
+ set("${var}" "${uid}" PARENT_SCOPE)
+ endif()
+ endif()
+endfunction()
+
# Protect RunCMake tests from calling environment.
unset(ENV{MAKEFLAGS})
diff --git a/Tests/RunCMake/SourceProperties/empty.c b/Tests/RunCMake/SourceProperties/empty.c
index a9ec102..768abc2 100644
--- a/Tests/RunCMake/SourceProperties/empty.c
+++ b/Tests/RunCMake/SourceProperties/empty.c
@@ -1,5 +1,5 @@
-int empty()
+int empty(void)
{
return 0;
}
diff --git a/Tests/RunCMake/Swift/CMP0157-NEW-stderr.txt b/Tests/RunCMake/Swift/CMP0157-NEW-stderr.txt
new file mode 100644
index 0000000..82adcda
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-NEW-stderr.txt
@@ -0,0 +1,3 @@
+CMake Warning \(dev\) in CMakeLists.txt:
+ Unknown Swift_COMPILATION_MODE on target 'greetings_who_knows'
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Swift/CMP0157-NEW.cmake b/Tests/RunCMake/Swift/CMP0157-NEW.cmake
new file mode 100644
index 0000000..96c2ff4
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-NEW.cmake
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.28)
+
+cmake_policy(SET CMP0157 NEW)
+include(CMP0157-common.cmake)
diff --git a/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt b/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt
new file mode 100644
index 0000000..0955c61
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt
@@ -0,0 +1 @@
+swiftc .* -output-file-map CMakeFiles/greetings_default.dir//output-file-map.json .*
diff --git a/Tests/RunCMake/Swift/CMP0157-OLD.cmake b/Tests/RunCMake/Swift/CMP0157-OLD.cmake
new file mode 100644
index 0000000..6b0ec94
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-OLD.cmake
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.28)
+
+cmake_policy(SET CMP0157 OLD)
+include(CMP0157-common.cmake)
diff --git a/Tests/RunCMake/Swift/CMP0157-WARN.cmake b/Tests/RunCMake/Swift/CMP0157-WARN.cmake
new file mode 100644
index 0000000..7d8c01d
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-WARN.cmake
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.28)
+
+include(CMP0157-common.cmake)
diff --git a/Tests/RunCMake/Swift/CMP0157-common.cmake b/Tests/RunCMake/Swift/CMP0157-common.cmake
new file mode 100644
index 0000000..53f14f6
--- /dev/null
+++ b/Tests/RunCMake/Swift/CMP0157-common.cmake
@@ -0,0 +1,19 @@
+enable_language(Swift)
+
+add_executable(greetings_default hello.swift)
+
+add_executable(greetings_wmo hello.swift)
+set_target_properties(greetings_wmo PROPERTIES
+ Swift_COMPILATION_MODE "wholemodule")
+
+add_executable(greetings_incremental hello.swift)
+set_target_properties(greetings_incremental PROPERTIES
+ Swift_COMPILATION_MODE "incremental")
+
+add_executable(greetings_singlefile hello.swift)
+set_target_properties(greetings_singlefile PROPERTIES
+ Swift_COMPILATION_MODE "singlefile")
+
+add_executable(greetings_who_knows hello.swift)
+set_target_properties(greetings_who_knows PROPERTIES
+ Swift_COMPILATION_MODE "not-a-real-mode")
diff --git a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
index bb08a49..d644d6b 100644
--- a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
+++ b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt
@@ -1,3 +1,3 @@
-.*Linking Swift static library libA.a
-.*Linking Swift static library libB.a
-FAILED: libB.a CMakeFiles/B.dir/b.swift.o B.swiftmodule
+.*Building Swift object A.swiftmodule CMakeFiles/A.dir/a.swift.o
+.*Building Swift object B.swiftmodule CMakeFiles/B.dir/b.swift.o
+FAILED: B.swiftmodule CMakeFiles/B.dir/b.swift.o
diff --git a/Tests/RunCMake/Swift/IncrementalSwift.cmake b/Tests/RunCMake/Swift/IncrementalSwift.cmake
index 092269f..08f3fff 100644
--- a/Tests/RunCMake/Swift/IncrementalSwift.cmake
+++ b/Tests/RunCMake/Swift/IncrementalSwift.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
enable_language(Swift)
# Write initial files to build directory
diff --git a/Tests/RunCMake/Swift/NoWorkToDo.cmake b/Tests/RunCMake/Swift/NoWorkToDo.cmake
index 51c2ff3..02b9195 100644
--- a/Tests/RunCMake/Swift/NoWorkToDo.cmake
+++ b/Tests/RunCMake/Swift/NoWorkToDo.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
enable_language(Swift)
add_executable(hello1 hello.swift)
set_target_properties(hello1 PROPERTIES ENABLE_EXPORTS TRUE)
diff --git a/Tests/RunCMake/Swift/RunCMakeTest.cmake b/Tests/RunCMake/Swift/RunCMakeTest.cmake
index 5537c01..184b461 100644
--- a/Tests/RunCMake/Swift/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Swift/RunCMakeTest.cmake
@@ -1,11 +1,15 @@
include(RunCMake)
if(RunCMake_GENERATOR STREQUAL Xcode)
- if(XCODE_BELOW_6_1)
+ if(XCODE_VERSION VERSION_LESS 6.1)
run_cmake(XcodeTooOld)
+ elseif(CMake_TEST_Swift)
+ run_cmake(CMP0157-NEW)
+ run_cmake(CMP0157-OLD)
+ run_cmake(CMP0157-WARN)
endif()
elseif(RunCMake_GENERATOR STREQUAL Ninja)
- if(CMAKE_Swift_COMPILER)
+ if(CMake_TEST_Swift)
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
run_cmake_with_options(Win32ExecutableDisallowed)
else()
@@ -45,11 +49,27 @@ elseif(RunCMake_GENERATOR STREQUAL Ninja)
run_cmake_command(IncrementalSwift-second ${CMAKE_COMMAND} --build ${IncrementalSwift_TEST_BINARY_DIR} -- -d explain)
endblock()
+ block()
+ set(CMP0157-OLD_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0157-OLD-build)
+ set(CMP0157-OLD_TEST_NO_CLEAN 1)
+ set(CMP0157-OLD_TEST_OUTPUT_MERGE 1)
+
+ run_cmake(CMP0157-NEW)
+ run_cmake(CMP0157-OLD)
+ # -n: dry-run to avoid actually compiling, -v: verbose to capture executed command
+ run_cmake_command(CMP0157-OLD-build ${CMAKE_COMMAND} --build ${CMP0157-OLD_TEST_BINARY_DIR} -- -n -v)
+ run_cmake(CMP0157-WARN)
+ endblock()
+
endif()
elseif(RunCMake_GENERATOR STREQUAL "Ninja Multi-Config")
- if(CMAKE_Swift_COMPILER)
+ if(CMake_TEST_Swift)
set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release")
run_cmake(SwiftSimple)
+
+ run_cmake(CMP0157-NEW)
+ run_cmake(CMP0157-OLD)
+ run_cmake(CMP0157-WARN)
unset(RunCMake_TEST_OPTIONS)
endif()
else()
diff --git a/Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake b/Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake
index 02d5447..5e52911 100644
--- a/Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake
+++ b/Tests/RunCMake/Swift/Win32ExecutableIgnored.cmake
@@ -1,3 +1,4 @@
+cmake_policy(SET CMP0157 NEW)
enable_language(Swift)
add_executable(E E.swift)
set_target_properties(E PROPERTIES
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index c2187ae..11d59b7 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -39,6 +39,8 @@
\* CMP0142
\* CMP0154
\* CMP0155
+ \* CMP0156
+ \* CMP0157
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt b/Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt
index f3c068a..efa7b32 100644
--- a/Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt
+++ b/Tests/RunCMake/ToolchainFile/CMP0126-OLD-stderr.txt
@@ -1 +1,12 @@
-^try_compile CMP0126='OLD' VAR='2'
+^CMake Deprecation Warning at CMP0126-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0126 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\)
++
+try_compile CMP0126='OLD' VAR='2'
diff --git a/Tests/RunCMake/TransformDepfile/noexist-gcc-stderr.txt b/Tests/RunCMake/TransformDepfile/noexist-gcc-stderr.txt
new file mode 100644
index 0000000..8956278
--- /dev/null
+++ b/Tests/RunCMake/TransformDepfile/noexist-gcc-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Warning:
+ Expected depfile does not exist.
+
+ .*/Tests/RunCMake/TransformDepfile/noexist.d$
diff --git a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
index e3643c0..0ec8c42 100644
--- a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
+++ b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
@@ -14,6 +14,13 @@ run_cmake(unitybuild_cxx)
run_cmake(unitybuild_cxx_group)
run_cmake(unitybuild_c_and_cxx)
run_cmake(unitybuild_c_and_cxx_group)
+if(CMake_TEST_OBJC)
+ run_cmake(unitybuild_objc)
+ run_cmake(unitybuild_objc_group)
+ run_cmake(unitybuild_objcxx)
+ run_cmake(unitybuild_objcxx_group)
+ run_cmake(unitybuild_c_and_cxx_and_objc_and_objcxx)
+endif()
run_cmake(unitybuild_batchsize)
run_cmake(unitybuild_default_batchsize)
run_cmake(unitybuild_skip)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_and_objc_and_objcxx.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_and_objc_and_objcxx.cmake
new file mode 100644
index 0000000..096a86b
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx_and_objc_and_objcxx.cmake
@@ -0,0 +1,25 @@
+project(unitybuild_c_and_cxx_and_objc_and_objcxx C CXX OBJC OBJCXX)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src_c "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src_c}" "int s${s}(void) { return 0; }\n")
+
+ set(src_cxx "${CMAKE_CURRENT_BINARY_DIR}/s${s}.cxx")
+ file(WRITE "${src_cxx}" "int s${s}(void) { return 0; }\n")
+
+ set(src_objc "${CMAKE_CURRENT_BINARY_DIR}/s${s}.m")
+ file(WRITE "${src_objc}" "int s${s}(void) { return 0; }\n")
+
+ set(src_objcxx "${CMAKE_CURRENT_BINARY_DIR}/s${s}.mm")
+ file(WRITE "${src_objcxx}" "int s${s}(void) { return 0; }\n")
+
+ list(APPEND srcs "${src_c}")
+ list(APPEND srcs "${src_cxx}")
+ list(APPEND srcs "${src_objc}")
+ list(APPEND srcs "${src_objcxx}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_objc.cmake b/Tests/RunCMake/UnityBuild/unitybuild_objc.cmake
new file mode 100644
index 0000000..cc88d98
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_objc.cmake
@@ -0,0 +1,12 @@
+project(unitybuild_objc OBJC)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.m")
+ 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)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_objc_group.cmake b/Tests/RunCMake/UnityBuild/unitybuild_objc_group.cmake
new file mode 100644
index 0000000..384c98a
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_objc_group.cmake
@@ -0,0 +1,27 @@
+project(unitybuild_objc_group OBJC)
+
+set(srcs "")
+foreach(s RANGE 1 4)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.m")
+ 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}.m")
+ 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.m s2.m odr1.m
+ PROPERTIES UNITY_GROUP "a"
+ )
+set_source_files_properties(s3.m s4.m odr2.m
+ PROPERTIES UNITY_GROUP "b"
+ )
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_objcxx.cmake b/Tests/RunCMake/UnityBuild/unitybuild_objcxx.cmake
new file mode 100644
index 0000000..fd0f743
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_objcxx.cmake
@@ -0,0 +1,12 @@
+project(unitybuild_objcxx OBJCXX)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.mm")
+ 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)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_objcxx_group.cmake b/Tests/RunCMake/UnityBuild/unitybuild_objcxx_group.cmake
new file mode 100644
index 0000000..517703e
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_objcxx_group.cmake
@@ -0,0 +1,27 @@
+project(unitybuild_objcxx_group OBJCXX)
+
+set(srcs "")
+foreach(s RANGE 1 4)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.mm")
+ 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}.mm")
+ 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.mm s2.mm odr1.mm
+ PROPERTIES UNITY_GROUP "a"
+ )
+set_source_files_properties(s3.mm s4.mm odr2.mm
+ PROPERTIES UNITY_GROUP "b"
+ )
diff --git a/Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake b/Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake
index a26c278..df14d15 100644
--- a/Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake
+++ b/Tests/RunCMake/UseSWIG/CMP0122-NEW-check.cmake
@@ -1,5 +1,5 @@
-cmake_policy(VERSION 3.1)
+cmake_policy(VERSION 3.5)
file(STRINGS "${RunCMake_TEST_BINARY_DIR}/CMP0122-library-name.txt" prefixes)
diff --git a/Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake b/Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake
index 01657d0..6eb5c20 100644
--- a/Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake
+++ b/Tests/RunCMake/UseSWIG/CMP0122-OLD-check.cmake
@@ -1,5 +1,5 @@
-cmake_policy(VERSION 3.1)
+cmake_policy(VERSION 3.5)
file(STRINGS "${RunCMake_TEST_BINARY_DIR}/CMP0122-library-name.txt" prefixes)
diff --git a/Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt b/Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt
new file mode 100644
index 0000000..84f2ee7
--- /dev/null
+++ b/Tests/RunCMake/UseSWIG/CMP0122-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0122-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0122 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/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 669049a..e0d74cf 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -11,6 +11,9 @@ run_cmake(CustomCommandGenex)
if(NOT RunCMake_GENERATOR MATCHES "^Visual Studio 1[1-5] ")
run_cmake(CustomCommandParallel)
endif()
+run_cmake_with_options(VsCharacterSet -DSET_CHARSET=MultiByte)
+run_cmake_with_options(VsCharacterSet -DSET_CHARSET=Unicode)
+run_cmake_with_options(VsCharacterSet -DSET_CHARSET=NotSet)
run_cmake(VsCsharpSourceGroup)
run_cmake(VsCSharpCompilerOpts)
run_cmake(ExplicitCMakeLists)
diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
index 17e7b46..c904cd0 100644
--- a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
+++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
@@ -27,7 +27,7 @@ foreach(line IN LISTS tgt_projects_strings)
endif()
endforeach()
-string(REPLACE "\\" "/" unity_source_line ${unity_source_line})
+string(REPLACE "\\" "/" unity_source_line "${unity_source_line}")
string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0_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.")
diff --git a/Tests/RunCMake/VS10Project/VsCharacterSet-check.cmake b/Tests/RunCMake/VS10Project/VsCharacterSet-check.cmake
new file mode 100644
index 0000000..93770a1
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCharacterSet-check.cmake
@@ -0,0 +1,49 @@
+macro(check_project_file projectFile outvar)
+ set(insideConfiguration FALSE)
+ set(characterSetFound FALSE)
+
+ if(NOT EXISTS "${projectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+ return()
+ endif()
+
+ string(REPLACE "${RunCMake_TEST_BINARY_DIR}/" "" projectName ${projectFile})
+
+ file(STRINGS "${projectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<PropertyGroup Condition=\"'[$][(]Configuration[)]|[$][(]Platform[)]'=='([^\"])+\" Label=\"Configuration\">.*$")
+ set(insideConfiguration TRUE)
+ elseif(insideConfiguration)
+ if(line MATCHES "^ *</PropertyGroup>.*$")
+ set(insideConfiguration FALSE)
+ elseif(line MATCHES "^ *<CharacterSet>(.+)</CharacterSet>*$")
+ message(STATUS "Found CharacterSet = ${CMAKE_MATCH_1} in PropertyGroup 'Configuration' in ${projectName}")
+ set(characterSetFound TRUE)
+ set(${outvar} ${CMAKE_MATCH_1})
+ endif()
+ endif()
+ endforeach()
+ if(NOT characterSetFound)
+ set(RunCMake_TEST_FAILED "CharacterSet not found in \"Configuration\" propertygroup in ${projectName}")
+ return() # This should intentionally return from the caller, not the macro
+ endif()
+endmacro()
+
+check_project_file("${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CompilerIdCXX/CompilerIdCXX.vcxproj" MULTI_BYTE_CHARSET)
+check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj" OVERRIDDEN_CHARSET)
+
+if (NOT "${MULTI_BYTE_CHARSET}" STREQUAL "MultiByte")
+ set(RunCMake_TEST_FAILED "Default character-set (\"MultiByte\") was overridden (it shouldn't)")
+ return()
+endif()
+
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/set_charset.txt")
+ set(RunCMake_TEST_FAILED "File 'set_charset.txt' with set charset does not exist.")
+ return()
+endif()
+file(STRINGS "${RunCMake_TEST_BINARY_DIR}/set_charset.txt" SET_CHARSET)
+
+if (NOT "${OVERRIDDEN_CHARSET}" STREQUAL "${SET_CHARSET}")
+ set(RunCMake_TEST_FAILED "Failed to override the character-set with \"${SET_CHARSET}\"")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCharacterSet.cmake b/Tests/RunCMake/VS10Project/VsCharacterSet.cmake
new file mode 100644
index 0000000..c8c3e0e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCharacterSet.cmake
@@ -0,0 +1,17 @@
+enable_language(CXX)
+
+# Write value of `SET_CHARSET` for comparison later.
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/set_charset.txt" "${SET_CHARSET}")
+
+# Set macro which determines the character-set.
+if("${SET_CHARSET}" STREQUAL "MultiByte")
+ add_compile_definitions(_MBCS=1)
+endif()
+if("${SET_CHARSET}" STREQUAL "NotSet")
+ add_compile_definitions(_SBCS=1)
+endif()
+if("${SET_CHARSET}" STREQUAL "Unicode")
+ add_compile_definitions(_UNICODE=1)
+endif()
+
+add_library(foo foo.cpp)
diff --git a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake
index 9a13892..fad088f 100644
--- a/Tests/RunCMake/XcFramework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcFramework/RunCMakeTest.cmake
@@ -119,3 +119,173 @@ unset(RunCMake_TEST_BINARY_DIR)
run_cmake(find-library)
run_cmake_command(find-library-script ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/find-library.cmake)
+
+file(REMOVE_RECURSE ${RunCMake_BINARY_DIR}/export-install)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/export-macos-build)
+run_cmake_with_options(export-macos -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/export-install)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(export-macos-build ${CMAKE_COMMAND} --build . ${_config_arg})
+run_cmake_command(export-macos-install ${CMAKE_COMMAND} --install . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/export-ios-build)
+run_cmake_with_options(export-ios -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos "-DCMAKE_OSX_ARCHITECTURES=arm64" -DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/export-install)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(export-ios-build ${CMAKE_COMMAND} --build . ${_config_arg})
+run_cmake_command(export-ios-install ${CMAKE_COMMAND} --install . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/export-ios-simulator-build)
+run_cmake_with_options(export-ios-simulator -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator "-DCMAKE_OSX_ARCHITECTURES=${macos_archs_1}" -DCMAKE_INSTALL_PREFIX=${RunCMake_BINARY_DIR}/export-install)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(export-ios-simulator-build ${CMAKE_COMMAND} --build . ${_config_arg})
+run_cmake_command(export-ios-simulator-install ${CMAKE_COMMAND} --install . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/import-macos-install-specific-no-xcframework-build)
+run_cmake_with_options(import-macos-install-specific-no-xcframework -DCMAKE_SYSTEM_NAME=Darwin -Dmylib_DIR=${RunCMake_BINARY_DIR}/export-install/lib/macos/cmake/mylib)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+set(_config_dir)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+ set(_config_dir /Release)
+endif()
+run_cmake_command(import-macos-install-specific-no-xcframework-build ${CMAKE_COMMAND} --build . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_NO_CLEAN 1)
+if(CMake_TEST_XCODE_VERSION VERSION_GREATER_EQUAL 15)
+ # 'xcodebuild -create-xcframework' fails on symlinked paths.
+ file(REAL_PATH "${RunCMake_SOURCE_DIR}" src_dir)
+ file(REAL_PATH "${RunCMake_BINARY_DIR}" bld_dir)
+else()
+ set(src_dir "${RunCMake_SOURCE_DIR}")
+ set(bld_dir "${RunCMake_BINARY_DIR}")
+endif()
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/export-install)
+run_cmake_command(export-install-xcframework xcodebuild -create-xcframework
+ -output ${bld_dir}/export-install/lib/mylib.xcframework
+ -library ${bld_dir}/export-install/lib/macos/libmylib.a
+ -headers ${src_dir}/mylib/include
+ -library ${bld_dir}/export-install/lib/ios/libmylib.a
+ -headers ${src_dir}/mylib/include
+ -library ${bld_dir}/export-install/lib/ios-simulator/libmylib.a
+ -headers ${src_dir}/mylib/include
+ )
+run_cmake_command(export-install-xcframework-genex xcodebuild -create-xcframework
+ -output ${bld_dir}/export-install/lib2/mylib-genex.xcframework
+ -library ${bld_dir}/export-install/lib/macos/libmylib-genex.a
+ -headers ${src_dir}/mylib/include
+ -library ${bld_dir}/export-install/lib/ios/libmylib-genex.a
+ -headers ${src_dir}/mylib/include
+ -library ${bld_dir}/export-install/lib/ios-simulator/libmylib-genex.a
+ -headers ${src_dir}/mylib/include
+ )
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/export-macos-build)
+run_cmake_command(export-build-macos-xcframework xcodebuild -create-xcframework
+ -output ${bld_dir}/export-macos-build/lib/mylib.xcframework
+ -library ${bld_dir}/export-macos-build/lib/macos${_config_dir}/libmylib.a
+ -headers ${src_dir}/mylib/include
+ )
+run_cmake_command(export-build-macos-xcframework-genex xcodebuild -create-xcframework
+ -output ${bld_dir}/export-macos-build/lib/mylib-genex.xcframework
+ -library ${bld_dir}/export-macos-build/lib/macos${_config_dir}/libmylib-genex.a
+ -headers ${src_dir}/mylib/include
+ )
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/import-macos-install-specific-build)
+run_cmake_with_options(import-macos-install-specific -DCMAKE_SYSTEM_NAME=Darwin -Dmylib_DIR=${RunCMake_BINARY_DIR}/export-install/lib/macos/cmake/mylib)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(import-macos-install-specific-build ${CMAKE_COMMAND} --build . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/import-macos-build-specific-build)
+run_cmake_with_options(import-macos-build-specific -DCMAKE_SYSTEM_NAME=Darwin -Dmylib_DIR=${RunCMake_BINARY_DIR}/export-macos-build/lib/macos/cmake/mylib)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(import-macos-build-specific-build ${CMAKE_COMMAND} --build . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/import-macos-install-specific-genex-build)
+run_cmake_with_options(import-macos-install-specific-genex -DCMAKE_SYSTEM_NAME=Darwin -Dmylib_DIR=${RunCMake_BINARY_DIR}/export-install/lib/macos/cmake/mylib)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(import-macos-install-specific-genex-build ${CMAKE_COMMAND} --build . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/import-macos-build-specific-genex-build)
+run_cmake_with_options(import-macos-build-specific-genex -DCMAKE_SYSTEM_NAME=Darwin -Dmylib_DIR=${RunCMake_BINARY_DIR}/export-macos-build/lib/macos/cmake/mylib)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(import-macos-build-specific-genex-build ${CMAKE_COMMAND} --build . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/import-macos-install-general-build)
+run_cmake_with_options(import-macos-install-general -DCMAKE_SYSTEM_NAME=Darwin -Dmylib_DIR=${RunCMake_BINARY_DIR}/export-install/lib/cmake/mylib)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(import-macos-install-general-build ${CMAKE_COMMAND} --build . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/import-macos-build-general-build)
+run_cmake_with_options(import-macos-build-general -DCMAKE_SYSTEM_NAME=Darwin -Dmylib_DIR=${RunCMake_BINARY_DIR}/export-macos-build/lib/cmake/mylib)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(import-macos-build-general-build ${CMAKE_COMMAND} --build . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/import-ios-install-general-build)
+run_cmake_with_options(import-ios-install-general -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64 -Dmylib_DIR=${RunCMake_BINARY_DIR}/export-install/lib/cmake/mylib)
+set(RunCMake_TEST_NO_CLEAN 1)
+set(_config_arg)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(_config_arg --config Release)
+endif()
+run_cmake_command(import-ios-install-general-build ${CMAKE_COMMAND} --build . ${_config_arg})
+unset(RunCMake_TEST_NO_CLEAN)
+unset(RunCMake_TEST_BINARY_DIR)
diff --git a/Tests/RunCMake/XcFramework/export-common.cmake b/Tests/RunCMake/XcFramework/export-common.cmake
new file mode 100644
index 0000000..ef2659c
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/export-common.cmake
@@ -0,0 +1,46 @@
+enable_language(C)
+
+include(CMakePackageConfigHelpers)
+
+if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
+endif()
+
+if(CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAKE_SYSTEM_NAME STREQUAL "watchOS" OR CMAKE_SYSTEM_NAME STREQUAL "visionOS")
+ set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
+endif()
+
+add_library(mylib STATIC mylib/mylib.c)
+target_include_directories(mylib INTERFACE $<INSTALL_INTERFACE:include>)
+set_property(TARGET mylib PROPERTY ARCHIVE_OUTPUT_DIRECTORY lib/${platform_name})
+
+add_library(mylib-genex STATIC mylib/mylib.c)
+target_include_directories(mylib-genex INTERFACE $<INSTALL_INTERFACE:include>)
+set_property(TARGET mylib-genex PROPERTY ARCHIVE_OUTPUT_DIRECTORY lib/${platform_name})
+
+install(TARGETS mylib mylib-genex DESTINATION lib/${platform_name} EXPORT mylib)
+install(FILES mylib/include/mylib/mylib.h DESTINATION include/mylib)
+export(SETUP mylib
+ TARGET mylib XCFRAMEWORK_LOCATION lib/mylib.xcframework
+ TARGET mylib-genex XCFRAMEWORK_LOCATION "$<BUILD_INTERFACE:lib/$<TARGET_PROPERTY:NAME>.xcframework>$<INSTALL_INTERFACE:lib2/$<TARGET_PROPERTY:NAME>.xcframework>"
+ )
+install(EXPORT mylib DESTINATION lib/${platform_name}/cmake/mylib FILE mylib-targets.cmake)
+export(EXPORT mylib FILE lib/${platform_name}/cmake/mylib/mylib-targets.cmake)
+
+configure_package_config_file(mylib-config.cmake.in mylib-config-sub.cmake INSTALL_DESTINATION lib/${platform_name}/cmake/mylib)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mylib-config-sub.cmake DESTINATION lib/${platform_name}/cmake/mylib RENAME mylib-config.cmake)
+
+configure_package_config_file(mylib-config.cmake.in lib/${platform_name}/cmake/mylib/mylib-config.cmake INSTALL_DESTINATION lib/${platform_name}/cmake/mylib)
+
+generate_apple_platform_selection_file(mylib-config-top.cmake
+ INSTALL_DESTINATION lib/cmake/mylib
+ MACOS_CONFIG_FILE lib/macos/cmake/mylib/mylib-config.cmake
+ IOS_CONFIG_FILE lib/ios/cmake/mylib/mylib-config.cmake
+ IOS_SIMULATOR_CONFIG_FILE lib/ios-simulator/cmake/mylib/mylib-config.cmake
+ )
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/mylib-config-top.cmake DESTINATION lib/cmake/mylib RENAME mylib-config.cmake)
+
+generate_apple_platform_selection_file(lib/cmake/mylib/mylib-config.cmake
+ INSTALL_DESTINATION lib/cmake/mylib
+ "${platform_arg}" lib/${platform_name}/cmake/mylib/mylib-config.cmake
+ )
diff --git a/Tests/RunCMake/XcFramework/export-ios-simulator.cmake b/Tests/RunCMake/XcFramework/export-ios-simulator.cmake
new file mode 100644
index 0000000..1a4b04e
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/export-ios-simulator.cmake
@@ -0,0 +1,3 @@
+set(platform_name ios-simulator)
+set(platform_arg IOS_SIMULATOR_CONFIG_FILE)
+include(export-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/export-ios.cmake b/Tests/RunCMake/XcFramework/export-ios.cmake
new file mode 100644
index 0000000..606b6a5
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/export-ios.cmake
@@ -0,0 +1,3 @@
+set(platform_name ios)
+set(platform_arg IOS_CONFIG_FILE)
+include(export-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/export-macos.cmake b/Tests/RunCMake/XcFramework/export-macos.cmake
new file mode 100644
index 0000000..64ac1c0
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/export-macos.cmake
@@ -0,0 +1,3 @@
+set(platform_name macos)
+set(platform_arg MACOS_CONFIG_FILE)
+include(export-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/import-common.cmake b/Tests/RunCMake/XcFramework/import-common.cmake
new file mode 100644
index 0000000..4def6a4
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-common.cmake
@@ -0,0 +1,5 @@
+enable_language(C)
+
+find_package(mylib REQUIRED)
+
+add_custom_target(print_loc ALL COMMAND ${CMAKE_COMMAND} -E echo "mylib location: $<TARGET_FILE:mylib>")
diff --git a/Tests/RunCMake/XcFramework/import-genex-common.cmake b/Tests/RunCMake/XcFramework/import-genex-common.cmake
new file mode 100644
index 0000000..e46902b
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-genex-common.cmake
@@ -0,0 +1,5 @@
+enable_language(C)
+
+find_package(mylib REQUIRED)
+
+add_custom_target(print_loc ALL COMMAND ${CMAKE_COMMAND} -E echo "mylib-genex location: $<TARGET_FILE:mylib-genex>")
diff --git a/Tests/RunCMake/XcFramework/import-ios-install-general.cmake b/Tests/RunCMake/XcFramework/import-ios-install-general.cmake
new file mode 100644
index 0000000..08ef6db
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-ios-install-general.cmake
@@ -0,0 +1 @@
+include(import-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/import-macos-build-general-build-stdout.txt b/Tests/RunCMake/XcFramework/import-macos-build-general-build-stdout.txt
new file mode 100644
index 0000000..3ac467d
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-build-general-build-stdout.txt
@@ -0,0 +1,2 @@
+mylib location: [^
+]*/Tests/RunCMake/XcFramework/export-macos-build/lib/mylib\.xcframework/macos-(arm64|x86_64|arm64_x86_64)/libmylib\.a
diff --git a/Tests/RunCMake/XcFramework/import-macos-build-general.cmake b/Tests/RunCMake/XcFramework/import-macos-build-general.cmake
new file mode 100644
index 0000000..08ef6db
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-build-general.cmake
@@ -0,0 +1 @@
+include(import-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/import-macos-build-specific-build-stdout.txt b/Tests/RunCMake/XcFramework/import-macos-build-specific-build-stdout.txt
new file mode 100644
index 0000000..3ac467d
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-build-specific-build-stdout.txt
@@ -0,0 +1,2 @@
+mylib location: [^
+]*/Tests/RunCMake/XcFramework/export-macos-build/lib/mylib\.xcframework/macos-(arm64|x86_64|arm64_x86_64)/libmylib\.a
diff --git a/Tests/RunCMake/XcFramework/import-macos-build-specific-genex-build-stdout.txt b/Tests/RunCMake/XcFramework/import-macos-build-specific-genex-build-stdout.txt
new file mode 100644
index 0000000..d3a20e8
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-build-specific-genex-build-stdout.txt
@@ -0,0 +1,2 @@
+mylib-genex location: [^
+]*/Tests/RunCMake/XcFramework/export-macos-build/lib/mylib-genex\.xcframework/macos-(arm64|x86_64|arm64_x86_64)/libmylib-genex\.a
diff --git a/Tests/RunCMake/XcFramework/import-macos-build-specific-genex.cmake b/Tests/RunCMake/XcFramework/import-macos-build-specific-genex.cmake
new file mode 100644
index 0000000..a061bd3
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-build-specific-genex.cmake
@@ -0,0 +1 @@
+include(import-genex-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/import-macos-build-specific.cmake b/Tests/RunCMake/XcFramework/import-macos-build-specific.cmake
new file mode 100644
index 0000000..08ef6db
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-build-specific.cmake
@@ -0,0 +1 @@
+include(import-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/import-macos-install-general-build-stdout.txt b/Tests/RunCMake/XcFramework/import-macos-install-general-build-stdout.txt
new file mode 100644
index 0000000..1421246
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-install-general-build-stdout.txt
@@ -0,0 +1,2 @@
+mylib location: [^
+]*/Tests/RunCMake/XcFramework/export-install/lib/mylib\.xcframework/macos-(arm64|x86_64|arm64_x86_64)/libmylib\.a
diff --git a/Tests/RunCMake/XcFramework/import-macos-install-general.cmake b/Tests/RunCMake/XcFramework/import-macos-install-general.cmake
new file mode 100644
index 0000000..08ef6db
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-install-general.cmake
@@ -0,0 +1 @@
+include(import-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/import-macos-install-specific-build-stdout.txt b/Tests/RunCMake/XcFramework/import-macos-install-specific-build-stdout.txt
new file mode 100644
index 0000000..1421246
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-install-specific-build-stdout.txt
@@ -0,0 +1,2 @@
+mylib location: [^
+]*/Tests/RunCMake/XcFramework/export-install/lib/mylib\.xcframework/macos-(arm64|x86_64|arm64_x86_64)/libmylib\.a
diff --git a/Tests/RunCMake/XcFramework/import-macos-install-specific-genex-build-stdout.txt b/Tests/RunCMake/XcFramework/import-macos-install-specific-genex-build-stdout.txt
new file mode 100644
index 0000000..5c88758
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-install-specific-genex-build-stdout.txt
@@ -0,0 +1,2 @@
+mylib-genex location: [^
+]*/Tests/RunCMake/XcFramework/export-install/lib2/mylib-genex\.xcframework/macos-(arm64|x86_64|arm64_x86_64)/libmylib-genex\.a
diff --git a/Tests/RunCMake/XcFramework/import-macos-install-specific-genex.cmake b/Tests/RunCMake/XcFramework/import-macos-install-specific-genex.cmake
new file mode 100644
index 0000000..a061bd3
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-install-specific-genex.cmake
@@ -0,0 +1 @@
+include(import-genex-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework-build-stdout.txt b/Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework-build-stdout.txt
new file mode 100644
index 0000000..1c92972
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework-build-stdout.txt
@@ -0,0 +1,2 @@
+mylib location: [^
+]*/Tests/RunCMake/XcFramework/export-install/lib/macos/libmylib\.a
diff --git a/Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework.cmake b/Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework.cmake
new file mode 100644
index 0000000..08ef6db
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-install-specific-no-xcframework.cmake
@@ -0,0 +1 @@
+include(import-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/import-macos-install-specific.cmake b/Tests/RunCMake/XcFramework/import-macos-install-specific.cmake
new file mode 100644
index 0000000..08ef6db
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/import-macos-install-specific.cmake
@@ -0,0 +1 @@
+include(import-common.cmake)
diff --git a/Tests/RunCMake/XcFramework/mylib-config.cmake.in b/Tests/RunCMake/XcFramework/mylib-config.cmake.in
new file mode 100644
index 0000000..878d6e8
--- /dev/null
+++ b/Tests/RunCMake/XcFramework/mylib-config.cmake.in
@@ -0,0 +1,3 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/mylib-targets.cmake")
diff --git a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c
index c00fce7..76ca54e 100644
--- a/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c
+++ b/Tests/RunCMake/XcodeProject-Device/DeploymentTarget.c
@@ -25,6 +25,6 @@
# error unknown OS
#endif
-void foo()
+void foo(void)
{
}
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS-check.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS-check.cmake
new file mode 100644
index 0000000..706add5
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS-check.cmake
@@ -0,0 +1,3 @@
+include(${CMAKE_CURRENT_LIST_DIR}/findAttribute.cmake)
+
+findAttribute(${test} "Embed XPC Services" TRUE)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS.cmake
new file mode 100644
index 0000000..5ad0436
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices-macOS.cmake
@@ -0,0 +1 @@
+include(${CMAKE_CURRENT_LIST_DIR}/EmbedXPCServices.cmake)
diff --git a/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices.cmake b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices.cmake
new file mode 100644
index 0000000..877a685
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/EmbedXPCServices.cmake
@@ -0,0 +1,17 @@
+add_executable(xpc_service MACOSX_BUNDLE main.m)
+set_target_properties(xpc_service PROPERTIES
+ BUNDLE_EXTENSION "xpc"
+ XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
+ MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/XPCService.Info.plist.in"
+ MACOSX_BUNDLE_GUI_IDENTIFIER "com.example.app.xpc_service"
+)
+
+add_executable(app MACOSX_BUNDLE main.m)
+add_dependencies(app xpc_service)
+set_target_properties(app PROPERTIES
+ XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO"
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
+ XCODE_EMBED_XPC_SERVICES xpc_service
+ MACOSX_BUNDLE_GUI_IDENTIFIER "com.example.app"
+)
diff --git a/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake
index 3798ddc..77ac63f 100644
--- a/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject-Embed/RunCMakeTest.cmake
@@ -122,4 +122,5 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 14.1)
TestEmbedCommon(Resources macOS)
TestEmbedCommon(Resources iOS)
TestEmbedCommon(PlugIns macOS)
+ TestEmbedCommon(XPCServices macOS)
endif()
diff --git a/Tests/RunCMake/XcodeProject-Embed/XPCService.Info.plist.in b/Tests/RunCMake/XcodeProject-Embed/XPCService.Info.plist.in
new file mode 100644
index 0000000..abc8db2
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject-Embed/XPCService.Info.plist.in
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>$(DEVELOPMENT_LANGUAGE)</string>
+ <key>CFBundleDisplayName</key>
+ <string>SomeExtension</string>
+ <key>CFBundleExecutable</key>
+ <string>$(EXECUTABLE_NAME)</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.example.app.xpc_service</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>example_app_xpc_service</string>
+ <key>CFBundlePackageType</key>
+ <string>XPC!</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0.0</string>
+ <key>CFBundleVersion</key>
+ <string>1.0.0</string>
+</dict>
+</plist>
diff --git a/Tests/RunCMake/XcodeProject/XcodeXCConfig.c b/Tests/RunCMake/XcodeProject/XcodeXCConfig.c
index ac59a6b..20aab00 100644
--- a/Tests/RunCMake/XcodeProject/XcodeXCConfig.c
+++ b/Tests/RunCMake/XcodeProject/XcodeXCConfig.c
@@ -15,6 +15,6 @@
# error TARGET_DEBUG does not match BUILD_DEBUG
#endif
-void some_symbol()
+void some_symbol(void)
{
}
diff --git a/Tests/RunCMake/add_compile_definitions/foo.c b/Tests/RunCMake/add_compile_definitions/foo.c
index 74a86e1..7d75e37 100644
--- a/Tests/RunCMake/add_compile_definitions/foo.c
+++ b/Tests/RunCMake/add_compile_definitions/foo.c
@@ -1,4 +1,4 @@
-void foo()
+void foo(void)
{
}
diff --git a/Tests/RunCMake/add_custom_command/a.c b/Tests/RunCMake/add_custom_command/a.c
index 707c1c3..4ef3698 100644
--- a/Tests/RunCMake/add_custom_command/a.c
+++ b/Tests/RunCMake/add_custom_command/a.c
@@ -1,3 +1,3 @@
-void a()
+void a(void)
{
}
diff --git a/Tests/RunCMake/add_dependencies/a.c b/Tests/RunCMake/add_dependencies/a.c
index 707c1c3..4ef3698 100644
--- a/Tests/RunCMake/add_dependencies/a.c
+++ b/Tests/RunCMake/add_dependencies/a.c
@@ -1,3 +1,3 @@
-void a()
+void a(void)
{
}
diff --git a/Tests/RunCMake/add_dependencies/b.c b/Tests/RunCMake/add_dependencies/b.c
index 57b2900..c7c7df4 100644
--- a/Tests/RunCMake/add_dependencies/b.c
+++ b/Tests/RunCMake/add_dependencies/b.c
@@ -1,3 +1,3 @@
-void b()
+void b(void)
{
}
diff --git a/Tests/RunCMake/add_dependencies/c.c b/Tests/RunCMake/add_dependencies/c.c
index cbf94ca..e2fa6de 100644
--- a/Tests/RunCMake/add_dependencies/c.c
+++ b/Tests/RunCMake/add_dependencies/c.c
@@ -1,3 +1,3 @@
-void c()
+void c(void)
{
}
diff --git a/Tests/RunCMake/add_test/RunCMakeTest.cmake b/Tests/RunCMake/add_test/RunCMakeTest.cmake
index ec6f6dd..8b5c915 100644
--- a/Tests/RunCMake/add_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_test/RunCMakeTest.cmake
@@ -41,3 +41,9 @@ block()
set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(EmptyArgument-ctest ${CMAKE_CTEST_COMMAND} -C Debug)
endblock()
+
+set(RunCMake_TEST_OPTIONS
+ "-DCMAKE_TEST_LAUNCHER=/path/to/pseudo_test_launcher")
+
+run_cmake(TestLauncherProperty)
+run_cmake(TestLauncher)
diff --git a/Tests/RunCMake/add_test/TestLauncher-check.cmake b/Tests/RunCMake/add_test/TestLauncher-check.cmake
new file mode 100644
index 0000000..78020a6
--- /dev/null
+++ b/Tests/RunCMake/add_test/TestLauncher-check.cmake
@@ -0,0 +1,28 @@
+set(testfile "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake")
+if(EXISTS "${testfile}")
+ file(READ "${testfile}" testfile_contents)
+else()
+ message(FATAL_ERROR "Could not find expected CTestTestfile.cmake.")
+endif()
+
+set(error_details "There is a problem with generated test file: ${testfile}")
+
+if(testfile_contents MATCHES "add_test[(]DoesNotUseTestLauncher [^\n]+pseudo_test_launcher[^\n]+\n")
+ message(SEND_ERROR "Used test launcher when it should not be used. ${error_details}")
+endif()
+
+if(NOT testfile_contents MATCHES "add_test[(]UsesTestLauncher [^\n]+pseudo_test_launcher[^\n]+\n")
+ message(SEND_ERROR "Did not use test launcher when it should be used. ${error_details}")
+endif()
+
+if(testfile_contents MATCHES "add_test[(]DoesNotUseTestLauncherWithGenex [^\n]+pseudo_test_launcher[^\n]+\n")
+ message(SEND_ERROR "Used test launcher when it should not be used. ${error_details}")
+endif()
+
+if(NOT testfile_contents MATCHES "add_test[(]UsesTestLauncherWithExecTargetFromSubdirAddedWithoutGenex [^\n]+pseudo_test_launcher[^\n]+\n")
+ message(SEND_ERROR "Did not use test launcher when it should be used. ${error_details}")
+endif()
+
+if(testfile_contents MATCHES "add_test[(]DoesNotUseTestLauncherWithExecTargetFromSubdirAddedWithGenex [^\n]+pseudo_test_launcher[^\n]+\n")
+ message(SEND_ERROR "Used test launcher when it should not be used. ${error_details}")
+endif()
diff --git a/Tests/RunCMake/add_test/TestLauncher.cmake b/Tests/RunCMake/add_test/TestLauncher.cmake
new file mode 100644
index 0000000..8ad3be9
--- /dev/null
+++ b/Tests/RunCMake/add_test/TestLauncher.cmake
@@ -0,0 +1,22 @@
+project(test_launcher LANGUAGES C)
+
+enable_testing()
+add_test(NAME DoesNotUseLauncher
+ COMMAND ${CMAKE_COMMAND} -E echo "Hi")
+
+add_executable(generated_exe simple_src_exiterror.cxx)
+set_target_properties(generated_exe PROPERTIES LINKER_LANGUAGE C)
+
+add_test(NAME UsesTestLauncher
+ COMMAND generated_exe)
+
+add_test(NAME DoesNotUseTestLauncherWithGenex
+ COMMAND $<TARGET_FILE:generated_exe>)
+
+add_subdirectory(TestLauncher)
+
+add_test(NAME UsesTestLauncherWithExecTargetFromSubdirAddedWithoutGenex
+ COMMAND generated_exe_in_subdir_added_to_test_without_genex)
+
+add_test(NAME DoesNotUseTestLauncherWithExecTargetFromSubdirAddedWithGenex
+ COMMAND $<TARGET_FILE:generated_exe_in_subdir_added_to_test_with_genex>)
diff --git a/Tests/RunCMake/add_test/TestLauncher/CMakeLists.txt b/Tests/RunCMake/add_test/TestLauncher/CMakeLists.txt
new file mode 100644
index 0000000..fb40a59
--- /dev/null
+++ b/Tests/RunCMake/add_test/TestLauncher/CMakeLists.txt
@@ -0,0 +1,9 @@
+add_executable(generated_exe_in_subdir_added_to_test_without_genex
+ ${CMAKE_CURRENT_SOURCE_DIR}/../simple_src_exiterror.cxx)
+set_target_properties(generated_exe_in_subdir_added_to_test_without_genex
+ PROPERTIES LINKER_LANGUAGE C)
+
+add_executable(generated_exe_in_subdir_added_to_test_with_genex
+ ${CMAKE_CURRENT_SOURCE_DIR}/../simple_src_exiterror.cxx)
+set_target_properties(generated_exe_in_subdir_added_to_test_with_genex
+ PROPERTIES LINKER_LANGUAGE C)
diff --git a/Tests/RunCMake/add_test/TestLauncherProperty.cmake b/Tests/RunCMake/add_test/TestLauncherProperty.cmake
new file mode 100644
index 0000000..e86f42b
--- /dev/null
+++ b/Tests/RunCMake/add_test/TestLauncherProperty.cmake
@@ -0,0 +1,41 @@
+
+# This tests setting the TEST_LAUNCHER target property from the
+# CMAKE_TEST_LAUNCHER variable.
+
+# -DCMAKE_TEST_LAUNCHER=/path/to/pseudo_test_launcher is passed to this
+# test
+
+project(test_launcher LANGUAGES C)
+
+add_executable(target_with_test_launcher simple_src_exiterror.cxx)
+set_target_properties(target_with_test_launcher PROPERTIES LINKER_LANGUAGE C)
+get_property(launcher TARGET target_with_test_launcher
+ PROPERTY TEST_LAUNCHER)
+if(NOT "${launcher}" MATCHES "pseudo_test_launcher")
+ message(SEND_ERROR "Default TEST_LAUNCHER property not set")
+endif()
+
+set_property(TARGET target_with_test_launcher
+ PROPERTY TEST_LAUNCHER "another_test_launcher")
+get_property(launcher TARGET target_with_test_launcher
+ PROPERTY TEST_LAUNCHER)
+if(NOT "${launcher}" MATCHES "another_test_launcher")
+ message(SEND_ERROR
+ "set_property/get_property TEST_LAUNCHER is not consistent")
+endif()
+
+unset(CMAKE_TEST_LAUNCHER CACHE)
+add_executable(target_without_test_launcher simple_src_exiterror.cxx)
+set_target_properties(target_without_test_launcher PROPERTIES LINKER_LANGUAGE C)
+get_property(launcher TARGET target_without_test_launcher
+ PROPERTY TEST_LAUNCHER)
+if(NOT "${launcher}" STREQUAL "")
+ message(SEND_ERROR "Default TEST_LAUNCHER property not set to null")
+endif()
+
+add_executable(target_with_empty_test_launcher simple_src_exiterror.cxx)
+set_target_properties(target_with_empty_test_launcher PROPERTIES LINKER_LANGUAGE C)
+set_property(TARGET target_with_empty_test_launcher PROPERTY TEST_LAUNCHER "")
+
+enable_testing()
+add_test(NAME test_target_with_empty_test_launcher COMMAND target_with_empty_test_launcher)
diff --git a/Tests/RunCMake/add_test/simple_src_exiterror.cxx b/Tests/RunCMake/add_test/simple_src_exiterror.cxx
new file mode 100644
index 0000000..6ce7183
--- /dev/null
+++ b/Tests/RunCMake/add_test/simple_src_exiterror.cxx
@@ -0,0 +1,4 @@
+int main(int, char**)
+{
+ return 13;
+}
diff --git a/Tests/RunCMake/ctest_empty_binary_directory/CMakeLists.txt.in b/Tests/RunCMake/ctest_empty_binary_directory/CMakeLists.txt.in
new file mode 100644
index 0000000..408b2f3
--- /dev/null
+++ b/Tests/RunCMake/ctest_empty_binary_directory/CMakeLists.txt.in
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.5)
+project(CTestTest@CASE_NAME@ NONE)
diff --git a/Tests/RunCMake/ctest_empty_binary_directory/NoCache-result.txt b/Tests/RunCMake/ctest_empty_binary_directory/NoCache-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_empty_binary_directory/NoCache-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_empty_binary_directory/NoCache-stderr.txt b/Tests/RunCMake/ctest_empty_binary_directory/NoCache-stderr.txt
new file mode 100644
index 0000000..338ac6d
--- /dev/null
+++ b/Tests/RunCMake/ctest_empty_binary_directory/NoCache-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at [^
+]*/Tests/RunCMake/ctest_empty_binary_directory/NoCache/test.cmake:[0-9]+ \(ctest_empty_binary_directory\):
+ Did not remove the binary directory:
+
+ [^
+]*/Tests/RunCMake/ctest_empty_binary_directory/NoCache-build
+
+ because:
+
+ path does not contain an existing CMakeCache\.txt file
++
+script continues after ctest_empty_binary_directory error$
diff --git a/Tests/RunCMake/ctest_empty_binary_directory/RunCMakeTest.cmake b/Tests/RunCMake/ctest_empty_binary_directory/RunCMakeTest.cmake
new file mode 100644
index 0000000..f1d4ca7
--- /dev/null
+++ b/Tests/RunCMake/ctest_empty_binary_directory/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCTest)
+
+run_ctest(NoCache)
diff --git a/Tests/RunCMake/ctest_empty_binary_directory/test.cmake.in b/Tests/RunCMake/ctest_empty_binary_directory/test.cmake.in
new file mode 100644
index 0000000..2e0cfe6
--- /dev/null
+++ b/Tests/RunCMake/ctest_empty_binary_directory/test.cmake.in
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.5)
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
+message("script continues after ctest_empty_binary_directory error")
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c b/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c
index babe82d..009162d 100644
--- a/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/MyThirdPartyDependency/src/thirdparty.c
@@ -7,7 +7,7 @@ int main(void)
return 0;
}
-int notcalled()
+int notcalled(void)
{
printf(This function doesn't get called.\n");
return 0;
diff --git a/Tests/RunCMake/ctest_test/TestLoadWait-stdout.txt b/Tests/RunCMake/ctest_test/CTestTestLoadWait0-stdout.txt
index fc32958..60d70c9 100644
--- a/Tests/RunCMake/ctest_test/TestLoadWait-stdout.txt
+++ b/Tests/RunCMake/ctest_test/CTestTestLoadWait0-stdout.txt
@@ -1,8 +1,8 @@
Test project [^
-]*/Tests/RunCMake/ctest_test/TestLoadWait-build(
+]*/Tests/RunCMake/ctest_test/CTestTestLoadWait0-build(
[^*][^
]*)*
-\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 2, Smallest test RunCMakeVersion requires 1\*\*\*\*\*
+\*\*\*\*\* WAITING, System Load: 7, Max Allowed Load: 6\*\*\*\*\*
test 1
Start 1: RunCMakeVersion
+(
diff --git a/Tests/RunCMake/ctest_test/CTestTestLoadWait1-stdout.txt b/Tests/RunCMake/ctest_test/CTestTestLoadWait1-stdout.txt
new file mode 100644
index 0000000..70d8d3e
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/CTestTestLoadWait1-stdout.txt
@@ -0,0 +1,15 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/CTestTestLoadWait1-build(
+[^*][^
+]*)*
+\*\*\*\*\* WAITING, System Load: 7, Max Allowed Load: 8, Smallest test RunCMakeVersion requires 2\*\*\*\*\*
+test 1
+ Start 1: RunCMakeVersion
++(
+[^*][^
+]*)*
+1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index d2f3da3..b1ec9ad 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -14,16 +14,20 @@ run_ctest_test(TestQuiet QUIET)
# Tests for the 'Test Load' feature of ctest
#
# Spoof a load average value to make these tests more reliable.
-set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 5)
+set(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING} 7)
set(RunCTest_VERBOSE_FLAG -VV)
+set(CASE_CMAKELISTS_SUFFIX_CODE [[
+set_property(TEST RunCMakeVersion PROPERTY PROCESSORS 2)
+]])
# Verify that new tests are started when the load average falls below
# our threshold.
-run_ctest_test(TestLoadPass TEST_LOAD 6)
+run_ctest_test(TestLoadPass TEST_LOAD 8)
# Verify that new tests are not started when the load average exceeds
# our threshold and that they then run once the load average drops.
-run_ctest_test(TestLoadWait TEST_LOAD 2)
+run_ctest_test(TestLoadWait0 TEST_LOAD 4 PARALLEL_LEVEL 8)
+run_ctest_test(TestLoadWait1 TEST_LOAD 8 PARALLEL_LEVEL 8)
# Verify that when an invalid "TEST_LOAD" value is given, a warning
# message is displayed and the value is ignored.
@@ -31,13 +35,15 @@ run_ctest_test(TestLoadInvalid TEST_LOAD "ERR1")
# Verify that new tests are started when the load average falls below
# our threshold.
-set(CASE_CTEST_TEST_LOAD 7)
+set(CASE_CTEST_TEST_LOAD 9)
run_ctest_test(CTestTestLoadPass)
# Verify that new tests are not started when the load average exceeds
# our threshold and that they then run once the load average drops.
-set(CASE_CTEST_TEST_LOAD 4)
-run_ctest_test(CTestTestLoadWait)
+set(CASE_CTEST_TEST_LOAD 6)
+run_ctest_test(CTestTestLoadWait0 PARALLEL_LEVEL 8)
+set(CASE_CTEST_TEST_LOAD 8)
+run_ctest_test(CTestTestLoadWait1 PARALLEL_LEVEL 8)
# Verify that when an invalid "CTEST_TEST_LOAD" value is given,
# a warning message is displayed and the value is ignored.
@@ -51,6 +57,7 @@ run_ctest_test(TestLoadOrder TEST_LOAD "ERR4")
unset(ENV{__CTEST_FAKE_LOAD_AVERAGE_FOR_TESTING})
unset(CASE_CTEST_TEST_LOAD)
+unset(CASE_CMAKELISTS_SUFFIX_CODE)
unset(RunCTest_VERBOSE_FLAG)
block()
diff --git a/Tests/RunCMake/ctest_test/CTestTestLoadWait-stdout.txt b/Tests/RunCMake/ctest_test/TestLoadWait0-stdout.txt
index 2f4468f..c7172aa 100644
--- a/Tests/RunCMake/ctest_test/CTestTestLoadWait-stdout.txt
+++ b/Tests/RunCMake/ctest_test/TestLoadWait0-stdout.txt
@@ -1,8 +1,8 @@
Test project [^
-]*/Tests/RunCMake/ctest_test/CTestTestLoadWait-build(
+]*/Tests/RunCMake/ctest_test/TestLoadWait0-build(
[^*][^
]*)*
-\*\*\*\*\* WAITING, System Load: 5, Max Allowed Load: 4, Smallest test RunCMakeVersion requires 1\*\*\*\*\*
+\*\*\*\*\* WAITING, System Load: 7, Max Allowed Load: 4\*\*\*\*\*
test 1
Start 1: RunCMakeVersion
+(
diff --git a/Tests/RunCMake/ctest_test/TestLoadWait1-stdout.txt b/Tests/RunCMake/ctest_test/TestLoadWait1-stdout.txt
new file mode 100644
index 0000000..bca3e54
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestLoadWait1-stdout.txt
@@ -0,0 +1,15 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestLoadWait1-build(
+[^*][^
+]*)*
+\*\*\*\*\* WAITING, System Load: 7, Max Allowed Load: 8, Smallest test RunCMakeVersion requires 2\*\*\*\*\*
+test 1
+ Start 1: RunCMakeVersion
++(
+[^*][^
+]*)*
+1/1 Test #1: RunCMakeVersion .................. Passed +[0-9.]+ sec
++
+100% tests passed, 0 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/export/CMake/FindHasDeps.cmake b/Tests/RunCMake/export/CMake/FindHasDeps.cmake
new file mode 100644
index 0000000..86b2abe
--- /dev/null
+++ b/Tests/RunCMake/export/CMake/FindHasDeps.cmake
@@ -0,0 +1,17 @@
+find_package(Threads REQUIRED)
+find_package(P4 REQUIRED)
+
+add_library(HasDeps::interface IMPORTED INTERFACE)
+target_link_libraries(HasDeps::interface INTERFACE Threads::Threads l4)
+
+add_library(HasDeps::A IMPORTED UNKNOWN)
+target_link_libraries(HasDeps::A INTERFACE HasDeps::interface)
+file(TOUCH "${CMAKE_CURRENT_BINARY_DIR}/a.so")
+set_property(TARGET HasDeps::A PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/a.so")
+
+add_library(HasDeps::B IMPORTED UNKNOWN)
+target_link_libraries(HasDeps::B INTERFACE HasDeps::interface)
+file(TOUCH "${CMAKE_CURRENT_BINARY_DIR}/b.so")
+set_property(TARGET HasDeps::B PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/b.so")
+
+set(HASDEPS_FOUND TRUE)
diff --git a/Tests/RunCMake/export/CMake/FindP1.cmake b/Tests/RunCMake/export/CMake/FindP1.cmake
new file mode 100644
index 0000000..e33c3d6
--- /dev/null
+++ b/Tests/RunCMake/export/CMake/FindP1.cmake
@@ -0,0 +1,2 @@
+add_library(l1 IMPORTED INTERFACE)
+set(P1_FOUND TRUE)
diff --git a/Tests/RunCMake/export/CMake/FindP2.cmake b/Tests/RunCMake/export/CMake/FindP2.cmake
new file mode 100644
index 0000000..6a360ce
--- /dev/null
+++ b/Tests/RunCMake/export/CMake/FindP2.cmake
@@ -0,0 +1,2 @@
+add_library(l2 IMPORTED INTERFACE)
+set(P2_FOUND TRUE)
diff --git a/Tests/RunCMake/export/CMake/FindP3.cmake b/Tests/RunCMake/export/CMake/FindP3.cmake
new file mode 100644
index 0000000..72bd829
--- /dev/null
+++ b/Tests/RunCMake/export/CMake/FindP3.cmake
@@ -0,0 +1,2 @@
+add_library(l3 IMPORTED INTERFACE)
+set(P3_FOUND TRUE)
diff --git a/Tests/RunCMake/export/CMake/FindP4.cmake b/Tests/RunCMake/export/CMake/FindP4.cmake
new file mode 100644
index 0000000..b62a040
--- /dev/null
+++ b/Tests/RunCMake/export/CMake/FindP4.cmake
@@ -0,0 +1,2 @@
+add_library(l4 IMPORTED INTERFACE)
+set(P4_FOUND TRUE)
diff --git a/Tests/RunCMake/export/CMake/FindP9.cmake b/Tests/RunCMake/export/CMake/FindP9.cmake
new file mode 100644
index 0000000..201b86a
--- /dev/null
+++ b/Tests/RunCMake/export/CMake/FindP9.cmake
@@ -0,0 +1,2 @@
+add_library(l9 IMPORTED INTERFACE)
+set(P9_FOUND TRUE)
diff --git a/Tests/RunCMake/export/FindDependencyExport-check.cmake b/Tests/RunCMake/export/FindDependencyExport-check.cmake
new file mode 100644
index 0000000..0cbb195
--- /dev/null
+++ b/Tests/RunCMake/export/FindDependencyExport-check.cmake
@@ -0,0 +1,35 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/mytargets.cmake" mytargets)
+if("${mytargets}" MATCHES "find_dependency\\(P1")
+ string(APPEND RunCMake_TEST_FAILED "P1 dependency should not be exported but it is\n")
+endif()
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P2 REQUIRED \"VERSION\" \"1\\.0\"\\)")
+ string(APPEND RunCMake_TEST_FAILED "P2 dependency should be exported but it is not\n")
+endif()
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P3 REQUIRED\\)")
+ string(APPEND RunCMake_TEST_FAILED "P3 dependency should be exported but it is not\n")
+endif()
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P4 REQUIRED\\)")
+ string(APPEND RunCMake_TEST_FAILED "P4 dependency should be exported but it is not\n")
+endif()
+if("${mytargets}" MATCHES "find_dependency\\(P5")
+ string(APPEND RunCMake_TEST_FAILED "P5 dependency should not be exported but it is\n")
+endif()
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P6 REQUIRED\\)")
+ string(APPEND RunCMake_TEST_FAILED "P6 dependency should be exported but it is not\n")
+endif()
+if("${mytargets}" MATCHES "find_dependency\\(P7")
+ string(APPEND RunCMake_TEST_FAILED "P7 dependency should not be exported but it is\n")
+endif()
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P3[^
+]*\\)
+find_dependency\\(P2[^
+]*\\)
+find_dependency\\(P8[^
+]*\\)
+find_dependency\\(P6[^
+]*\\)
+find_dependency\\(P9[^
+]*\\)
+find_dependency\\(P4")
+ string(APPEND RunCMake_TEST_FAILED "Dependencies are not in the correct order\n")
+endif()
diff --git a/Tests/RunCMake/export/FindDependencyExport.cmake b/Tests/RunCMake/export/FindDependencyExport.cmake
new file mode 100644
index 0000000..59dd4cc
--- /dev/null
+++ b/Tests/RunCMake/export/FindDependencyExport.cmake
@@ -0,0 +1,30 @@
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
+
+find_package(P1)
+find_package(P2)
+find_package(P9)
+find_package(P4)
+find_package(P3)
+
+add_library(mylib INTERFACE)
+target_link_libraries(mylib INTERFACE l1 l2 l3 l4 l9)
+
+install(TARGETS mylib EXPORT mytargets)
+export(SETUP mytargets
+ PACKAGE_DEPENDENCY P1
+ ENABLED OFF
+ PACKAGE_DEPENDENCY P3
+ ENABLED AUTO
+ PACKAGE_DEPENDENCY P2
+ ENABLED ON
+ EXTRA_ARGS VERSION 1.0
+ PACKAGE_DEPENDENCY P5
+ ENABLED FALSE
+ PACKAGE_DEPENDENCY P8
+ ENABLED TRUE
+ PACKAGE_DEPENDENCY P6
+ ENABLED 1
+ PACKAGE_DEPENDENCY P7
+ ENABLED AUTO
+ )
+export(EXPORT mytargets EXPORT_PACKAGE_DEPENDENCIES FILE mytargets.cmake)
diff --git a/Tests/RunCMake/export/FindDependencyExportFetchContent-check.cmake b/Tests/RunCMake/export/FindDependencyExportFetchContent-check.cmake
new file mode 100644
index 0000000..353bb08
--- /dev/null
+++ b/Tests/RunCMake/export/FindDependencyExportFetchContent-check.cmake
@@ -0,0 +1,14 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/my_private_targets.cmake" my_private_targets)
+if(NOT "${my_private_targets}" MATCHES "find_dependency\\(HasDeps")
+ string(APPEND RunCMake_TEST_FAILED "HasDeps dependency should be exported but it is not\n")
+endif()
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/my_static_targets.cmake" my_static_targets)
+if(NOT "${my_static_targets}" MATCHES "find_dependency\\(MyPrivate")
+ string(APPEND RunCMake_TEST_FAILED "HasDeps dependency should be exported but it is not\n")
+endif()
+
+file(READ "${RunCMake_TEST_BINARY_DIR}/my_shared_targets.cmake" my_shared_targets)
+if(NOT "${my_shared_targets}" MATCHES "find_dependency\\(MyPrivate")
+ string(APPEND RunCMake_TEST_FAILED "MyStatic dependency should be exported but it is not\n")
+endif()
diff --git a/Tests/RunCMake/export/FindDependencyExportFetchContent.cmake b/Tests/RunCMake/export/FindDependencyExportFetchContent.cmake
new file mode 100644
index 0000000..9e6c565
--- /dev/null
+++ b/Tests/RunCMake/export/FindDependencyExportFetchContent.cmake
@@ -0,0 +1,37 @@
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
+
+enable_language(CXX)
+
+find_package(HasDeps)
+
+# replicates FetchContent where a dependency is brought
+# in via source. In these cases we need to extend the `install`
+# `export` commands to allow markup on what `Find<Project>` will
+# map to the export set
+add_library(my_private_lib STATIC empty.cpp)
+target_link_libraries(my_private_lib PUBLIC HasDeps::A)
+set_target_properties(my_private_lib PROPERTIES EXPORT_FIND_PACKAGE_NAME "MyPrivate")
+
+install(TARGETS my_private_lib EXPORT my_private_targets)
+install(EXPORT my_private_targets
+ FILE my_private.cmake
+ DESTINATION lib)
+export(EXPORT my_private_targets EXPORT_PACKAGE_DEPENDENCIES FILE my_private_targets.cmake)
+
+add_library(my_static_lib STATIC empty.cpp)
+target_link_libraries(my_static_lib PRIVATE my_private_lib)
+
+install(TARGETS my_static_lib EXPORT my_static_targets)
+install(EXPORT my_static_targets
+ FILE my_static.cmake
+ DESTINATION lib)
+export(EXPORT my_static_targets EXPORT_PACKAGE_DEPENDENCIES FILE my_static_targets.cmake)
+
+add_library(my_shared_lib SHARED empty.cpp)
+target_link_libraries(my_shared_lib PUBLIC my_private_lib)
+
+install(TARGETS my_shared_lib EXPORT my_shared_targets)
+install(EXPORT my_shared_targets
+ FILE my_shared.cmake
+ DESTINATION lib)
+export(EXPORT my_shared_targets EXPORT_PACKAGE_DEPENDENCIES FILE my_shared_targets.cmake)
diff --git a/Tests/RunCMake/export/FindDependencyExportShared-check.cmake b/Tests/RunCMake/export/FindDependencyExportShared-check.cmake
new file mode 100644
index 0000000..d7a32d1
--- /dev/null
+++ b/Tests/RunCMake/export/FindDependencyExportShared-check.cmake
@@ -0,0 +1,4 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/mytargets.cmake" mytargets)
+if("${mytargets}" MATCHES "find_dependency")
+ string(APPEND RunCMake_TEST_FAILED "No dependencies should not be exported\n")
+endif()
diff --git a/Tests/RunCMake/export/FindDependencyExportShared.cmake b/Tests/RunCMake/export/FindDependencyExportShared.cmake
new file mode 100644
index 0000000..6e662a1
--- /dev/null
+++ b/Tests/RunCMake/export/FindDependencyExportShared.cmake
@@ -0,0 +1,14 @@
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
+
+enable_language(CXX)
+
+find_package(P1)
+find_package(P2)
+find_package(P3)
+find_package(P4)
+
+add_library(mylib SHARED empty.cpp)
+target_link_libraries(mylib PRIVATE l1 l2 l3 l4)
+
+install(TARGETS mylib EXPORT mytargets)
+export(EXPORT mytargets EXPORT_PACKAGE_DEPENDENCIES FILE mytargets.cmake)
diff --git a/Tests/RunCMake/export/FindDependencyExportStatic-check.cmake b/Tests/RunCMake/export/FindDependencyExportStatic-check.cmake
new file mode 100644
index 0000000..b78bccb
--- /dev/null
+++ b/Tests/RunCMake/export/FindDependencyExportStatic-check.cmake
@@ -0,0 +1,13 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/mytargets.cmake" mytargets)
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P1")
+ string(APPEND RunCMake_TEST_FAILED "P1 dependency should be exported but it is not\n")
+endif()
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P2")
+ string(APPEND RunCMake_TEST_FAILED "P2 dependency should be exported but it is not\n")
+endif()
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P3")
+ string(APPEND RunCMake_TEST_FAILED "P3 dependency should be exported but it is not\n")
+endif()
+if(NOT "${mytargets}" MATCHES "find_dependency\\(P4")
+ string(APPEND RunCMake_TEST_FAILED "P4 dependency should be exported but it is not\n")
+endif()
diff --git a/Tests/RunCMake/export/FindDependencyExportStatic.cmake b/Tests/RunCMake/export/FindDependencyExportStatic.cmake
new file mode 100644
index 0000000..2d32eb2
--- /dev/null
+++ b/Tests/RunCMake/export/FindDependencyExportStatic.cmake
@@ -0,0 +1,14 @@
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake)
+
+enable_language(CXX)
+
+find_package(P1)
+find_package(P2)
+find_package(P3)
+find_package(P4)
+
+add_library(mylib STATIC empty.cpp)
+target_link_libraries(mylib PRIVATE l1 l2 l3 l4)
+
+install(TARGETS mylib EXPORT mytargets)
+export(EXPORT mytargets EXPORT_PACKAGE_DEPENDENCIES FILE mytargets.cmake)
diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake
index ee00b27..3e1b7d6 100644
--- a/Tests/RunCMake/export/RunCMakeTest.cmake
+++ b/Tests/RunCMake/export/RunCMakeTest.cmake
@@ -19,3 +19,7 @@ run_cmake(UnknownExport)
run_cmake(NamelinkOnlyExport)
run_cmake(SeparateNamelinkExport)
run_cmake(TryCompileExport)
+run_cmake(FindDependencyExport)
+run_cmake(FindDependencyExportStatic)
+run_cmake(FindDependencyExportShared)
+run_cmake(FindDependencyExportFetchContent)
diff --git a/Tests/RunCMake/find_file/NO_CACHE-stderr.txt b/Tests/RunCMake/find_file/NO_CACHE-stderr.txt
new file mode 100644
index 0000000..6da353b
--- /dev/null
+++ b/Tests/RunCMake/find_file/NO_CACHE-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at NO_CACHE\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0125 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/find_library/NO_CACHE-stderr.txt b/Tests/RunCMake/find_library/NO_CACHE-stderr.txt
new file mode 100644
index 0000000..6da353b
--- /dev/null
+++ b/Tests/RunCMake/find_library/NO_CACHE-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at NO_CACHE\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0125 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/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake
index 0bed252..f9c8528 100644
--- a/Tests/RunCMake/find_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake
@@ -24,6 +24,10 @@ if(CMAKE_HOST_WIN32 AND MINGW)
run_cmake(MSYSTEM_PREFIX)
endif()
+if(CMAKE_HOST_WIN32 AND MSVC)
+ run_cmake(Windows-MSVC)
+endif()
+
run_cmake_script(FromScriptMode "-DTEMP_DIR=${RunCMake_BINARY_DIR}/FromScriptMode-temp")
run_cmake_with_options(FromPATHEnvDebugVar --debug-find-var=CREATED_LIBRARY)
diff --git a/Tests/RunCMake/find_library/Windows-MSVC-stdout.txt b/Tests/RunCMake/find_library/Windows-MSVC-stdout.txt
new file mode 100644
index 0000000..598ede5
--- /dev/null
+++ b/Tests/RunCMake/find_library/Windows-MSVC-stdout.txt
@@ -0,0 +1,2 @@
+-- STATIC_LIBRARY='[^']*/Tests/RunCMake/find_library/Windows-MSVC/static.lib'
+-- RUSTC_IMPORT_LIBRARY='[^']*/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib'
diff --git a/Tests/RunCMake/find_library/Windows-MSVC.cmake b/Tests/RunCMake/find_library/Windows-MSVC.cmake
new file mode 100644
index 0000000..485952d
--- /dev/null
+++ b/Tests/RunCMake/find_library/Windows-MSVC.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+
+find_library(STATIC_LIBRARY NAMES static NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Windows-MSVC)
+message(STATUS "STATIC_LIBRARY='${STATIC_LIBRARY}'")
+
+find_library(RUSTC_IMPORT_LIBRARY NAMES rustc_import NO_DEFAULT_PATH PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Windows-MSVC)
+message(STATUS "RUSTC_IMPORT_LIBRARY='${RUSTC_IMPORT_LIBRARY}'")
diff --git a/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib b/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.dll.lib
diff --git a/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib b/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_library/Windows-MSVC/rustc_import.lib
diff --git a/Tests/RunCMake/find_library/Windows-MSVC/static.lib b/Tests/RunCMake/find_library/Windows-MSVC/static.lib
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_library/Windows-MSVC/static.lib
diff --git a/Tests/RunCMake/find_path/NO_CACHE-stderr.txt b/Tests/RunCMake/find_path/NO_CACHE-stderr.txt
new file mode 100644
index 0000000..6da353b
--- /dev/null
+++ b/Tests/RunCMake/find_path/NO_CACHE-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at NO_CACHE\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0125 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/find_program/NO_CACHE-stderr.txt b/Tests/RunCMake/find_program/NO_CACHE-stderr.txt
new file mode 100644
index 0000000..6da353b
--- /dev/null
+++ b/Tests/RunCMake/find_program/NO_CACHE-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at NO_CACHE\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0125 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/foreach/foreach-var-scope-CMP0124-OLD-stderr.txt b/Tests/RunCMake/foreach/foreach-var-scope-CMP0124-OLD-stderr.txt
new file mode 100644
index 0000000..7a49647
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-var-scope-CMP0124-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at foreach-var-scope-CMP0124-OLD\.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0124 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/if/FilePermissions.cmake b/Tests/RunCMake/if/FilePermissions.cmake
new file mode 100644
index 0000000..9edbddb
--- /dev/null
+++ b/Tests/RunCMake/if/FilePermissions.cmake
@@ -0,0 +1,179 @@
+
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/readable.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/writable.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/executable.txt")
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/readable.txt" "foo")
+file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/readable.txt" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/writable.txt" "foo")
+file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/writable.txt" PERMISSIONS OWNER_WRITE GROUP_WRITE)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/executable.txt" "foo")
+file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/executable.txt" PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+
+if(NOT WIN32)
+ file(REMOVE_RECURSE
+ "${CMAKE_CURRENT_BINARY_DIR}/readable-dir"
+ "${CMAKE_CURRENT_BINARY_DIR}/writable-dir"
+ "${CMAKE_CURRENT_BINARY_DIR}/executable-dir"
+ )
+
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/readable-dir")
+ file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/readable-dir" PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
+
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/writable-dir")
+ file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/writable-dir" PERMISSIONS OWNER_WRITE GROUP_WRITE)
+
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/executable-dir")
+ file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/executable-dir" PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+endif()
+
+function(cleanup)
+ if(NOT WIN32)
+ # CMake versions prior to 3.29 did not know how to remove non-readable directories.
+ file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/writable-dir" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_WRITE)
+ file(CHMOD "${CMAKE_CURRENT_BINARY_DIR}/executable-dir" PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+ endif()
+endfunction()
+
+if(WIN32)
+ # files are always readable and executable
+ # directories are always, readable, writable and executable
+ if(NOT IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/readable.txt"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/readable.txt")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/readable.txt\" failed")
+ endif()
+
+ if(NOT IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/executable.txt"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/executable.txt")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/executable.txt\" failed")
+ endif()
+else()
+ if(NOT IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/readable.txt"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/readable.txt"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/readable.txt")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/readable.txt\" failed")
+ endif()
+
+ if(NOT IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/writable.txt"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/writable.txt"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/writable.txt")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/writable.txt\" failed")
+ endif()
+
+ if(NOT IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/executable.txt"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/executable.txt"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/executable.txt")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/executable.txt\" failed")
+ endif()
+
+
+ if(NOT IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/readable-dir"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/readable-dir"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/readable-dir")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/readable-dir\" failed")
+ endif()
+
+ if(NOT IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/writable-dir")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/writable-dir\" failed")
+ endif()
+
+ if(NOT IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/executable-dir"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/executable-dir"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/executable-dir")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/executable.txt\" failed")
+ endif()
+endif()
+
+if(UNIX)
+ #
+ # Check that file permissions are on the real file, not the symbolic link
+ #
+ file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable-dir"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable-dir")
+
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/readable.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable.txt"
+ SYMBOLIC)
+
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/writable.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable.txt"
+ SYMBOLIC)
+
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/executable.txt"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable.txt"
+ SYMBOLIC)
+
+
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/readable-dir"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable-dir"
+ SYMBOLIC)
+
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/writable-dir"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir"
+ SYMBOLIC)
+
+ file(CREATE_LINK "${CMAKE_CURRENT_BINARY_DIR}/executable-dir"
+ "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable-dir"
+ SYMBOLIC)
+
+ if(NOT IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable.txt"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable.txt"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable.txt")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-readable.txt\" failed")
+ endif()
+
+ if(NOT IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable.txt"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable.txt"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable.txt")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-writable.txt\" failed")
+ endif()
+
+ if(NOT IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable.txt"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable.txt"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable.txt")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-executable.txt\" failed")
+ endif()
+
+
+ if(NOT IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable-dir"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable-dir"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-readable-dir")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-readable-dir\" failed")
+ endif()
+
+ if(NOT IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir"
+ OR IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-writable-dir\" failed")
+ endif()
+
+ if(NOT IS_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable-dir"
+ OR IS_READABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable-dir"
+ OR IS_WRITABLE "${CMAKE_CURRENT_BINARY_DIR}/link-to-executable-dir")
+ cleanup()
+ message(FATAL_ERROR "checks on \"${CMAKE_CURRENT_BINARY_DIR}/link-to-executable-dir\" failed")
+ endif()
+endif()
+
+cleanup()
diff --git a/Tests/RunCMake/if/RunCMakeTest.cmake b/Tests/RunCMake/if/RunCMakeTest.cmake
index efee116..43dfd3c 100644
--- a/Tests/RunCMake/if/RunCMakeTest.cmake
+++ b/Tests/RunCMake/if/RunCMakeTest.cmake
@@ -2,6 +2,14 @@ include(RunCMake)
run_cmake(InvalidArgument1)
run_cmake(exists)
+if(NOT MSYS)
+ # permissions and symbolic links are broken on MSYS
+ # if real user is root, tests are irrelevant
+ get_unix_uid(uid)
+ if(NOT uid STREQUAL "0")
+ run_cmake(FilePermissions)
+ endif()
+endif()
run_cmake(IsDirectory)
run_cmake(IsDirectoryLong)
run_cmake(duplicate-deep-else)
diff --git a/Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake b/Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake
new file mode 100644
index 0000000..6a8b2e5
--- /dev/null
+++ b/Tests/RunCMake/install/EXPORT-FindDependencyExport-all-check.cmake
@@ -0,0 +1,4 @@
+file(READ "${RunCMake_TEST_BINARY_DIR}/root-all/lib/cmake/mylib/mylib-targets.cmake" contents)
+if(NOT contents MATCHES "include\\(CMakeFindDependencyMacro\\)\nfind_dependency\\(P2 REQUIRED\\)\nfind_dependency\\(P1 REQUIRED\\)\n")
+ set(RunCMake_TEST_FAILED "Dependencies were not properly exported")
+endif()
diff --git a/Tests/RunCMake/install/EXPORT-FindDependencyExport.cmake b/Tests/RunCMake/install/EXPORT-FindDependencyExport.cmake
new file mode 100644
index 0000000..071414b
--- /dev/null
+++ b/Tests/RunCMake/install/EXPORT-FindDependencyExport.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
+
+find_package(P1 REQUIRED)
+find_package(P2 REQUIRED)
+find_package(P3 REQUIRED)
+
+add_library(mylib INTERFACE)
+target_link_libraries(mylib INTERFACE lib1 lib2 lib3)
+install(TARGETS mylib EXPORT mylib-targets)
+export(SETUP mylib-targets
+ PACKAGE_DEPENDENCY P2
+ ENABLED AUTO
+ PACKAGE_DEPENDENCY P3
+ ENABLED OFF
+ )
+install(EXPORT mylib-targets EXPORT_PACKAGE_DEPENDENCIES FILE mylib-targets.cmake DESTINATION lib/cmake/mylib)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index efafdd1..6f63550 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -176,6 +176,7 @@ run_install_test(TARGETS-Parts)
run_install_test(FILES-PERMISSIONS)
run_install_test(TARGETS-RPATH)
run_install_test(InstallRequiredSystemLibraries)
+run_install_test(EXPORT-FindDependencyExport)
set(RunCMake_TEST_OPTIONS "-DCMAKE_POLICY_DEFAULT_CMP0087:STRING=NEW")
run_install_test(SCRIPT)
diff --git a/Tests/RunCMake/install/cmake/FindP1.cmake b/Tests/RunCMake/install/cmake/FindP1.cmake
new file mode 100644
index 0000000..c772836
--- /dev/null
+++ b/Tests/RunCMake/install/cmake/FindP1.cmake
@@ -0,0 +1,2 @@
+add_library(lib1 IMPORTED INTERFACE)
+set(P1_FOUND TRUE)
diff --git a/Tests/RunCMake/install/cmake/FindP2.cmake b/Tests/RunCMake/install/cmake/FindP2.cmake
new file mode 100644
index 0000000..d81b35d
--- /dev/null
+++ b/Tests/RunCMake/install/cmake/FindP2.cmake
@@ -0,0 +1,2 @@
+add_library(lib2 IMPORTED INTERFACE)
+set(P2_FOUND TRUE)
diff --git a/Tests/RunCMake/install/cmake/FindP3.cmake b/Tests/RunCMake/install/cmake/FindP3.cmake
new file mode 100644
index 0000000..2818c3b
--- /dev/null
+++ b/Tests/RunCMake/install/cmake/FindP3.cmake
@@ -0,0 +1,2 @@
+add_library(lib3 IMPORTED INTERFACE)
+set(P3_FOUND TRUE)
diff --git a/Tests/RunCMake/print_stdin.c b/Tests/RunCMake/print_stdin.c
index e083e62..76b3a84 100644
--- a/Tests/RunCMake/print_stdin.c
+++ b/Tests/RunCMake/print_stdin.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-int main()
+int main(void)
{
char buf[1024];
size_t nIn = sizeof(buf);
diff --git a/Tests/RunCMake/project/CodeInjection-stdout.txt b/Tests/RunCMake/project/CodeInjection-stdout.txt
deleted file mode 100644
index 88ac966..0000000
--- a/Tests/RunCMake/project/CodeInjection-stdout.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE
-(-- )?Included CMAKE_TOOLCHAIN_FILE
-.*Included CMAKE_PROJECT_TOP_LEVEL_INCLUDES first file
-(-- )?Included CMAKE_PROJECT_TOP_LEVEL_INCLUDES second file
-(-- )?Included CMAKE_PROJECT_INCLUDE
-(-- )?Calling sub-project
-(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE
-(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE
-(-- )?Included CMAKE_PROJECT_INCLUDE
-(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_include.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_include.cmake
deleted file mode 100644
index f3f0a7e..0000000
--- a/Tests/RunCMake/project/CodeInjection/cmake_project_include.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(STATUS "Included CMAKE_PROJECT_INCLUDE")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_include_before.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_include_before.cmake
deleted file mode 100644
index 01d53c9..0000000
--- a/Tests/RunCMake/project/CodeInjection/cmake_project_include_before.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(STATUS "Included CMAKE_PROJECT_INCLUDE_BEFORE")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_includes_1.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_includes_1.cmake
new file mode 100644
index 0000000..2bc65cf
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/cmake_project_includes_1.cmake
@@ -0,0 +1 @@
+message(STATUS "Included CMAKE_PROJECT_INCLUDE first file")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_includes_2.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_includes_2.cmake
new file mode 100644
index 0000000..df7240c
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/cmake_project_includes_2.cmake
@@ -0,0 +1 @@
+message(STATUS "Included CMAKE_PROJECT_INCLUDE second file")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_1.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_1.cmake
new file mode 100644
index 0000000..20bea78
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_1.cmake
@@ -0,0 +1 @@
+message(STATUS "Included CMAKE_PROJECT_INCLUDE_BEFORE first file")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_2.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_2.cmake
new file mode 100644
index 0000000..91b59d1
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/cmake_project_includes_before_2.cmake
@@ -0,0 +1 @@
+message(STATUS "Included CMAKE_PROJECT_INCLUDE_BEFORE second file")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include.cmake
deleted file mode 100644
index d68de6a..0000000
--- a/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(STATUS "Included CMAKE_PROJECT_SubProj_INCLUDE")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include_before.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include_before.cmake
deleted file mode 100644
index ef3bfc0..0000000
--- a/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_include_before.cmake
+++ /dev/null
@@ -1 +0,0 @@
-message(STATUS "Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_1.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_1.cmake
new file mode 100644
index 0000000..fe0fe4a
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_1.cmake
@@ -0,0 +1 @@
+message(STATUS "Included CMAKE_PROJECT_SubProj_INCLUDE first file")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_2.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_2.cmake
new file mode 100644
index 0000000..c36fb52
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_2.cmake
@@ -0,0 +1 @@
+message(STATUS "Included CMAKE_PROJECT_SubProj_INCLUDE second file")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_1.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_1.cmake
new file mode 100644
index 0000000..23ae05a
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_1.cmake
@@ -0,0 +1 @@
+message(STATUS "Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE first file")
diff --git a/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_2.cmake b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_2.cmake
new file mode 100644
index 0000000..17f1d29
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/cmake_project_subproj_includes_before_2.cmake
@@ -0,0 +1 @@
+message(STATUS "Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE second file")
diff --git a/Tests/RunCMake/project/CodeInjection/initial_cache.cmake b/Tests/RunCMake/project/CodeInjection/initial_cache_1.cmake
index 6c8995b..43bb817 100644
--- a/Tests/RunCMake/project/CodeInjection/initial_cache.cmake
+++ b/Tests/RunCMake/project/CodeInjection/initial_cache_1.cmake
@@ -1,10 +1,9 @@
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/passthrough_toolchain_file.cmake" CACHE FILEPATH "")
-set(CMAKE_PROJECT_INCLUDE "${CMAKE_CURRENT_LIST_DIR}/cmake_project_include.cmake" CACHE FILEPATH "")
-set(CMAKE_PROJECT_INCLUDE_BEFORE "${CMAKE_CURRENT_LIST_DIR}/cmake_project_include_before.cmake" CACHE FILEPATH "")
-set(CMAKE_PROJECT_SubProj_INCLUDE "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_include.cmake" CACHE FILEPATH "")
-set(CMAKE_PROJECT_SubProj_INCLUDE_BEFORE "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_include_before.cmake" CACHE FILEPATH "")
+set(CMAKE_PROJECT_INCLUDE "${CMAKE_CURRENT_LIST_DIR}/cmake_project_includes_1.cmake" CACHE FILEPATH "")
+set(CMAKE_PROJECT_INCLUDE_BEFORE "${CMAKE_CURRENT_LIST_DIR}/cmake_project_includes_before_1.cmake" CACHE FILEPATH "")
+set(CMAKE_PROJECT_SubProj_INCLUDE "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_includes_1.cmake" CACHE FILEPATH "")
+set(CMAKE_PROJECT_SubProj_INCLUDE_BEFORE "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_includes_before_1.cmake" CACHE FILEPATH "")
set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES
"${CMAKE_CURRENT_LIST_DIR}/cmake_project_top_level_includes_1.cmake"
- "${CMAKE_CURRENT_LIST_DIR}/cmake_project_top_level_includes_2.cmake"
- CACHE STRING ""
+ CACHE FILEPATH ""
)
diff --git a/Tests/RunCMake/project/CodeInjection/initial_cache_2.cmake b/Tests/RunCMake/project/CodeInjection/initial_cache_2.cmake
new file mode 100644
index 0000000..09fcbfd
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/initial_cache_2.cmake
@@ -0,0 +1,27 @@
+set(CMAKE_TOOLCHAIN_FILE
+ "${CMAKE_CURRENT_LIST_DIR}/passthrough_toolchain_file.cmake" CACHE FILEPATH "")
+set(CMAKE_PROJECT_INCLUDE
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_includes_1.cmake"
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_includes_2.cmake"
+ CACHE STRING ""
+)
+set(CMAKE_PROJECT_INCLUDE_BEFORE
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_includes_before_1.cmake"
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_includes_before_2.cmake"
+ CACHE STRING ""
+)
+set(CMAKE_PROJECT_SubProj_INCLUDE
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_includes_1.cmake"
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_includes_2.cmake"
+ CACHE STRING ""
+)
+set(CMAKE_PROJECT_SubProj_INCLUDE_BEFORE
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_includes_before_1.cmake"
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_includes_before_2.cmake"
+ CACHE STRING ""
+)
+set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_top_level_includes_1.cmake"
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_top_level_includes_2.cmake"
+ CACHE STRING ""
+)
diff --git a/Tests/RunCMake/project/CodeInjection/initial_cache_3.cmake b/Tests/RunCMake/project/CodeInjection/initial_cache_3.cmake
new file mode 100644
index 0000000..dd299bc
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection/initial_cache_3.cmake
@@ -0,0 +1,28 @@
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}" CACHE STRING "")
+set(CMAKE_TOOLCHAIN_FILE
+ "${CMAKE_CURRENT_LIST_DIR}/passthrough_toolchain_file.cmake" CACHE FILEPATH "")
+set(CMAKE_PROJECT_INCLUDE
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_includes_1.cmake"
+ "cmake_project_includes_2"
+ CACHE STRING ""
+)
+set(CMAKE_PROJECT_INCLUDE_BEFORE
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_includes_before_1.cmake"
+ "cmake_project_includes_before_2"
+ CACHE STRING ""
+)
+set(CMAKE_PROJECT_SubProj_INCLUDE
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_includes_1.cmake"
+ "cmake_project_subproj_includes_2"
+ CACHE STRING ""
+)
+set(CMAKE_PROJECT_SubProj_INCLUDE_BEFORE
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_subproj_includes_before_1.cmake"
+ "cmake_project_subproj_includes_before_2"
+ CACHE STRING ""
+)
+set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES
+ "${CMAKE_CURRENT_LIST_DIR}/cmake_project_top_level_includes_1.cmake"
+ "cmake_project_top_level_includes_2"
+ CACHE STRING ""
+)
diff --git a/Tests/RunCMake/project/CodeInjection1-stdout.txt b/Tests/RunCMake/project/CodeInjection1-stdout.txt
new file mode 100644
index 0000000..7a780b7
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection1-stdout.txt
@@ -0,0 +1,9 @@
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_TOOLCHAIN_FILE
+.*Included CMAKE_PROJECT_TOP_LEVEL_INCLUDES first file
+(-- )?Included CMAKE_PROJECT_INCLUDE first file
+(-- )?Calling sub-project
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE first file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE first file
diff --git a/Tests/RunCMake/project/CodeInjection.cmake b/Tests/RunCMake/project/CodeInjection1.cmake
index dcf56a1..dcf56a1 100644
--- a/Tests/RunCMake/project/CodeInjection.cmake
+++ b/Tests/RunCMake/project/CodeInjection1.cmake
diff --git a/Tests/RunCMake/project/CodeInjection2-stdout.txt b/Tests/RunCMake/project/CodeInjection2-stdout.txt
new file mode 100644
index 0000000..5c18cdf
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection2-stdout.txt
@@ -0,0 +1,16 @@
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE second file
+(-- )?Included CMAKE_TOOLCHAIN_FILE
+.*Included CMAKE_PROJECT_TOP_LEVEL_INCLUDES first file
+(-- )?Included CMAKE_PROJECT_TOP_LEVEL_INCLUDES second file
+(-- )?Included CMAKE_PROJECT_INCLUDE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE second file
+(-- )?Calling sub-project
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE second file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE second file
+(-- )?Included CMAKE_PROJECT_INCLUDE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE second file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE first file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE second file
diff --git a/Tests/RunCMake/project/CodeInjection2.cmake b/Tests/RunCMake/project/CodeInjection2.cmake
new file mode 100644
index 0000000..dcf56a1
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection2.cmake
@@ -0,0 +1 @@
+add_subdirectory(CodeInjection)
diff --git a/Tests/RunCMake/project/CodeInjection3-stdout.txt b/Tests/RunCMake/project/CodeInjection3-stdout.txt
new file mode 100644
index 0000000..5c18cdf
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection3-stdout.txt
@@ -0,0 +1,16 @@
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE second file
+(-- )?Included CMAKE_TOOLCHAIN_FILE
+.*Included CMAKE_PROJECT_TOP_LEVEL_INCLUDES first file
+(-- )?Included CMAKE_PROJECT_TOP_LEVEL_INCLUDES second file
+(-- )?Included CMAKE_PROJECT_INCLUDE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE second file
+(-- )?Calling sub-project
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE_BEFORE second file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE first file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE_BEFORE second file
+(-- )?Included CMAKE_PROJECT_INCLUDE first file
+(-- )?Included CMAKE_PROJECT_INCLUDE second file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE first file
+(-- )?Included CMAKE_PROJECT_SubProj_INCLUDE second file
diff --git a/Tests/RunCMake/project/CodeInjection3.cmake b/Tests/RunCMake/project/CodeInjection3.cmake
new file mode 100644
index 0000000..dcf56a1
--- /dev/null
+++ b/Tests/RunCMake/project/CodeInjection3.cmake
@@ -0,0 +1 @@
+add_subdirectory(CodeInjection)
diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake
index 0f3716f..16f10be 100644
--- a/Tests/RunCMake/project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/project/RunCMakeTest.cmake
@@ -5,8 +5,16 @@ include(RunCMake)
# which tests some of the individual variables one at a time.
# Here, we are focused on testing that the variables are all injected
# at the expected points in the expected order.
-run_cmake_with_options(CodeInjection
- -C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache.cmake"
+run_cmake_with_options(CodeInjection1
+ -C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_1.cmake"
+)
+# This checks that List variables are allowed.
+run_cmake_with_options(CodeInjection2
+ -C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_2.cmake"
+)
+# This checks that module names are also allowed.
+run_cmake_with_options(CodeInjection3
+ -C "${CMAKE_CURRENT_LIST_DIR}/CodeInjection/initial_cache_3.cmake"
)
if(CMake_TEST_RESOURCES)
diff --git a/Tests/RunCMake/property_init/Executable.cmake b/Tests/RunCMake/property_init/Executable.cmake
index ede0e4b..a5e4fb8 100644
--- a/Tests/RunCMake/property_init/Executable.cmake
+++ b/Tests/RunCMake/property_init/Executable.cmake
@@ -17,6 +17,7 @@ set(properties
# Metadata
"CROSSCOMPILING_EMULATOR" "emu" "<SAME>"
+ "TEST_LAUNCHER" "test" "<SAME>"
)
prepare_target_types(executable
diff --git a/Tests/RunCMake/showIncludes.c b/Tests/RunCMake/showIncludes.c
index 7d467cf..5114965 100644
--- a/Tests/RunCMake/showIncludes.c
+++ b/Tests/RunCMake/showIncludes.c
@@ -10,7 +10,7 @@
#include <stdio.h>
#include <stdlib.h>
-int main()
+int main(void)
{
/* 'cl /showIncludes' encodes output in the console output code page. */
unsigned int cp = GetConsoleOutputCP();
diff --git a/Tests/RunCMake/target_compile_definitions/foo.c b/Tests/RunCMake/target_compile_definitions/foo.c
index 74a86e1..7d75e37 100644
--- a/Tests/RunCMake/target_compile_definitions/foo.c
+++ b/Tests/RunCMake/target_compile_definitions/foo.c
@@ -1,4 +1,4 @@
-void foo()
+void foo(void)
{
}
diff --git a/Tests/RunCMake/target_compile_features/empty.c b/Tests/RunCMake/target_compile_features/empty.c
index 11ec041..8d91e77 100644
--- a/Tests/RunCMake/target_compile_features/empty.c
+++ b/Tests/RunCMake/target_compile_features/empty.c
@@ -1,7 +1,7 @@
#ifdef _WIN32
__declspec(dllexport)
#endif
- int empty()
+ int empty(void)
{
return 0;
}
diff --git a/Tests/RunCMake/target_compile_options/CMP0101.c b/Tests/RunCMake/target_compile_options/CMP0101.c
index 250869a..7ef6117 100644
--- a/Tests/RunCMake/target_compile_options/CMP0101.c
+++ b/Tests/RunCMake/target_compile_options/CMP0101.c
@@ -3,7 +3,7 @@
# error "BEFORE not honored"
#endif
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/func.c b/Tests/RunCMake/target_link_libraries-ALIAS/func.c
index 415a9bf..ebc6a5f 100644
--- a/Tests/RunCMake/target_link_libraries-ALIAS/func.c
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/func.c
@@ -2,6 +2,6 @@
#if defined(_WIN32)
__declspec(dllexport)
#endif
- void func_c()
+ void func_c(void)
{
}
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/lib.c b/Tests/RunCMake/target_link_libraries-ALIAS/lib.c
index b2d1b66..95c0e91 100644
--- a/Tests/RunCMake/target_link_libraries-ALIAS/lib.c
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/lib.c
@@ -2,9 +2,9 @@
#if defined(_WIN32)
__declspec(dllimport)
#endif
- void func_c();
+ void func_c(void);
-void lib()
+void lib(void)
{
func_c();
}
diff --git a/Tests/RunCMake/target_link_libraries-ALIAS/main.c b/Tests/RunCMake/target_link_libraries-ALIAS/main.c
index a908dea..72a3ddb 100644
--- a/Tests/RunCMake/target_link_libraries-ALIAS/main.c
+++ b/Tests/RunCMake/target_link_libraries-ALIAS/main.c
@@ -2,9 +2,9 @@
#if defined(_WIN32)
__declspec(dllimport)
#endif
- void func_c();
+ void func_c(void);
-int main()
+int main(void)
{
func_c();
diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/base.c b/Tests/RunCMake/target_link_libraries-LINK_GROUP/base.c
index a5075d4..ed769a0 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/base.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/base.c
@@ -4,6 +4,6 @@
__declspec(dllexport)
# endif
#endif
- void base()
+ void base(void)
{
}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/func1.c b/Tests/RunCMake/target_link_libraries-LINK_GROUP/func1.c
index 3399e00..ef11bc2 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/func1.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/func1.c
@@ -1,7 +1,7 @@
-extern void func2();
+extern void func2(void);
-void func1()
+void func1(void)
{
func2();
}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/func2.c b/Tests/RunCMake/target_link_libraries-LINK_GROUP/func2.c
index 0f9aa64..3eab38e 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/func2.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/func2.c
@@ -1,7 +1,7 @@
-extern void func3();
+extern void func3(void);
-void func2()
+void func2(void)
{
func3();
}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/func3.c b/Tests/RunCMake/target_link_libraries-LINK_GROUP/func3.c
index 0b7df64..c109e09 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/func3.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/func3.c
@@ -1,6 +1,6 @@
-extern void func3();
+extern void func3(void);
-void func3()
+void func3(void)
{
}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/lib.c b/Tests/RunCMake/target_link_libraries-LINK_GROUP/lib.c
index 35ab367..21f559c 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/lib.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/lib.c
@@ -4,12 +4,12 @@
__declspec(dllimport)
# endif
#endif
- void base();
+ void base(void);
#if defined(_WIN32)
__declspec(dllexport)
#endif
- void lib()
+ void lib(void)
{
base();
}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_GROUP/main.c b/Tests/RunCMake/target_link_libraries-LINK_GROUP/main.c
index 403583d..d78b0f6 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_GROUP/main.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_GROUP/main.c
@@ -1,7 +1,7 @@
-extern void func1();
+extern void func1(void);
-int main()
+int main(void)
{
func1();
}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c
index 415a9bf..ebc6a5f 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/func.c
@@ -2,6 +2,6 @@
#if defined(_WIN32)
__declspec(dllexport)
#endif
- void func_c()
+ void func_c(void)
{
}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c
index b2d1b66..95c0e91 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/lib.c
@@ -2,9 +2,9 @@
#if defined(_WIN32)
__declspec(dllimport)
#endif
- void func_c();
+ void func_c(void);
-void lib()
+void lib(void)
{
func_c();
}
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c
index 689dbd7..891c4ad 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANGUAGE/main.c
@@ -1,14 +1,14 @@
#if defined(C_USE_CXX)
-void func_c_cxx();
+void func_c_cxx(void);
#else
# if defined(_WIN32)
__declspec(dllimport)
# endif
- void func_c();
+ void func_c(void);
#endif
-int main()
+int main(void)
{
#if defined(C_USE_CXX)
func_c_cxx();
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
index 415a9bf..ebc6a5f 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/func.c
@@ -2,6 +2,6 @@
#if defined(_WIN32)
__declspec(dllexport)
#endif
- void func_c()
+ void func_c(void)
{
}
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
index b2d1b66..95c0e91 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/lib.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/lib.c
@@ -2,9 +2,9 @@
#if defined(_WIN32)
__declspec(dllimport)
#endif
- void func_c();
+ void func_c(void);
-void lib()
+void lib(void)
{
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
index a908dea..72a3ddb 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.c
+++ b/Tests/RunCMake/target_link_libraries-LINK_LANG_AND_ID/main.c
@@ -2,9 +2,9 @@
#if defined(_WIN32)
__declspec(dllimport)
#endif
- void func_c();
+ void func_c(void);
-int main()
+int main(void)
{
func_c();
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-check.cmake
new file mode 100644
index 0000000..7003ade
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-check.cmake
@@ -0,0 +1,4 @@
+
+if (actual_stdout MATCHES "(/|-)-LIBFLAG${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}")
+ set (RunCMake_TEST_FAILED "Found unexpected '--LIBFLAG<base1>'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple2-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-consuming_LINK_LIBRARIES_DIRECT-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group1-check.cmake
index 255c9a6..255c9a6 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature1-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group1-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group1-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple1-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group1-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group2-check.cmake
index a8e0da7..a8e0da7 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature2-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group2-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-with-DEFAULT-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group2-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-with-DEFAULT-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-group2-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items1-check.cmake
index 54cef2c..54cef2c 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items1-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items1-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features4-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items1-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features4-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items1-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items2-check.cmake
index 7c38134..7c38134 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items2-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items2-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features3-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items2-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features3-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items2-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items3-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items3-check.cmake
index 88b5cf6..88b5cf6 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items3-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items3-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items3-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features2-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items3-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items4-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items4-check.cmake
index c473637..c473637 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items4-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items4-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items4-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features1-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-link-items4-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-check.cmake
new file mode 100644
index 0000000..eb1f755
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-check.cmake
@@ -0,0 +1,12 @@
+
+include("${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-NEW-build/LIBRARIES_PROCESSING.cmake")
+
+if (CMAKE_C_LINK_LIBRARIES_PROCESSING MATCHES "ORDER=FORWARD")
+ if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<base3> --SUFFIXGROUP'.")
+ endif()
+else()
+ if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base3> --LIBGROUP<base1> --SUFFIXGROUP'.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature2-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features1-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-check.cmake
new file mode 100644
index 0000000..eb1f755
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-check.cmake
@@ -0,0 +1,12 @@
+
+include("${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-NEW-build/LIBRARIES_PROCESSING.cmake")
+
+if (CMAKE_C_LINK_LIBRARIES_PROCESSING MATCHES "ORDER=FORWARD")
+ if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<base3> --SUFFIXGROUP'.")
+ endif()
+else()
+ if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base3> --LIBGROUP<base1> --SUFFIXGROUP'.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-nested-feature1-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features2-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-check.cmake
new file mode 100644
index 0000000..783bad9
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-check.cmake
@@ -0,0 +1,12 @@
+
+include("${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-NEW-build/LIBRARIES_PROCESSING.cmake")
+
+if (CMAKE_C_LINK_LIBRARIES_PROCESSING MATCHES "ORDER=FORWARD")
+ if (NOT actual_stdout MATCHES "${LINK_SHARED_LIBRARY_PREFIX}base2${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other2${LINK_EXTERN_LIBRARY_SUFFIX}\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other1${LINK_EXTERN_LIBRARY_SUFFIX}")
+ set (RunCMake_TEST_FAILED "Not found expected '<base2> --PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<base3> --SUFFIXGROUP <other2> <other1>'.")
+ endif()
+else()
+ if (NOT actual_stdout MATCHES "${LINK_SHARED_LIBRARY_PREFIX}base2${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other2${LINK_EXTERN_LIBRARY_SUFFIX}\"? +\"?(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other1${LINK_EXTERN_LIBRARY_SUFFIX}")
+ set (RunCMake_TEST_FAILED "Not found expected '<base2> --PREFIXGROUP --LIBGROUP<base3> --SUFFIXGROUP <other2> --PREFIXGROUP --LIBGROUP<base1> --SUFFIXGROUP <other1>'.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features3-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features3-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-mix-features3-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature1-check.cmake
index 255c9a6..255c9a6 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group1-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature1-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature1-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features2-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature1-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature2-check.cmake
index a8e0da7..a8e0da7 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group2-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature2-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature2-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features1-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-nested-feature2-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-check.cmake
new file mode 100644
index 0000000..ce72570
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-check.cmake
@@ -0,0 +1,12 @@
+
+include("${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-NEW-build/LIBRARIES_PROCESSING.cmake")
+
+if (CMAKE_C_LINK_LIBRARIES_PROCESSING MATCHES "ORDER=FORWARD")
+ if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other1")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base1> --LIBFLAG<base3> <other1>'.")
+ endif()
+else()
+ if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other1")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base3> --LIBFLAG<base1> <other1>'.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items4-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items4-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features1-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-check.cmake
new file mode 100644
index 0000000..817b6e2
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-check.cmake
@@ -0,0 +1,12 @@
+
+include("${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-NEW-build/LIBRARIES_PROCESSING.cmake")
+
+if (CMAKE_C_LINK_LIBRARIES_PROCESSING MATCHES "ORDER=FORWARD")
+ if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}other1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base1> --SUFFIXGROUP --LIBFLAG<base3> --PREFIXGROUP --LIBGROUP<other1> --SUFFIXGROUP'.")
+ endif()
+else()
+ if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUPother1${LINK_EXTERN_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base3> --PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<other1> --SUFFIXGROUP'.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items3-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items3-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features2-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-check.cmake
new file mode 100644
index 0000000..ce72570
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-check.cmake
@@ -0,0 +1,12 @@
+
+include("${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-NEW-build/LIBRARIES_PROCESSING.cmake")
+
+if (CMAKE_C_LINK_LIBRARIES_PROCESSING MATCHES "ORDER=FORWARD")
+ if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other1")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base1> --LIBFLAG<base3> <other1>'.")
+ endif()
+else()
+ if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other1")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base3> --LIBFLAG<base1> <other1>'.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items2-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features3-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-check.cmake
new file mode 100644
index 0000000..700bcf2
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-check.cmake
@@ -0,0 +1,12 @@
+
+include("${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-NEW-build/LIBRARIES_PROCESSING.cmake")
+
+if (CMAKE_C_LINK_LIBRARIES_PROCESSING MATCHES "ORDER=FORWARD")
+ if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUPother1${LINK_EXTERN_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP\"?")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base1> --SUFFIXGROUP --LIBFLAG<base3> --PREFIXGROUP --LIBGROUP<other1> --SUFFIXGROUP'.")
+ endif()
+else()
+ if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUPother1${LINK_EXTERN_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base3> --PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<other1> --SUFFIXGROUP'.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-link-items1-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-features4-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-check.cmake
new file mode 100644
index 0000000..3a44bc0
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-check.cmake
@@ -0,0 +1,12 @@
+
+include("${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-NEW-build/LIBRARIES_PROCESSING.cmake")
+
+if (CMAKE_C_LINK_LIBRARIES_PROCESSING MATCHES "ORDER=FORWARD")
+ if (NOT actual_stdout MATCHES "${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other1${LINK_EXTERN_LIBRARY_SUFFIX}\"?")
+ set (RunCMake_TEST_FAILED "Not found expected '<base1> --LIBFLAG<base3> <other1>'.")
+ endif()
+else()
+ if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other1${LINK_EXTERN_LIBRARY_SUFFIX}\"?")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base3> <base1> <other1>'.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group2-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-override-with-DEFAULT-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple1-check.cmake
index 32b58fe..32b58fe 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple2-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple1-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple1-result.txt
index 8d98f9d..8d98f9d 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-group1-result.txt
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple1-result.txt
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-check.cmake
index 32b58fe..32b58fe 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-simple1-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-NEW-simple2-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-check.cmake
new file mode 100644
index 0000000..e04526a
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-check.cmake
@@ -0,0 +1,3 @@
+if (actual_stdout MATCHES "(/|-)-LIBFLAG${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}")
+ set (RunCMake_TEST_FAILED "Found unexpected '--LIBFLAG<base1>'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-consuming_LINK_LIBRARIES_DIRECT-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-check.cmake
new file mode 100644
index 0000000..255c9a6
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base2${LINK_SHARED_LIBRARY_SUFFIX}")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base1> --LIBFLAG<base2>'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group1-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-check.cmake
new file mode 100644
index 0000000..a8e0da7
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base2${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<base2> --SUFFIXGROUP'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-group2-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-check.cmake
new file mode 100644
index 0000000..54cef2c
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?${CMAKE_LINK_LIBRARY_FLAG}other${LINK_EXTERN_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP <base1> <other> --SUFFIXGROUP'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items1-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-check.cmake
new file mode 100644
index 0000000..7c38134
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUPother${LINK_EXTERN_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<other> --SUFFIXGROUP'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items2-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-check.cmake
new file mode 100644
index 0000000..88b5cf6
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-ITEMFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBFLAGother${LINK_EXTERN_LIBRARY_SUFFIX}\"? +\"?(/|-)-ITEMFLAGother\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBFLAG<base1> --ITEMFLAG<base1> --LIBFLAG<other> --ITEMFLAG<other> --SUFFIXGROUP'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items3-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-check.cmake
new file mode 100644
index 0000000..c473637
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-ITEMFLAGother\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBFLAG<base1> --ITEMFLAG<other> --SUFFIXGROUP'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-link-items4-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-check.cmake
index ab06726..ab06726 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features2-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features1-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-check.cmake
index 858dcfe..ab06726 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features1-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-check.cmake
@@ -1,4 +1,4 @@
if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base3${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
- set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<base3> --SUFFIXGROUP'.")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base3> --LIBGROUP<base1> --SUFFIXGROUP'.")
endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features2-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features3-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-check.cmake
index 62aa17c..62aa17c 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-mix-features3-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-mix-features3-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-check.cmake
new file mode 100644
index 0000000..255c9a6
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base2${LINK_SHARED_LIBRARY_SUFFIX}")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base1> --LIBFLAG<base2>'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature1-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-check.cmake
new file mode 100644
index 0000000..a8e0da7
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-PREFIXGROUP\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base1${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-LIBGROUP.*${LINK_SHARED_LIBRARY_PREFIX}base2${LINK_SHARED_LIBRARY_SUFFIX}\"? +\"?(/|-)-SUFFIXGROUP")
+ set (RunCMake_TEST_FAILED "Not found expected '--PREFIXGROUP --LIBGROUP<base1> --LIBGROUP<base2> --SUFFIXGROUP'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-nested-feature2-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features3-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-check.cmake
index a9fba20..a9fba20 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features3-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features1-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features4-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-check.cmake
index 58c117e..58c117e 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features4-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features2-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-check.cmake
index a9fba20..a9fba20 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features1-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features3-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-check.cmake
index 58c117e..58c117e 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-features2-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-features4-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-with-DEFAULT-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-check.cmake
index d022f7e..d022f7e 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-override-with-DEFAULT-check.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-check.cmake
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-override-with-DEFAULT-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-check.cmake
new file mode 100644
index 0000000..32b58fe
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base1>'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple1-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-check.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-check.cmake
new file mode 100644
index 0000000..32b58fe
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "(/|-)-LIBFLAG.*${LINK_SHARED_LIBRARY_PREFIX}base1")
+ set (RunCMake_TEST_FAILED "Not found expected '--LIBFLAG<base1>'.")
+endif()
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-result.txt b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY-CMP0156-OLD-simple2-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY.cmake
index f19112a..0aa11be 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/LINK_LIBRARY.cmake
@@ -1,5 +1,12 @@
enable_language(C)
+if(CMP0156 STREQUAL "NEW")
+ cmake_policy(SET CMP0156 NEW)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LIBRARIES_PROCESSING.cmake" "set(CMAKE_C_LINK_LIBRARIES_PROCESSING \"${CMAKE_C_LINK_LIBRARIES_PROCESSING}\")\n")
+else()
+ cmake_policy(SET CMP0156 OLD)
+endif()
+
# ensure command line is always displayed and do not use any response file
set(CMAKE_VERBOSE_MAKEFILE TRUE)
set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
@@ -101,3 +108,10 @@ target_link_libraries(LinkLibrary_override_features4 PRIVATE "$<LINK_LIBRARY:fea
set_property(TARGET LinkLibrary_override_features4 PROPERTY LINK_LIBRARY_OVERRIDE "feat3,base1,other1")
set_property(TARGET LinkLibrary_override_features4 PROPERTY LINK_LIBRARY_OVERRIDE_base1 feat2)
set_property(TARGET LinkLibrary_override_features4 PROPERTY LINK_LIBRARY_OVERRIDE_other1 feat2)
+
+# testing NTERFACE_LINK_LIBRARIES_DIRECT property
+add_library(lib_with_LINK_LIBRARIES_DIRECT SHARED base.c)
+set_property(TARGET lib_with_LINK_LIBRARIES_DIRECT PROPERTY INTERFACE_LINK_LIBRARIES_DIRECT base1)
+
+add_library(LinkLibrary_consuming_LINK_LIBRARIES_DIRECT SHARED lib.c)
+target_link_libraries(LinkLibrary_consuming_LINK_LIBRARIES_DIRECT PRIVATE $<LINK_LIBRARY:feat1,lib_with_LINK_LIBRARIES_DIRECT>)
diff --git a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake
index 0f3a6b7..88a7e63 100644
--- a/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries-LINK_LIBRARY/RunCMakeTest.cmake
@@ -37,29 +37,35 @@ if ((RunCMake_GENERATOR MATCHES "Makefiles|Ninja|Xcode"
set(LINK_EXTERN_LIBRARY_SUFFIX "${CMAKE_IMPORT_LIBRARY_SUFFIX}")
endif()
- run_cmake(LINK_LIBRARY)
-
- run_cmake_target(LINK_LIBRARY simple1 LinkLibrary_simple1)
- run_cmake_target(LINK_LIBRARY simple2 LinkLibrary_simple2)
- run_cmake_target(LINK_LIBRARY group1 LinkLibrary_group1)
- run_cmake_target(LINK_LIBRARY group2 LinkLibrary_group2)
- run_cmake_target(LINK_LIBRARY nested-feature1 LinkLibrary_nested_feature1)
- run_cmake_target(LINK_LIBRARY nested-feature2 LinkLibrary_nested_feature2)
- run_cmake_target(LINK_LIBRARY link-items1 LinkLibrary_link_items1)
- run_cmake_target(LINK_LIBRARY link-items2 LinkLibrary_link_items2)
- run_cmake_target(LINK_LIBRARY link-items3 LinkLibrary_link_items3)
- run_cmake_target(LINK_LIBRARY link-items4 LinkLibrary_link_items4)
- run_cmake_target(LINK_LIBRARY mix-features1 LinkLibrary_mix_features1)
- run_cmake_target(LINK_LIBRARY mix-features2 LinkLibrary_mix_features2)
- run_cmake_target(LINK_LIBRARY mix-features3 LinkLibrary_mix_features3)
-
- # testing target property LINK_LIBRARY_OVERRIDE
- run_cmake_target(LINK_LIBRARY override-features1 LinkLibrary_override_features1)
- run_cmake_target(LINK_LIBRARY override-features2 LinkLibrary_override_features2)
- run_cmake_target(LINK_LIBRARY override-with-DEFAULT LinkLibrary_override_with_default)
- # testing target property LINK_LIBRARY_OVERRIDE_<LIBRARY>
- run_cmake_target(LINK_LIBRARY override-features3 LinkLibrary_override_features3)
- run_cmake_target(LINK_LIBRARY override-features4 LinkLibrary_override_features4)
+ foreach(policy IN ITEMS OLD NEW)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/LINK_LIBRARY-CMP0156-${policy}-build)
+ run_cmake_with_options(LINK_LIBRARY -DCMP0156=${policy})
+
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} simple1 LinkLibrary_simple1)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} simple2 LinkLibrary_simple2)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} group1 LinkLibrary_group1)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} group2 LinkLibrary_group2)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} nested-feature1 LinkLibrary_nested_feature1)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} nested-feature2 LinkLibrary_nested_feature2)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} link-items1 LinkLibrary_link_items1)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} link-items2 LinkLibrary_link_items2)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} link-items3 LinkLibrary_link_items3)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} link-items4 LinkLibrary_link_items4)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} mix-features1 LinkLibrary_mix_features1)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} mix-features2 LinkLibrary_mix_features2)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} mix-features3 LinkLibrary_mix_features3)
+
+ # testing target property LINK_LIBRARY_OVERRIDE
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} override-features1 LinkLibrary_override_features1)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} override-features2 LinkLibrary_override_features2)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} override-with-DEFAULT LinkLibrary_override_with_default)
+ # testing target property LINK_LIBRARY_OVERRIDE_<LIBRARY>
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} override-features3 LinkLibrary_override_features3)
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} override-features4 LinkLibrary_override_features4)
+
+ # testing target property INTERFACE_LINK_LIBRARIES_DIRECT
+ run_cmake_target(LINK_LIBRARY-CMP0156-${policy} consuming_LINK_LIBRARIES_DIRECT LinkLibrary_consuming_LINK_LIBRARIES_DIRECT)
+ endforeach()
run_cmake(imported-target)
diff --git a/Tests/RunCMake/target_link_libraries/lib.c b/Tests/RunCMake/target_link_libraries/lib.c
index b2d1b66..95c0e91 100644
--- a/Tests/RunCMake/target_link_libraries/lib.c
+++ b/Tests/RunCMake/target_link_libraries/lib.c
@@ -2,9 +2,9 @@
#if defined(_WIN32)
__declspec(dllimport)
#endif
- void func_c();
+ void func_c(void);
-void lib()
+void lib(void)
{
func_c();
}
diff --git a/Tests/RunCMake/try_compile/LinkOptions.cmake b/Tests/RunCMake/try_compile/LinkOptions.cmake
index 7fae35c..45cbedf 100644
--- a/Tests/RunCMake/try_compile/LinkOptions.cmake
+++ b/Tests/RunCMake/try_compile/LinkOptions.cmake
@@ -1,8 +1,5 @@
-
enable_language(C)
-cmake_policy(SET CMP0054 NEW)
-
set (lib_name "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lib${CMAKE_STATIC_LIBRARY_SUFFIX}")
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if (RunCMake_C_COMPILER_ID STREQUAL "MSVC"
diff --git a/Tests/RunCMake/try_compile/lib.c b/Tests/RunCMake/try_compile/lib.c
index b00c576..ce64a13 100644
--- a/Tests/RunCMake/try_compile/lib.c
+++ b/Tests/RunCMake/try_compile/lib.c
@@ -1,4 +1,4 @@
-void func()
+void func(void)
{
}
diff --git a/Tests/RunCMake/try_compile/main.c b/Tests/RunCMake/try_compile/main.c
index 2128ead..6b1e682 100644
--- a/Tests/RunCMake/try_compile/main.c
+++ b/Tests/RunCMake/try_compile/main.c
@@ -1,4 +1,4 @@
-extern void func();
+extern void func(void);
int main(void)
{
diff --git a/Tests/RunCMake/try_run/ConfigureLog-test.c b/Tests/RunCMake/try_run/ConfigureLog-test.c
index 6a8f125..465069d 100644
--- a/Tests/RunCMake/try_run/ConfigureLog-test.c
+++ b/Tests/RunCMake/try_run/ConfigureLog-test.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-int main()
+int main(void)
{
fprintf(stderr, "Output, with backslash '\\', on stderr!\n");
fflush(stderr); /* make output deterministic even if stderr is buffered */
diff --git a/Tests/RunCMake/try_run/Inspect.cmake b/Tests/RunCMake/try_run/Inspect.cmake
new file mode 100644
index 0000000..66698d6
--- /dev/null
+++ b/Tests/RunCMake/try_run/Inspect.cmake
@@ -0,0 +1,22 @@
+enable_language(C)
+enable_language(CXX)
+if(CMake_TEST_Fortran)
+ enable_language(Fortran)
+endif()
+
+set(info "")
+foreach(var
+ CMAKE_SYSTEM_NAME
+ CMAKE_C_COMPILER_ID
+ CMAKE_C_COMPILER_VERSION
+ CMAKE_CXX_COMPILER_ID
+ CMAKE_CXX_COMPILER_VERSION
+ CMAKE_Fortran_COMPILER_ID
+ CMAKE_Fortran_COMPILER_VERSION
+ )
+ if(DEFINED ${var})
+ string(APPEND info "set(${var} \"${${var}}\")\n")
+ endif()
+endforeach()
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/info.cmake" "${info}")
diff --git a/Tests/RunCMake/try_run/LinkOptions.cmake b/Tests/RunCMake/try_run/LinkOptions.cmake
index b9a87f3..b19141c 100644
--- a/Tests/RunCMake/try_run/LinkOptions.cmake
+++ b/Tests/RunCMake/try_run/LinkOptions.cmake
@@ -1,8 +1,5 @@
-
enable_language(C)
-cmake_policy(SET CMP0054 NEW)
-
set (lib_name "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lib${CMAKE_STATIC_LIBRARY_SUFFIX}")
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
if (RunCMake_C_COMPILER_ID STREQUAL "MSVC"
diff --git a/Tests/RunCMake/try_run/LinkerLanguage.cmake b/Tests/RunCMake/try_run/LinkerLanguage.cmake
new file mode 100644
index 0000000..137e198
--- /dev/null
+++ b/Tests/RunCMake/try_run/LinkerLanguage.cmake
@@ -0,0 +1,29 @@
+enable_language(CXX)
+enable_language(Fortran)
+
+set (lib_name "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}lib${CMAKE_STATIC_LIBRARY_SUFFIX}")
+if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
+ if (CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set (undef_flag -u _func)
+ else()
+ set (undef_flag -u func)
+ endif()
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ set (undef_flag -u _func)
+else()
+ set (undef_flag -u func)
+endif()
+
+set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE)
+try_run(run_result compile_result
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/lib.cxx ${CMAKE_CURRENT_SOURCE_DIR}/main.f90
+ COMPILE_OUTPUT_VARIABLE compile_out
+ RUN_OUTPUT_VARIABLE run_out
+ LINKER_LANGUAGE Fortran)
+
+if(NOT compile_result)
+ message(FATAL_ERROR "try_run(... LINKER_LANGUAGE Fortran) compilation failed:\n${compile_out}")
+endif()
+if(run_result STREQUAL "FAILED_TO_RUN")
+ message(FATAL_ERROR "try_run(... LINKER_LANGUAGE Fortran) execution failed:\n${run_out}")
+endif()
diff --git a/Tests/RunCMake/try_run/RunCMakeTest.cmake b/Tests/RunCMake/try_run/RunCMakeTest.cmake
index 62e3caf..7e9b2d1 100644
--- a/Tests/RunCMake/try_run/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_run/RunCMakeTest.cmake
@@ -1,5 +1,16 @@
include(RunCMake)
+# Detect information from the toolchain:
+# - CMAKE_SYSTEM_NAME
+# - CMAKE_C_COMPILER_ID
+# - CMAKE_C_COMPILER_VERSION
+# - CMAKE_CXX_COMPILER_ID
+# - CMAKE_CXX_COMPILER_VERSION
+run_cmake_with_options(Inspect
+ -DCMake_TEST_Fortran=${CMake_TEST_Fortran}
+ )
+include("${RunCMake_BINARY_DIR}/Inspect-build/info.cmake")
+
run_cmake(BinDirEmpty)
run_cmake(BinDirRelative)
run_cmake(NoOutputVariable)
@@ -19,3 +30,9 @@ if (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$" AND
run_cmake(LinkOptions)
unset (RunCMake_TEST_OPTIONS)
endif()
+
+if (CMAKE_SYSTEM_NAME MATCHES "^(Linux|Darwin|Windows)$" AND
+ CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$" AND
+ (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" AND CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3))
+ run_cmake(LinkerLanguage)
+endif()
diff --git a/Tests/RunCMake/try_run/lib.c b/Tests/RunCMake/try_run/lib.c
index b00c576..ce64a13 100644
--- a/Tests/RunCMake/try_run/lib.c
+++ b/Tests/RunCMake/try_run/lib.c
@@ -1,4 +1,4 @@
-void func()
+void func(void)
{
}
diff --git a/Tests/RunCMake/try_run/lib.cxx b/Tests/RunCMake/try_run/lib.cxx
new file mode 100644
index 0000000..b01a075
--- /dev/null
+++ b/Tests/RunCMake/try_run/lib.cxx
@@ -0,0 +1,4 @@
+
+extern "C" void func()
+{
+}
diff --git a/Tests/RunCMake/try_run/main.c b/Tests/RunCMake/try_run/main.c
index 2128ead..6b1e682 100644
--- a/Tests/RunCMake/try_run/main.c
+++ b/Tests/RunCMake/try_run/main.c
@@ -1,4 +1,4 @@
-extern void func();
+extern void func(void);
int main(void)
{
diff --git a/Tests/RunCMake/try_run/main.f90 b/Tests/RunCMake/try_run/main.f90
new file mode 100644
index 0000000..29b933e
--- /dev/null
+++ b/Tests/RunCMake/try_run/main.f90
@@ -0,0 +1,12 @@
+program main
+
+implicit none
+
+interface
+subroutine func() bind(C)
+end subroutine
+end interface
+
+call func()
+
+end program
diff --git a/Tests/RuntimePath/bar1.c b/Tests/RuntimePath/bar1.c
index 5dc5ec9..11b3a74 100644
--- a/Tests/RuntimePath/bar1.c
+++ b/Tests/RuntimePath/bar1.c
@@ -1,5 +1,5 @@
-extern int foo1();
-int bar1()
+extern int foo1(void);
+int bar1(void)
{
return foo1();
}
diff --git a/Tests/RuntimePath/bar2.c b/Tests/RuntimePath/bar2.c
index 9035489..a117f6f 100644
--- a/Tests/RuntimePath/bar2.c
+++ b/Tests/RuntimePath/bar2.c
@@ -1,5 +1,5 @@
-extern int foo2();
-int bar2()
+extern int foo2(void);
+int bar2(void)
{
return foo2();
}
diff --git a/Tests/RuntimePath/foo1.c b/Tests/RuntimePath/foo1.c
index dfcb0b7..14370ac 100644
--- a/Tests/RuntimePath/foo1.c
+++ b/Tests/RuntimePath/foo1.c
@@ -1,4 +1,4 @@
-int foo1()
+int foo1(void)
{
return 0;
}
diff --git a/Tests/RuntimePath/foo2.c b/Tests/RuntimePath/foo2.c
index 12a3e77..a105df9 100644
--- a/Tests/RuntimePath/foo2.c
+++ b/Tests/RuntimePath/foo2.c
@@ -1,4 +1,4 @@
-int foo2()
+int foo2(void)
{
return 0;
}
diff --git a/Tests/RuntimePath/main.c b/Tests/RuntimePath/main.c
index c71ee06..f25b493 100644
--- a/Tests/RuntimePath/main.c
+++ b/Tests/RuntimePath/main.c
@@ -1,5 +1,5 @@
-extern int bar1();
-int main()
+extern int bar1(void);
+int main(void)
{
return bar1();
}
diff --git a/Tests/SetLang/bar.c b/Tests/SetLang/bar.c
index 515e8c2..3a299dc 100644
--- a/Tests/SetLang/bar.c
+++ b/Tests/SetLang/bar.c
@@ -20,7 +20,7 @@ public:
int i;
};
-int main()
+int main(void)
{
A a;
if (a.i == 21) {
diff --git a/Tests/Simple/simpleCLib.c b/Tests/Simple/simpleCLib.c
index 6509865..90c4440 100644
--- a/Tests/Simple/simpleCLib.c
+++ b/Tests/Simple/simpleCLib.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-int FooBar()
+int FooBar(void)
{
int class;
int private = 10;
diff --git a/Tests/SimpleCOnly/bar.c b/Tests/SimpleCOnly/bar.c
index 570fee9..6c7605a 100644
--- a/Tests/SimpleCOnly/bar.c
+++ b/Tests/SimpleCOnly/bar.c
@@ -1,4 +1,4 @@
-int bar()
+int bar(void)
{
return 5;
}
diff --git a/Tests/SimpleCOnly/foo.c b/Tests/SimpleCOnly/foo.c
index c61d212..c12b865 100644
--- a/Tests/SimpleCOnly/foo.c
+++ b/Tests/SimpleCOnly/foo.c
@@ -1,4 +1,4 @@
-int foo()
+int foo(void)
{
return 12;
}
diff --git a/Tests/SimpleCOnly/main.c b/Tests/SimpleCOnly/main.c
index 54a7312..ad4c75c 100644
--- a/Tests/SimpleCOnly/main.c
+++ b/Tests/SimpleCOnly/main.c
@@ -3,7 +3,7 @@
extern int foo();
extern int bar();
-int main()
+int main(void)
{
int i = foo();
int k = bar();
diff --git a/Tests/SourceFileIncludeDirProperty/main.c b/Tests/SourceFileIncludeDirProperty/main.c
index 36144ca..d32e2ad 100644
--- a/Tests/SourceFileIncludeDirProperty/main.c
+++ b/Tests/SourceFileIncludeDirProperty/main.c
@@ -1,7 +1,7 @@
#include "header.h"
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/SourceFileProperty/ICaseTest.c b/Tests/SourceFileProperty/ICaseTest.c
index 454c721..70ae53e 100644
--- a/Tests/SourceFileProperty/ICaseTest.c
+++ b/Tests/SourceFileProperty/ICaseTest.c
@@ -1,6 +1,6 @@
#ifdef NEEDED_TO_WORK
-int icasetest()
+int icasetest(void)
{
return 0;
}
diff --git a/Tests/SourceGroups/main.c b/Tests/SourceGroups/main.c
index f646b49..85a6c8b 100644
--- a/Tests/SourceGroups/main.c
+++ b/Tests/SourceGroups/main.c
@@ -14,7 +14,7 @@ extern int tree_foobar(void);
extern int tree_baz(void);
extern int nested(void);
-int main()
+int main(void)
{
printf("foo: %d bar: %d foobar: %d barbar: %d baz: %d\n", foo(), bar(),
foobar(), barbar(), baz());
diff --git a/Tests/SourceGroups/sub2/main.c b/Tests/SourceGroups/sub2/main.c
index 4cd8ae0..6a195bc 100644
--- a/Tests/SourceGroups/sub2/main.c
+++ b/Tests/SourceGroups/sub2/main.c
@@ -3,7 +3,7 @@
extern int qax(void);
extern int qux(void);
-int main()
+int main(void)
{
printf("qux: %d qax: %d\n", qux(), qax());
diff --git a/Tests/SubDir/AnotherSubdir/pair+int.int.c b/Tests/SubDir/AnotherSubdir/pair+int.int.c
index b7a6237..6e719fe 100644
--- a/Tests/SubDir/AnotherSubdir/pair+int.int.c
+++ b/Tests/SubDir/AnotherSubdir/pair+int.int.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_stuff()
+void pair_stuff(void)
{
printf("Placeholder for a strange file in subdirectory\n");
}
diff --git a/Tests/SubDir/AnotherSubdir/pair_int.int.c b/Tests/SubDir/AnotherSubdir/pair_int.int.c
index b7a6237..6e719fe 100644
--- a/Tests/SubDir/AnotherSubdir/pair_int.int.c
+++ b/Tests/SubDir/AnotherSubdir/pair_int.int.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_stuff()
+void pair_stuff(void)
{
printf("Placeholder for a strange file in subdirectory\n");
}
diff --git a/Tests/SubDir/AnotherSubdir/secondone.c b/Tests/SubDir/AnotherSubdir/secondone.c
index 3e9e5af..0dd9c6b 100644
--- a/Tests/SubDir/AnotherSubdir/secondone.c
+++ b/Tests/SubDir/AnotherSubdir/secondone.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void secondone()
+void secondone(void)
{
printf("Hello again\n");
}
diff --git a/Tests/SubDir/AnotherSubdir/testfromsubdir.c b/Tests/SubDir/AnotherSubdir/testfromsubdir.c
index 34b6e7a..5e72140 100644
--- a/Tests/SubDir/AnotherSubdir/testfromsubdir.c
+++ b/Tests/SubDir/AnotherSubdir/testfromsubdir.c
@@ -4,7 +4,7 @@ void secondone();
void pair_stuff();
void vcl_stuff();
-int main()
+int main(void)
{
printf("Hello from subdirectory\n");
secondone();
diff --git a/Tests/SubDir/ThirdSubDir/pair+int.int1.c b/Tests/SubDir/ThirdSubDir/pair+int.int1.c
index b7a6237..6e719fe 100644
--- a/Tests/SubDir/ThirdSubDir/pair+int.int1.c
+++ b/Tests/SubDir/ThirdSubDir/pair+int.int1.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_stuff()
+void pair_stuff(void)
{
printf("Placeholder for a strange file in subdirectory\n");
}
diff --git a/Tests/SubDir/ThirdSubDir/pair_int.int1.c b/Tests/SubDir/ThirdSubDir/pair_int.int1.c
index b7a6237..6e719fe 100644
--- a/Tests/SubDir/ThirdSubDir/pair_int.int1.c
+++ b/Tests/SubDir/ThirdSubDir/pair_int.int1.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_stuff()
+void pair_stuff(void)
{
printf("Placeholder for a strange file in subdirectory\n");
}
diff --git a/Tests/SubDir/ThirdSubDir/pair_p_int.int1.c b/Tests/SubDir/ThirdSubDir/pair_p_int.int1.c
index 95a66ee..3cf9442 100644
--- a/Tests/SubDir/ThirdSubDir/pair_p_int.int1.c
+++ b/Tests/SubDir/ThirdSubDir/pair_p_int.int1.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_p_stuff()
+void pair_p_stuff(void)
{
printf("Placeholder for another strange file in subdirectory\n");
}
diff --git a/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c b/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c
index d162084..448ef52 100644
--- a/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c
+++ b/Tests/SubDir/ThirdSubDir/testfromauxsubdir.c
@@ -5,7 +5,7 @@ void pair_stuff();
void pair_p_stuff();
void vcl_stuff();
-int main()
+int main(void)
{
printf("Hello from subdirectory\n");
secondone();
diff --git a/Tests/SubDir/ThirdSubDir/thirdone.c b/Tests/SubDir/ThirdSubDir/thirdone.c
index 3e9e5af..0dd9c6b 100644
--- a/Tests/SubDir/ThirdSubDir/thirdone.c
+++ b/Tests/SubDir/ThirdSubDir/thirdone.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void secondone()
+void secondone(void)
{
printf("Hello again\n");
}
diff --git a/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c b/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c
index a0c60f7..689c827 100644
--- a/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c
+++ b/Tests/SubDir/vcl_algorithm+vcl_pair+double.foo.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void vcl_stuff()
+void vcl_stuff(void)
{
printf("Placeholder for a file with strange name\n");
}
diff --git a/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c b/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c
index a0c60f7..689c827 100644
--- a/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c
+++ b/Tests/SubDir/vcl_algorithm_vcl_pair_double.foo.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void vcl_stuff()
+void vcl_stuff(void)
{
printf("Placeholder for a file with strange name\n");
}
diff --git a/Tests/SubDirSpaces/Another Subdir/pair+int.int.c b/Tests/SubDirSpaces/Another Subdir/pair+int.int.c
index b7a6237..6e719fe 100644
--- a/Tests/SubDirSpaces/Another Subdir/pair+int.int.c
+++ b/Tests/SubDirSpaces/Another Subdir/pair+int.int.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_stuff()
+void pair_stuff(void)
{
printf("Placeholder for a strange file in subdirectory\n");
}
diff --git a/Tests/SubDirSpaces/Another Subdir/pair_int.int.c b/Tests/SubDirSpaces/Another Subdir/pair_int.int.c
index b7a6237..6e719fe 100644
--- a/Tests/SubDirSpaces/Another Subdir/pair_int.int.c
+++ b/Tests/SubDirSpaces/Another Subdir/pair_int.int.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_stuff()
+void pair_stuff(void)
{
printf("Placeholder for a strange file in subdirectory\n");
}
diff --git a/Tests/SubDirSpaces/Another Subdir/secondone.c b/Tests/SubDirSpaces/Another Subdir/secondone.c
index 3e9e5af..0dd9c6b 100644
--- a/Tests/SubDirSpaces/Another Subdir/secondone.c
+++ b/Tests/SubDirSpaces/Another Subdir/secondone.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void secondone()
+void secondone(void)
{
printf("Hello again\n");
}
diff --git a/Tests/SubDirSpaces/Another Subdir/testfromsubdir.c b/Tests/SubDirSpaces/Another Subdir/testfromsubdir.c
index 34b6e7a..5e72140 100644
--- a/Tests/SubDirSpaces/Another Subdir/testfromsubdir.c
+++ b/Tests/SubDirSpaces/Another Subdir/testfromsubdir.c
@@ -4,7 +4,7 @@ void secondone();
void pair_stuff();
void vcl_stuff();
-int main()
+int main(void)
{
printf("Hello from subdirectory\n");
secondone();
diff --git a/Tests/SubDirSpaces/Some(x86) Sources/test.c b/Tests/SubDirSpaces/Some(x86) Sources/test.c
index 66568d4..5baf240 100644
--- a/Tests/SubDirSpaces/Some(x86) Sources/test.c
+++ b/Tests/SubDirSpaces/Some(x86) Sources/test.c
@@ -1,3 +1,3 @@
-void testOdd()
+void testOdd(void)
{
}
diff --git a/Tests/SubDirSpaces/ThirdSubDir/pair+int.int1.c b/Tests/SubDirSpaces/ThirdSubDir/pair+int.int1.c
index b7a6237..6e719fe 100644
--- a/Tests/SubDirSpaces/ThirdSubDir/pair+int.int1.c
+++ b/Tests/SubDirSpaces/ThirdSubDir/pair+int.int1.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_stuff()
+void pair_stuff(void)
{
printf("Placeholder for a strange file in subdirectory\n");
}
diff --git a/Tests/SubDirSpaces/ThirdSubDir/pair_int.int1.c b/Tests/SubDirSpaces/ThirdSubDir/pair_int.int1.c
index b7a6237..6e719fe 100644
--- a/Tests/SubDirSpaces/ThirdSubDir/pair_int.int1.c
+++ b/Tests/SubDirSpaces/ThirdSubDir/pair_int.int1.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_stuff()
+void pair_stuff(void)
{
printf("Placeholder for a strange file in subdirectory\n");
}
diff --git a/Tests/SubDirSpaces/ThirdSubDir/pair_p_int.int1.c b/Tests/SubDirSpaces/ThirdSubDir/pair_p_int.int1.c
index 95a66ee..3cf9442 100644
--- a/Tests/SubDirSpaces/ThirdSubDir/pair_p_int.int1.c
+++ b/Tests/SubDirSpaces/ThirdSubDir/pair_p_int.int1.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void pair_p_stuff()
+void pair_p_stuff(void)
{
printf("Placeholder for another strange file in subdirectory\n");
}
diff --git a/Tests/SubDirSpaces/ThirdSubDir/testfromauxsubdir.c b/Tests/SubDirSpaces/ThirdSubDir/testfromauxsubdir.c
index fa6c33c..2bff654 100644
--- a/Tests/SubDirSpaces/ThirdSubDir/testfromauxsubdir.c
+++ b/Tests/SubDirSpaces/ThirdSubDir/testfromauxsubdir.c
@@ -7,7 +7,7 @@ void vcl_stuff();
#ifdef CMAKE_PAREN
void testOdd();
#endif
-int main()
+int main(void)
{
printf("Hello from subdirectory\n");
secondone();
diff --git a/Tests/SubDirSpaces/ThirdSubDir/thirdone.c b/Tests/SubDirSpaces/ThirdSubDir/thirdone.c
index 3e9e5af..0dd9c6b 100644
--- a/Tests/SubDirSpaces/ThirdSubDir/thirdone.c
+++ b/Tests/SubDirSpaces/ThirdSubDir/thirdone.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void secondone()
+void secondone(void)
{
printf("Hello again\n");
}
diff --git a/Tests/SubDirSpaces/vcl_algorithm+vcl_pair+double.foo.c b/Tests/SubDirSpaces/vcl_algorithm+vcl_pair+double.foo.c
index a0c60f7..689c827 100644
--- a/Tests/SubDirSpaces/vcl_algorithm+vcl_pair+double.foo.c
+++ b/Tests/SubDirSpaces/vcl_algorithm+vcl_pair+double.foo.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void vcl_stuff()
+void vcl_stuff(void)
{
printf("Placeholder for a file with strange name\n");
}
diff --git a/Tests/SubDirSpaces/vcl_algorithm_vcl_pair_double.foo.c b/Tests/SubDirSpaces/vcl_algorithm_vcl_pair_double.foo.c
index a0c60f7..689c827 100644
--- a/Tests/SubDirSpaces/vcl_algorithm_vcl_pair_double.foo.c
+++ b/Tests/SubDirSpaces/vcl_algorithm_vcl_pair_double.foo.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-void vcl_stuff()
+void vcl_stuff(void)
{
printf("Placeholder for a file with strange name\n");
}
diff --git a/Tests/SwiftOnly/CMakeLists.txt b/Tests/SwiftOnly/CMakeLists.txt
index 13cf2b1..2aa5710 100644
--- a/Tests/SwiftOnly/CMakeLists.txt
+++ b/Tests/SwiftOnly/CMakeLists.txt
@@ -2,6 +2,9 @@ cmake_minimum_required(VERSION 3.3)
if(POLICY CMP0126)
cmake_policy(SET CMP0126 NEW)
endif()
+if(POLICY CMP0157)
+ cmake_policy(SET CMP0157 NEW)
+endif()
# NOTE: Force the Release mode configuration as there are some issues with the
# debug information handling on macOS on certain Xcode builds.
@@ -40,6 +43,13 @@ add_library(N N.swift)
target_link_libraries(N PUBLIC
M)
+if(NOT XCODE_VERSION OR XCODE_VERSION VERSION_GREATER_EQUAL 9.0)
+ # TODO: Add a wholemodule object-library test once that is working
+ add_library(O OBJECT O.swift L.swift)
+ target_link_libraries(N PUBLIC O)
+ set_target_properties(O PROPERTIES Swift_COMPILATION_MODE "incremental")
+endif()
+
# Dummy to make sure generation works with such targets.
add_library(SwiftIface INTERFACE)
target_link_libraries(SwiftOnly PRIVATE SwiftIface)
@@ -54,3 +64,21 @@ target_link_libraries(SwiftOnly PRIVATE SwiftIface)
if(CMAKE_Swift_COMPILER_VERSION VERSION_GREATER_EQUAL 5.2)
add_subdirectory("SwiftPlugin")
endif()
+
+function(test_cmp0157_default mode)
+ if(POLICY CMP0157)
+ cmake_policy(GET CMP0157 cmp0157_wmo)
+ if(cmp0157_wmo STREQUAL "NEW")
+ set(CMAKE_Swift_COMPILATION_MODE "${mode}")
+ add_executable(hi_${mode} main.swift)
+ get_target_property(${mode}_swift_comp_mode hi_${mode} "Swift_COMPILATION_MODE")
+ if(NOT ${mode}_swift_comp_mode STREQUAL ${mode})
+ message(SEND_ERROR "expected ${mode} -- found ${${mode}_swift_comp_mode}")
+ endif()
+ endif()
+ endif()
+endfunction()
+
+test_cmp0157_default("wholemodule")
+test_cmp0157_default("incremental")
+test_cmp0157_default("singlefile")
diff --git a/Tests/SwiftOnly/O.swift b/Tests/SwiftOnly/O.swift
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/SwiftOnly/O.swift
diff --git a/Tests/TryCompile/Inner/innerexe.c b/Tests/TryCompile/Inner/innerexe.c
index e329c5f..6d1e3da 100644
--- a/Tests/TryCompile/Inner/innerexe.c
+++ b/Tests/TryCompile/Inner/innerexe.c
@@ -1,5 +1,5 @@
extern int innerlib(void);
-int main()
+int main(void)
{
return innerlib();
}
diff --git a/Tests/TryCompile/check_a_b.c b/Tests/TryCompile/check_a_b.c
index 05fba0f..65535ac 100644
--- a/Tests/TryCompile/check_a_b.c
+++ b/Tests/TryCompile/check_a_b.c
@@ -4,7 +4,7 @@
#ifndef DEF_B
# error DEF_B not defined
#endif
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/TryCompile/exit_success.c b/Tests/TryCompile/exit_success.c
index 82f5b5f..302d926 100644
--- a/Tests/TryCompile/exit_success.c
+++ b/Tests/TryCompile/exit_success.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-int main()
+int main(void)
{
printf("hello world\n");
return 0;
diff --git a/Tests/TryCompile/exit_with_error.c b/Tests/TryCompile/exit_with_error.c
index dbddcf5..dfa36fc 100644
--- a/Tests/TryCompile/exit_with_error.c
+++ b/Tests/TryCompile/exit_with_error.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-int main()
+int main(void)
{
printf("hello world\n");
return 1;
diff --git a/Tests/TryCompile/pass.c b/Tests/TryCompile/pass.c
index f8b643a..8488f4e 100644
--- a/Tests/TryCompile/pass.c
+++ b/Tests/TryCompile/pass.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/TryCompile/pass2a.c b/Tests/TryCompile/pass2a.c
index 27c377b..8375a8e 100644
--- a/Tests/TryCompile/pass2a.c
+++ b/Tests/TryCompile/pass2a.c
@@ -1,5 +1,5 @@
extern int pass2b(void);
-int main()
+int main(void)
{
return pass2b();
}
diff --git a/Tests/TryCompile/stdout_and_stderr.c b/Tests/TryCompile/stdout_and_stderr.c
index 84ded1f..c25b7d9 100644
--- a/Tests/TryCompile/stdout_and_stderr.c
+++ b/Tests/TryCompile/stdout_and_stderr.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-int main()
+int main(void)
{
fputs("error\n", stderr);
puts("hello world\n");
diff --git a/Tests/Unset/unset.c b/Tests/Unset/unset.c
index f8b643a..8488f4e 100644
--- a/Tests/Unset/unset.c
+++ b/Tests/Unset/unset.c
@@ -1,4 +1,4 @@
-int main()
+int main(void)
{
return 0;
}
diff --git a/Tests/VSGNUFortran/c_code/main.c b/Tests/VSGNUFortran/c_code/main.c
index 60c1120..be868c3 100644
--- a/Tests/VSGNUFortran/c_code/main.c
+++ b/Tests/VSGNUFortran/c_code/main.c
@@ -1,6 +1,6 @@
#include <HelloWorldFCMangle.h> /* created by FortranCInterface */
extern void FC_hello(void);
-int main()
+int main(void)
{
FC_hello();
return 0;
diff --git a/Tests/Visibility/bar.c b/Tests/Visibility/bar.c
index b72a1a5..e1f4df6 100644
--- a/Tests/Visibility/bar.c
+++ b/Tests/Visibility/bar.c
@@ -1,3 +1,3 @@
-void bar()
+void bar(void)
{
}
diff --git a/Tests/X11/X11.c b/Tests/X11/X11.c
index 3a6f9f0..9f002f6 100644
--- a/Tests/X11/X11.c
+++ b/Tests/X11/X11.c
@@ -4,7 +4,7 @@
# include <X11/Xlib.h>
# include <X11/Xutil.h>
-int main()
+int main(void)
{
printf("There is X on this computer\n");
return 0;
@@ -12,7 +12,7 @@ int main()
#else
-int main()
+int main(void)
{
printf("No X on this computer\n");
return 0;
diff --git a/Tests/XCTest/FrameworkExample/FrameworkExample.c b/Tests/XCTest/FrameworkExample/FrameworkExample.c
index 77361c8..9da1bf2 100644
--- a/Tests/XCTest/FrameworkExample/FrameworkExample.c
+++ b/Tests/XCTest/FrameworkExample/FrameworkExample.c
@@ -1,6 +1,6 @@
#include "FrameworkExample.h"
-int FourtyTwo()
+int FourtyTwo(void)
{
return 42;
}