summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt6
-rw-r--r--Tests/CMakeLib/CMakeLists.txt2
-rw-r--r--Tests/CMakeLib/testCMExtAlgorithm.cxx117
-rw-r--r--Tests/CMakeLib/testCMExtMemory.cxx65
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec.cxx122
-rw-r--r--Tests/CMakeLib/testUTF8.cxx2
-rw-r--r--Tests/CMakeLists.txt61
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt11
-rw-r--r--Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt18
-rw-r--r--Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt16
-rw-r--r--Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt5
-rw-r--r--Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake9
-rw-r--r--Tests/CMakeTestMultipleConfigures/RunCMake.cmake6
-rw-r--r--Tests/CMakeTests/CMakeLists.txt3
-rw-r--r--Tests/CMakeTests/FileDownloadTest.cmake.in81
-rw-r--r--Tests/CMakeTests/FileTestScript.cmake2
-rw-r--r--Tests/CPackComponentsDEB/CMakeLists.txt2
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake5
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake5
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake2
-rw-r--r--Tests/CPackNSISGenerator/CMakeLists.txt20
-rw-r--r--Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake46
-rw-r--r--Tests/CPackNSISGenerator/header-icon.bmpbin0 -> 28166 bytes
-rw-r--r--Tests/CPackNSISGenerator/header-image.bmpbin0 -> 28166 bytes
-rw-r--r--Tests/CPackNSISGenerator/install.icobin0 -> 838 bytes
-rw-r--r--Tests/CPackNSISGenerator/main.cpp4
-rw-r--r--Tests/CPackNSISGenerator/uninstall.icobin0 -> 838 bytes
-rw-r--r--Tests/Complex/CMakeLists.txt2
-rw-r--r--Tests/Complex/Library/CMakeLists.txt2
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt2
-rw-r--r--Tests/ComplexOneConfig/Library/CMakeLists.txt2
-rw-r--r--Tests/Contracts/VTK/CMakeLists.txt2
-rw-r--r--Tests/Cuda/CMakeLists.txt19
-rw-r--r--Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt (renamed from Tests/Cuda/MixedStandardLevels/CMakeLists.txt)8
-rw-r--r--Tests/Cuda/CXXStandardSetTwice/main.cu (renamed from Tests/Cuda/MixedStandardLevels/main.cu)0
-rw-r--r--Tests/Cuda/IncludePathNoToolkit/CMakeLists.txt (renamed from Tests/Cuda/ToolkitInclude/CMakeLists.txt)6
-rw-r--r--Tests/Cuda/IncludePathNoToolkit/main.cpp (renamed from Tests/Cuda/ToolkitInclude/main.cpp)0
-rw-r--r--Tests/Cuda/MixedStandardLevels1/CMakeLists.txt14
-rw-r--r--Tests/Cuda/MixedStandardLevels1/lib.cpp7
-rw-r--r--Tests/Cuda/MixedStandardLevels1/main.cu9
-rw-r--r--Tests/Cuda/MixedStandardLevels2/CMakeLists.txt14
-rw-r--r--Tests/Cuda/MixedStandardLevels2/lib.cpp7
-rw-r--r--Tests/Cuda/MixedStandardLevels2/main.cu11
-rw-r--r--Tests/Cuda/MixedStandardLevels3/CMakeLists.txt12
-rw-r--r--Tests/Cuda/MixedStandardLevels3/lib.cpp7
-rw-r--r--Tests/Cuda/MixedStandardLevels3/main.cu5
-rw-r--r--Tests/Cuda/MixedStandardLevels4/CMakeLists.txt14
-rw-r--r--Tests/Cuda/MixedStandardLevels4/lib.cpp16
-rw-r--r--Tests/Cuda/MixedStandardLevels4/main.cu5
-rw-r--r--Tests/Cuda/MixedStandardLevels5/CMakeLists.txt13
-rw-r--r--Tests/Cuda/MixedStandardLevels5/lib.cpp13
-rw-r--r--Tests/Cuda/MixedStandardLevels5/main.cu8
-rw-r--r--Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt3
-rw-r--r--Tests/Cuda/SeparableCompCXXOnly/main.cpp5
-rw-r--r--Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt35
-rw-r--r--Tests/Cuda/SharedRuntimePlusToolkit/curand.cpp65
-rw-r--r--Tests/Cuda/SharedRuntimePlusToolkit/main.cpp23
-rw-r--r--Tests/Cuda/SharedRuntimePlusToolkit/mixed.cpp16
-rw-r--r--Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp92
-rw-r--r--Tests/Cuda/SharedRuntimePlusToolkit/shared.cpp16
-rw-r--r--Tests/Cuda/SharedRuntimePlusToolkit/static.cpp16
-rw-r--r--Tests/Cuda/StaticRuntimePlusToolkit/CMakeLists.txt29
-rw-r--r--Tests/Cuda/StaticRuntimePlusToolkit/curand.cpp59
-rw-r--r--Tests/Cuda/StaticRuntimePlusToolkit/main.cpp11
-rw-r--r--Tests/Cuda/StaticRuntimePlusToolkit/mixed.cpp8
-rw-r--r--Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp86
-rw-r--r--Tests/Cuda/StaticRuntimePlusToolkit/shared.cpp8
-rw-r--r--Tests/Cuda/StaticRuntimePlusToolkit/static.cpp8
-rw-r--r--Tests/Cuda/Toolkit/CMakeLists.txt38
-rw-r--r--Tests/Cuda/Toolkit/main.cpp8
-rw-r--r--Tests/CudaOnly/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/EnableStandard/CMakeLists.txt5
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt4
-rw-r--r--Tests/CudaOnly/SeparateCompilation/CMakeLists.txt6
-rw-r--r--Tests/CudaOnly/Standard98/CMakeLists.txt15
-rw-r--r--Tests/CudaOnly/Standard98/main.cu8
-rw-r--r--Tests/CudaOnly/Toolkit/CMakeLists.txt44
-rw-r--r--Tests/CudaOnly/Toolkit/main.cu8
-rw-r--r--Tests/CudaOnly/WithDefs/CMakeLists.txt2
-rw-r--r--Tests/CustomCommand/CMakeLists.txt36
-rw-r--r--Tests/EnforceConfig.cmake.in1
-rw-r--r--Tests/ExportImport/CMakeLists.txt2
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt19
-rw-r--r--Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt2
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt13
-rw-r--r--Tests/ExportImport/InitialCache.cmake.in1
-rw-r--r--Tests/ExternalProject/CMakeLists.txt60
-rw-r--r--Tests/ExternalProject/gitrepo-sub-rec.tgzbin0 -> 9008 bytes
-rw-r--r--Tests/FindLibArchive/CMakeLists.txt10
-rw-r--r--Tests/FindLibArchive/Test/CMakeLists.txt14
-rw-r--r--Tests/FindLibArchive/Test/main.c7
-rw-r--r--Tests/FindLibXml2/Test/CMakeLists.txt4
-rw-r--r--Tests/FindPackageModeMakefileTest/CMakeLists.txt8
-rw-r--r--Tests/FindPackageModeMakefileTest/Makefile.in3
-rw-r--r--Tests/FindPython/CMakeLists.txt55
-rw-r--r--Tests/FindPython/CustomFailureMessage/CMakeLists.txt79
-rw-r--r--Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt5
-rw-r--r--Tests/FindPython/SOABI/CMakeLists.txt12
-rw-r--r--Tests/FindPython/VirtualEnv/CMakeLists.txt4
-rw-r--r--Tests/FindPython/VirtualEnvConda/CMakeLists.txt46
-rw-r--r--Tests/FindPython/VirtualEnvConda/VirtualEnvDefault.cmake6
-rw-r--r--Tests/FindPython/VirtualEnvConda/VirtualEnvOnly.cmake16
-rw-r--r--Tests/FindPython/VirtualEnvConda/VirtualEnvStandard.cmake7
-rw-r--r--Tests/FortranModules/Executable/CMakeLists.txt2
-rw-r--r--Tests/FortranOnly/CMakeLists.txt4
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt2
-rw-r--r--Tests/InterfaceLibrary/CMakeLists.txt8
-rw-r--r--Tests/JavaExportImport/CMakeLists.txt2
-rw-r--r--Tests/LinkDirectory/CMakeLists.txt2
-rw-r--r--Tests/LinkDirectory/External/CMakeLists.txt14
-rw-r--r--Tests/MacRuntimePath/CMakeLists.txt2
-rw-r--r--Tests/OutDir/CMakeLists.txt4
-rw-r--r--Tests/OutDir/OutDir.cmake6
-rw-r--r--Tests/QtAutogen/MocCMP0100/CMakeLists.txt9
-rw-r--r--Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt10
-rw-r--r--Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt31
-rw-r--r--Tests/QtAutogen/MocCMP0100/Obj.cpp31
-rw-r--r--Tests/QtAutogen/MocCMP0100/Obj.hh20
-rw-r--r--Tests/QtAutogen/MocCMP0100/Obj2.cpp31
-rw-r--r--Tests/QtAutogen/MocCMP0100/Obj2.hh20
-rw-r--r--Tests/QtAutogen/MocCMP0100/main.cpp9
-rw-r--r--Tests/QtAutogen/SameName/CMakeLists.txt6
-rw-r--r--Tests/QtAutogen/SameName/main.cpp2
-rw-r--r--Tests/QtAutogen/SameName/object.hh13
-rw-r--r--Tests/QtAutogen/Tests.cmake1
-rw-r--r--Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt10
-rw-r--r--Tests/RunCMake/CMakeLists.txt32
-rw-r--r--Tests/RunCMake/CPack/CPackTestHelpers.cmake2
-rw-r--r--Tests/RunCMake/CPack/DragNDrop/Helpers.cmake54
-rw-r--r--Tests/RunCMake/CPack/DragNDrop/Prerequirements.cmake8
-rw-r--r--Tests/RunCMake/CPack/DragNDrop/packaging_COMPONENT_default.cmake3
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake3
-rw-r--r--Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake3
-rw-r--r--Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake2
-rw-r--r--Tests/RunCMake/CPack/tests/EXTERNAL/expected-json-1.0.txt3
-rw-r--r--Tests/RunCMake/CPack/tests/PROJECT_META/ExpectedFiles.cmake9
-rw-r--r--Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake30
-rw-r--r--Tests/RunCMake/CPack/tests/PROJECT_META/test.cmake11
-rw-r--r--Tests/RunCMake/CTest/CMakeCTestArguments-test-check.cmake4
-rw-r--r--Tests/RunCMake/CTest/CMakeCTestArguments.cmake2
-rw-r--r--Tests/RunCMake/CTest/RunCMakeTest.cmake13
-rw-r--r--Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in4
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake59
-rw-r--r--Tests/RunCMake/CTestCommandLine/check-configuration-type-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake15
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt15
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake15
-rw-r--r--Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt15
-rw-r--r--Tests/RunCMake/CTestCommandLine/test.cmake.in19
-rw-r--r--Tests/RunCMake/CTestCommandLine/test1-pass.cmake13
-rw-r--r--Tests/RunCMake/CTestCommandLine/test1-timeout.cmake14
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx3
-rw-r--r--Tests/RunCMake/CTestTimeout/Basic-stdout.txt6
-rw-r--r--Tests/RunCMake/CTestTimeout/CMakeLists.txt.in15
-rw-r--r--Tests/RunCMake/CTestTimeout/Fork-stdout.txt6
-rw-r--r--Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake22
-rw-r--r--Tests/RunCMake/CTestTimeout/TestTimeout.c24
-rw-r--r--Tests/RunCMake/CTestTimeout/test.cmake.in16
-rw-r--r--Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt13
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake8
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake96
-rw-r--r--Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake3
-rw-r--r--Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt7
-rw-r--r--Tests/RunCMake/CommandLine/trace-json-v1-check.cmake11
-rwxr-xr-xTests/RunCMake/CommandLine/trace-json-v1-check.py72
-rw-r--r--Tests/RunCMake/CommandLine/trace-json-v1-expand-check.cmake11
-rw-r--r--Tests/RunCMake/CommandLine/trace-json-v1-expand.cmake1
-rw-r--r--Tests/RunCMake/CommandLine/trace-json-v1.cmake5
-rw-r--r--Tests/RunCMake/CompilerLauncher/C-common.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/C-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/C-env.cmake1
-rw-r--r--Tests/RunCMake/CompilerLauncher/C-launch-env.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/C.cmake4
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-common.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-env.cmake1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA-launch-env.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/CUDA.cmake4
-rw-r--r--Tests/RunCMake/CompilerLauncher/CXX-common.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CXX-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CXX-env.cmake1
-rw-r--r--Tests/RunCMake/CompilerLauncher/CXX-launch-env.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/CXX.cmake4
-rw-r--r--Tests/RunCMake/CompilerLauncher/Fortran-common.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/Fortran-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/Fortran-env.cmake1
-rw-r--r--Tests/RunCMake/CompilerLauncher/Fortran-launch-env.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/Fortran.cmake4
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-common.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-env.cmake1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJC.cmake2
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-launch-Build-stdout.txt1
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake3
-rw-r--r--Tests/RunCMake/CompilerLauncher/OBJCXX.cmake2
-rw-r--r--Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/CompilerLauncher/main.m4
-rw-r--r--Tests/RunCMake/CompilerLauncher/main.mm4
-rw-r--r--Tests/RunCMake/FPHSA/FindNameMismatch.cmake4
-rw-r--r--Tests/RunCMake/FPHSA/FindNameMismatchOld.cmake4
-rw-r--r--Tests/RunCMake/FPHSA/FindNameMismatchSuppressed.cmake6
-rw-r--r--Tests/RunCMake/FPHSA/FindNameMismatchSuppressedArg.cmake4
-rw-r--r--Tests/RunCMake/FPHSA/FindNameMismatchSuppressedCompat.cmake6
-rw-r--r--Tests/RunCMake/FPHSA/NameMismatch-stderr.txt23
-rw-r--r--Tests/RunCMake/FPHSA/NameMismatch.cmake7
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/FileAPI/check_index.py5
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py24
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake2
-rw-r--r--Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in1
-rw-r--r--Tests/RunCMake/Graphviz/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/Graphviz/GraphvizTestProject.cmake58
-rw-r--r--Tests/RunCMake/Graphviz/RunCMakeTest.cmake82
-rw-r--r--Tests/RunCMake/Graphviz/default_options-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot52
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot44
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot46
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot35
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot43
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot44
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot48
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot44
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot42
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot48
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot50
-rw-r--r--Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot50
-rw-r--r--Tests/RunCMake/Graphviz/no_dependers_files-check.cmake4
-rw-r--r--Tests/RunCMake/Graphviz/no_executables-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_external_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_interface_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_module_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_object_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_per_target_files-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_shared_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_static_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/set_graph_header-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/set_graph_name-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/set_node_prefix-check.cmake5
-rw-r--r--Tests/RunCMake/Graphviz/test_project/core_library.c3
-rw-r--r--Tests/RunCMake/Graphviz/test_project/graphic_library.c3
-rw-r--r--Tests/RunCMake/Graphviz/test_project/main.c4
-rw-r--r--Tests/RunCMake/Graphviz/test_project/module.c3
-rw-r--r--Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake15
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake69
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/none.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake6
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake1
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake3
-rw-r--r--Tests/RunCMake/INSTALL_NAME_DIR/test.c3
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt4
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt4
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt4
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt4
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt10
-rw-r--r--Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt10
-rw-r--r--Tests/RunCMake/Ninja/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-all-clean-ninja-check.cmake4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-check.cmake8
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-release-clean-build-check.cmake6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles.cmake3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/AutoMocExecutable.cmake10
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Clean-release-build-check.cmake16
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Clean-release-clean-build-check.cmake7
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Clean-release-notall-ninja-check.cmake16
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Clean.cmake17
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Common.cmake57
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CudaSimple-all-clean-build-check.cmake21
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CudaSimple-debug-target-build-check.cmake27
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake21
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-build-check.cmake38
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-ninja-check.cmake37
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-generated-stdout.txt12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-build-check.cmake44
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake36
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-generated-stdout.txt12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-clean-build-check.cmake29
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-generated-stdout.txt12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-in-debug-graph-generated-stdout.txt12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-in-debug-graph-ninja-check.cmake45
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-ninja-check.cmake46
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator.cmake56
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-command-ninja-check.cmake6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-in-release-graph-postbuild-build-check.cmake8
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-target-build-check.cmake8
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-targetpostbuild-build-check.cmake12
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-minsizerel-command-ninja-check.cmake5
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-command-build-check.cmake5
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-postbuild-ninja-check.cmake11
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-target-ninja-check.cmake7
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-targetpostbuild-ninja-check.cmake13
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake39
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargetsSubdir/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Install-debug-in-release-graph-install-ninja-check.cmake31
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Install-release-install-build-check.cmake23
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Install.cmake10
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation-debug-in-release-graph-build-check.cmake7
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation-release-in-release-graph-build-check.cmake5
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation.cmake18
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Qt5-debug-in-release-graph-build-check.cmake7
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Qt5.cmake18
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake202
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-all-clean-again-ninja-check.cmake25
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-all-clean-build-check.cmake25
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-all-configs-build-check.cmake47
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake49
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake56
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake53
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake31
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-debug-target-build-check.cmake31
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-debug-target-ninja-check.cmake33
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-ninja-check.cmake51
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake51
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-release-file-ninja-check.cmake39
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-release-filename-build-check.cmake36
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake37
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/Simple.cmake13
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-all-ninja-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-all-ninja-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-clean-build-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-clean-build-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-target-ninja-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-target-ninja-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-debug-target-build-check.cmake31
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-debug-target-ninja-check.cmake32
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-clean-build-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-clean-build-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-result.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleNoCross.cmake1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/WriteFile.cmake1
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/badmoc.c7
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/empty.c0
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/generator.c101
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/generatorlib.c24
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/generatorobj.c24
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/main.c4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/main.cu15
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/qt5.cxx9
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/qt5.h5
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/simplelib.c6
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/simplelib.cu9
-rw-r--r--Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input2
-rw-r--r--Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input2
-rw-r--r--Tests/RunCMake/RunCMake.cmake29
-rw-r--r--Tests/RunCMake/RuntimePath/Relative.cmake17
-rw-r--r--Tests/RunCMake/RuntimePath/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/RuntimePath/SymlinkImplicitCheck.cmake2
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/TargetProperties/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/TargetProperties/Deprecation-stderr.txt9
-rw-r--r--Tests/RunCMake/TargetProperties/Deprecation.cmake5
-rw-r--r--Tests/RunCMake/TargetProperties/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/TargetProperties/empty.cpp4
-rw-r--r--Tests/RunCMake/TargetSources/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake4
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake4
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake2
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake4
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake4
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake26
-rw-r--r--Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake8
-rw-r--r--Tests/RunCMake/VS10Project/VsGlobals-check.cmake93
-rw-r--r--Tests/RunCMake/VS10Project/VsGlobals.cmake7
-rw-r--r--Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake32
-rw-r--r--Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake3
-rw-r--r--Tests/RunCMake/VS10Project/VsWinRTByDefault-check.cmake66
-rw-r--r--Tests/RunCMake/VS10Project/VsWinRTByDefault.cmake16
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake1
-rw-r--r--Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake2
-rw-r--r--Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt3
-rw-r--r--Tests/RunCMake/ctest_test/RunCMakeTest.cmake22
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt10
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake10
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt13
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake9
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt10
-rw-r--r--Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake9
-rw-r--r--Tests/RunCMake/file/RunCMakeTest.cmake4
-rw-r--r--Tests/RunCMake/find_file/PrefixInPATH-stderr.txt13
-rw-r--r--Tests/RunCMake/find_file/PrefixInPATH.cmake6
-rw-r--r--Tests/RunCMake/find_library/FromPATHEnv-stderr.txt28
-rw-r--r--Tests/RunCMake/find_library/FromPATHEnv.cmake13
-rw-r--r--Tests/RunCMake/find_library/PrefixInPATH-stderr.txt14
-rw-r--r--Tests/RunCMake/find_library/PrefixInPATH.cmake6
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnv-stderr.txt20
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnv.cmake6
-rw-r--r--Tests/RunCMake/find_package/MissingConfigDebug-stderr.txt18
-rw-r--r--Tests/RunCMake/find_package/MissingConfigDebug.cmake4
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnv-stderr.txt27
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnv.cmake12
-rw-r--r--Tests/RunCMake/find_program/EnvAndHints-stderr.txt28
-rw-r--r--Tests/RunCMake/find_program/EnvAndHints.cmake2
-rw-r--r--Tests/RunCMake/foreach/RunCMakeTest.cmake11
-rw-r--r--Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test.cmake2
-rw-r--r--Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake2
-rw-r--r--Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test.cmake2
-rw-r--r--Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test.cmake2
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake2
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake2
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test-stdout.txt6
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake42
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt19
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake68
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake2
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-result.txt1
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-stderr.txt4
-rw-r--r--Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test.cmake2
-rw-r--r--Tests/RunCMake/foreach/foreach-all-test-stdout.txt44
-rw-r--r--Tests/RunCMake/foreach/foreach-all-test.cmake67
-rw-r--r--Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION-stdout.txt7
-rw-r--r--Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake94
-rw-r--r--Tests/RunCMake/function/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/function/DummyMacro.cmake20
-rw-r--r--Tests/RunCMake/function/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/get_property/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt4
-rw-r--r--Tests/RunCMake/load_cache/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/load_cache/NewForm_Project.cmake16
-rw-r--r--Tests/RunCMake/load_cache/NewForm_Script.cmake16
-rw-r--r--Tests/RunCMake/load_cache/OldForm_Script-result.txt1
-rw-r--r--Tests/RunCMake/load_cache/OldForm_Script-stderr.txt2
-rw-r--r--Tests/RunCMake/load_cache/OldForm_Script.cmake13
-rw-r--r--Tests/RunCMake/load_cache/RunCMakeTest.cmake13
-rw-r--r--Tests/RunCMake/message/RunCMakeTest.cmake25
-rw-r--r--Tests/RunCMake/message/message-checks-stderr.txt3
-rw-r--r--Tests/RunCMake/message/message-checks-stdout.txt10
-rw-r--r--Tests/RunCMake/message/message-checks.cmake13
-rw-r--r--Tests/RunCMake/message/message-context-cache-stdout.txt8
-rw-r--r--Tests/RunCMake/message/message-context-cli-stdout.txt8
-rw-r--r--Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt5
-rw-r--r--Tests/RunCMake/message/message-context.cmake27
-rw-r--r--Tests/RunCMake/message/message-log-level-debug-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-default-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-override-stderr.txt12
-rw-r--r--Tests/RunCMake/message/message-log-level-override-stdout.txt3
-rw-r--r--Tests/RunCMake/message/message-log-level-status-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-trace-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-verbose-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-debug-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-default-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-status-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-trace-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-loglevel-verbose-stdout.txt2
-rw-r--r--Tests/RunCMake/target_compile_options/BEFORE_keyword.cmake8
-rw-r--r--Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-NEW-result.txt1
-rw-r--r--Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-OLD-result.txt1
-rw-r--r--Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-OLD-stdout.txt1
-rw-r--r--Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword.cmake15
-rw-r--r--Tests/RunCMake/target_compile_options/CMP0101.c9
-rw-r--r--Tests/RunCMake/target_compile_options/RunCMakeTest.cmake18
-rw-r--r--Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/CMP0099-NEW.cmake4
-rw-r--r--Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-result.txt1
-rw-r--r--Tests/RunCMake/target_link_directories/CMP0099-OLD.cmake4
-rw-r--r--Tests/RunCMake/target_link_directories/CMP0099.cmake14
-rw-r--r--Tests/RunCMake/target_link_directories/RunCMakeTest.cmake30
-rw-r--r--Tests/RunCMake/target_link_directories/exe.c4
-rw-r--r--Tests/RunCMake/target_link_directories/lib.c7
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-iface-NEW-stdout.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-iface-OLD-stdout.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stderr.txt20
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stdout.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-iface/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake2
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-stdout.txt2
-rw-r--r--Tests/RunCMake/target_link_options/CMP0099-NEW-basic-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/CMP0099-NEW-basic-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/CMP0099-NEW.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/CMP0099-OLD-basic-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/CMP0099-OLD-basic-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/CMP0099-OLD.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/CMP0099.cmake19
-rw-r--r--Tests/RunCMake/target_link_options/LINKER_expansion.cmake11
-rw-r--r--Tests/RunCMake/target_link_options/RunCMakeTest.cmake18
-rw-r--r--Tests/RunCMake/try_compile/CleanupNoFollowSymlink.cmake21
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake10
-rw-r--r--Tests/StagingPrefix/CMakeLists.txt2
-rw-r--r--Tests/SubDir/Examples/example1/CMakeLists.txt2
-rw-r--r--Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt2
-rw-r--r--Tests/VSMidl/CMakeLists.txt4
599 files changed, 7326 insertions, 333 deletions
diff --git a/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt b/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt
index 7c918e6..06d1111 100644
--- a/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_link_libraries/SubDirB/CMakeLists.txt
@@ -2,7 +2,11 @@ add_executable(SubDirB SubDirB.c)
# Link to a target imported in this directory that would not normally
# be visible to the directory in which TopDir is defined.
-target_link_libraries(TopDir PUBLIC SameNameImported)
+target_link_libraries(TopDir PUBLIC debug SameNameImported optimized SameNameImported)
+
+# Link to a list of targets imported in this directory that would not
+# normally be visible to the directory in which TopDir is defined.
+target_link_libraries(TopDir PUBLIC "$<1:SameNameImported;SameNameImported>")
# Link SubDirA to a target imported in this directory that has the same
# name as a target imported in SubDirA's directory. We verify when
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index 840afc1..25d2de6 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -25,6 +25,8 @@ set(CMakeLib_TESTS
testUVProcessChain.cxx
testUVRAII.cxx
testUVStreambuf.cxx
+ testCMExtMemory.cxx
+ testCMExtAlgorithm.cxx
)
add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx)
diff --git a/Tests/CMakeLib/testCMExtAlgorithm.cxx b/Tests/CMakeLib/testCMExtAlgorithm.cxx
new file mode 100644
index 0000000..c731b72
--- /dev/null
+++ b/Tests/CMakeLib/testCMExtAlgorithm.cxx
@@ -0,0 +1,117 @@
+#include <iostream>
+#include <memory>
+#include <utility>
+#include <vector>
+
+#include <cmext/algorithm>
+
+namespace {
+
+int failed = 0;
+
+void testAppend()
+{
+ std::cout << "testAppend()" << std::endl;
+
+ // ----------------------------------------------------
+ // cm::append(Vector, Iterator, Iterator)
+ {
+ std::vector<int> v1{ 1, 2, 3 };
+ std::vector<int> v1_ref{ 1, 2, 3, 4, 5, 6 };
+ std::vector<int> v2{ 4, 5, 6 };
+ std::vector<int> v2_ref{ 4, 5, 6 };
+
+ cm::append(v1, v2.begin(), v2.end());
+
+ if (v1 != v1_ref || v2 != v2_ref) {
+ ++failed;
+ }
+ }
+
+ // ----------------------------------------------------
+ // cm::append(Vector, Range)
+ {
+ std::vector<int> v1{ 1, 2, 3 };
+ std::vector<int> v1_ref{ 1, 2, 3, 4, 5, 6 };
+ std::vector<int> v2{ 4, 5, 6 };
+ std::vector<int> v2_ref{ 4, 5, 6 };
+
+ cm::append(v1, v2);
+
+ if (v1 != v1_ref || v2 != v2_ref) {
+ ++failed;
+ }
+ }
+
+ // ----------------------------------------------------
+ // cm::append(Vector<*>, Vector<unique_ptr>)
+ {
+ std::vector<int*> v1{ new int(1), new int(2), new int(3) };
+ std::vector<int*> v1_ref = v1;
+ std::vector<std::unique_ptr<int>> v2;
+
+ v2.emplace_back(new int(4));
+ v2.emplace_back(new int(5));
+ v2.emplace_back(new int(6));
+
+ cm::append(v1, v2);
+
+ if (v1.size() == 6 && v2.size() == 3) {
+ for (int i = 0; i < 3; i++) {
+ if (v1[i] != v1_ref[i]) {
+ ++failed;
+ break;
+ }
+ }
+ for (int i = 0; i < 3; i++) {
+ if (v1[i + 3] != v2[i].get()) {
+ ++failed;
+ break;
+ }
+ }
+ } else {
+ ++failed;
+ }
+
+ // free memory to please memory sanitizer
+ delete v1[0];
+ delete v1[1];
+ delete v1[2];
+ }
+
+ // ----------------------------------------------------
+ // cm::append(Vector<unique_ptr>, Vector<unique_ptr>)
+ {
+ std::vector<std::unique_ptr<int>> v1;
+ std::vector<std::unique_ptr<int>> v2;
+
+ v1.emplace_back(new int(1));
+ v1.emplace_back(new int(2));
+ v1.emplace_back(new int(3));
+
+ v2.emplace_back(new int(4));
+ v2.emplace_back(new int(5));
+ v2.emplace_back(new int(6));
+
+ cm::append(v1, std::move(v2));
+
+ if (v1.size() == 6 && v2.empty()) {
+ for (int i = 0; i < 6; i++) {
+ if (*v1[i] != i + 1) {
+ ++failed;
+ break;
+ }
+ }
+ } else {
+ ++failed;
+ }
+ }
+}
+}
+
+int testCMExtAlgorithm(int /*unused*/, char* /*unused*/ [])
+{
+ testAppend();
+
+ return failed;
+}
diff --git a/Tests/CMakeLib/testCMExtMemory.cxx b/Tests/CMakeLib/testCMExtMemory.cxx
new file mode 100644
index 0000000..6663c17
--- /dev/null
+++ b/Tests/CMakeLib/testCMExtMemory.cxx
@@ -0,0 +1,65 @@
+#include <iostream>
+#include <memory>
+
+#include <cmext/memory>
+
+namespace {
+class Base
+{
+public:
+ virtual ~Base() = default;
+};
+
+class Derived : public Base
+{
+public:
+ ~Derived() = default;
+
+ void method() {}
+};
+
+template <typename T>
+class Wrapper
+{
+public:
+ Wrapper(T* v)
+ : value(v)
+ {
+ }
+ ~Wrapper() { delete value; }
+
+ T* get() const { return value; }
+
+private:
+ T* value;
+};
+
+bool testReferenceCast()
+{
+ std::cout << "testReferenceCast()" << std::endl;
+
+ std::unique_ptr<Base> u(new Derived);
+ cm::static_reference_cast<Derived>(u).method();
+ cm::dynamic_reference_cast<Derived>(u).method();
+
+ std::shared_ptr<Base> s(new Derived);
+ cm::static_reference_cast<Derived>(s).method();
+ cm::dynamic_reference_cast<Derived>(s).method();
+
+ // can also be used with custom wrappers
+ Wrapper<Base> w(new Derived);
+ cm::static_reference_cast<Derived>(w).method();
+ cm::dynamic_reference_cast<Derived>(w).method();
+
+ return true;
+}
+}
+
+int testCMExtMemory(int /*unused*/, char* /*unused*/ [])
+{
+ if (!testReferenceCast()) {
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec.cxx b/Tests/CMakeLib/testCTestResourceSpec.cxx
index 99bee56..b49f8ff 100644
--- a/Tests/CMakeLib/testCTestResourceSpec.cxx
+++ b/Tests/CMakeLib/testCTestResourceSpec.cxx
@@ -7,71 +7,89 @@
struct ExpectedSpec
{
std::string Path;
- bool ParseResult;
+ cmCTestResourceSpec::ReadFileResult ParseResult;
cmCTestResourceSpec Expected;
};
static const std::vector<ExpectedSpec> expectedResourceSpecs = {
- /* clang-format off */
- {"spec1.json", true, {{{
- {"gpus", {
- {"2", 4},
- {"e", 1},
- }},
- {"threads", {
- }},
- }}}},
- {"spec2.json", true, {}},
- {"spec3.json", false, {}},
- {"spec4.json", false, {}},
- {"spec5.json", false, {}},
- {"spec6.json", false, {}},
- {"spec7.json", false, {}},
- {"spec8.json", false, {}},
- {"spec9.json", false, {}},
- {"spec10.json", false, {}},
- {"spec11.json", false, {}},
- {"spec12.json", false, {}},
- {"spec13.json", false, {}},
- {"spec14.json", true, {}},
- {"spec15.json", true, {}},
- {"spec16.json", true, {}},
- {"spec17.json", false, {}},
- {"spec18.json", false, {}},
- {"spec19.json", false, {}},
- {"spec20.json", true, {}},
- {"spec21.json", false, {}},
- {"spec22.json", false, {}},
- {"spec23.json", false, {}},
- {"spec24.json", false, {}},
- {"spec25.json", false, {}},
- {"spec26.json", false, {}},
- {"spec27.json", false, {}},
- {"spec28.json", false, {}},
- {"spec29.json", false, {}},
- {"spec30.json", false, {}},
- {"spec31.json", false, {}},
- {"spec32.json", false, {}},
- {"spec33.json", false, {}},
- {"spec34.json", false, {}},
- {"spec35.json", false, {}},
- {"spec36.json", false, {}},
- {"noexist.json", false, {}},
- /* clang-format on */
+ { "spec1.json",
+ cmCTestResourceSpec::ReadFileResult::READ_OK,
+ { { {
+ { "gpus",
+ {
+ { "2", 4 },
+ { "e", 1 },
+ } },
+ { "threads", {} },
+ } } } },
+ { "spec2.json", cmCTestResourceSpec::ReadFileResult::READ_OK, {} },
+ { "spec3.json",
+ cmCTestResourceSpec::ReadFileResult::INVALID_SOCKET_SPEC,
+ {} },
+ { "spec4.json",
+ cmCTestResourceSpec::ReadFileResult::INVALID_SOCKET_SPEC,
+ {} },
+ { "spec5.json",
+ cmCTestResourceSpec::ReadFileResult::INVALID_SOCKET_SPEC,
+ {} },
+ { "spec6.json",
+ cmCTestResourceSpec::ReadFileResult::INVALID_SOCKET_SPEC,
+ {} },
+ { "spec7.json",
+ cmCTestResourceSpec::ReadFileResult::INVALID_RESOURCE_TYPE,
+ {} },
+ { "spec8.json", cmCTestResourceSpec::ReadFileResult::INVALID_RESOURCE, {} },
+ { "spec9.json", cmCTestResourceSpec::ReadFileResult::INVALID_RESOURCE, {} },
+ { "spec10.json", cmCTestResourceSpec::ReadFileResult::INVALID_RESOURCE, {} },
+ { "spec11.json", cmCTestResourceSpec::ReadFileResult::INVALID_RESOURCE, {} },
+ { "spec12.json", cmCTestResourceSpec::ReadFileResult::INVALID_ROOT, {} },
+ { "spec13.json", cmCTestResourceSpec::ReadFileResult::JSON_PARSE_ERROR, {} },
+ { "spec14.json", cmCTestResourceSpec::ReadFileResult::READ_OK, {} },
+ { "spec15.json", cmCTestResourceSpec::ReadFileResult::READ_OK, {} },
+ { "spec16.json", cmCTestResourceSpec::ReadFileResult::READ_OK, {} },
+ { "spec17.json", cmCTestResourceSpec::ReadFileResult::INVALID_RESOURCE, {} },
+ { "spec18.json", cmCTestResourceSpec::ReadFileResult::INVALID_RESOURCE, {} },
+ { "spec19.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec20.json", cmCTestResourceSpec::ReadFileResult::READ_OK, {} },
+ { "spec21.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec22.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec23.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec24.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec25.json",
+ cmCTestResourceSpec::ReadFileResult::UNSUPPORTED_VERSION,
+ {} },
+ { "spec26.json",
+ cmCTestResourceSpec::ReadFileResult::UNSUPPORTED_VERSION,
+ {} },
+ { "spec27.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec28.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec29.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec30.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec31.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec32.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec33.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec34.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec35.json", cmCTestResourceSpec::ReadFileResult::INVALID_VERSION, {} },
+ { "spec36.json", cmCTestResourceSpec::ReadFileResult::NO_VERSION, {} },
+ { "noexist.json", cmCTestResourceSpec::ReadFileResult::FILE_NOT_FOUND, {} },
};
-static bool testSpec(const std::string& path, bool expectedResult,
+static bool testSpec(const std::string& path,
+ cmCTestResourceSpec::ReadFileResult expectedResult,
const cmCTestResourceSpec& expected)
{
cmCTestResourceSpec actual;
- bool result = actual.ReadFromJSONFile(path);
+ auto result = actual.ReadFromJSONFile(path);
if (result != expectedResult) {
- std::cout << "ReadFromJSONFile(\"" << path << "\") returned " << result
- << ", should be " << expectedResult << std::endl;
+ std::cout << "ReadFromJSONFile(\"" << path << "\") returned \""
+ << cmCTestResourceSpec::ResultToString(result)
+ << "\", should be \""
+ << cmCTestResourceSpec::ResultToString(expectedResult) << "\""
+ << std::endl;
return false;
}
- if (result && actual != expected) {
+ if (actual != expected) {
std::cout << "ReadFromJSONFile(\"" << path
<< "\") did not give expected spec" << std::endl;
return false;
diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx
index 986f595..1bf88cf 100644
--- a/Tests/CMakeLib/testUTF8.cxx
+++ b/Tests/CMakeLib/testUTF8.cxx
@@ -9,9 +9,11 @@ typedef char test_utf8_char[5];
static void test_utf8_char_print(test_utf8_char const c)
{
unsigned char const* d = reinterpret_cast<unsigned char const*>(c);
+#ifndef __clang_analyzer__ // somehow thinks arguments are not initialized
printf("[0x%02X,0x%02X,0x%02X,0x%02X]", static_cast<int>(d[0]),
static_cast<int>(d[1]), static_cast<int>(d[2]),
static_cast<int>(d[3]));
+#endif
}
static void byte_array_print(char const* s)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 57fa7fc..6fad175 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -211,6 +211,13 @@ if(BUILD_TESTING)
#---------------------------------------------------------------------------
# Add tests below here.
+ if(NOT DEFINED CMake_TEST_Qt5)
+ set(CMake_TEST_Qt5 1)
+ endif()
+ if(CMake_TEST_Qt5)
+ find_package(Qt5Widgets QUIET NO_MODULE)
+ endif()
+
if(NOT CMake_TEST_EXTERNAL_CMAKE)
add_subdirectory(CMakeLib)
@@ -436,7 +443,9 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(Assembler HelloAsm)
ADD_TEST_MACRO(SourceGroups SourceGroups)
ADD_TEST_MACRO(Preprocess Preprocess)
- set(ExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM})
+ set(ExportImport_BUILD_OPTIONS -DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
+ -DCMake_TEST_CUDA:BOOL=${CMake_TEST_CUDA}
+ )
ADD_TEST_MACRO(ExportImport ExportImport)
ADD_TEST_MACRO(Unset Unset)
ADD_TEST_MACRO(PolicyScope PolicyScope)
@@ -451,8 +460,12 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(StagingPrefix StagingPrefix)
ADD_TEST_MACRO(ImportedSameName ImportedSameName)
ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary)
- if(NOT _isMultiConfig)
- set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+ if(NOT CMAKE_GENERATOR STREQUAL "Xcode")
+ if(_isMultiConfig)
+ set(ConfigSources_CTEST_OPTIONS --build-config $<CONFIGURATION>)
+ else()
+ set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
+ endif()
ADD_TEST_MACRO(ConfigSources ConfigSources)
endif()
ADD_TEST_MACRO(SourcesProperty SourcesProperty)
@@ -976,6 +989,27 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endif()
endif()
+ # On Windows run the CPackNSISGenerator test
+ # if the nsis is available
+ if(WIN32 AND NSIS_MAKENSIS_EXECUTABLE)
+ add_test(CPackNSISGenerator ${CMAKE_CTEST_COMMAND}
+ -C \${CTEST_CONFIGURATION_TYPE}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/CPackNSISGenerator"
+ "${CMake_BINARY_DIR}/Tests/CPackNSISGenerator"
+ ${build_generator_args}
+ --build-project CPackNSISGenerator
+ --build-options
+ --test-command ${CMAKE_CMAKE_COMMAND}
+ "-DCPackNSISGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackNSISGenerator"
+ "-Dconfig=\${CTEST_CONFIGURATION_TYPE}"
+ -P "${CMake_SOURCE_DIR}/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake")
+
+ set_property(TEST CPackNSISGenerator PROPERTY
+ ATTACHED_FILES_ON_FAIL
+ "${CMake_BINARY_DIR}/Tests/CPackNSISGenerator/_CPack_Packages/win32/NSIS/NSISOutput.log")
+ endif()
+
if(CTEST_TEST_CPACK)
add_test(CPackUseDefaultVersion ${CMAKE_CTEST_COMMAND}
--build-and-test
@@ -1128,8 +1162,8 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
foreach(CPackDEBConfiguration IN LISTS DEB_CONFIGURATIONS_TO_TEST)
set(CPackRun_CPackDEBConfiguration "-DCPackDEBConfiguration=${CPackDEBConfiguration}")
- add_test(${DEB_TEST_NAMES}-${CPackDEBConfiguration}
- ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
+ add_test(NAME ${DEB_TEST_NAMES}-${CPackDEBConfiguration} COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIG>
--build-and-test
"${CMake_SOURCE_DIR}/Tests/${DEB_TEST_NAMES}"
"${CMake_BINARY_DIR}/Tests/${DEB_TEST_NAMES}/build${CPackGen}-${CPackDEBConfiguration}"
@@ -1146,6 +1180,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"-D${DEB_TEST_NAMES}_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/${DEB_TEST_NAMES}/build${CPackGen}-${CPackDEBConfiguration}"
"${CPackRun_CPackGen}"
"${CPackRun_CPackDEBConfiguration}"
+ "-DCONFIG=$<CONFIG>"
-P "${CMake_SOURCE_DIR}/Tests/${DEB_TEST_NAMES}/RunCPackVerifyResult-${CPackDEBConfiguration}.cmake")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${DEB_TEST_NAMES}/build${CPackGen}-${CPackDEBConfiguration}")
endforeach()
@@ -1325,12 +1360,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt")
- if(NOT DEFINED CMake_TEST_Qt5)
- set(CMake_TEST_Qt5 1)
- endif()
- if(CMake_TEST_Qt5)
- find_package(Qt5Widgets QUIET NO_MODULE)
- endif()
if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND)
add_subdirectory(Qt5Autogen)
endif()
@@ -1401,6 +1430,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
ICU
JPEG
JsonCpp
+ LibArchive
LibLZMA
LibRHash
Libinput
@@ -1440,7 +1470,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
add_subdirectory(GoogleTest)
endif()
- if(CMake_TEST_FindPython OR CMake_TEST_FindPython_NumPy)
+ if(CMake_TEST_FindPython OR CMake_TEST_FindPython_NumPy OR CMake_TEST_FindPython_Conda)
add_subdirectory(FindPython)
endif()
@@ -1586,6 +1616,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
set(tutorial_build_options -DUSE_MYMATH:BOOL=OFF)
endif()
add_test(${tutorial_test_name} ${CMAKE_CTEST_COMMAND}
+ -C "Release"
--build-and-test
"${CMake_SOURCE_DIR}/Help/guide/tutorial/${step_name}"
${tutorial_build_dir}_Build
@@ -1597,11 +1628,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endfunction()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
- foreach(STP RANGE 2 11)
+ foreach(STP RANGE 2 12)
add_tutorial_test(Step${STP} TRUE)
endforeach()
add_tutorial_test(Complete TRUE)
- foreach(STP RANGE 3 11)
+ foreach(STP RANGE 3 12)
add_tutorial_test(Step${STP} FALSE)
endforeach()
add_tutorial_test(Complete FALSE)
@@ -1861,7 +1892,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables)
if("${CMAKE_GENERATOR}" MATCHES "Makefile" OR
- "${CMAKE_GENERATOR}" MATCHES "Ninja")
+ "${CMAKE_GENERATOR}" MATCHES "^Ninja$")
add_test(MakeClean ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/MakeClean"
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 03babd2..361cf5f 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -31,12 +31,9 @@ add_CMakeOnly_test(CheckStructHasMember)
add_CMakeOnly_test(CompilerIdC)
add_CMakeOnly_test(CompilerIdCXX)
-if(CMAKE_OBJC_COMPILER)
+if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
add_CMakeOnly_test(CompilerIdOBJC)
add_CMakeOnly_test(CheckOBJCCompilerFlag)
-endif()
-
-if(CMAKE_OBJCXX_COMPILER)
add_CMakeOnly_test(CompilerIdOBJCXX)
add_CMakeOnly_test(CheckOBJCXXCompilerFlag)
endif()
@@ -75,6 +72,12 @@ add_test(CMakeOnly.ProjectIncludeAny ${CMAKE_CMAKE_COMMAND}
add_test(CMakeOnly.ProjectIncludeBefore ${CMAKE_CMAKE_COMMAND}
-DTEST=ProjectIncludeBefore
+ -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake
+ -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
+ )
+
+add_test(CMakeOnly.ProjectIncludeBeforeAny ${CMAKE_CMAKE_COMMAND}
+ -DTEST=ProjectIncludeBeforeAny
-DCMAKE_ARGS=-DCMAKE_PROJECT_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake
-P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake
)
diff --git a/Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt b/Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt
index a9a96ee..a714b73 100644
--- a/Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt
@@ -1,17 +1,7 @@
-cmake_minimum_required(VERSION 2.8.12)
-
-project(CheckOBJCCompilerFlag)
-
+cmake_minimum_required(VERSION 3.16)
+project(CheckOBJCCompilerFlag OBJC)
include(CheckOBJCCompilerFlag)
-
-if(CMAKE_COMPILER_IS_GNUOBJC)
- set(COMPILER_FLAG -fobjc-direct-dispatch)
-else()
- set(COMPILER_FLAG -fobjc-gc)
-endif()
-
-CHECK_OBJC_COMPILER_FLAGS(${COMPILER_FLAG} HAS_COMPILER_FLAG)
-
+check_objc_compiler_flag(-DFOO HAS_COMPILER_FLAG)
if(NOT HAS_COMPILER_FLAG)
message(SEND_ERROR "Test fail: HAS_COMPILER_FLAG: ${COMPILER_FLAG}")
-endif
+endif()
diff --git a/Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt b/Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt
index f83b738..d09f0b9 100644
--- a/Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt
@@ -1,17 +1,7 @@
-cmake_minimum_required(VERSION 2.8.12)
-
-project(CheckOBJCXXCompilerFlag)
-
+cmake_minimum_required(VERSION 3.16)
+project(CheckOBJCXXCompilerFlag OBJCXX)
include(CheckOBJCXXCompilerFlag)
-
-if(CMAKE_COMPILER_IS_GNUOBJCXX)
- set(COMPILER_FLAG -fobjc-direct-dispatch)
-else()
- set(COMPILER_FLAG -fobjc-gc)
-endif()
-
-CHECK_OBJCXX_COMPILER_FLAGS(${COMPILER_FLAG} HAS_COMPILER_FLAG)
-
+check_objcxx_compiler_flag(-DFOO HAS_COMPILER_FLAG)
if(NOT HAS_COMPILER_FLAG)
message(SEND_ERROR "Test fail: HAS_COMPILER_FLAG: ${COMPILER_FLAG}")
endif()
diff --git a/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt b/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt
new file mode 100644
index 0000000..5cd9cba
--- /dev/null
+++ b/Tests/CMakeOnly/ProjectIncludeBeforeAny/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(FOO TRUE)
+project(ProjectInclude LANGUAGES NONE)
+if(NOT AUTO_INCLUDE)
+ message(FATAL_ERROR "include file not found")
+endif()
diff --git a/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake b/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake
new file mode 100644
index 0000000..0a4799d
--- /dev/null
+++ b/Tests/CMakeOnly/ProjectIncludeBeforeAny/include.cmake
@@ -0,0 +1,9 @@
+if(NOT FOO)
+ message(FATAL_ERROR "FOO is not set")
+endif()
+
+if(NOT "${PROJECT_NAME}" STREQUAL "")
+ message(FATAL_ERROR "PROJECT_NAME should be empty")
+endif()
+
+set(AUTO_INCLUDE TRUE)
diff --git a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
index 9632664..a79bfcb 100644
--- a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
+++ b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake
@@ -21,11 +21,11 @@ set(N 7)
# First setup source and binary trees:
#
-execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
+execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
${dir}/Source
)
-execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
+execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
${dir}/Build
)
@@ -69,7 +69,7 @@ foreach(i RANGE 1 ${N})
# Save this iteration of the Build directory:
#
- execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory
+ execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf
${dir}/b${i}
)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory
diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt
index 1619081..e32d693 100644
--- a/Tests/CMakeTests/CMakeLists.txt
+++ b/Tests/CMakeTests/CMakeLists.txt
@@ -33,8 +33,9 @@ AddCMakeTest(While "")
AddCMakeTest(CMakeHostSystemInformation "")
AddCMakeTest(FileDownload "")
-set_property(TEST CMake.FileDownload PROPERTY
+set_tests_properties(CMake.FileDownload PROPERTIES
PASS_REGULAR_EXPRESSION "file already exists with expected MD5 sum"
+ FAIL_REGULAR_EXPRESSION "Unexpected status"
)
AddCMakeTest(FileDownloadBadHash "")
set_property(TEST CMake.FileDownloadBadHash PROPERTY
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in
index 3935449..5bd3803 100644
--- a/Tests/CMakeTests/FileDownloadTest.cmake.in
+++ b/Tests/CMakeTests/FileDownloadTest.cmake.in
@@ -1,23 +1,50 @@
+# We do not contact any real URLs, but do try a bogus one.
+# Remove any proxy configuration that may change behavior.
+unset(ENV{http_proxy})
+unset(ENV{https_proxy})
+
+set(timeout 4)
+
if(NOT "@CMAKE_CURRENT_SOURCE_DIR@" MATCHES "^/")
set(slash /)
endif()
set(url "file://${slash}@CMAKE_CURRENT_SOURCE_DIR@/FileDownloadInput.png")
set(dir "@CMAKE_CURRENT_BINARY_DIR@/downloads")
+# Beware Windows asynchronous file/directory removal, rename and then
+# remove the renamed dir so we can be certain the dir isn't there when
+# we get to the file() commands below
+if(EXISTS "${dir}")
+ file(RENAME ${dir} "${dir}_beingRemoved")
+ file(REMOVE_RECURSE "${dir}_beingRemoved")
+endif()
+
+function(__reportIfWrongStatus statusPair expectedStatusCode)
+ list(GET statusPair 0 statusCode)
+ if(NOT statusCode EQUAL expectedStatusCode)
+ message(SEND_ERROR
+ "Unexpected status: ${statusCode}, expected: ${expectedStatusCode}")
+ endif()
+endfunction()
+
message(STATUS "FileDownload:1")
file(DOWNLOAD
${url}
${dir}/file1.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
+ STATUS status
)
+__reportIfWrongStatus("${status}" 0)
message(STATUS "FileDownload:2")
file(DOWNLOAD
${url}
${dir}/file2.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
+ STATUS status
SHOW_PROGRESS
)
+__reportIfWrongStatus("${status}" 0)
# Two calls in a row, exactly the same arguments.
# Since downloaded file should exist already for 2nd call,
@@ -31,82 +58,108 @@ message(STATUS "FileDownload:3")
file(DOWNLOAD
${url}
${dir}/file3.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
+ STATUS status
EXPECTED_MD5 dbd330d52f4dbd60115d4191904ded92
)
+__reportIfWrongStatus("${status}" 0)
message(STATUS "FileDownload:4")
file(DOWNLOAD
${url}
${dir}/file3.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
STATUS status
EXPECTED_HASH SHA1=67eee17f79d9ac557284fc0b8ad19f25723fb578
)
+__reportIfWrongStatus("${status}" 0)
message(STATUS "FileDownload:5")
file(DOWNLOAD
${url}
${dir}/file3.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
STATUS status
EXPECTED_HASH SHA224=ba283726bbb602776818b463943189afd91836cb7ee5dd6e2c7b5ae4
)
+__reportIfWrongStatus("${status}" 0)
message(STATUS "FileDownload:6")
file(DOWNLOAD
${url}
${dir}/file3.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
STATUS status
EXPECTED_HASH SHA256=cf3334b1275071e1da6e8c396ccb72cf1b2388d8c937526f3af26230affb9423
)
+__reportIfWrongStatus("${status}" 0)
message(STATUS "FileDownload:7")
file(DOWNLOAD
${url}
${dir}/file3.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
STATUS status
EXPECTED_HASH SHA384=43a5d13978d97c660db44481aee0604cb4ff6ca0775cd5c2cd68cd8000e107e507c4caf6c228941231041e282ffb8950
)
+__reportIfWrongStatus("${status}" 0)
message(STATUS "FileDownload:8")
file(DOWNLOAD
${url}
${dir}/file3.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
STATUS status
EXPECTED_HASH SHA512=6984e0909a1018030ccaa418e3be1654223cdccff0fe6adc745f9aea7e377f178be53b9fc7d54a6f81c2b62ef9ddcd38ba1978fedf4c5e7139baaf355eefad5b
)
+__reportIfWrongStatus("${status}" 0)
+
message(STATUS "FileDownload:9")
file(DOWNLOAD
${url}
${dir}/file3.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
STATUS status
EXPECTED_HASH MD5=dbd330d52f4dbd60115d4191904ded92
)
+__reportIfWrongStatus("${status}" 0)
message(STATUS "FileDownload:10")
file(DOWNLOAD
${url}
${dir}/file3.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
STATUS status
EXPECTED_MD5 dbd330d52f4dbd60115d4191904ded92
)
+__reportIfWrongStatus("${status}" 0)
+# Print status because we check its message too
message(STATUS "${status}")
message(STATUS "FileDownload:11")
file(DOWNLOAD
badhostname.png
${dir}/file11.png
- TIMEOUT 2
+ TIMEOUT ${timeout}
STATUS status
)
message(STATUS "${status}")
-list(GET status 0 status_code)
-if(NOT ${status_code} EQUAL 6)
- message(SEND_ERROR "error: expected status code 6 for bad host name, got: ${status_code}")
+__reportIfWrongStatus("${status}" 6) # 6 corresponds to an unresolvable host name
+
+message(STATUS "FileDownload:12")
+set(absFile "@CMAKE_CURRENT_BINARY_DIR@/file12.png")
+if(EXISTS "${absFile}")
+ file(RENAME ${absFile} "${absFile}_beingRemoved")
+ file(REMOVE "${absFile}_beingRemoved")
+endif()
+file(DOWNLOAD
+ ${url}
+ file12.png
+ TIMEOUT ${timeout}
+ EXPECTED_MD5 dbd330d52f4dbd60115d4191904ded92
+ STATUS status
+ )
+__reportIfWrongStatus("${status}" 0)
+if(NOT EXISTS file12.png)
+ message(SEND_ERROR "file12.png not downloaded: ${status}")
endif()
diff --git a/Tests/CMakeTests/FileTestScript.cmake b/Tests/CMakeTests/FileTestScript.cmake
index 9a43569..145f28a 100644
--- a/Tests/CMakeTests/FileTestScript.cmake
+++ b/Tests/CMakeTests/FileTestScript.cmake
@@ -183,7 +183,7 @@ elseif(testname STREQUAL to_native_path) # pass
elseif(testname STREQUAL download_wrong_number_of_args) # fail
file(DOWNLOAD zzzz://bogus/ffff)
-elseif(testname STREQUAL download_file_with_no_path) # fail
+elseif(testname STREQUAL download_file_with_no_path) # pass
file(DOWNLOAD zzzz://bogus/ffff ffff)
elseif(testname STREQUAL download_missing_time) # fail
diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt
index bc5b6a9..4363f1b 100644
--- a/Tests/CPackComponentsDEB/CMakeLists.txt
+++ b/Tests/CPackComponentsDEB/CMakeLists.txt
@@ -104,7 +104,7 @@ install(FILES ${CPackComponentsDEB_BINARY_DIR}/symtest
COMPONENT applications)
if(EXISTS "./dirtest")
- execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ./dirtest)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E rm -rf ./dirtest)
endif()
# NOTE: directory left empty on purpose
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ./dirtest)
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
index 86a74b2..f46a575 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
@@ -65,9 +65,10 @@ if(DPKGDEB_EXECUTABLE)
"dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: `${dpkg_description}` != `${expected_description}`")
endif()
elseif(dpkg_package_name STREQUAL "mylib-libraries")
- if(NOT dpkg_description MATCHES "main description\n.*")
+ set(expected_description "main description")
+ if(NOT dpkg_description STREQUAL expected_description)
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: `${dpkg_description}` =~ `main description.*`")
+ "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: `${dpkg_description}` != `${expected_description}`")
endif()
else()
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
index d53c73d..c00921a 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
@@ -53,9 +53,10 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
if(dpkg_package_name STREQUAL "mylib-applications" OR dpkg_package_name STREQUAL "mylib-headers")
- if(NOT dpkg_description MATCHES "main description 2\n.*")
+ set(expected_description "main description 2")
+ if(NOT dpkg_description STREQUAL expected_description)
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: `${dpkg_description}` =~ `main description 2`")
+ "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: `${dpkg_description}` != `${expected_description}`")
endif()
elseif(dpkg_package_name STREQUAL "mylib-libraries")
set(expected_description "main description 2\n library description")
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
index b172da2..3bc8d2a 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
@@ -45,7 +45,7 @@ function(run_cpack output_expected_file CPack_output_parent CPack_error_parent)
message("config_args = ${run_cpack_deb_CONFIG_ARGS}")
message("config_verbose = ${run_cpack_deb_CONFIG_VERBOSE}")
- execute_process(COMMAND ${CMAKE_CPACK_COMMAND} ${run_cpack_deb_CONFIG_VERBOSE} -G ${CPackGen} ${run_cpack_deb_CONFIG_ARGS}
+ execute_process(COMMAND ${CMAKE_CPACK_COMMAND} ${run_cpack_deb_CONFIG_VERBOSE} -G ${CPackGen} -C "${CONFIG}" ${run_cpack_deb_CONFIG_ARGS}
RESULT_VARIABLE CPack_result
OUTPUT_VARIABLE CPack_output
ERROR_VARIABLE CPack_error
diff --git a/Tests/CPackNSISGenerator/CMakeLists.txt b/Tests/CPackNSISGenerator/CMakeLists.txt
new file mode 100644
index 0000000..b8b2ed6
--- /dev/null
+++ b/Tests/CPackNSISGenerator/CMakeLists.txt
@@ -0,0 +1,20 @@
+cmake_minimum_required(VERSION 3.16)
+
+project(CPackNSISGenerator)
+
+add_executable(hello main.cpp)
+
+install(TARGETS hello
+ ARCHIVE DESTINATION .
+ RUNTIME DESTINATION .
+ LIBRARY DESTINATION .
+ BUNDLE DESTINATION .)
+
+set(CPACK_NSIS_MUI_HEADERIMAGE "${PROJECT_SOURCE_DIR}\\\\header-image.bmp")
+set(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}\\\\header-icon.bmp")
+set(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}\\\\install.ico")
+set(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}\\\\uninstall.ico")
+set(CPACK_GENERATOR "NSIS")
+set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
+
+include(CPack)
diff --git a/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake b/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake
new file mode 100644
index 0000000..01b37c5
--- /dev/null
+++ b/Tests/CPackNSISGenerator/RunCPackVerifyResult.cmake
@@ -0,0 +1,46 @@
+message(STATUS "=============================================================")
+message(STATUS "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)")
+message(STATUS "")
+
+if(NOT CPackNSISGenerator_BINARY_DIR)
+ message(FATAL_ERROR "CPackNSISGenerator_BINARY_DIR not set")
+endif()
+
+message(STATUS "CMAKE_COMMAND: ${CMAKE_COMMAND}")
+message(STATUS "CMAKE_CPACK_COMMAND: ${CMAKE_CPACK_COMMAND}")
+message(STATUS "CPackNSISGenerator_BINARY_DIR: ${CPackNSISGenerator_BINARY_DIR}")
+
+if(config)
+ set(_C_config -C ${config})
+endif()
+
+execute_process(COMMAND "${CMAKE_CPACK_COMMAND}"
+ ${_C_config}
+ RESULT_VARIABLE CPack_result
+ OUTPUT_VARIABLE CPack_output
+ ERROR_VARIABLE CPack_error
+ WORKING_DIRECTORY "${CPackNSISGenerator_BINARY_DIR}")
+
+if(CPack_result)
+ message(FATAL_ERROR "CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}")
+else ()
+ message(STATUS "CPack_output=${CPack_output}")
+endif()
+
+set(expected_file_mask "${CPackNSISGenerator_BINARY_DIR}/_CPack_Packages/*/NSIS/*.nsi")
+file(GLOB project_file "${expected_file_mask}")
+
+message(STATUS "project_file='${project_file}'")
+message(STATUS "expected_file_mask='${expected_file_mask}'")
+
+if(NOT project_file)
+ message(FATAL_ERROR "project_file does not exist.")
+endif()
+
+# should match !define MUI_HEADERIMAGE_BITMAP "${PROJECT_SOURCE_DIR}\header-image.bmp"
+file(STRINGS "${project_file}" line REGEX "^!define MUI_HEADERIMAGE_BITMAP")
+string(FIND "${line}" "header-image.bmp" output_index)
+message(STATUS "Found the bitmap at index ${output_index}")
+if("${output_index}" EQUAL "-1")
+ message(FATAL_ERROR "MUI_HEADERIMAGE_BITMAP not found in the project")
+endif()
diff --git a/Tests/CPackNSISGenerator/header-icon.bmp b/Tests/CPackNSISGenerator/header-icon.bmp
new file mode 100644
index 0000000..ef6a656
--- /dev/null
+++ b/Tests/CPackNSISGenerator/header-icon.bmp
Binary files differ
diff --git a/Tests/CPackNSISGenerator/header-image.bmp b/Tests/CPackNSISGenerator/header-image.bmp
new file mode 100644
index 0000000..15b1730
--- /dev/null
+++ b/Tests/CPackNSISGenerator/header-image.bmp
Binary files differ
diff --git a/Tests/CPackNSISGenerator/install.ico b/Tests/CPackNSISGenerator/install.ico
new file mode 100644
index 0000000..3b1e480
--- /dev/null
+++ b/Tests/CPackNSISGenerator/install.ico
Binary files differ
diff --git a/Tests/CPackNSISGenerator/main.cpp b/Tests/CPackNSISGenerator/main.cpp
new file mode 100644
index 0000000..956f345
--- /dev/null
+++ b/Tests/CPackNSISGenerator/main.cpp
@@ -0,0 +1,4 @@
+int main()
+{
+ return 42;
+}
diff --git a/Tests/CPackNSISGenerator/uninstall.ico b/Tests/CPackNSISGenerator/uninstall.ico
new file mode 100644
index 0000000..c4f6316
--- /dev/null
+++ b/Tests/CPackNSISGenerator/uninstall.ico
Binary files differ
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 2e41754..9fd85be 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -324,7 +324,7 @@ if (WIN32)
${file}
"[${hkey}]" DOC "Registry_Test_Path")
exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
- exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
+ exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"")
endif ()
endif ()
diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt
index 64f6dc8..df874ef 100644
--- a/Tests/Complex/Library/CMakeLists.txt
+++ b/Tests/Complex/Library/CMakeLists.txt
@@ -131,7 +131,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
# Custom target to try preprocessing invocation.
add_custom_target(test_preprocess ${MAYBE_ALL}
- COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
+ COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/create_file.dir/create_file.i
COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index 628cd4e..28b73af 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -281,7 +281,7 @@ if (WIN32)
${file}
"[${hkey}]" DOC "Registry_Test_Path")
exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"")
- exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"")
+ exec_program(${CMAKE_COMMAND} ARGS "-E rm -f \"${dir}/${file}\"")
endif ()
endif ()
diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt
index 64f6dc8..df874ef 100644
--- a/Tests/ComplexOneConfig/Library/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt
@@ -131,7 +131,7 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
# Custom target to try preprocessing invocation.
add_custom_target(test_preprocess ${MAYBE_ALL}
- COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i
+ COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/create_file.dir/create_file.i
COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/Tests/Contracts/VTK/CMakeLists.txt b/Tests/Contracts/VTK/CMakeLists.txt
index c946499..6ae2732 100644
--- a/Tests/Contracts/VTK/CMakeLists.txt
+++ b/Tests/Contracts/VTK/CMakeLists.txt
@@ -21,7 +21,7 @@ configure_file(
# build & test VTK's release branch
ExternalProject_Add(${PROJECT_NAME}
- GIT_REPOSITORY "git://vtk.org/VTK.git"
+ GIT_REPOSITORY "https://gitlab.kitware.com/vtk/vtk.git"
GIT_TAG "release"
PREFIX ${base_dir}
CONFIGURE_COMMAND ""
diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt
index a30071f..58b9b03 100644
--- a/Tests/Cuda/CMakeLists.txt
+++ b/Tests/Cuda/CMakeLists.txt
@@ -1,10 +1,25 @@
ADD_TEST_MACRO(Cuda.Complex CudaComplex)
ADD_TEST_MACRO(Cuda.ConsumeCompileFeatures CudaConsumeCompileFeatures)
+ADD_TEST_MACRO(Cuda.CXXStandardSetTwice CXXStandardSetTwice)
ADD_TEST_MACRO(Cuda.ObjectLibrary CudaObjectLibrary)
-ADD_TEST_MACRO(Cuda.MixedStandardLevels MixedStandardLevels)
+ADD_TEST_MACRO(Cuda.MixedStandardLevels1 MixedStandardLevels1)
+ADD_TEST_MACRO(Cuda.MixedStandardLevels2 MixedStandardLevels2)
+ADD_TEST_MACRO(Cuda.MixedStandardLevels3 MixedStandardLevels3)
+ADD_TEST_MACRO(Cuda.MixedStandardLevels4 MixedStandardLevels4)
+ADD_TEST_MACRO(Cuda.MixedStandardLevels5 MixedStandardLevels5)
ADD_TEST_MACRO(Cuda.NotEnabled CudaNotEnabled)
-ADD_TEST_MACRO(Cuda.ToolkitInclude CudaToolkitInclude)
+ADD_TEST_MACRO(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
+ADD_TEST_MACRO(Cuda.Toolkit Toolkit)
+ADD_TEST_MACRO(Cuda.IncludePathNoToolkit IncludePathNoToolkit)
ADD_TEST_MACRO(Cuda.ProperDeviceLibraries ProperDeviceLibraries)
ADD_TEST_MACRO(Cuda.ProperLinkFlags ProperLinkFlags)
+ADD_TEST_MACRO(Cuda.SharedRuntimePlusToolkit SharedRuntimePlusToolkit)
+
+# The CUDA only ships the shared version of the toolkit libraries
+# on windows
+if(NOT WIN32)
+ ADD_TEST_MACRO(Cuda.StaticRuntimePlusToolkit StaticRuntimePlusToolkit)
+endif()
+
ADD_TEST_MACRO(Cuda.WithC CudaWithC)
diff --git a/Tests/Cuda/MixedStandardLevels/CMakeLists.txt b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt
index b399662..1941c49 100644
--- a/Tests/Cuda/MixedStandardLevels/CMakeLists.txt
+++ b/Tests/Cuda/CXXStandardSetTwice/CMakeLists.txt
@@ -1,14 +1,14 @@
cmake_minimum_required(VERSION 3.7)
-project(MixedStandardLevels CXX CUDA)
+project(CXXStandardSetTwice CXX CUDA)
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
set(CMAKE_CXX_STANDARD 11)
-add_executable(MixedStandardLevels main.cu)
-target_compile_features(MixedStandardLevels PUBLIC cxx_std_11)
+add_executable(CXXStandardSetTwice main.cu)
+target_compile_features(CXXStandardSetTwice PUBLIC cxx_std_11)
if(APPLE)
# Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
- set_property(TARGET MixedStandardLevels PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+ set_property(TARGET CXXStandardSetTwice PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
endif()
diff --git a/Tests/Cuda/MixedStandardLevels/main.cu b/Tests/Cuda/CXXStandardSetTwice/main.cu
index d57c05a..d57c05a 100644
--- a/Tests/Cuda/MixedStandardLevels/main.cu
+++ b/Tests/Cuda/CXXStandardSetTwice/main.cu
diff --git a/Tests/Cuda/ToolkitInclude/CMakeLists.txt b/Tests/Cuda/IncludePathNoToolkit/CMakeLists.txt
index f246b54..7be1561 100644
--- a/Tests/Cuda/ToolkitInclude/CMakeLists.txt
+++ b/Tests/Cuda/IncludePathNoToolkit/CMakeLists.txt
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.8)
-project (ToolkitInclude CXX CUDA)
+project (IncludePathNoToolkit CXX CUDA)
#Goal for this example:
# Validate that between the CXX implicit include directories and the
# CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES directories we can find
# the cuda runtime headers
-add_executable(CudaToolkitInclude main.cpp)
-target_include_directories(CudaToolkitInclude PRIVATE
+add_executable(IncludePathNoToolkit main.cpp)
+target_include_directories(IncludePathNoToolkit PRIVATE
${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
diff --git a/Tests/Cuda/ToolkitInclude/main.cpp b/Tests/Cuda/IncludePathNoToolkit/main.cpp
index c8d5c6b..c8d5c6b 100644
--- a/Tests/Cuda/ToolkitInclude/main.cpp
+++ b/Tests/Cuda/IncludePathNoToolkit/main.cpp
diff --git a/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
new file mode 100644
index 0000000..b03e51e
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels1/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.7)
+project(MixedStandardLevels1 CXX CUDA)
+
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CUDA_STANDARD 11)
+
+add_executable(MixedStandardLevels1 main.cu lib.cpp)
+
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET MixedStandardLevels1 PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/Cuda/MixedStandardLevels1/lib.cpp b/Tests/Cuda/MixedStandardLevels1/lib.cpp
new file mode 100644
index 0000000..cabbacb
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels1/lib.cpp
@@ -0,0 +1,7 @@
+
+int func(int A, int B)
+{
+ // Verify that we have at least c++14
+ auto mult_func = [](auto a, auto b) { return a * b; };
+ return mult_func(A, B);
+}
diff --git a/Tests/Cuda/MixedStandardLevels1/main.cu b/Tests/Cuda/MixedStandardLevels1/main.cu
new file mode 100644
index 0000000..bc02c6d
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels1/main.cu
@@ -0,0 +1,9 @@
+
+#include <type_traits>
+
+int main(int argc, char** argv)
+{
+ // Verify that we have at least c++11
+ using returnv = std::integral_constant<int, 0>;
+ return returnv::value;
+}
diff --git a/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt
new file mode 100644
index 0000000..12dd328
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels2/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.7)
+project(MixedStandardLevels2 CXX CUDA)
+
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+
+set(CMAKE_CXX_STANDARD 17) #this can decay
+
+add_executable(MixedStandardLevels2 main.cu lib.cpp)
+target_compile_features(MixedStandardLevels2 PUBLIC cuda_std_11)
+
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET MixedStandardLevels2 PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/Cuda/MixedStandardLevels2/lib.cpp b/Tests/Cuda/MixedStandardLevels2/lib.cpp
new file mode 100644
index 0000000..cabbacb
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels2/lib.cpp
@@ -0,0 +1,7 @@
+
+int func(int A, int B)
+{
+ // Verify that we have at least c++14
+ auto mult_func = [](auto a, auto b) { return a * b; };
+ return mult_func(A, B);
+}
diff --git a/Tests/Cuda/MixedStandardLevels2/main.cu b/Tests/Cuda/MixedStandardLevels2/main.cu
new file mode 100644
index 0000000..a97a41e
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels2/main.cu
@@ -0,0 +1,11 @@
+
+#if __cplusplus < 201103L && !defined(_MSC_VER)
+# error "invalid standard value"
+#endif
+#include <type_traits>
+
+int main(int argc, char** argv)
+{
+ using returnv = std::integral_constant<int, 0>;
+ return returnv::value;
+}
diff --git a/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt
new file mode 100644
index 0000000..2b611be
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels3/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.7)
+project(MixedStandardLevels3 CXX CUDA)
+
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+
+add_executable(MixedStandardLevels3 main.cu lib.cpp)
+target_compile_features(MixedStandardLevels3 PUBLIC cuda_std_03 cxx_std_14)
+
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET MixedStandardLevels3 PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/Cuda/MixedStandardLevels3/lib.cpp b/Tests/Cuda/MixedStandardLevels3/lib.cpp
new file mode 100644
index 0000000..cabbacb
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels3/lib.cpp
@@ -0,0 +1,7 @@
+
+int func(int A, int B)
+{
+ // Verify that we have at least c++14
+ auto mult_func = [](auto a, auto b) { return a * b; };
+ return mult_func(A, B);
+}
diff --git a/Tests/Cuda/MixedStandardLevels3/main.cu b/Tests/Cuda/MixedStandardLevels3/main.cu
new file mode 100644
index 0000000..1c19e8d
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels3/main.cu
@@ -0,0 +1,5 @@
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt
new file mode 100644
index 0000000..faf6869
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels4/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.7)
+project(MixedStandardLevels4 CXX CUDA)
+
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+
+set(CMAKE_CUDA_STANDARD 03)
+
+add_executable(MixedStandardLevels4 main.cu lib.cpp)
+target_compile_features(MixedStandardLevels4 PUBLIC cxx_std_14)
+
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET MixedStandardLevels4 PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/Cuda/MixedStandardLevels4/lib.cpp b/Tests/Cuda/MixedStandardLevels4/lib.cpp
new file mode 100644
index 0000000..ef6fc20
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels4/lib.cpp
@@ -0,0 +1,16 @@
+
+
+constexpr int func(int A, int B)
+{
+#if defined(_MSC_VER) && _MSC_VER < 1913
+ // no suppport for extended constexpr
+ return B * A;
+#else
+ // Verify that we have at least c++14
+ if (A < B) {
+ return A + B;
+ } else {
+ return B * A;
+ }
+#endif
+}
diff --git a/Tests/Cuda/MixedStandardLevels4/main.cu b/Tests/Cuda/MixedStandardLevels4/main.cu
new file mode 100644
index 0000000..1c19e8d
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels4/main.cu
@@ -0,0 +1,5 @@
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt
new file mode 100644
index 0000000..7209f60
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels5/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.7)
+project(MixedStandardLevels5 CXX CUDA)
+
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+
+set(CMAKE_CXX_STANDARD 98)
+
+add_executable(MixedStandardLevels5 main.cu lib.cpp)
+
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET MixedStandardLevels5 PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/Cuda/MixedStandardLevels5/lib.cpp b/Tests/Cuda/MixedStandardLevels5/lib.cpp
new file mode 100644
index 0000000..dd7b31b
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels5/lib.cpp
@@ -0,0 +1,13 @@
+
+#if __cplusplus >= 201103L
+# error "invalid standard value"
+#endif
+int func(int A, int B)
+{
+ // Verify that we have at least c++14
+ if (A < B) {
+ return A + B;
+ } else {
+ return B * A;
+ }
+}
diff --git a/Tests/Cuda/MixedStandardLevels5/main.cu b/Tests/Cuda/MixedStandardLevels5/main.cu
new file mode 100644
index 0000000..c79afd6
--- /dev/null
+++ b/Tests/Cuda/MixedStandardLevels5/main.cu
@@ -0,0 +1,8 @@
+
+#if __cplusplus >= 201103L
+# error "invalid standard value"
+#endif
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt b/Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt
new file mode 100644
index 0000000..97670e3
--- /dev/null
+++ b/Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt
@@ -0,0 +1,3 @@
+project(SeparableCompCXXOnly LANGUAGES CXX CUDA)
+set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
+add_executable(SeparableCompCXXOnly main.cpp)
diff --git a/Tests/Cuda/SeparableCompCXXOnly/main.cpp b/Tests/Cuda/SeparableCompCXXOnly/main.cpp
new file mode 100644
index 0000000..8135246
--- /dev/null
+++ b/Tests/Cuda/SeparableCompCXXOnly/main.cpp
@@ -0,0 +1,5 @@
+
+int main(int, char const* [])
+{
+ return 0;
+}
diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt b/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt
new file mode 100644
index 0000000..48df558
--- /dev/null
+++ b/Tests/Cuda/SharedRuntimePlusToolkit/CMakeLists.txt
@@ -0,0 +1,35 @@
+cmake_minimum_required(VERSION 3.15)
+project(SharedRuntimePlusToolkit CXX)
+
+#Goal for this example:
+# Validate that with c++ we can use some components of the CUDA toolkit, and
+# specify the cuda runtime
+find_package(CUDAToolkit REQUIRED)
+
+add_library(Common OBJECT curand.cpp nppif.cpp)
+target_link_libraries(Common PRIVATE CUDA::toolkit)
+set_target_properties(Common PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
+#shared runtime with shared toolkit libraries
+add_library(SharedToolkit SHARED shared.cpp)
+target_link_libraries(SharedToolkit PRIVATE Common PUBLIC CUDA::curand CUDA::nppif)
+target_link_libraries(SharedToolkit PUBLIC CUDA::cudart)
+
+# The CUDA only ships the shared version of the toolkit libraries
+# on windows
+if(NOT WIN32)
+ #shared runtime with static toolkit libraries
+ add_library(StaticToolkit SHARED static.cpp)
+ target_link_libraries(StaticToolkit PRIVATE Common CUDA::curand_static CUDA::nppif_static)
+ target_link_libraries(StaticToolkit PUBLIC CUDA::cudart)
+
+ #static runtime with mixed toolkit libraries
+ add_library(MixedToolkit SHARED mixed.cpp)
+ target_link_libraries(MixedToolkit PRIVATE Common CUDA::curand_static CUDA::nppif)
+ target_link_libraries(MixedToolkit PUBLIC CUDA::cudart)
+endif()
+
+add_executable(SharedRuntimePlusToolkit main.cpp)
+target_link_libraries(SharedRuntimePlusToolkit PRIVATE SharedToolkit
+ $<TARGET_NAME_IF_EXISTS:StaticToolkit>
+ $<TARGET_NAME_IF_EXISTS:MixedToolkit>)
diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/curand.cpp b/Tests/Cuda/SharedRuntimePlusToolkit/curand.cpp
new file mode 100644
index 0000000..fdd7b53
--- /dev/null
+++ b/Tests/Cuda/SharedRuntimePlusToolkit/curand.cpp
@@ -0,0 +1,65 @@
+// Comes from:
+// https://docs.nvidia.com/cuda/curand/host-api-overview.html#host-api-example
+
+#ifdef _WIN32
+# define EXPORT __declspec(dllexport)
+#else
+# define EXPORT
+#endif
+
+/*
+ * This program uses the host CURAND API to generate 100
+ * pseudorandom floats.
+ */
+#include <cuda.h>
+#include <curand.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define CUDA_CALL(x) \
+ do { \
+ if ((x) != cudaSuccess) { \
+ printf("Error at %s:%d\n", __FILE__, __LINE__); \
+ return EXIT_FAILURE; \
+ } \
+ } while (0)
+#define CURAND_CALL(x) \
+ do { \
+ if ((x) != CURAND_STATUS_SUCCESS) { \
+ printf("Error at %s:%d\n", __FILE__, __LINE__); \
+ return EXIT_FAILURE; \
+ } \
+ } while (0)
+
+EXPORT int curand_main()
+{
+ size_t n = 100;
+ size_t i;
+ curandGenerator_t gen;
+ float *devData, *hostData;
+
+ /* Allocate n floats on host */
+ hostData = (float*)calloc(n, sizeof(float));
+
+ /* Allocate n floats on device */
+ CUDA_CALL(cudaMalloc((void**)&devData, n * sizeof(float)));
+
+ /* Create pseudo-random number generator */
+ CURAND_CALL(curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT));
+
+ /* Set seed */
+ CURAND_CALL(curandSetPseudoRandomGeneratorSeed(gen, 1234ULL));
+
+ /* Generate n floats on device */
+ CURAND_CALL(curandGenerateUniform(gen, devData, n));
+
+ /* Copy device memory to host */
+ CUDA_CALL(
+ cudaMemcpy(hostData, devData, n * sizeof(float), cudaMemcpyDeviceToHost));
+
+ /* Cleanup */
+ CURAND_CALL(curandDestroyGenerator(gen));
+ CUDA_CALL(cudaFree(devData));
+ free(hostData);
+ return EXIT_SUCCESS;
+}
diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/main.cpp b/Tests/Cuda/SharedRuntimePlusToolkit/main.cpp
new file mode 100644
index 0000000..2a4da22
--- /dev/null
+++ b/Tests/Cuda/SharedRuntimePlusToolkit/main.cpp
@@ -0,0 +1,23 @@
+
+#ifdef _WIN32
+# define IMPORT __declspec(dllimport)
+IMPORT int shared_version();
+int static_version()
+{
+ return 0;
+}
+int mixed_version()
+{
+ return 0;
+}
+#else
+int shared_version();
+int static_version();
+int mixed_version();
+#endif
+
+int main()
+{
+ return mixed_version() == 0 && shared_version() == 0 &&
+ static_version() == 0;
+}
diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/mixed.cpp b/Tests/Cuda/SharedRuntimePlusToolkit/mixed.cpp
new file mode 100644
index 0000000..6de6886
--- /dev/null
+++ b/Tests/Cuda/SharedRuntimePlusToolkit/mixed.cpp
@@ -0,0 +1,16 @@
+
+#ifdef _WIN32
+# define IMPORT __declspec(dllimport)
+# define EXPORT __declspec(dllexport)
+#else
+# define IMPORT
+# define EXPORT
+#endif
+
+IMPORT int curand_main();
+IMPORT int nppif_main();
+
+EXPORT int mixed_version()
+{
+ return curand_main() == 0 && nppif_main() == 0;
+}
diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp b/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp
new file mode 100644
index 0000000..ac5341c
--- /dev/null
+++ b/Tests/Cuda/SharedRuntimePlusToolkit/nppif.cpp
@@ -0,0 +1,92 @@
+// Comes from
+// https://devtalk.nvidia.com/default/topic/1037482/gpu-accelerated-libraries/help-me-help-you-with-modern-cmake-and-cuda-mwe-for-npp/post/5271066/#5271066
+
+#ifdef _WIN32
+# define EXPORT __declspec(dllexport)
+#else
+# define EXPORT
+#endif
+
+#include <cstdio>
+#include <iostream>
+
+#include <assert.h>
+#include <cuda_runtime_api.h>
+#include <nppi_filtering_functions.h>
+
+EXPORT int nppif_main()
+{
+ /**
+ * 8-bit unsigned single-channel 1D row convolution.
+ */
+ const int simgrows = 32;
+ const int simgcols = 32;
+ Npp8u *d_pSrc, *d_pDst;
+ const int nMaskSize = 3;
+ NppiSize oROI;
+ oROI.width = simgcols - nMaskSize;
+ oROI.height = simgrows;
+ const int simgsize = simgrows * simgcols * sizeof(d_pSrc[0]);
+ const int dimgsize = oROI.width * oROI.height * sizeof(d_pSrc[0]);
+ const int simgpix = simgrows * simgcols;
+ const int dimgpix = oROI.width * oROI.height;
+ const int nSrcStep = simgcols * sizeof(d_pSrc[0]);
+ const int nDstStep = oROI.width * sizeof(d_pDst[0]);
+ const int pixval = 1;
+ const int nDivisor = 1;
+ const Npp32s h_pKernel[nMaskSize] = { pixval, pixval, pixval };
+ Npp32s* d_pKernel;
+ const Npp32s nAnchor = 2;
+ cudaError_t err = cudaMalloc((void**)&d_pSrc, simgsize);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ err = cudaMalloc((void**)&d_pDst, dimgsize);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ err = cudaMalloc((void**)&d_pKernel, nMaskSize * sizeof(d_pKernel[0]));
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ // set image to pixval initially
+ err = cudaMemset(d_pSrc, pixval, simgsize);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ err = cudaMemset(d_pDst, 0, dimgsize);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ err = cudaMemcpy(d_pKernel, h_pKernel, nMaskSize * sizeof(d_pKernel[0]),
+ cudaMemcpyHostToDevice);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ // copy src to dst
+ NppStatus ret =
+ nppiFilterRow_8u_C1R(d_pSrc, nSrcStep, d_pDst, nDstStep, oROI, d_pKernel,
+ nMaskSize, nAnchor, nDivisor);
+ assert(ret == NPP_NO_ERROR);
+ Npp8u* h_imgres = new Npp8u[dimgpix];
+ err = cudaMemcpy(h_imgres, d_pDst, dimgsize, cudaMemcpyDeviceToHost);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ // test for filtering
+ for (int i = 0; i < dimgpix; i++) {
+ if (h_imgres[i] != (pixval * pixval * nMaskSize)) {
+ fprintf(stderr, "h_imgres at index %d failed to match\n", i);
+ return 1;
+ }
+ }
+
+ return 0;
+}
diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/shared.cpp b/Tests/Cuda/SharedRuntimePlusToolkit/shared.cpp
new file mode 100644
index 0000000..f3c3dbc
--- /dev/null
+++ b/Tests/Cuda/SharedRuntimePlusToolkit/shared.cpp
@@ -0,0 +1,16 @@
+
+#ifdef _WIN32
+# define IMPORT __declspec(dllimport)
+# define EXPORT __declspec(dllexport)
+#else
+# define IMPORT
+# define EXPORT
+#endif
+
+int curand_main();
+int nppif_main();
+
+EXPORT int shared_version()
+{
+ return curand_main() == 0 && nppif_main() == 0;
+}
diff --git a/Tests/Cuda/SharedRuntimePlusToolkit/static.cpp b/Tests/Cuda/SharedRuntimePlusToolkit/static.cpp
new file mode 100644
index 0000000..6932fa3
--- /dev/null
+++ b/Tests/Cuda/SharedRuntimePlusToolkit/static.cpp
@@ -0,0 +1,16 @@
+
+#ifdef _WIN32
+# define IMPORT __declspec(dllimport)
+# define EXPORT __declspec(dllexport)
+#else
+# define IMPORT
+# define EXPORT
+#endif
+
+IMPORT int curand_main();
+IMPORT int nppif_main();
+
+EXPORT int static_version()
+{
+ return curand_main() == 0 && nppif_main() == 0;
+}
diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/CMakeLists.txt b/Tests/Cuda/StaticRuntimePlusToolkit/CMakeLists.txt
new file mode 100644
index 0000000..df6c392
--- /dev/null
+++ b/Tests/Cuda/StaticRuntimePlusToolkit/CMakeLists.txt
@@ -0,0 +1,29 @@
+cmake_minimum_required(VERSION 3.15)
+project(StaticRuntimePlusToolkit CXX)
+
+#Goal for this example:
+# Validate that with c++ we can use some components of the CUDA toolkit, and
+# specify the cuda runtime
+find_package(CUDAToolkit REQUIRED)
+
+add_library(Common OBJECT curand.cpp nppif.cpp)
+target_link_libraries(Common PRIVATE CUDA::toolkit)
+set_target_properties(Common PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
+#static runtime with shared toolkit libraries
+add_library(SharedToolkit SHARED shared.cpp)
+target_link_libraries(SharedToolkit PRIVATE Common PUBLIC CUDA::curand CUDA::nppif)
+target_link_libraries(SharedToolkit PUBLIC CUDA::cudart_static)
+
+#static runtime with static toolkit libraries
+add_library(StaticToolkit SHARED static.cpp)
+target_link_libraries(StaticToolkit PRIVATE Common CUDA::curand_static CUDA::nppif_static)
+target_link_libraries(StaticToolkit PUBLIC CUDA::cudart_static)
+
+#static runtime with mixed toolkit libraries
+add_library(MixedToolkit SHARED mixed.cpp)
+target_link_libraries(MixedToolkit PRIVATE Common CUDA::curand CUDA::nppif_static)
+target_link_libraries(MixedToolkit PUBLIC CUDA::cudart_static)
+
+add_executable(StaticRuntimePlusToolkit main.cpp)
+target_link_libraries(StaticRuntimePlusToolkit PRIVATE SharedToolkit StaticToolkit MixedToolkit)
diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/curand.cpp b/Tests/Cuda/StaticRuntimePlusToolkit/curand.cpp
new file mode 100644
index 0000000..95872f0
--- /dev/null
+++ b/Tests/Cuda/StaticRuntimePlusToolkit/curand.cpp
@@ -0,0 +1,59 @@
+// Comes from:
+// https://docs.nvidia.com/cuda/curand/host-api-overview.html#host-api-example
+
+/*
+ * This program uses the host CURAND API to generate 100
+ * pseudorandom floats.
+ */
+#include <cuda.h>
+#include <curand.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define CUDA_CALL(x) \
+ do { \
+ if ((x) != cudaSuccess) { \
+ printf("Error at %s:%d\n", __FILE__, __LINE__); \
+ return EXIT_FAILURE; \
+ } \
+ } while (0)
+#define CURAND_CALL(x) \
+ do { \
+ if ((x) != CURAND_STATUS_SUCCESS) { \
+ printf("Error at %s:%d\n", __FILE__, __LINE__); \
+ return EXIT_FAILURE; \
+ } \
+ } while (0)
+
+int curand_main()
+{
+ size_t n = 100;
+ size_t i;
+ curandGenerator_t gen;
+ float *devData, *hostData;
+
+ /* Allocate n floats on host */
+ hostData = (float*)calloc(n, sizeof(float));
+
+ /* Allocate n floats on device */
+ CUDA_CALL(cudaMalloc((void**)&devData, n * sizeof(float)));
+
+ /* Create pseudo-random number generator */
+ CURAND_CALL(curandCreateGenerator(&gen, CURAND_RNG_PSEUDO_DEFAULT));
+
+ /* Set seed */
+ CURAND_CALL(curandSetPseudoRandomGeneratorSeed(gen, 1234ULL));
+
+ /* Generate n floats on device */
+ CURAND_CALL(curandGenerateUniform(gen, devData, n));
+
+ /* Copy device memory to host */
+ CUDA_CALL(
+ cudaMemcpy(hostData, devData, n * sizeof(float), cudaMemcpyDeviceToHost));
+
+ /* Cleanup */
+ CURAND_CALL(curandDestroyGenerator(gen));
+ CUDA_CALL(cudaFree(devData));
+ free(hostData);
+ return EXIT_SUCCESS;
+}
diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/main.cpp b/Tests/Cuda/StaticRuntimePlusToolkit/main.cpp
new file mode 100644
index 0000000..5a09f8e
--- /dev/null
+++ b/Tests/Cuda/StaticRuntimePlusToolkit/main.cpp
@@ -0,0 +1,11 @@
+
+
+int shared_version();
+int static_version();
+int mixed_version();
+
+int main()
+{
+ return mixed_version() == 0 && shared_version() == 0 &&
+ static_version() == 0;
+}
diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/mixed.cpp b/Tests/Cuda/StaticRuntimePlusToolkit/mixed.cpp
new file mode 100644
index 0000000..a05140d
--- /dev/null
+++ b/Tests/Cuda/StaticRuntimePlusToolkit/mixed.cpp
@@ -0,0 +1,8 @@
+
+int curand_main();
+int nppif_main();
+
+int mixed_version()
+{
+ return curand_main() == 0 && nppif_main() == 0;
+}
diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp b/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp
new file mode 100644
index 0000000..2871090
--- /dev/null
+++ b/Tests/Cuda/StaticRuntimePlusToolkit/nppif.cpp
@@ -0,0 +1,86 @@
+// Comes from
+// https://devtalk.nvidia.com/default/topic/1037482/gpu-accelerated-libraries/help-me-help-you-with-modern-cmake-and-cuda-mwe-for-npp/post/5271066/#5271066
+
+#include <cstdio>
+#include <iostream>
+
+#include <assert.h>
+#include <cuda_runtime_api.h>
+#include <nppi_filtering_functions.h>
+
+int nppif_main()
+{
+ /**
+ * 8-bit unsigned single-channel 1D row convolution.
+ */
+ const int simgrows = 32;
+ const int simgcols = 32;
+ Npp8u *d_pSrc, *d_pDst;
+ const int nMaskSize = 3;
+ NppiSize oROI;
+ oROI.width = simgcols - nMaskSize;
+ oROI.height = simgrows;
+ const int simgsize = simgrows * simgcols * sizeof(d_pSrc[0]);
+ const int dimgsize = oROI.width * oROI.height * sizeof(d_pSrc[0]);
+ const int simgpix = simgrows * simgcols;
+ const int dimgpix = oROI.width * oROI.height;
+ const int nSrcStep = simgcols * sizeof(d_pSrc[0]);
+ const int nDstStep = oROI.width * sizeof(d_pDst[0]);
+ const int pixval = 1;
+ const int nDivisor = 1;
+ const Npp32s h_pKernel[nMaskSize] = { pixval, pixval, pixval };
+ Npp32s* d_pKernel;
+ const Npp32s nAnchor = 2;
+ cudaError_t err = cudaMalloc((void**)&d_pSrc, simgsize);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ err = cudaMalloc((void**)&d_pDst, dimgsize);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ err = cudaMalloc((void**)&d_pKernel, nMaskSize * sizeof(d_pKernel[0]));
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ // set image to pixval initially
+ err = cudaMemset(d_pSrc, pixval, simgsize);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ err = cudaMemset(d_pDst, 0, dimgsize);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ err = cudaMemcpy(d_pKernel, h_pKernel, nMaskSize * sizeof(d_pKernel[0]),
+ cudaMemcpyHostToDevice);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ // copy src to dst
+ NppStatus ret =
+ nppiFilterRow_8u_C1R(d_pSrc, nSrcStep, d_pDst, nDstStep, oROI, d_pKernel,
+ nMaskSize, nAnchor, nDivisor);
+ assert(ret == NPP_NO_ERROR);
+ Npp8u* h_imgres = new Npp8u[dimgpix];
+ err = cudaMemcpy(h_imgres, d_pDst, dimgsize, cudaMemcpyDeviceToHost);
+ if (err != cudaSuccess) {
+ fprintf(stderr, "Cuda error %d\n", __LINE__);
+ return 1;
+ }
+ // test for filtering
+ for (int i = 0; i < dimgpix; i++) {
+ if (h_imgres[i] != (pixval * pixval * nMaskSize)) {
+ fprintf(stderr, "h_imgres at index %d failed to match\n", i);
+ return 1;
+ }
+ }
+
+ return 0;
+}
diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/shared.cpp b/Tests/Cuda/StaticRuntimePlusToolkit/shared.cpp
new file mode 100644
index 0000000..9967b66
--- /dev/null
+++ b/Tests/Cuda/StaticRuntimePlusToolkit/shared.cpp
@@ -0,0 +1,8 @@
+
+int curand_main();
+int nppif_main();
+
+int shared_version()
+{
+ return curand_main() == 0 && nppif_main() == 0;
+}
diff --git a/Tests/Cuda/StaticRuntimePlusToolkit/static.cpp b/Tests/Cuda/StaticRuntimePlusToolkit/static.cpp
new file mode 100644
index 0000000..ca7eb4c
--- /dev/null
+++ b/Tests/Cuda/StaticRuntimePlusToolkit/static.cpp
@@ -0,0 +1,8 @@
+
+int curand_main();
+int nppif_main();
+
+int static_version()
+{
+ return curand_main() == 0 && nppif_main() == 0;
+}
diff --git a/Tests/Cuda/Toolkit/CMakeLists.txt b/Tests/Cuda/Toolkit/CMakeLists.txt
new file mode 100644
index 0000000..86b4652
--- /dev/null
+++ b/Tests/Cuda/Toolkit/CMakeLists.txt
@@ -0,0 +1,38 @@
+cmake_minimum_required(VERSION 3.15)
+project(Toolkit CXX)
+
+#Goal for this example:
+# Validate that we can use CUDAToolkit to find cuda include paths
+find_package(CUDAToolkit REQUIRED)
+
+message(STATUS "CUDAToolkit_VERSION: ${CUDAToolkit_VERSION}")
+message(STATUS "CUDAToolkit_VERSION_MAJOR: ${CUDAToolkit_VERSION_MAJOR}")
+message(STATUS "CUDAToolkit_VERSION_MINOR: ${CUDAToolkit_VERSION_MINOR}")
+message(STATUS "CUDAToolkit_VERSION_PATCH: ${CUDAToolkit_VERSION_PATCH}")
+message(STATUS "CUDAToolkit_BIN_DIR: ${CUDAToolkit_BIN_DIR}")
+message(STATUS "CUDAToolkit_INCLUDE_DIRS: ${CUDAToolkit_INCLUDE_DIRS}")
+message(STATUS "CUDAToolkit_LIBRARY_DIR: ${CUDAToolkit_LIBRARY_DIR}")
+message(STATUS "CUDAToolkit_NVCC_EXECUTABLE ${CUDAToolkit_NVCC_EXECUTABLE}")
+
+# Verify that all the CUDA:: targets exist even when the CUDA language isn't enabled
+
+foreach (cuda_lib cudart cuda_driver cublas cufft cufftw curand cusolver cusparse nvgraph)
+ if(NOT TARGET CUDA::${cuda_lib})
+ message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found")
+ endif()
+endforeach()
+
+foreach (cuda_lib nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppicom nppisu)
+ if(NOT TARGET CUDA::${cuda_lib})
+ message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found")
+ endif()
+endforeach()
+
+foreach (cuda_lib nvrtc nvToolsExt OpenCL)
+ if(NOT TARGET CUDA::${cuda_lib})
+ message(FATAL_ERROR "The CUDA::${cuda_lib} target was expected but couldn't be found")
+ endif()
+endforeach()
+
+add_executable(Toolkit main.cpp)
+target_link_libraries(Toolkit PRIVATE CUDA::toolkit)
diff --git a/Tests/Cuda/Toolkit/main.cpp b/Tests/Cuda/Toolkit/main.cpp
new file mode 100644
index 0000000..c8d5c6b
--- /dev/null
+++ b/Tests/Cuda/Toolkit/main.cpp
@@ -0,0 +1,8 @@
+// Only thing we care about is that these headers are found
+#include <cuda.h>
+#include <cuda_runtime_api.h>
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt
index f1fd344..a0575cd 100644
--- a/Tests/CudaOnly/CMakeLists.txt
+++ b/Tests/CudaOnly/CMakeLists.txt
@@ -5,6 +5,8 @@ ADD_TEST_MACRO(CudaOnly.ExportPTX CudaOnlyExportPTX)
ADD_TEST_MACRO(CudaOnly.GPUDebugFlag CudaOnlyGPUDebugFlag)
ADD_TEST_MACRO(CudaOnly.ResolveDeviceSymbols CudaOnlyResolveDeviceSymbols)
ADD_TEST_MACRO(CudaOnly.SeparateCompilation CudaOnlySeparateCompilation)
+ADD_TEST_MACRO(CudaOnly.Standard98 CudaOnlyStandard98)
+ADD_TEST_MACRO(CudaOnly.Toolkit CudaOnlyToolkit)
ADD_TEST_MACRO(CudaOnly.WithDefs CudaOnlyWithDefs)
add_test(NAME CudaOnly.DontResolveDeviceSymbols COMMAND
diff --git a/Tests/CudaOnly/EnableStandard/CMakeLists.txt b/Tests/CudaOnly/EnableStandard/CMakeLists.txt
index 54e2c14..dfcb8da 100644
--- a/Tests/CudaOnly/EnableStandard/CMakeLists.txt
+++ b/Tests/CudaOnly/EnableStandard/CMakeLists.txt
@@ -11,8 +11,9 @@ add_library(CUDADynamic11 SHARED shared.cu)
add_executable(CudaOnlyEnableStandard main.cu)
target_link_libraries(CudaOnlyEnableStandard PRIVATE CUDAStatic11 CUDADynamic11)
-set_target_properties(CUDAStatic11 CUDADynamic11 PROPERTIES CUDA_STANDARD 11)
-set_target_properties(CUDAStatic11 CUDADynamic11 PROPERTIES CUDA_STANDARD_REQUIRED TRUE)
+target_compile_features(CUDADynamic11 PRIVATE cuda_std_11)
+set_target_properties(CUDAStatic11 PROPERTIES CUDA_STANDARD 11)
+set_target_properties(CUDAStatic11 PROPERTIES CUDA_STANDARD_REQUIRED TRUE)
#Verify CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES
foreach(dir ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
index 64845c5..57aa0b9 100644
--- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
@@ -22,11 +22,11 @@ endif()
# 3. Verify that we can't use those device symbols from anything that links
# to the static library
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[sm_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CUDA_STANDARD 11)
add_library(CUDAResolveDeviceDepsA STATIC file1.cu)
add_library(CUDAResolveDeviceDepsB STATIC file2.cu)
+target_compile_features(CUDAResolveDeviceDepsA PUBLIC cuda_std_11)
+target_compile_features(CUDAResolveDeviceDepsB PUBLIC cuda_std_11)
set_target_properties(CUDAResolveDeviceDepsA CUDAResolveDeviceDepsB
PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
diff --git a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
index 1e574d6..c1bd64a 100644
--- a/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
+++ b/Tests/CudaOnly/SeparateCompilation/CMakeLists.txt
@@ -11,11 +11,10 @@ project (SeparateCompilation CUDA)
#all containing cuda separable compilation code links properly
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=\\\"compute_30,sm_30,sm_35\\\"")
string(APPEND CMAKE_CUDA_FLAGS " --generate-code=arch=compute_50,code=[compute_50,sm_50,sm_52]")
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CUDA_STANDARD 11)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)
add_library(CUDASeparateLibA STATIC file1.cu file2.cu file3.cu)
+target_compile_features(CUDASeparateLibA PRIVATE cuda_std_11)
get_property(sep_comp TARGET CUDASeparateLibA PROPERTY CUDA_SEPARABLE_COMPILATION)
if(NOT sep_comp)
message(FATAL_ERROR "CUDA_SEPARABLE_COMPILATION not initialized")
@@ -36,11 +35,14 @@ endif()
#cause a segv when trying to run the executable
#
add_library(CUDASeparateLibB STATIC file4.cu file5.cu)
+target_compile_features(CUDASeparateLibB PRIVATE cuda_std_11)
target_link_libraries(CUDASeparateLibB PRIVATE CUDASeparateLibA)
add_executable(CudaOnlySeparateCompilation main.cu)
target_link_libraries(CudaOnlySeparateCompilation
PRIVATE CUDASeparateLibB)
+set_target_properties(CudaOnlySeparateCompilation PROPERTIES CUDA_STANDARD 11)
+set_target_properties(CudaOnlySeparateCompilation PROPERTIES CUDA_STANDARD_REQUIRED TRUE)
set_target_properties(CUDASeparateLibA
CUDASeparateLibB
diff --git a/Tests/CudaOnly/Standard98/CMakeLists.txt b/Tests/CudaOnly/Standard98/CMakeLists.txt
new file mode 100644
index 0000000..ef9a685
--- /dev/null
+++ b/Tests/CudaOnly/Standard98/CMakeLists.txt
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.7)
+project(CudaOnlyStandard98 CUDA)
+
+string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30")
+
+# Support setting CUDA Standard to 98 which internally gets transformed to
+# CUDA03
+set(CMAKE_CUDA_STANDARD 98)
+
+add_executable(CudaOnlyStandard98 main.cu)
+
+if(APPLE)
+ # Help the static cuda runtime find the driver (libcuda.dyllib) at runtime.
+ set_property(TARGET CudaOnlyStandard98 PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+endif()
diff --git a/Tests/CudaOnly/Standard98/main.cu b/Tests/CudaOnly/Standard98/main.cu
new file mode 100644
index 0000000..c79afd6
--- /dev/null
+++ b/Tests/CudaOnly/Standard98/main.cu
@@ -0,0 +1,8 @@
+
+#if __cplusplus >= 201103L
+# error "invalid standard value"
+#endif
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/CudaOnly/Toolkit/CMakeLists.txt b/Tests/CudaOnly/Toolkit/CMakeLists.txt
new file mode 100644
index 0000000..0d5d574
--- /dev/null
+++ b/Tests/CudaOnly/Toolkit/CMakeLists.txt
@@ -0,0 +1,44 @@
+cmake_minimum_required(VERSION 3.15)
+project(CudaOnlyToolkit CUDA)
+find_package(CUDAToolkit REQUIRED)
+
+message(STATUS "CUDAToolkit_VERSION: ${CUDAToolkit_VERSION}")
+message(STATUS "CUDAToolkit_VERSION_MAJOR: ${CUDAToolkit_VERSION_MAJOR}")
+message(STATUS "CUDAToolkit_VERSION_MINOR: ${CUDAToolkit_VERSION_MINOR}")
+message(STATUS "CUDAToolkit_VERSION_PATCH: ${CUDAToolkit_VERSION_PATCH}")
+message(STATUS "CUDAToolkit_BIN_DIR: ${CUDAToolkit_BIN_DIR}")
+message(STATUS "CUDAToolkit_INCLUDE_DIRS: ${CUDAToolkit_INCLUDE_DIRS}")
+message(STATUS "CUDAToolkit_LIBRARY_DIR: ${CUDAToolkit_LIBRARY_DIR}")
+message(STATUS "CUDAToolkit_NVCC_EXECUTABLE ${CUDAToolkit_NVCC_EXECUTABLE}")
+
+# Verify that all the CUDA:: targets and variables exist
+foreach (cuda_lib cudart cuda_driver cublas cufft cufftw curand cusolver cusparse nvgraph)
+ if(NOT CUDA_${cuda_lib}_LIBRARY)
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
+ endif()
+ if(NOT TARGET CUDA::${cuda_lib})
+ message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found")
+ endif()
+endforeach()
+
+foreach (cuda_lib nppc nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppicom nppisu)
+ if(NOT CUDA_${cuda_lib}_LIBRARY)
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
+ endif()
+ if(NOT TARGET CUDA::${cuda_lib})
+ message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found")
+ endif()
+endforeach()
+
+foreach (cuda_lib nvrtc nvToolsExt OpenCL)
+ if(NOT CUDA_${cuda_lib}_LIBRARY)
+ message(FATAL_ERROR "expected CUDAToolkit variable CUDA_${cuda_lib}_LIBRARY not found")
+ endif()
+
+ if(NOT TARGET CUDA::${cuda_lib})
+ message(FATAL_ERROR "expected CUDAToolkit target CUDA::${cuda_lib} not found")
+ endif()
+endforeach()
+
+add_executable(CudaOnlyToolkit main.cu)
+target_link_libraries(CudaOnlyToolkit PRIVATE CUDA::toolkit)
diff --git a/Tests/CudaOnly/Toolkit/main.cu b/Tests/CudaOnly/Toolkit/main.cu
new file mode 100644
index 0000000..0f3ccdc
--- /dev/null
+++ b/Tests/CudaOnly/Toolkit/main.cu
@@ -0,0 +1,8 @@
+// Only thing we care about is that these headers are found
+#include <cuda.h>
+#include <cuda_runtime_api.h>
+
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/CudaOnly/WithDefs/CMakeLists.txt b/Tests/CudaOnly/WithDefs/CMakeLists.txt
index 00fd7d2..ba9bf04 100644
--- a/Tests/CudaOnly/WithDefs/CMakeLists.txt
+++ b/Tests/CudaOnly/WithDefs/CMakeLists.txt
@@ -28,7 +28,7 @@ target_compile_options(CudaOnlyWithDefs
PRIVATE
-DFLAG_COMPILE_LANG_$<COMPILE_LANGUAGE>
-DFLAG_LANG_IS_CUDA=$<COMPILE_LANGUAGE:CUDA>
- -Xcompiler=-DHOST_DEFINE
+ --compiler-options=-DHOST_DEFINE
$<$<CONFIG:DEBUG>:$<BUILD_INTERFACE:${debug_compile_flags}>>
)
diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt
index e9a9f52..196fea3 100644
--- a/Tests/CustomCommand/CMakeLists.txt
+++ b/Tests/CustomCommand/CMakeLists.txt
@@ -70,7 +70,7 @@ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1temp.h
${PROJECT_BINARY_DIR}/doc1.h
COMMAND ${CMAKE_COMMAND} -E echo " Removing doc1temp.h."
- COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_BINARY_DIR}/doc1temp.h
+ COMMAND ${CMAKE_COMMAND} -E rm -f ${PROJECT_BINARY_DIR}/doc1temp.h
)
# Add custom command to generate foo.h.
@@ -412,7 +412,7 @@ add_custom_target(do_check_command_line ALL
add_dependencies(do_check_command_line check_command_line)
add_custom_target(pre_check_command_line
- COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
+ COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt
)
add_dependencies(do_check_command_line pre_check_command_line)
@@ -534,3 +534,35 @@ add_custom_command(
set_property(SOURCE "${gen_file}" PROPERTY SYMBOLIC ON)
add_custom_target(command_expand_lists ALL DEPENDS "${gen_file}")
set_property(TARGET command_expand_lists PROPERTY CMPARGS "${cmp_args}")
+
+# This also tests that `./` is squeezed out of the resulting path.
+set(depends_path "./depended_upon_path.txt")
+
+add_custom_command(
+ OUTPUT ${depends_path}
+ COMMAND ${CMAKE_COMMAND} -E touch ${depends_path}
+)
+
+add_custom_command(
+ OUTPUT "depends_on_path.txt"
+ COMMAND ${CMAKE_COMMAND} -E touch "depends_on_path.txt"
+ DEPENDS ${depends_path}
+)
+
+add_custom_target(depends_on_path ALL DEPENDS "depends_on_path.txt")
+
+add_custom_command(
+ OUTPUT "depends_on_in_source_path.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/main.cxx" depends_on_in_source_path.txt
+ DEPENDS main.cxx
+)
+
+add_custom_target(depends_on_in_source_path ALL DEPENDS "depends_on_in_source_path.txt")
+
+add_custom_command(
+ OUTPUT "depends_on_in_rel_source_path.txt"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/main.cxx" depends_on_in_rel_source_path.txt
+ DEPENDS ./main.cxx
+)
+
+add_custom_target(depends_on_in_rel_source_path ALL DEPENDS "depends_on_in_rel_source_path.txt")
diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in
index b7587aa..7781ded 100644
--- a/Tests/EnforceConfig.cmake.in
+++ b/Tests/EnforceConfig.cmake.in
@@ -33,5 +33,6 @@ unset(ENV{CMAKE_GENERATOR})
unset(ENV{CMAKE_GENERATOR_INSTANCE})
unset(ENV{CMAKE_GENERATOR_PLATFORM})
unset(ENV{CMAKE_GENERATOR_TOOLSET})
+unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
@TEST_HOME_ENV_CODE@
diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt
index dc621eb..d88eb11 100644
--- a/Tests/ExportImport/CMakeLists.txt
+++ b/Tests/ExportImport/CMakeLists.txt
@@ -7,7 +7,7 @@ endif()
# Wipe out the install tree to make sure the exporter works.
add_custom_command(
OUTPUT ${ExportImport_BINARY_DIR}/CleanupProject
- COMMAND ${CMAKE_COMMAND} -E remove_directory ${ExportImport_BINARY_DIR}/Root
+ COMMAND ${CMAKE_COMMAND} -E rm -rf ${ExportImport_BINARY_DIR}/Root
)
add_custom_target(CleanupTarget ALL DEPENDS ${ExportImport_BINARY_DIR}/CleanupProject)
set_property(
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index 9d8a248..387fe6b 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -156,6 +156,7 @@ target_link_libraries(testLibDepends PRIVATE testStaticLibRequiredPrivate)
cmake_policy(POP)
cmake_policy(PUSH)
+cmake_policy(SET CMP0022 NEW)
cmake_policy(SET CMP0079 NEW)
add_library(TopDirLib STATIC testTopDirLib.c)
add_subdirectory(SubDirLinkA)
@@ -240,6 +241,10 @@ set_property(TARGET testLibRequired APPEND PROPERTY
)
include(GenerateExportHeader)
+# Test deprecation of imported library
+add_library(testLibDeprecation STATIC testLib1.c)
+set_property(TARGET testLibDeprecation PROPERTY DEPRECATION "Deprecated version. Please use latest version")
+
add_subdirectory(renamed)
add_library(testSharedLibRequired SHARED testSharedLibRequired.cpp)
@@ -515,6 +520,7 @@ install(
testExe2lib testLib4lib testLib4libdbg testLib4libopt
testLib6 testLib7 testLib8
testLib9
+ testLibDeprecation
testLibCycleA testLibCycleB
testLibNoSONAME
cmp0022NEW cmp0022OLD
@@ -585,6 +591,7 @@ export(TARGETS testExe1 testLib1 testLib2 testLib3
export(TARGETS testExe2 testLib4 testLib5 testLib6 testLib7 testExe3 testExe4 testExe2lib
testLib8
testLib9 testLib9ObjPub testLib9ObjPriv testLib9ObjIface
+ testLibDeprecation
testLib4lib testLib4libdbg testLib4libopt
testLibCycleA testLibCycleB
testLibNoSONAME
@@ -646,6 +653,18 @@ if(CMAKE_GENERATOR MATCHES "Make|Ninja")
export(TARGETS testLinkDepends NAMESPACE bld_ APPEND FILE ExportBuildTree.cmake)
endif()
+#------------------------------------------------------------------------------
+# test export of CUDA language
+if(CMake_TEST_CUDA)
+ enable_language(CUDA)
+ add_library(cudaInterfaceLib INTERFACE)
+ target_compile_features(cudaInterfaceLib INTERFACE $<BUILD_INTERFACE:cuda_std_11> $<INSTALL_INTERFACE:cuda_std_14>)
+
+ install(TARGETS cudaInterfaceLib
+ EXPORT RequiredExp DESTINATION lib)
+ export(TARGETS cudaInterfaceLib NAMESPACE bld_ APPEND FILE ExportBuildTree.cmake)
+endif()
+
# Test the presence of targets named the same as languages.
# IMPORTED_LINK_INTERFACE_LANGUAGES entries should not be targets.
add_library(C INTERFACE)
diff --git a/Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt b/Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt
index 1c3c9dc..1aa41d2 100644
--- a/Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt
+++ b/Tests/ExportImport/Export/SubDirLinkA/CMakeLists.txt
@@ -1,6 +1,6 @@
add_library(SubDirLinkAImported IMPORTED INTERFACE)
target_compile_definitions(SubDirLinkAImported INTERFACE DEF_SubDirLinkAImportedForExport)
-target_link_libraries(TopDirLib PUBLIC SubDirLinkAImported)
+target_link_libraries(TopDirLib PUBLIC debug "$<1:SubDirLinkAImported;SubDirLinkAImported>" optimized "$<1:SubDirLinkAImported;SubDirLinkAImported>")
add_library(SubDirLinkA STATIC SubDirLinkA.c)
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index b5df961..3cb3833 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -51,6 +51,12 @@ checkForProperty(bld_testLib4 "EXPORTED_PROPERTY2" "EXPORTING_TESTLIB4_1")
checkForProperty(exp_testLib4 "EXPORTED_PROPERTY2" "EXPORTING_TESTLIB4_1")
checkForProperty(bld_testLib4 "EXPORTED_PROPERTY3" "EXPORTING_TESTLIB4_2")
checkForProperty(exp_testLib4 "EXPORTED_PROPERTY3" "EXPORTING_TESTLIB4_2")
+checkForProperty(bld_testLibDeprecation "DEPRECATION" "Deprecated version. Please use latest version")
+checkForProperty(exp_testLibDeprecation "DEPRECATION" "Deprecated version. Please use latest version")
+
+# Try linking to a deprecated library
+target_link_libraries(imp_testExe1 exp_testLibDeprecation)
+
# Try linking to a library imported from the install tree.
target_link_libraries(imp_testExe1
@@ -499,3 +505,10 @@ if(CMAKE_GENERATOR MATCHES "Make|Ninja")
checkForProperty(bld_testLinkDepends "INTERFACE_LINK_DEPENDS" "BUILD_LINK_DEPENDS")
checkForProperty(Req::testLinkDepends "INTERFACE_LINK_DEPENDS" "${CMAKE_INSTALL_PREFIX}/INSTALL_LINK_DEPENDS")
endif()
+
+#------------------------------------------------------------------------------
+# test import of CUDA language level
+if(CMake_TEST_CUDA)
+ checkForProperty(bld_cudaInterfaceLib "INTERFACE_COMPILE_FEATURES" "cuda_std_11")
+ checkForProperty(Req::cudaInterfaceLib "INTERFACE_COMPILE_FEATURES" "cuda_std_14")
+endif()
diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in
index f600d90..44cd179 100644
--- a/Tests/ExportImport/InitialCache.cmake.in
+++ b/Tests/ExportImport/InitialCache.cmake.in
@@ -14,3 +14,4 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRI
set(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix")
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")
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 093391e..ef81169 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -482,6 +482,66 @@ if(do_git_tests)
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+ # Unzip/untar the git repository in our source folder so that other
+ # projects below may use it to test git args of ExternalProject_Add
+ #
+ set(proj SetupLocalGITRepositoryWithRecursiveSubmodules)
+ ExternalProject_Add(${proj}
+ SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/GIT-with-recursive-submodules
+ URL ${CMAKE_CURRENT_SOURCE_DIR}/gitrepo-sub-rec.tgz
+ BUILD_COMMAND ""
+ CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
+ INSTALL_COMMAND ""
+ )
+ set_property(TARGET ${proj}
+ PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
+
+ set(local_git_repo "../../LocalRepositories/GIT-with-recursive-submodules")
+
+ set(proj TS1-GIT-RECURSIVE_SUBMODULES-default)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DWITH_RECURSIVE:BOOL=ON
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ "SetupLocalGITRepositoryWithSubmodules"
+ "SetupLocalGITRepositoryWithRecursiveSubmodules"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
+ set(proj TS1-GIT-RECURSIVE_SUBMODULES-exclusive)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_SUBMODULES_RECURSE TRUE
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DWITH_RECURSIVE:BOOL=ON
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ "SetupLocalGITRepositoryWithSubmodules"
+ "SetupLocalGITRepositoryWithRecursiveSubmodules"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
+ set(proj TS1-GIT-RECURSIVE_SUBMODULES-off)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_SUBMODULES_RECURSE FALSE
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DWITH_RECURSIVE:BOOL=OFF
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ "SetupLocalGITRepositoryWithSubmodules"
+ "SetupLocalGITRepositoryWithRecursiveSubmodules"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
endif()
set(do_hg_tests 0)
diff --git a/Tests/ExternalProject/gitrepo-sub-rec.tgz b/Tests/ExternalProject/gitrepo-sub-rec.tgz
new file mode 100644
index 0000000..b0f3f18
--- /dev/null
+++ b/Tests/ExternalProject/gitrepo-sub-rec.tgz
Binary files differ
diff --git a/Tests/FindLibArchive/CMakeLists.txt b/Tests/FindLibArchive/CMakeLists.txt
new file mode 100644
index 0000000..f532ef2
--- /dev/null
+++ b/Tests/FindLibArchive/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindLibArchive.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindLibArchive/Test"
+ "${CMake_BINARY_DIR}/Tests/FindLibArchive/Test"
+ ${build_generator_args}
+ --build-project TestFindLibArchive
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindLibArchive/Test/CMakeLists.txt b/Tests/FindLibArchive/Test/CMakeLists.txt
new file mode 100644
index 0000000..35843bb
--- /dev/null
+++ b/Tests/FindLibArchive/Test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.12)
+project(TestFindLibArchive C)
+include(CTest)
+
+find_package(LibArchive REQUIRED)
+
+add_executable(test_libarchive_tgt main.c)
+target_link_libraries(test_libarchive_tgt LibArchive::LibArchive)
+add_test(NAME test_libarchive_tgt COMMAND test_libarchive_tgt)
+
+add_executable(test_libarchive_var main.c)
+target_include_directories(test_libarchive_var PRIVATE ${LibArchive_INCLUDE_DIRS})
+target_link_libraries(test_libarchive_var PRIVATE ${LibArchive_LIBRARIES})
+add_test(NAME test_libarchive_var COMMAND test_libarchive_var)
diff --git a/Tests/FindLibArchive/Test/main.c b/Tests/FindLibArchive/Test/main.c
new file mode 100644
index 0000000..03e7ece
--- /dev/null
+++ b/Tests/FindLibArchive/Test/main.c
@@ -0,0 +1,7 @@
+#include <archive.h>
+
+int main(void)
+{
+ archive_read_free(archive_read_new());
+ return 0;
+}
diff --git a/Tests/FindLibXml2/Test/CMakeLists.txt b/Tests/FindLibXml2/Test/CMakeLists.txt
index df5d8c3..041cc13 100644
--- a/Tests/FindLibXml2/Test/CMakeLists.txt
+++ b/Tests/FindLibXml2/Test/CMakeLists.txt
@@ -14,3 +14,7 @@ add_executable(test_var main.c)
target_include_directories(test_var PRIVATE ${LIBXML2_INCLUDE_DIRS})
target_link_libraries(test_var PRIVATE ${LIBXML2_LIBRARIES})
add_test(NAME test_var COMMAND test_var)
+
+add_test(NAME xmllint_tgt COMMAND LibXml2::xmllint --version)
+
+add_test(NAME xmllint_var COMMAND ${LIBXML2_XMLLINT_EXECUTABLE} --version)
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
index 23832da..8a87a8c 100644
--- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
+++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
@@ -19,6 +19,14 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile" AND
# configure a FindFoo.cmake so it knows where the library can be found
configure_file(FindFoo.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindFoo.cmake @ONLY)
+ # Need the -isysroot flag on recentish macOS after command line tools
+ # no longer provide headers in /usr/include
+ if(APPLE AND CMAKE_OSX_SYSROOT)
+ set(__EXTRA_OSX_SYSROOT_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
+ else()
+ set(__EXTRA_OSX_SYSROOT_FLAGS "")
+ endif()
+
# now set up the test:
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
CONTENT "CMAKE = \"$<TARGET_FILE:cmake>\"\n"
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index 8e7ff72..5ef67d0 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -5,6 +5,7 @@ CMAKE_CURRENT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"
CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@"
CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@"
CMAKE_CXX_FLAGS = @CMAKE_CXX_FLAGS@
+__EXTRA_OSX_SYSROOT_FLAGS = @__EXTRA_OSX_SYSROOT_FLAGS@
CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID)
@@ -15,7 +16,7 @@ all: pngtest
main.o: clean main.cpp
@$(CMAKE_FOO) -DMODE=COMPILE >$(tmp)
@foo="`cat $(tmp)`"; \
- printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$$foo" >$(tmp)
+ printf '"%s" %s %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(__EXTRA_OSX_SYSROOT_FLAGS)" "$$foo" >$(tmp)
@cat $(tmp)
@sh $(tmp)
@rm -f $(tmp)
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 868cfe0..bfec986 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -134,6 +134,48 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ add_test(NAME FindPython.CustomFailureMessage COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage
+ --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
+ "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
+ "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+ "-DCMake_TEST_FindPython_NumPy=${CMake_TEST_FindPython_NumPy}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+ if (CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
+ add_test(NAME FindPython.Interpreter.SOABI COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
+ "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Interpreter"
+ ${build_generator_args}
+ --build-project TestSOABI
+ --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
+ "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
+ "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+ "-DCMake_TEST_FindPython_COMPONENT=Interpreter"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ add_test(NAME FindPython.Development.SOABI COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/SOABI"
+ "${CMake_BINARY_DIR}/Tests/FindPython/SOABI.Development"
+ ${build_generator_args}
+ --build-project TestSOABI
+ --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
+ "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
+ "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+ "-DCMake_TEST_FindPython_COMPONENT=Development"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ endif()
endif()
if(CMake_TEST_FindPython_NumPy)
@@ -158,3 +200,16 @@ if(CMake_TEST_FindPython_NumPy)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
endif()
+
+ if(CMake_TEST_FindPython_Conda)
+ add_test(NAME FindPython.VirtualEnvConda COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/VirtualEnvConda"
+ "${CMake_BINARY_DIR}/Tests/FindPython/VirtualEnvConda"
+ ${build_generator_args}
+ --build-project TestVirtualEnvConda
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ endif()
diff --git a/Tests/FindPython/CustomFailureMessage/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt
new file mode 100644
index 0000000..a0d8eb2
--- /dev/null
+++ b/Tests/FindPython/CustomFailureMessage/CMakeLists.txt
@@ -0,0 +1,79 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestCustomFailureMessage LANGUAGES NONE)
+
+include(CTest)
+
+add_test(NAME FindPython.CustomFailureMessage.Interpreter COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Interpreter"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Interpreter"
+ "-DPython3_EXECUTABLE=/not/found/interpreter"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+set_tests_properties(FindPython.CustomFailureMessage.Interpreter PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter")
+
+add_test(NAME FindPython.CustomFailureMessage.Library COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Library"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Development"
+ "-DPython3_LIBRARY=/not/found/library"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+set_tests_properties(FindPython.CustomFailureMessage.Library PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the library")
+
+add_test(NAME FindPython.CustomFailureMessage.Include COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Include"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Development"
+ "-DPython3_INCLUDE_DIR=/not/found/include"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+set_tests_properties(FindPython.CustomFailureMessage.Include PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+Development: Cannot find the directory")
+
+add_test(NAME FindPython.CustomFailureMessage.Multiple COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/Multiple"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Interpreter;Development"
+ "-DPython3_EXECUTABLE=/not/found/interpreter"
+ "-DPython3_LIBRARY=/not/found/library"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+set_tests_properties(FindPython.CustomFailureMessage.Multiple PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+Interpreter: Cannot run the interpreter.+Development: Cannot find the library")
+
+
+if (CMake_TEST_FindPython_NumPy)
+ add_test(NAME FindPython.CustomFailureMessage.NumPy COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/CustomFailureMessage/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/CustomFailureMessage/NumPy"
+ ${build_generator_args}
+ --build-project TestCustomFailureMessage.Check
+ --build-options "-DCHECK_COMPONENTS=Interpreter;Development;NumPy"
+ "-DPython3_NumPy_INCLUDE_DIR=/not/found/numpy/include"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ set_tests_properties(FindPython.CustomFailureMessage.NumPy PROPERTIES
+ PASS_REGULAR_EXPRESSION "Reason given by package:.+NumPy: Cannot find the directory")
+endif()
diff --git a/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt
new file mode 100644
index 0000000..fed963e
--- /dev/null
+++ b/Tests/FindPython/CustomFailureMessage/Check/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestCustomFailureMessage.Check LANGUAGES C)
+
+find_package (Python3 REQUIRED COMPONENTS ${CHECK_COMPONENTS})
diff --git a/Tests/FindPython/SOABI/CMakeLists.txt b/Tests/FindPython/SOABI/CMakeLists.txt
new file mode 100644
index 0000000..aea2baf
--- /dev/null
+++ b/Tests/FindPython/SOABI/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestSOABI C)
+
+find_package(Python3 COMPONENTS ${CMake_TEST_FindPython_COMPONENT})
+if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Fail to found Python 3")
+endif()
+
+if(NOT DEFINED Python3_SOABI)
+ message(FATAL_ERROR "Python3_SOABI for ${CMake_TEST_FindPython_COMPONENT} not found")
+endif()
diff --git a/Tests/FindPython/VirtualEnv/CMakeLists.txt b/Tests/FindPython/VirtualEnv/CMakeLists.txt
index 64ba201..9e8c673 100644
--- a/Tests/FindPython/VirtualEnv/CMakeLists.txt
+++ b/Tests/FindPython/VirtualEnv/CMakeLists.txt
@@ -21,22 +21,26 @@ endif()
add_test(NAME FindPython3.VirtualEnvDefault
COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
+ --unset=CONDA_PREFIX
"VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
"${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
-P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvDefault.cmake")
add_test(NAME FindPython3.VirtualEnvOnly
COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
+ --unset=CONDA_PREFIX
"VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
"${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
-P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake")
add_test(NAME FindPython3.UnsetVirtualEnvOnly
COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
--unset=VIRTUAL_ENV
+ --unset=CONDA_PREFIX
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake")
add_test(NAME FindPython3.VirtualEnvStandard
COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
+ --unset=CONDA_PREFIX
"VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
"${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
-P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvStandard.cmake")
diff --git a/Tests/FindPython/VirtualEnvConda/CMakeLists.txt b/Tests/FindPython/VirtualEnvConda/CMakeLists.txt
new file mode 100644
index 0000000..565095a
--- /dev/null
+++ b/Tests/FindPython/VirtualEnvConda/CMakeLists.txt
@@ -0,0 +1,46 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestVirtualEnvConda LANGUAGES NONE)
+
+include(CTest)
+
+find_program(CONDA_EXECUTABLE conda)
+if (CONDA_EXECUTABLE EQUAL NOTFOUND)
+ message (FATAL_ERROR "Fail to found Conda")
+endif()
+
+set (Python3_VIRTUAL_ENV "${CMAKE_CURRENT_BINARY_DIR}/condaenv")
+
+execute_process (COMMAND "${CONDA_EXECUTABLE}" create --no-default-packages --prefix "${Python3_VIRTUAL_ENV}" --yes python=3
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE outputs
+ ERROR_VARIABLE outputs)
+if (result)
+ message (FATAL_ERROR "Fail to create virtual environment: ${outputs}")
+endif()
+
+add_test(NAME FindPython3.VirtualEnvDefaultConda
+ COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
+ --unset=VIRTUAL_ENV
+ "CONDA_PREFIX=${Python3_VIRTUAL_ENV}"
+ "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvDefault.cmake")
+
+add_test(NAME FindPython3.VirtualEnvOnlyConda
+ COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
+ --unset=VIRTUAL_ENV
+ "CONDA_PREFIX=${Python3_VIRTUAL_ENV}"
+ "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake")
+add_test(NAME FindPython3.UnsetVirtualEnvOnlyConda
+ COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
+ --unset=CONDA_PREFIX
+ --unset=VIRTUAL_ENV
+ "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvOnly.cmake")
+
+add_test(NAME FindPython3.VirtualEnvStandardConda
+ COMMAND "${CMAKE_COMMAND}" -E env --unset=PYTHONHOME
+ --unset=VIRTUAL_ENV
+ "CONDA_PREFIX=${Python3_VIRTUAL_ENV}"
+ "${CMAKE_COMMAND}" "-DPYTHON3_VIRTUAL_ENV=${Python3_VIRTUAL_ENV}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/VirtualEnvStandard.cmake")
diff --git a/Tests/FindPython/VirtualEnvConda/VirtualEnvDefault.cmake b/Tests/FindPython/VirtualEnvConda/VirtualEnvDefault.cmake
new file mode 100644
index 0000000..020ecac
--- /dev/null
+++ b/Tests/FindPython/VirtualEnvConda/VirtualEnvDefault.cmake
@@ -0,0 +1,6 @@
+
+find_package (Python3 REQUIRED)
+
+if (NOT Python3_EXECUTABLE MATCHES "^${PYTHON3_VIRTUAL_ENV}/.+")
+ message (FATAL_ERROR "Fail to use virtual environment")
+endif()
diff --git a/Tests/FindPython/VirtualEnvConda/VirtualEnvOnly.cmake b/Tests/FindPython/VirtualEnvConda/VirtualEnvOnly.cmake
new file mode 100644
index 0000000..29a4924
--- /dev/null
+++ b/Tests/FindPython/VirtualEnvConda/VirtualEnvOnly.cmake
@@ -0,0 +1,16 @@
+
+#
+# Virtual environment is defined for python3
+# Trying to find a python2 using only virtual environment
+# It is expecting to fail if a virtual environment is active and to success otherwise.
+#
+set (Python2_FIND_VIRTUALENV ONLY)
+find_package (Python2 QUIET)
+
+if (PYTHON3_VIRTUAL_ENV AND Python2_FOUND)
+ message (FATAL_ERROR "Python2 unexpectedly found.")
+endif()
+
+if (NOT PYTHON3_VIRTUAL_ENV AND NOT Python2_FOUND)
+ message (FATAL_ERROR "Fail to find Python2.")
+endif()
diff --git a/Tests/FindPython/VirtualEnvConda/VirtualEnvStandard.cmake b/Tests/FindPython/VirtualEnvConda/VirtualEnvStandard.cmake
new file mode 100644
index 0000000..89f27d8
--- /dev/null
+++ b/Tests/FindPython/VirtualEnvConda/VirtualEnvStandard.cmake
@@ -0,0 +1,7 @@
+
+set (Python3_FIND_VIRTUALENV STANDARD)
+find_package (Python3 REQUIRED)
+
+if (Python3_EXECUTABLE MATCHES "^${PYTHON3_VIRTUAL_ENV}/.+")
+ message (FATAL_ERROR "Python3 virtual env unexpectedly found.")
+endif()
diff --git a/Tests/FortranModules/Executable/CMakeLists.txt b/Tests/FortranModules/Executable/CMakeLists.txt
index de08d86..f31a3e6 100644
--- a/Tests/FortranModules/Executable/CMakeLists.txt
+++ b/Tests/FortranModules/Executable/CMakeLists.txt
@@ -1,6 +1,6 @@
include_directories(${Library_MODDIR})
include_directories(${External_BINARY_DIR})
-link_directories(${External_BINARY_DIR})
+link_directories(${External_BINARY_DIR}/${CMAKE_CFG_INTDIR})
add_executable(subdir_exe2 main.f90)
target_link_libraries(subdir_exe2 subdir_mods subdir_mods2)
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index de887fa..d945375 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -103,11 +103,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
# Custom target to try preprocessing invocation.
add_custom_target(test_preprocess ${MAYBE_ALL}
- COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/preprocess.dir/preprocess.F.i
+ COMMAND ${CMAKE_COMMAND} -E rm -f CMakeFiles/preprocess.dir/preprocess.F.i
COMMAND ${CMAKE_MAKE_PROGRAM} preprocess.i
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake
# Remove bogus file some compilers leave behind.
- COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_SOURCE_DIR}/preprocess.s
+ COMMAND ${CMAKE_COMMAND} -E rm -f ${CMAKE_CURRENT_SOURCE_DIR}/preprocess.s
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index 761c405..fa3309f 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -94,6 +94,6 @@ if (NOT incs STREQUAL ";/one/two")
message(SEND_ERROR "Empty include_directories entry was not ignored.")
endif()
-if(NOT CMAKE_GENERATOR STREQUAL Xcode AND NOT CMAKE_GENERATOR STREQUAL Ninja)
+if(NOT CMAKE_GENERATOR STREQUAL "Xcode" AND NOT CMAKE_GENERATOR MATCHES "Ninja")
add_subdirectory(CMP0021)
endif()
diff --git a/Tests/InterfaceLibrary/CMakeLists.txt b/Tests/InterfaceLibrary/CMakeLists.txt
index 954c02d..311ca2a 100644
--- a/Tests/InterfaceLibrary/CMakeLists.txt
+++ b/Tests/InterfaceLibrary/CMakeLists.txt
@@ -3,6 +3,12 @@ cmake_minimum_required(VERSION 2.8)
project(InterfaceLibrary)
+set(cfg_dir)
+get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if(_isMultiConfig)
+ set(cfg_dir /$<CONFIG>)
+endif()
+
add_library(iface_nodepends INTERFACE)
target_compile_definitions(iface_nodepends INTERFACE IFACE_DEFINE)
@@ -32,7 +38,7 @@ add_library(item_iface INTERFACE IMPORTED)
set_property(TARGET item_iface PROPERTY IMPORTED_LIBNAME item_real)
add_dependencies(item_iface item_real)
get_property(item_iface_dependencies TARGET item_iface PROPERTY MANUALLY_ADDED_DEPENDENCIES)
-link_directories(${CMAKE_CURRENT_BINARY_DIR})
+link_directories(${CMAKE_CURRENT_BINARY_DIR}${cfg_dir})
add_executable(InterfaceLibrary definetestexe.cpp)
target_link_libraries(InterfaceLibrary
diff --git a/Tests/JavaExportImport/CMakeLists.txt b/Tests/JavaExportImport/CMakeLists.txt
index c70704a..7a2d020 100644
--- a/Tests/JavaExportImport/CMakeLists.txt
+++ b/Tests/JavaExportImport/CMakeLists.txt
@@ -9,7 +9,7 @@ find_package(Java COMPONENTS Development)
# Wipe out the install tree to make sure the exporter works.
add_custom_command(
OUTPUT ${JavaExportImport_BINARY_DIR}/CleanupProject
- COMMAND ${CMAKE_COMMAND} -E remove_directory ${JavaExportImport_BINARY_DIR}/Root
+ COMMAND ${CMAKE_COMMAND} -E rm -rf ${JavaExportImport_BINARY_DIR}/Root
)
add_custom_target(CleanupTarget ALL DEPENDS ${JavaExportImport_BINARY_DIR}/CleanupProject)
set_property(
diff --git a/Tests/LinkDirectory/CMakeLists.txt b/Tests/LinkDirectory/CMakeLists.txt
index c60de84..c7a2700 100644
--- a/Tests/LinkDirectory/CMakeLists.txt
+++ b/Tests/LinkDirectory/CMakeLists.txt
@@ -33,7 +33,7 @@ ExternalProject_Add(ExternalTarget
# directly because it does not know the full paths to the libraries.
# (The purpose of this test is to check that link_directories works.)
ExternalProject_Add_Step(ExternalTarget cleanup
- COMMAND ${CMAKE_COMMAND} -E remove_directory ${LinkDirectory_BINARY_DIR}/bin
+ COMMAND ${CMAKE_COMMAND} -E rm -rf ${LinkDirectory_BINARY_DIR}/bin
DEPENDEES download
DEPENDERS configure
DEPENDS mylibA mylibB
diff --git a/Tests/LinkDirectory/External/CMakeLists.txt b/Tests/LinkDirectory/External/CMakeLists.txt
index d2a1f9f..c877913 100644
--- a/Tests/LinkDirectory/External/CMakeLists.txt
+++ b/Tests/LinkDirectory/External/CMakeLists.txt
@@ -2,13 +2,19 @@ cmake_minimum_required(VERSION 2.8)
project(LinkDirectoryExternal C)
+set(cfg_dir)
+get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if(_isMultiConfig)
+ set(cfg_dir /$<CONFIG>)
+endif()
+
add_executable(myexe2 myexe.c)
set_property(TARGET myexe2 PROPERTY OUTPUT_NAME LinkDirectory2)
-target_link_directories(myexe2 PRIVATE lib "${CMAKE_CURRENT_SOURCE_DIR}/../lib")
+target_link_directories(myexe2 PRIVATE lib${cfg_dir} "${CMAKE_CURRENT_SOURCE_DIR}/../lib${cfg_dir}")
target_link_libraries(myexe2 PRIVATE mylibA mylibB)
add_library (mylibs INTERFACE)
-target_link_directories(mylibs INTERFACE lib "${CMAKE_CURRENT_SOURCE_DIR}/../lib")
+target_link_directories(mylibs INTERFACE lib${cfg_dir} "${CMAKE_CURRENT_SOURCE_DIR}/../lib${cfg_dir}")
target_link_libraries(mylibs INTERFACE mylibA mylibB)
add_executable(myexe3 myexe.c)
set_property(TARGET myexe3 PROPERTY OUTPUT_NAME LinkDirectory3)
@@ -17,11 +23,11 @@ target_link_libraries(myexe3 PRIVATE mylibs)
# Test CMP0015 OLD behavior: -L../lib
cmake_policy(SET CMP0015 OLD)
-link_directories(../lib)
+link_directories(../lib${cfg_dir})
# Test CMP0015 NEW behavior: -L${CMAKE_CURRENT_SOURCE_DIR}/lib
cmake_policy(SET CMP0015 NEW)
-link_directories(lib)
+link_directories(lib${cfg_dir})
add_executable(myexe myexe.c)
set_property(TARGET myexe PROPERTY OUTPUT_NAME LinkDirectory)
diff --git a/Tests/MacRuntimePath/CMakeLists.txt b/Tests/MacRuntimePath/CMakeLists.txt
index a3c6fd9..9f1bf1a 100644
--- a/Tests/MacRuntimePath/CMakeLists.txt
+++ b/Tests/MacRuntimePath/CMakeLists.txt
@@ -7,7 +7,7 @@ endif()
# Wipe out the install tree to make sure the exporter works.
add_custom_command(
OUTPUT ${MacRuntimePath_BINARY_DIR}/CleanupProject
- COMMAND ${CMAKE_COMMAND} -E remove_directory ${MacRuntimePath_BINARY_DIR}/Root
+ COMMAND ${CMAKE_COMMAND} -E rm -rf ${MacRuntimePath_BINARY_DIR}/Root
)
add_custom_target(CleanupTarget ALL DEPENDS ${MacRuntimePath_BINARY_DIR}/CleanupProject)
set_property(
diff --git a/Tests/OutDir/CMakeLists.txt b/Tests/OutDir/CMakeLists.txt
index 823ab08..8afe036 100644
--- a/Tests/OutDir/CMakeLists.txt
+++ b/Tests/OutDir/CMakeLists.txt
@@ -20,7 +20,7 @@ set(top "${OutDir_BINARY_DIR}")
foreach(config ${configs})
foreach(type archive runtime library)
string(TOUPPER "${type}" TYPE)
- set(CMAKE_${TYPE}_OUTPUT_DIRECTORY_${config} "${top}/${type}")
+ set(CMAKE_${TYPE}_OUTPUT_DIRECTORY_${config} "${top}/${type}/$<CONFIG>")
file(REMOVE_RECURSE "${top}/${type}")
endforeach()
endforeach()
@@ -29,7 +29,7 @@ add_subdirectory(../COnly COnly)
add_custom_command(
OUTPUT OutDir.h
- COMMAND ${CMAKE_COMMAND} -Dtop=${top} -P ${OutDir_SOURCE_DIR}/OutDir.cmake
+ COMMAND ${CMAKE_COMMAND} -Dtop=${top} -Dcfg_dir=$<CONFIG> -P ${OutDir_SOURCE_DIR}/OutDir.cmake
DEPENDS COnly ${OutDir_SOURCE_DIR}/OutDir.cmake
)
include_directories(${top})
diff --git a/Tests/OutDir/OutDir.cmake b/Tests/OutDir/OutDir.cmake
index a1f13e7..2a003b8 100644
--- a/Tests/OutDir/OutDir.cmake
+++ b/Tests/OutDir/OutDir.cmake
@@ -3,17 +3,17 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a" ".so" ".sl" ".dylib" ".dll.a")
find_library(TESTC1_LIB
NAMES testc1 testc1_test_debug_postfix
- PATHS ${top}/archive
+ PATHS ${top}/archive/${cfg_dir}
NO_DEFAULT_PATH)
find_library(TESTC2_LIB
NAMES testc2 testc2_test_debug_postfix
- PATHS ${top}/archive ${top}/library
+ PATHS ${top}/archive/${cfg_dir} ${top}/library/${cfg_dir}
NO_DEFAULT_PATH)
find_program(CONLY_EXE
NAMES COnly
- PATHS ${top}/runtime
+ PATHS ${top}/runtime/${cfg_dir}
NO_DEFAULT_PATH)
file(RELATIVE_PATH TESTC1_LIB_FILE "${top}" "${TESTC1_LIB}")
diff --git a/Tests/QtAutogen/MocCMP0100/CMakeLists.txt b/Tests/QtAutogen/MocCMP0100/CMakeLists.txt
new file mode 100644
index 0000000..559cffe
--- /dev/null
+++ b/Tests/QtAutogen/MocCMP0100/CMakeLists.txt
@@ -0,0 +1,9 @@
+cmake_minimum_required(VERSION 3.10)
+project(MocCMP0100)
+include("../AutogenCoreTest.cmake")
+
+set(CMAKE_AUTOMOC ON)
+set(CSD ${CMAKE_CURRENT_SOURCE_DIR})
+
+add_subdirectory(OLD)
+add_subdirectory(NEW)
diff --git a/Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt b/Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt
new file mode 100644
index 0000000..654b31e
--- /dev/null
+++ b/Tests/QtAutogen/MocCMP0100/NEW/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required(VERSION 3.16)
+cmake_policy(SET CMP0100 NEW)
+
+add_executable(mocCMP0100New
+ ${CSD}/main.cpp
+ ${CSD}/Obj.hh # Manually include Obj.hh
+ ${CSD}/Obj.cpp
+ ${CSD}/Obj2.cpp # Let AUTOMOC detect Obj2.hh
+)
+target_link_libraries(mocCMP0100New ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt b/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt
new file mode 100644
index 0000000..2be0535
--- /dev/null
+++ b/Tests/QtAutogen/MocCMP0100/OLD/CMakeLists.txt
@@ -0,0 +1,31 @@
+cmake_minimum_required(VERSION 3.16)
+cmake_policy(SET CMP0100 OLD)
+
+# Generate moc files externally.
+# If AUTOMOC generates the header moc files as well
+# (it should not in OLD behavior), the test will fail with a
+# multiple definition error when linking the executable.
+qtx_wrap_cpp(mocCMP0100OldMoc ${CSD}/Obj.hh ${CSD}/Obj2.hh)
+qtx_generate_moc(${CBD}/Obj.cpp ${CMAKE_CURRENT_BINARY_DIR}/Obj.moc)
+qtx_generate_moc(${CBD}/Obj2.cpp ${CMAKE_CURRENT_BINARY_DIR}/Obj2.moc)
+
+# Make sure AUTOGEN file skipping is disabled
+set_source_files_properties(
+ ${CSD}/Obj.hh
+ ${CBD}/Obj.cpp
+ ${CSD}/Obj2.hh
+ ${CBD}/Obj2.cpp
+ PROPERTIES
+ SKIP_AUTOGEN OFF
+ SKIP_AUTOMOC OFF
+)
+
+add_executable(mocCMP0100Old
+ ${CSD}/main.cpp
+ ${CSD}/Obj.hh # Manually include Obj.hh
+ ${CSD}/Obj.cpp
+ ${CSD}/Obj2.cpp # Let AUTOMOC detect Obj2.hh
+ ${mocCMP0100OldMoc}
+)
+target_link_libraries(mocCMP0100Old ${QT_LIBRARIES})
+target_include_directories(mocCMP0100Old PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
diff --git a/Tests/QtAutogen/MocCMP0100/Obj.cpp b/Tests/QtAutogen/MocCMP0100/Obj.cpp
new file mode 100644
index 0000000..bb6d0a0
--- /dev/null
+++ b/Tests/QtAutogen/MocCMP0100/Obj.cpp
@@ -0,0 +1,31 @@
+#include "Obj.hh"
+
+#include <QObject>
+
+class ObjPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ ObjPrivate();
+ ~ObjPrivate();
+};
+
+ObjPrivate::ObjPrivate()
+{
+}
+
+ObjPrivate::~ObjPrivate()
+{
+}
+
+Obj::Obj()
+ : d(new ObjPrivate)
+{
+}
+
+Obj::~Obj()
+{
+ delete d;
+}
+
+#include "Obj.moc"
diff --git a/Tests/QtAutogen/MocCMP0100/Obj.hh b/Tests/QtAutogen/MocCMP0100/Obj.hh
new file mode 100644
index 0000000..940bfc2
--- /dev/null
+++ b/Tests/QtAutogen/MocCMP0100/Obj.hh
@@ -0,0 +1,20 @@
+#ifndef OBJ_HH
+#define OBJ_HH
+
+#include <QObject>
+
+// Qt enabled private class
+class ObjPrivate;
+// Qt enabled class
+class Obj : public QObject
+{
+ Q_OBJECT
+public:
+ Obj();
+ ~Obj();
+
+private:
+ ObjPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocCMP0100/Obj2.cpp b/Tests/QtAutogen/MocCMP0100/Obj2.cpp
new file mode 100644
index 0000000..8a359ad
--- /dev/null
+++ b/Tests/QtAutogen/MocCMP0100/Obj2.cpp
@@ -0,0 +1,31 @@
+#include "Obj2.hh"
+
+#include <QObject>
+
+class Obj2Private : public QObject
+{
+ Q_OBJECT
+public:
+ Obj2Private();
+ ~Obj2Private();
+};
+
+Obj2Private::Obj2Private()
+{
+}
+
+Obj2Private::~Obj2Private()
+{
+}
+
+Obj2::Obj2()
+ : d(new Obj2Private)
+{
+}
+
+Obj2::~Obj2()
+{
+ delete d;
+}
+
+#include "Obj2.moc"
diff --git a/Tests/QtAutogen/MocCMP0100/Obj2.hh b/Tests/QtAutogen/MocCMP0100/Obj2.hh
new file mode 100644
index 0000000..1c74cdd
--- /dev/null
+++ b/Tests/QtAutogen/MocCMP0100/Obj2.hh
@@ -0,0 +1,20 @@
+#ifndef OBJ2_HH
+#define OBJ2_HH
+
+#include <QObject>
+
+// Qt enabled private class
+class Obj2Private;
+// Qt enabled class
+class Obj2 : public QObject
+{
+ Q_OBJECT
+public:
+ Obj2();
+ ~Obj2();
+
+private:
+ Obj2Private* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocCMP0100/main.cpp b/Tests/QtAutogen/MocCMP0100/main.cpp
new file mode 100644
index 0000000..17061da
--- /dev/null
+++ b/Tests/QtAutogen/MocCMP0100/main.cpp
@@ -0,0 +1,9 @@
+#include "Obj.hh"
+#include "Obj2.hh"
+
+int main(int argv, char** args)
+{
+ Obj obj;
+ Obj2 obj2;
+ return 0;
+}
diff --git a/Tests/QtAutogen/SameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt
index cd29a2a..4ce8dbd 100644
--- a/Tests/QtAutogen/SameName/CMakeLists.txt
+++ b/Tests/QtAutogen/SameName/CMakeLists.txt
@@ -1,7 +1,10 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.16.0)
project(SameName)
include("../AutogenGuiTest.cmake")
+# Process .hh headers in AUTOMOC
+cmake_policy(SET CMP0100 NEW)
+
# Test AUTOMOC and AUTORCC on source files with the same name
# but in different subdirectories
@@ -18,6 +21,7 @@ add_executable(sameName
ccc/data.qrc
item.cpp
object.h
+ object.hh
object.h++
object.hpp
object.hxx
diff --git a/Tests/QtAutogen/SameName/main.cpp b/Tests/QtAutogen/SameName/main.cpp
index 19a6f6d..725f4cd 100644
--- a/Tests/QtAutogen/SameName/main.cpp
+++ b/Tests/QtAutogen/SameName/main.cpp
@@ -6,6 +6,7 @@
#include "item.hpp"
#include "object.h"
#include "object.h++"
+#include "object.hh"
#include "object.hpp"
#include "object.hxx"
#include "object_upper_ext.H"
@@ -21,6 +22,7 @@ int main(int argv, char** args)
::ccc::Item ccc_item;
// Object instances
::Object_h obj_h;
+ ::Object_hh obj_hh;
::Object_hplpl obj_hplpl;
::Object_hpp obj_hpp;
::Object_hxx obj_hxx;
diff --git a/Tests/QtAutogen/SameName/object.hh b/Tests/QtAutogen/SameName/object.hh
new file mode 100644
index 0000000..3e16f83
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object.hh
@@ -0,0 +1,13 @@
+#ifndef OBJECT_HH
+#define OBJECT_HH
+
+#include <QObject>
+
+class Object_hh : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake
index 2b001d4..a19a9ae 100644
--- a/Tests/QtAutogen/Tests.cmake
+++ b/Tests/QtAutogen/Tests.cmake
@@ -32,6 +32,7 @@ ADD_AUTOGEN_TEST(UicSkipSource)
if(QT_TEST_ALLOW_QT_MACROS)
ADD_AUTOGEN_TEST(MocCMP0071)
+ ADD_AUTOGEN_TEST(MocCMP0100)
ADD_AUTOGEN_TEST(MocInclude)
ADD_AUTOGEN_TEST(MocIncludeSymlink)
ADD_AUTOGEN_TEST(MocSkipSource)
diff --git a/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt b/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt
new file mode 100644
index 0000000..a736129
--- /dev/null
+++ b/Tests/RunCMake/CMP0068/CMP0068-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0068-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0068 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/CMP0069/CMP0069-OLD-stderr.txt b/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt
new file mode 100644
index 0000000..f51a6f4
--- /dev/null
+++ b/Tests/RunCMake/CMP0069/CMP0069-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0069-OLD.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0069 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/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 6b2f117..d302fe3 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -125,7 +125,7 @@ endif()
if(CMAKE_GENERATOR MATCHES "Make")
add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU})
endif()
-if(CMAKE_GENERATOR STREQUAL "Ninja")
+if(CMAKE_GENERATOR MATCHES "Ninja")
set(Ninja_ARGS
-DCMAKE_C_OUTPUT_EXTENSION=${CMAKE_C_OUTPUT_EXTENSION}
-DCMAKE_SHARED_LIBRARY_PREFIX=${CMAKE_SHARED_LIBRARY_PREFIX}
@@ -134,6 +134,16 @@ if(CMAKE_GENERATOR STREQUAL "Ninja")
list(APPEND Ninja_ARGS -DTEST_Fortran=1)
endif()
add_RunCMake_test(Ninja)
+ set(NinjaMultiConfig_ARGS
+ -DCYGWIN=${CYGWIN}
+ )
+ if(CMake_TEST_Qt5 AND Qt5Core_FOUND)
+ list(APPEND NinjaMultiConfig_ARGS -DCMake_TEST_Qt5=1)
+ endif()
+ if(DEFINED CMake_TEST_CUDA)
+ list(APPEND NinjaMultiConfig_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
+ endif()
+ add_RunCMake_test(NinjaMultiConfig)
endif()
add_RunCMake_test(CTest)
@@ -189,6 +199,7 @@ add_RunCMake_test(GeneratorToolset)
add_RunCMake_test(GetPrerequisites)
add_RunCMake_test(GNUInstallDirs -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(GoogleTest) # Note: does not actually depend on Google Test
+add_RunCMake_test(Graphviz)
add_RunCMake_test(TargetPropertyGeneratorExpressions)
add_RunCMake_test(Languages)
add_RunCMake_test(LinkStatic)
@@ -209,6 +220,7 @@ add_RunCMake_test(ScriptMode)
add_RunCMake_test(Swift -DCMAKE_Swift_COMPILER=${CMAKE_Swift_COMPILER})
add_RunCMake_test(TargetObjects)
add_RunCMake_test(TargetSources)
+add_RunCMake_test(TargetProperties)
add_RunCMake_test(ToolchainFile)
add_RunCMake_test(find_dependency)
add_RunCMake_test(CompileDefinitions)
@@ -271,6 +283,7 @@ add_RunCMake_test(find_package)
add_RunCMake_test(find_path)
add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(foreach)
+add_RunCMake_test(function)
add_RunCMake_test(get_filename_component)
add_RunCMake_test(get_property)
add_RunCMake_test(if)
@@ -278,6 +291,7 @@ add_RunCMake_test(include)
add_RunCMake_test(include_directories)
add_RunCMake_test(include_guard)
add_RunCMake_test(list)
+add_RunCMake_test(load_cache)
add_RunCMake_test(math)
add_RunCMake_test(message)
add_RunCMake_test(option)
@@ -289,6 +303,9 @@ add_RunCMake_test(set_property)
add_RunCMake_test(string)
add_RunCMake_test(test_include_dirs)
add_RunCMake_test(BundleUtilities)
+if(APPLE)
+ add_RunCMake_test(INSTALL_NAME_DIR)
+endif()
function(add_RunCMake_test_try_compile)
if(CMAKE_VERSION VERSION_LESS 3.9.20170907 AND "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
@@ -335,6 +352,7 @@ add_RunCMake_test(alias_targets)
add_RunCMake_test(interface_library)
add_RunCMake_test(no_install_prefix)
add_RunCMake_test(configure_file)
+add_RunCMake_test(CTestTimeout -DTIMEOUT=${CTestTestTimeout_TIME})
add_RunCMake_test(CTestTimeoutAfterMatch)
# ctresalloc links against CMakeLib and CTestLib, which means it can't be built
@@ -436,12 +454,12 @@ add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_I
add_RunCMake_test(target_compile_definitions)
add_RunCMake_test(target_compile_features)
-add_RunCMake_test(target_compile_options)
+add_RunCMake_test(target_compile_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
add_RunCMake_test(target_include_directories)
add_RunCMake_test(target_sources)
add_RunCMake_test(CheckModules)
add_RunCMake_test(CheckIPOSupported)
-add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
+add_RunCMake_test(CommandLine -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DCYGWIN=${CYGWIN} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE})
add_RunCMake_test(CommandLineTar)
if(CMAKE_PLATFORM_NO_VERSIONED_SONAME OR (NOT CMAKE_SHARED_LIBRARY_SONAME_FLAG AND NOT CMAKE_SHARED_LIBRARY_SONAME_C_FLAG))
@@ -530,6 +548,9 @@ if("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
if(CMAKE_Fortran_COMPILER)
list(APPEND CompilerLauncher_ARGS -DCMake_TEST_Fortran=1)
endif()
+ if (APPLE AND CMAKE_C_COMPILER_ID MATCHES "Clang|GNU")
+ list(APPEND CompilerLauncher_ARGS -DCMake_TEST_OBJC=1)
+ endif()
add_RunCMake_test(CompilerLauncher)
add_RunCMake_test(ctest_labels_for_subprojects)
endif()
@@ -551,6 +572,7 @@ set(cpack_tests
DEB.MD5SUMS
DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY
DEB.DEB_DESCRIPTION
+ DEB.PROJECT_META
RPM.CUSTOM_BINARY_SPEC_FILE
RPM.CUSTOM_NAMES
@@ -571,6 +593,7 @@ set(cpack_tests
RPM.SUGGESTS
RPM.SYMLINKS
RPM.USER_FILELIST
+ RPM.PROJECT_META
7Z
TBZ2
@@ -581,6 +604,9 @@ set(cpack_tests
STGZ
External
)
+if(APPLE)
+ list(APPEND cpack_tests DragNDrop)
+endif()
add_RunCMake_test_group(CPack "${cpack_tests}")
# add a test to make sure symbols are exported from a shared library
# for MSVC compilers CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS property is used
diff --git a/Tests/RunCMake/CPack/CPackTestHelpers.cmake b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
index f65cb9d..24f54c6 100644
--- a/Tests/RunCMake/CPack/CPackTestHelpers.cmake
+++ b/Tests/RunCMake/CPack/CPackTestHelpers.cmake
@@ -75,7 +75,7 @@ function(run_cpack_test_common_ TEST_NAME types build SUBTEST_SUFFIX source PACK
if(package_target)
set(cpack_command_ ${CMAKE_COMMAND} --build "${RunCMake_TEST_BINARY_DIR}" --target package)
else()
- set(cpack_command_ ${CMAKE_CPACK_COMMAND} ${pack_params_})
+ set(cpack_command_ ${CMAKE_CPACK_COMMAND} ${pack_params_} -C Debug)
endif()
# execute cpack
diff --git a/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake b/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake
new file mode 100644
index 0000000..023e597
--- /dev/null
+++ b/Tests/RunCMake/CPack/DragNDrop/Helpers.cmake
@@ -0,0 +1,54 @@
+set(ALL_FILES_GLOB "*.dmg")
+
+function(getPackageContent FILE RESULT_VAR)
+ get_filename_component(path_ "${FILE}" DIRECTORY)
+ file(REMOVE_RECURSE "${path_}/content")
+ file(MAKE_DIRECTORY "${path_}/content")
+ execute_process(COMMAND ${HDIUTIL_EXECUTABLE} attach -mountroot ${path_}/content -nobrowse ${FILE}
+ RESULT_VARIABLE attach_result_
+ ERROR_VARIABLE attach_error_
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(attach_result_)
+ message(FATAL_ERROR "Failed to attach DMG: '${attach_result_}';"
+ " '${attach_error_}'.")
+ endif()
+
+ file(GLOB_RECURSE package_content_ LIST_DIRECTORIES true RELATIVE
+ "${path_}/content" "${path_}/content/*")
+ # Some versions of macOS have .Trashes, others do not.
+ list(FILTER package_content_ EXCLUDE REGEX "/.Trashes$")
+ set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE)
+
+ execute_process(COMMAND ${HDIUTIL_EXECUTABLE} detach ${path_}/content/volume-name
+ RESULT_VARIABLE detach_result_
+ ERROR_VARIABLE detach_error_
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ if(detach_result_)
+ message(FATAL_ERROR "Failed to detach DMG: '${detach_result_}';"
+ " '${detach_error_}'.")
+ endif()
+endfunction()
+
+function(getPackageNameGlobexpr NAME COMPONENT VERSION REVISION FILE_NO RESULT_VAR)
+ if(COMPONENT)
+ set(COMPONENT "-${COMPONENT}")
+ endif()
+
+ set(${RESULT_VAR} "${NAME}-${VERSION}-Darwin${COMPONENT}.dmg" PARENT_SCOPE)
+endfunction()
+
+function(getPackageContentList FILE RESULT_VAR)
+ getPackageContent("${FILE}" package_content_)
+
+ set(${RESULT_VAR} "${package_content_}" PARENT_SCOPE)
+endfunction()
+
+function(toExpectedContentList FILE_NO CONTENT_VAR)
+ set(prefix_ "volume-name")
+ list(TRANSFORM ${CONTENT_VAR} PREPEND "${prefix_}" OUTPUT_VARIABLE prepared_)
+ list(APPEND prepared_ "${prefix_}")
+
+ set(${CONTENT_VAR} "${prepared_}" PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/CPack/DragNDrop/Prerequirements.cmake b/Tests/RunCMake/CPack/DragNDrop/Prerequirements.cmake
new file mode 100644
index 0000000..f0aaf2c
--- /dev/null
+++ b/Tests/RunCMake/CPack/DragNDrop/Prerequirements.cmake
@@ -0,0 +1,8 @@
+function(get_test_prerequirements found_var config_file)
+ find_program(HDIUTIL_EXECUTABLE hdiutil)
+
+ if(HDIUTIL_EXECUTABLE)
+ file(WRITE "${config_file}" "set(HDIUTIL_EXECUTABLE \"${HDIUTIL_EXECUTABLE}\")")
+ set(${found_var} true PARENT_SCOPE)
+ endif()
+endfunction()
diff --git a/Tests/RunCMake/CPack/DragNDrop/packaging_COMPONENT_default.cmake b/Tests/RunCMake/CPack/DragNDrop/packaging_COMPONENT_default.cmake
new file mode 100644
index 0000000..aa6c8ff
--- /dev/null
+++ b/Tests/RunCMake/CPack/DragNDrop/packaging_COMPONENT_default.cmake
@@ -0,0 +1,3 @@
+set(CPACK_COMPONENTS_GROUPING "IGNORE")
+set(CPACK_DMG_DISABLE_APPLICATIONS_SYMLINK ON)
+set(CPACK_DMG_VOLUME_NAME "volume-name")
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index b154c79..0fb0cc4 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -5,7 +5,7 @@ include("${RunCMake_SOURCE_DIR}/CPackTestHelpers.cmake")
# 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" true "COMPONENT")
+run_cpack_test(CUSTOM_NAMES "RPM.CUSTOM_NAMES;DEB.CUSTOM_NAMES;TGZ;DragNDrop" true "COMPONENT")
run_cpack_test(DEBUGINFO "RPM.DEBUGINFO;DEB.DEBUGINFO" true "COMPONENT")
run_cpack_test_subtests(DEFAULT_PERMISSIONS "CMAKE_var_set;CPACK_var_set;both_set;invalid_CMAKE_var;invalid_CPACK_var" "RPM.DEFAULT_PERMISSIONS;DEB.DEFAULT_PERMISSIONS" false "MONOLITHIC;COMPONENT")
run_cpack_test(DEPENDENCIES "RPM.DEPENDENCIES;DEB.DEPENDENCIES" true "COMPONENT")
@@ -38,8 +38,9 @@ run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB.DEB_PACKAGE_VERSION_B
run_cpack_test_subtests(EXTERNAL "none;good;good_multi;bad_major;bad_minor;invalid_good;invalid_bad;stage_and_package" "External" false "MONOLITHIC;COMPONENT")
run_cpack_test_subtests(
DEB_DESCRIPTION
- "CPACK_DEBIAN_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION_FILE"
+ "CPACK_DEBIAN_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION;CPACK_PACKAGE_DESCRIPTION_FILE;CPACK_NO_PACKAGE_DESCRIPTION"
"DEB.DEB_DESCRIPTION"
false
"MONOLITHIC;COMPONENT"
)
+run_cpack_test(PROJECT_META "RPM.PROJECT_META;DEB.PROJECT_META" false "MONOLITHIC;COMPONENT")
diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake
index 07226df..9ac19e2 100644
--- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/ExpectedFiles.cmake
@@ -12,4 +12,7 @@ if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM")
elseif(GENERATOR_TYPE STREQUAL "TGZ")
set(EXPECTED_FILE_2 "second.tar.gz")
set(EXPECTED_FILE_3 "pkg_3_abc.tar.gz")
+elseif(GENERATOR_TYPE STREQUAL "DragNDrop")
+ set(EXPECTED_FILE_2 "second.dmg")
+ set(EXPECTED_FILE_3 "pkg_3_abc.dmg")
endif()
diff --git a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake
index 4c20e41..899258e 100644
--- a/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake
+++ b/Tests/RunCMake/CPack/tests/CUSTOM_NAMES/test.cmake
@@ -10,6 +10,9 @@ if(GENERATOR_TYPE STREQUAL "DEB" OR GENERATOR_TYPE STREQUAL "RPM")
elseif(GENERATOR_TYPE STREQUAL "TGZ")
set(CPACK_ARCHIVE_PKG_2_FILE_NAME "second")
set(CPACK_ARCHIVE_PKG_3_FILE_NAME "pkg_3_abc")
+elseif(GENERATOR_TYPE STREQUAL "DragNDrop")
+ set(CPACK_DMG_PKG_2_FILE_NAME "second")
+ set(CPACK_DMG_PKG_3_FILE_NAME "pkg_3_abc")
endif()
install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1)
diff --git a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
index e9ac13a..a8e2e7a 100644
--- a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
@@ -56,6 +56,8 @@ set(_expected_description [[ Description: This is the summary line
# workaround required!
if(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_PACKAGE_DESCRIPTION_FILE" AND PACKAGING_TYPE STREQUAL "MONOLITHIC")
string(APPEND _expected_description "\n ." )
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_NO_PACKAGE_DESCRIPTION")
+ set(_expected_description [[ Description: This is the summary line]])
endif()
foreach(_file_no RANGE 1 ${EXPECTED_FILES_COUNT})
diff --git a/Tests/RunCMake/CPack/tests/EXTERNAL/expected-json-1.0.txt b/Tests/RunCMake/CPack/tests/EXTERNAL/expected-json-1.0.txt
index 18bf617..ca25b1e 100644
--- a/Tests/RunCMake/CPack/tests/EXTERNAL/expected-json-1.0.txt
+++ b/Tests/RunCMake/CPack/tests/EXTERNAL/expected-json-1.0.txt
@@ -1,5 +1,6 @@
^\{
- "componentGroups" :[ ]
+ ("buildConfig" : "Debug",
+)? "componentGroups" :[ ]
\{
"f12" :[ ]
\{
diff --git a/Tests/RunCMake/CPack/tests/PROJECT_META/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/PROJECT_META/ExpectedFiles.cmake
new file mode 100644
index 0000000..448ed2b
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PROJECT_META/ExpectedFiles.cmake
@@ -0,0 +1,9 @@
+if(GENERATOR_TYPE STREQUAL DEB)
+ set(EXPECTED_FILE_1 "project_meta-1.2.3*.deb")
+elseif(GENERATOR_TYPE STREQUAL RPM)
+ set(EXPECTED_FILE_1 "project_meta-1.2.3*.rpm")
+else()
+ message(FATAL_ERROR "Unexpected CPack generator")
+endif()
+set(EXPECTED_FILES_COUNT "1")
+set(EXPECTED_FILE_CONTENT_1_LIST "/foo;/foo/CMakeLists.txt")
diff --git a/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake
new file mode 100644
index 0000000..b3accb5
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PROJECT_META/VerifyResult.cmake
@@ -0,0 +1,30 @@
+function(checkPackageURL FILE TAG EXPECTED_URL)
+ getPackageInfo("${FILE}" "_file_info")
+ string(REPLACE "\n" ";" _file_info "${_file_info}")
+
+ set(_seen_url FALSE)
+ foreach(_line IN LISTS _file_info)
+ if(_line MATCHES "${TAG}: (.*)")
+ set(_seen_url TRUE)
+ if(NOT CMAKE_MATCH_1 STREQUAL EXPECTED_URL)
+ message(FATAL_ERROR "Unexpected `Homepage` URL: `${CMAKE_MATCH_1}` != `${EXPECTED_URL}`")
+ endif()
+ break()
+ endif()
+ endforeach()
+ if(NOT _seen_url)
+ message(FATAL_ERROR "The packge `${FILE}` do not have URL as expected")
+ endif()
+endfunction()
+
+if(GENERATOR_TYPE STREQUAL DEB)
+ set(_tag " Homepage") # NOTE The leading space
+elseif(GENERATOR_TYPE STREQUAL RPM)
+ set(_tag "URL.*")
+else()
+ message(FATAL_ERROR "Unexpected CPack generator")
+endif()
+
+checkPackageURL("${FOUND_FILE_1}" "${_tag}" "https://meta.test.info")
+
+# kate: indent-width 2;
diff --git a/Tests/RunCMake/CPack/tests/PROJECT_META/test.cmake b/Tests/RunCMake/CPack/tests/PROJECT_META/test.cmake
new file mode 100644
index 0000000..9c5266a
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/PROJECT_META/test.cmake
@@ -0,0 +1,11 @@
+project(
+ MetaInfoTest
+ VERSION 1.2.3
+ DESCRIPTION "This is going to be a summary"
+ HOMEPAGE_URL "https://meta.test.info"
+)
+install(FILES CMakeLists.txt DESTINATION foo COMPONENT test)
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(CPACK_COMPONENTS_ALL test)
+endif()
diff --git a/Tests/RunCMake/CTest/CMakeCTestArguments-test-check.cmake b/Tests/RunCMake/CTest/CMakeCTestArguments-test-check.cmake
new file mode 100644
index 0000000..3e05953
--- /dev/null
+++ b/Tests/RunCMake/CTest/CMakeCTestArguments-test-check.cmake
@@ -0,0 +1,4 @@
+set(log "${RunCMake_TEST_BINARY_DIR}/output-log.txt")
+if(NOT EXISTS "${log}")
+ set(RunCMake_TEST_FAILED "The expected output log file is missing:\n ${log}")
+endif()
diff --git a/Tests/RunCMake/CTest/CMakeCTestArguments.cmake b/Tests/RunCMake/CTest/CMakeCTestArguments.cmake
new file mode 100644
index 0000000..37f2933
--- /dev/null
+++ b/Tests/RunCMake/CTest/CMakeCTestArguments.cmake
@@ -0,0 +1,2 @@
+include(CTest)
+add_test(NAME CMakeCTestArguments COMMAND ${CMAKE_COMMAND} -E echo CMakeCTestArguments)
diff --git a/Tests/RunCMake/CTest/RunCMakeTest.cmake b/Tests/RunCMake/CTest/RunCMakeTest.cmake
index 1392240..761224a 100644
--- a/Tests/RunCMake/CTest/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTest/RunCMakeTest.cmake
@@ -5,3 +5,16 @@ run_cmake(BeforeProject)
unset(RunCMake_TEST_OPTIONS)
run_cmake(NotOn)
+
+function(run_CMakeCTestArguments)
+ run_cmake_with_options(CMakeCTestArguments "-DCMAKE_CTEST_ARGUMENTS=--quiet\\;--output-log\\;output-log.txt")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMakeCTestArguments-build)
+ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ set(test "test")
+ else()
+ set(test "RUN_TESTS")
+ endif()
+ run_cmake_command(CMakeCTestArguments-test ${CMAKE_COMMAND} --build . --config Debug --target "${test}")
+endfunction()
+run_CMakeCTestArguments()
diff --git a/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in b/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in
new file mode 100644
index 0000000..5437800
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/CMakeLists.txt.in
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.1)
+project(CTestCommandLine@CASE_NAME@ NONE)
+include(CTest)
+add_test(NAME RunCMakeVersion COMMAND "${CMAKE_COMMAND}" --version)
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index 6b23162..b2de596 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -1,9 +1,33 @@
include(RunCMake)
+include(RunCTest)
+
set(RunCMake_TEST_TIMEOUT 60)
unset(ENV{CTEST_PARALLEL_LEVEL})
unset(ENV{CTEST_OUTPUT_ON_FAILURE})
+run_cmake_command(repeat-opt-bad1
+ ${CMAKE_CTEST_COMMAND} --repeat until-pass
+ )
+run_cmake_command(repeat-opt-bad2
+ ${CMAKE_CTEST_COMMAND} --repeat until-pass:foo
+ )
+run_cmake_command(repeat-opt-bad3
+ ${CMAKE_CTEST_COMMAND} --repeat until-fail:2 --repeat-until-fail 2
+ )
+run_cmake_command(repeat-opt-bad4
+ ${CMAKE_CTEST_COMMAND} --repeat-until-fail 2 --repeat until-fail:2
+ )
+run_cmake_command(repeat-opt-until-pass
+ ${CMAKE_CTEST_COMMAND} --repeat until-pass:2
+ )
+run_cmake_command(repeat-opt-until-fail
+ ${CMAKE_CTEST_COMMAND} --repeat until-fail:2
+ )
+run_cmake_command(repeat-opt-after-timeout
+ ${CMAKE_CTEST_COMMAND} --repeat after-timeout:2
+ )
+
run_cmake_command(repeat-until-fail-bad1
${CMAKE_CTEST_COMMAND} --repeat-until-fail
)
@@ -14,19 +38,39 @@ run_cmake_command(repeat-until-fail-good
${CMAKE_CTEST_COMMAND} --repeat-until-fail 2
)
-function(run_repeat_until_fail_tests)
+function(run_repeat_until_pass_tests)
# Use a single build tree for a few tests without cleaning.
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-pass-build)
+ run_cmake(repeat-until-pass-cmake)
set(RunCMake_TEST_NO_CLEAN 1)
- file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
- file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake_command(repeat-until-pass-ctest
+ ${CMAKE_CTEST_COMMAND} -C Debug --repeat until-pass:3
+ )
+endfunction()
+run_repeat_until_pass_tests()
+
+function(run_repeat_after_timeout_tests)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-after-timeout-build)
+ run_cmake(repeat-after-timeout-cmake)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(repeat-after-timeout-ctest
+ ${CMAKE_CTEST_COMMAND} -C Debug --repeat after-timeout:3
+ )
+endfunction()
+run_repeat_after_timeout_tests()
+function(run_repeat_until_fail_tests)
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/repeat-until-fail-build)
run_cmake(repeat-until-fail-cmake)
+ set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(repeat-until-fail-ctest
- ${CMAKE_CTEST_COMMAND} -C Debug --repeat-until-fail 3
+ ${CMAKE_CTEST_COMMAND} -C Debug ${ARGN}
)
endfunction()
-run_repeat_until_fail_tests()
+run_repeat_until_fail_tests(--repeat-until-fail 3)
+run_repeat_until_fail_tests(--repeat until-fail:3)
function(run_BadCTestTestfile)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/BadCTestTestfile)
@@ -269,3 +313,6 @@ function(run_ShowOnly)
run_cmake_command(show-only_json-v1 ${CMAKE_CTEST_COMMAND} --show-only=json-v1)
endfunction()
run_ShowOnly()
+
+# Check the configuration type variable is passed
+run_ctest(check-configuration-type)
diff --git a/Tests/RunCMake/CTestCommandLine/check-configuration-type-stderr.txt b/Tests/RunCMake/CTestCommandLine/check-configuration-type-stderr.txt
new file mode 100644
index 0000000..b2c1a45
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/check-configuration-type-stderr.txt
@@ -0,0 +1,2 @@
+Command line CTEST_CONFIGURATION_TYPE=Debug
+set CTEST_CONFIGURATION_TYPE=Release
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
new file mode 100644
index 0000000..873c0bd
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-cmake.cmake
@@ -0,0 +1,15 @@
+enable_testing()
+
+set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt")
+add_test(NAME initialization
+ COMMAND ${CMAKE_COMMAND}
+ "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake")
+add_test(NAME test1
+ COMMAND ${CMAKE_COMMAND}
+ "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-timeout.cmake")
+set_tests_properties(test1 PROPERTIES DEPENDS "initialization" TIMEOUT 5)
+
+add_test(hello ${CMAKE_COMMAND} -E echo hello)
+add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye)
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt
new file mode 100644
index 0000000..d0a5487
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-ctest-stdout.txt
@@ -0,0 +1,15 @@
+^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-after-timeout-build
+ Start 1: initialization
+1/4 Test #1: initialization ................... Passed +[0-9.]+ sec
+ Start 2: test1
+2/4 Test #2: test1 ............................\*\*\*Timeout +[0-9.]+ sec
+ Start 2: test1
+ Test #2: test1 ............................ Passed +[0-9.]+ sec
+ Start 3: hello
+3/4 Test #3: hello ............................ Passed +[0-9.]+ sec
+ Start 4: goodbye
+4/4 Test #4: goodbye .......................... Passed +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 4
+
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-after-timeout-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt
new file mode 100644
index 0000000..f6f3241
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad1-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--repeat' given invalid value 'until-pass'$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt
new file mode 100644
index 0000000..2f9f32a
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad2-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: '--repeat' given invalid value 'until-pass:foo'$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt
new file mode 100644
index 0000000..de4e11b
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad3-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: At most one '--repeat' option may be used\.$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt
new file mode 100644
index 0000000..de4e11b
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-bad4-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: At most one '--repeat' option may be used\.$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-fail-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt
new file mode 100644
index 0000000..a7c4b11
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-opt-until-pass-stderr.txt
@@ -0,0 +1 @@
+^No tests were found!!!$
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake
new file mode 100644
index 0000000..d109551
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-cmake.cmake
@@ -0,0 +1,15 @@
+enable_testing()
+
+set(TEST_OUTPUT_FILE "${CMAKE_CURRENT_BINARY_DIR}/test_output.txt")
+add_test(NAME initialization
+ COMMAND ${CMAKE_COMMAND}
+ "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/init.cmake")
+add_test(NAME test1
+ COMMAND ${CMAKE_COMMAND}
+ "-DTEST_OUTPUT_FILE=${TEST_OUTPUT_FILE}"
+ -P "${CMAKE_CURRENT_SOURCE_DIR}/test1-pass.cmake")
+set_tests_properties(test1 PROPERTIES DEPENDS "initialization")
+
+add_test(hello ${CMAKE_COMMAND} -E echo hello)
+add_test(goodbye ${CMAKE_COMMAND} -E echo goodbye)
diff --git a/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt
new file mode 100644
index 0000000..3745dc2
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/repeat-until-pass-ctest-stdout.txt
@@ -0,0 +1,15 @@
+^Test project .*/Tests/RunCMake/CTestCommandLine/repeat-until-pass-build
+ Start 1: initialization
+1/4 Test #1: initialization ................... Passed +[0-9.]+ sec
+ Start 2: test1
+2/4 Test #2: test1 ............................\*\*\*Failed +[0-9.]+ sec
+ Start 2: test1
+ Test #2: test1 ............................ Passed +[0-9.]+ sec
+ Start 3: hello
+3/4 Test #3: hello ............................ Passed +[0-9.]+ sec
+ Start 4: goodbye
+4/4 Test #4: goodbye .......................... Passed +[0-9.]+ sec
+
+100% tests passed, 0 tests failed out of 4
+
+Total Test time \(real\) = +[0-9.]+ sec$
diff --git a/Tests/RunCMake/CTestCommandLine/test.cmake.in b/Tests/RunCMake/CTestCommandLine/test.cmake.in
new file mode 100644
index 0000000..b82968a
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test.cmake.in
@@ -0,0 +1,19 @@
+cmake_minimum_required(VERSION 3.1)
+
+set(CTEST_SITE "test-site")
+set(CTEST_BUILD_NAME "test-build-name")
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
+set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+set(CTEST_COMMAND "@CMAKE_CTEST_COMMAND@")
+
+if("@CASE_NAME@" MATCHES "^check-configuration-type")
+ message("Command line CTEST_CONFIGURATION_TYPE=" ${CTEST_CONFIGURATION_TYPE})
+ set(CTEST_CONFIGURATION_TYPE "Release")
+ message("set CTEST_CONFIGURATION_TYPE=" ${CTEST_CONFIGURATION_TYPE})
+
+ ctest_start(Experimental)
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/test1-pass.cmake b/Tests/RunCMake/CTestCommandLine/test1-pass.cmake
new file mode 100644
index 0000000..dda8dea
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test1-pass.cmake
@@ -0,0 +1,13 @@
+# This is run by test test1 in repeat-until-pass-cmake.cmake with cmake -P.
+# It reads the file TEST_OUTPUT_FILE and increments the number
+# found in the file by 1. Unless the number is 2, then the
+# code sends out a cmake error causing the test to pass only on
+# the second time it is run.
+message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}")
+file(READ "${TEST_OUTPUT_FILE}" COUNT)
+message("COUNT= ${COUNT}")
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}")
+if(NOT COUNT EQUAL 2)
+ message(FATAL_ERROR "this test passes only on the 2nd run")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake b/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake
new file mode 100644
index 0000000..fbf2ccc
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/test1-timeout.cmake
@@ -0,0 +1,14 @@
+# This is run by test test1 in repeat-after-timeout-cmake.cmake with cmake -P.
+# It reads the file TEST_OUTPUT_FILE and increments the number
+# found in the file by 1. Unless the number is 2, then the
+# code sends out a cmake error causing the test to not timeout only on
+# the second time it is run.
+message("TEST_OUTPUT_FILE = ${TEST_OUTPUT_FILE}")
+file(READ "${TEST_OUTPUT_FILE}" COUNT)
+message("COUNT= ${COUNT}")
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${TEST_OUTPUT_FILE}" "${COUNT}")
+if(NOT COUNT EQUAL 2)
+ message("this test times out except on the 2nd run")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
index 7d63299..ef79dce 100644
--- a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
+++ b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
@@ -1,6 +1,6 @@
function(setup_resource_tests)
if(CTEST_RESOURCE_ALLOC_ENABLED)
- add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E remove -f "${CMAKE_BINARY_DIR}/ctresalloc.log")
+ add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E rm -f "${CMAKE_BINARY_DIR}/ctresalloc.log")
endif()
endfunction()
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx b/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
index 27644af..80db05e 100644
--- a/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
@@ -285,7 +285,8 @@ static int doVerify(int argc, char const* const* argv)
std::set<std::string> testNameSet(testNameList.begin(), testNameList.end());
cmCTestResourceSpec spec;
- if (!spec.ReadFromJSONFile(resFile)) {
+ if (spec.ReadFromJSONFile(resFile) !=
+ cmCTestResourceSpec::ReadFileResult::READ_OK) {
std::cout << "Could not read resource spec " << resFile << std::endl;
return 1;
}
diff --git a/Tests/RunCMake/CTestTimeout/Basic-stdout.txt b/Tests/RunCMake/CTestTimeout/Basic-stdout.txt
new file mode 100644
index 0000000..30ed178
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeout/Basic-stdout.txt
@@ -0,0 +1,6 @@
+Test project [^
+]*/Tests/RunCMake/CTestTimeout/Basic-build
+ Start 1: TestTimeout
+1/1 Test #1: TestTimeout ......................\*\*\*Timeout +[0-9.]+ sec
++
+0% tests passed, 1 tests failed out of 1
diff --git a/Tests/RunCMake/CTestTimeout/CMakeLists.txt.in b/Tests/RunCMake/CTestTimeout/CMakeLists.txt.in
new file mode 100644
index 0000000..20faa94
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeout/CMakeLists.txt.in
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.16)
+project(CTestTest@CASE_NAME@ C)
+include(CTest)
+
+add_executable(TestTimeout TestTimeout.c)
+
+if(NOT TIMEOUT)
+ set(TIMEOUT 4)
+endif()
+target_compile_definitions(TestTimeout PRIVATE TIMEOUT=${TIMEOUT})
+
+add_test(NAME TestTimeout COMMAND TestTimeout)
+set_property(TEST TestTimeout PROPERTY TIMEOUT ${TIMEOUT})
+
+@CASE_CMAKELISTS_SUFFIX_CODE@
diff --git a/Tests/RunCMake/CTestTimeout/Fork-stdout.txt b/Tests/RunCMake/CTestTimeout/Fork-stdout.txt
new file mode 100644
index 0000000..284e4b1
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeout/Fork-stdout.txt
@@ -0,0 +1,6 @@
+Test project [^
+]*/Tests/RunCMake/CTestTimeout/Fork-build
+ Start 1: TestTimeout
+1/1 Test #1: TestTimeout ......................\*\*\*Timeout +[0-9.]+ sec
++
+0% tests passed, 1 tests failed out of 1
diff --git a/Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake b/Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake
new file mode 100644
index 0000000..7e96b6d
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeout/RunCMakeTest.cmake
@@ -0,0 +1,22 @@
+include(RunCTest)
+
+if(NOT TIMEOUT)
+ # Give the process time to load and start running.
+ set(TIMEOUT 4)
+endif()
+
+function(run_ctest_timeout CASE_NAME)
+ configure_file(${RunCMake_SOURCE_DIR}/TestTimeout.c
+ ${RunCMake_BINARY_DIR}/${CASE_NAME}/TestTimeout.c COPYONLY)
+ run_ctest(${CASE_NAME})
+endfunction()
+
+run_ctest_timeout(Basic)
+
+if(UNIX)
+ string(CONCAT CASE_CMAKELISTS_SUFFIX_CODE [[
+ target_compile_definitions(TestTimeout PRIVATE FORK)
+]])
+ run_ctest_timeout(Fork)
+ unset(CASE_CMAKELISTS_SUFFIX_CODE)
+endif()
diff --git a/Tests/RunCMake/CTestTimeout/TestTimeout.c b/Tests/RunCMake/CTestTimeout/TestTimeout.c
new file mode 100644
index 0000000..5a008a7
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeout/TestTimeout.c
@@ -0,0 +1,24 @@
+#if defined(_WIN32)
+# include <windows.h>
+#else
+# include <unistd.h>
+#endif
+
+#include <stdio.h>
+
+int main(void)
+{
+#ifdef FORK
+ pid_t pid = fork();
+ if (pid != 0) {
+ return 0;
+ }
+#endif
+
+#if defined(_WIN32)
+ Sleep((TIMEOUT + 4) * 1000);
+#else
+ sleep((TIMEOUT + 4));
+#endif
+ return 0;
+}
diff --git a/Tests/RunCMake/CTestTimeout/test.cmake.in b/Tests/RunCMake/CTestTimeout/test.cmake.in
new file mode 100644
index 0000000..be2625b
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeout/test.cmake.in
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 3.16)
+@CASE_TEST_PREFIX_CODE@
+
+set(CTEST_SITE "test-site")
+set(CTEST_BUILD_NAME "test-build-name")
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
+set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+
+ctest_start(Experimental)
+ctest_configure(OPTIONS "-DTIMEOUT=@TIMEOUT@")
+ctest_build()
+ctest_test()
diff --git a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
index f183594..1baa63a 100644
--- a/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
+++ b/Tests/RunCMake/CheckIPOSupported/cmp0069-is-old-stderr.txt
@@ -1,4 +1,15 @@
-^CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
+^CMake Deprecation Warning at cmp0069-is-old.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0069 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\)
++
+CMake Error at .*/Modules/CheckIPOSupported\.cmake:[0-9]+ \(message\):
Policy CMP0069 set to OLD
Call Stack \(most recent call first\):
cmp0069-is-old\.cmake:[0-9]+ \(check_ipo_supported\)
diff --git a/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt b/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_bad_argument-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt
new file mode 100644
index 0000000..62b963a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_bad_argument-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Unknown -E rm argument: -rd$
diff --git a/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake
new file mode 100644
index 0000000..b1a29a2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/dir/existing.txt)
+ set(RunCMake_TEST_FAILED "${out}/dir/existing.txt should exist (we only removed the link to dir folder)")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_directory_link_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt
new file mode 100644
index 0000000..1ac7dba
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Missing file/directory to remove$
diff --git a/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake
new file mode 100644
index 0000000..6cd4edd
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_empty_file_specified.cmake
@@ -0,0 +1,8 @@
+execute_process(
+ COMMAND ${CMAKE_COMMAND} -E rm ""
+ RESULT_VARIABLE actual_result
+ )
+
+if(NOT "${actual_result}" EQUAL "1")
+ message(SEND_ERROR "cmake -E rm \"\" should have returned 1, got ${actual_result}")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake
new file mode 100644
index 0000000..e28b160
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out}/existing.txt)
+ set(RunCMake_TEST_FAILED "${out}/existing.txt not removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_force_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_force_non_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake
new file mode 100644
index 0000000..a0a9b20
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/existing.txt)
+ set(RunCMake_TEST_FAILED "${out}/existing.txt should exist (we only removed the link)")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_link_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_link_non_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake
new file mode 100644
index 0000000..e28b160
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out}/existing.txt)
+ set(RunCMake_TEST_FAILED "${out}/existing.txt not removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt
new file mode 100644
index 0000000..05df88a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_non_force_non_existing-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: File to remove does not exist and force is not set: .*/rm_tests/not_existing.txt
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake
new file mode 100644
index 0000000..e28b160
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out}/existing.txt)
+ set(RunCMake_TEST_FAILED "${out}/existing.txt not removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt
new file mode 100644
index 0000000..05df88a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_file_recursive_non_existing-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: File to remove does not exist and force is not set: .*/rm_tests/not_existing.txt
diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake
new file mode 100644
index 0000000..1a976cb
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out})
+ set(RunCMake_TEST_FAILED "${out} not removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_directory_with_files-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt b/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_force_recursive_non_existing_file-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt
new file mode 100644
index 0000000..1ac7dba
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_no_file_specified-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Missing file/directory to remove$
diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake
new file mode 100644
index 0000000..609271e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/d1 OR NOT EXISTS ${out}/d2)
+ set(RunCMake_TEST_FAILED "${out}/d1 or ${out}/d2 is removed but should not")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt
new file mode 100644
index 0000000..33ea2e3
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_non_recursive_directory-two-directories-stderr.txt
@@ -0,0 +1,2 @@
+^Error removing directory ".*/rm_tests/d1" without recursive option\.
+Error removing directory ".*/rm_tests/d2" without recursive option\.$
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake
new file mode 100644
index 0000000..5282da7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS ${out}/d1 OR EXISTS ${out}/d2)
+ set(RunCMake_TEST_FAILED "${out}/d1 or ${out}/d2 should be removed")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory-two-directories-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake
new file mode 100644
index 0000000..b1a29a2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/dir/existing.txt)
+ set(RunCMake_TEST_FAILED "${out}/dir/existing.txt should exist (we only removed the link to dir folder)")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_directory_link_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake
new file mode 100644
index 0000000..a0a9b20
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS ${out}/existing.txt)
+ set(RunCMake_TEST_FAILED "${out}/existing.txt should exist (we only removed the link)")
+endif()
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_rm_recursive_file_link_non_existing-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index b608d33..4bdc759 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -254,6 +254,24 @@ function(run_EnvironmentGenerator)
endfunction()
run_EnvironmentGenerator()
+function(run_EnvironmentExportCompileCommands)
+ set(RunCMake_TEST_SOURCE_DIR ${RunCMake_SOURCE_DIR}/env-export-compile-commands)
+
+ run_cmake(env-export-compile-commands-unset)
+
+ set(ENV{CMAKE_EXPORT_COMPILE_COMMANDS} ON)
+ run_cmake(env-export-compile-commands-set)
+
+ set(RunCMake_TEST_OPTIONS -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF)
+ run_cmake(env-export-compile-commands-override)
+
+ unset(ENV{CMAKE_EXPORT_COMPILE_COMMANDS})
+endfunction(run_EnvironmentExportCompileCommands)
+
+if(RunCMake_GENERATOR MATCHES "Unix Makefiles" OR RunCMake_GENERATOR MATCHES "Ninja")
+ run_EnvironmentExportCompileCommands()
+endif()
+
if(RunCMake_GENERATOR STREQUAL "Ninja")
# Use a single build tree for a few tests without cleaning.
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Build-build)
@@ -370,6 +388,76 @@ endif()
unset(out)
unset(outfile)
+set(out ${RunCMake_BINARY_DIR}/rm_tests)
+file(REMOVE_RECURSE "${out}")
+file(MAKE_DIRECTORY ${out})
+file(TOUCH ${out}/existing.txt)
+run_cmake_command(E_rm_file_force_existing
+ ${CMAKE_COMMAND} -E rm -f ${out}/existing.txt)
+file(TOUCH ${out}/existing.txt)
+run_cmake_command(E_rm_file_non_force_existing
+ ${CMAKE_COMMAND} -E rm ${out}/existing.txt)
+run_cmake_command(E_rm_file_force_non_existing
+ ${CMAKE_COMMAND} -E rm -f ${out}/not_existing.txt)
+run_cmake_command(E_rm_file_non_force_non_existing
+ ${CMAKE_COMMAND} -E rm ${out}/not_existing.txt)
+
+file(TOUCH ${out}/existing.txt)
+run_cmake_command(E_rm_file_recursive_existing
+ ${CMAKE_COMMAND} -E rm -r ${out}/existing.txt)
+run_cmake_command(E_rm_file_recursive_non_existing
+ ${CMAKE_COMMAND} -E rm -r ${out}/not_existing.txt)
+
+file(MAKE_DIRECTORY ${out}/d1 ${out}/d2)
+run_cmake_command(E_rm_non_recursive_directory-two-directories
+ ${CMAKE_COMMAND} -E rm ${out}/d1 ${out}/d2)
+
+run_cmake_command(E_rm_recursive_directory-two-directories
+ ${CMAKE_COMMAND} -E rm -R ${out}/d1 ${out}/d2)
+
+run_cmake_command(E_rm_no_file_specified
+ ${CMAKE_COMMAND} -E rm -rf)
+
+run_cmake_command(E_rm_empty_file_specified
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/E_rm_empty_file_specified.cmake)
+
+run_cmake_command(E_rm_bad_argument
+ ${CMAKE_COMMAND} -E rm -rd ${out}/d1 ${out}/d2)
+
+file(MAKE_DIRECTORY ${out}/d1 ${out}/d2)
+file(WRITE ${out}/test.txt "")
+run_cmake_command(E_rm_force_recursive_directory_with_files
+ ${CMAKE_COMMAND} -E rm -rf ${out}/)
+
+run_cmake_command(E_rm_force_recursive_non_existing_file
+ ${CMAKE_COMMAND} -E rm -Rf ${out}/test.txt)
+
+if(NOT WIN32 AND NOT CYGWIN)
+ file(MAKE_DIRECTORY ${out})
+ file(TOUCH ${out}/existing.txt)
+ file(MAKE_DIRECTORY ${out}/dir)
+ file(TOUCH ${out}/dir/existing.txt) # add a file in the folder
+ file(CREATE_LINK ${out}/dir ${out}/link_dir SYMBOLIC)
+ file(CREATE_LINK ${out}/existing.txt ${out}/existing_file_link.txt SYMBOLIC)
+ file(CREATE_LINK ${out}/non_existing.txt ${out}/non_existing_file_link.txt SYMBOLIC)
+ run_cmake_command(E_rm_file_link_existing
+ ${CMAKE_COMMAND} -E rm ${out}/existing_file_link.txt)
+ run_cmake_command(E_rm_directory_link_existing
+ ${CMAKE_COMMAND} -E rm ${out}/link_dir)
+ run_cmake_command(E_rm_file_link_non_existing
+ ${CMAKE_COMMAND} -E rm ${out}/non_existing_file_link.txt)
+
+ file(CREATE_LINK ${out}/dir ${out}/link_dir SYMBOLIC)
+ file(CREATE_LINK ${out}/existing.txt ${out}/existing_file_link.txt SYMBOLIC)
+ file(CREATE_LINK ${out}/non_existing.txt ${out}/non_existing_file_link.txt SYMBOLIC)
+ run_cmake_command(E_rm_recursive_file_link_existing
+ ${CMAKE_COMMAND} -E rm -R ${out}/existing_file_link.txt)
+ run_cmake_command(E_rm_recursive_directory_link_existing
+ ${CMAKE_COMMAND} -E rm -r ${out}/link_dir)
+ run_cmake_command(E_rm_recursive_file_link_non_existing
+ ${CMAKE_COMMAND} -E rm -r ${out}/non_existing_file_link.txt)
+endif()
+unset(out)
run_cmake_command(E_env-no-command0 ${CMAKE_COMMAND} -E env)
run_cmake_command(E_env-no-command1 ${CMAKE_COMMAND} -E env TEST_ENV=1)
@@ -519,6 +607,14 @@ set(RunCMake_TEST_OPTIONS --trace-redirect=/no/such/file.txt)
run_cmake(trace-redirect-nofile)
unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS --trace --trace-format=json-v1 --trace-redirect=${RunCMake_BINARY_DIR}/json-v1.trace)
+run_cmake(trace-json-v1)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS --trace-expand --trace-format=json-v1 --trace-redirect=${RunCMake_BINARY_DIR}/json-v1-expand.trace)
+run_cmake(trace-json-v1-expand)
+unset(RunCMake_TEST_OPTIONS)
+
set(RunCMake_TEST_OPTIONS -Wno-deprecated --warn-uninitialized)
run_cmake(warn-uninitialized)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake
new file mode 100644
index 0000000..032a1ae
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-override-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+ set(RunCMake_TEST_FAILED "compile_commands.json generated with CMAKE_EXPORT_COMPILE_COMMANDS overridden")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake
new file mode 100644
index 0000000..a749a55
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-set-check.cmake
@@ -0,0 +1,3 @@
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+ set(RunCMake_TEST_FAILED "compile_commands.json not generated with CMAKE_EXPORT_COMPILE_COMMANDS set")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake b/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake
new file mode 100644
index 0000000..c5878f0
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands-unset-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/compile_commands.json")
+ set(RunCMake_TEST_FAILED "compile_commands.json generated with CMAKE_EXPORT_COMPILE_COMMANDS unset")
+endif()
diff --git a/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt b/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt
new file mode 100644
index 0000000..aa6fbfd
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/env-export-compile-commands/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 3.14)
+project(env-export-compile-commands C)
+
+# Add target with a source file to make sure compile_commands.json gets
+# generated.
+file(TOUCH ${CMAKE_CURRENT_BINARY_DIR}/main.c)
+add_executable(env-export-compile-commands ${CMAKE_CURRENT_BINARY_DIR}/main.c)
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-check.cmake b/Tests/RunCMake/CommandLine/trace-json-v1-check.cmake
new file mode 100644
index 0000000..66af039
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-json-v1-check.cmake
@@ -0,0 +1,11 @@
+if(PYTHON_EXECUTABLE)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/trace-json-v1-check.py" "${RunCMake_BINARY_DIR}/json-v1.trace"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE output
+ ERROR_VARIABLE output
+ )
+ if(NOT result EQUAL 0)
+ set(RunCMake_TEST_FAILED "JSON trace validation failed:\n${output}")
+ endif()
+endif()
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-check.py b/Tests/RunCMake/CommandLine/trace-json-v1-check.py
new file mode 100755
index 0000000..14febaf
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-json-v1-check.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python3
+
+import json
+import os
+import sys
+
+if sys.version_info[0] >= 3:
+ unicode = str
+
+trace_file = None
+expand = False
+
+for i in sys.argv[1:]:
+ if trace_file is None and not i.startswith('-'):
+ trace_file = i
+ continue
+
+ if i in ['-e', '--expand']:
+ expand = True
+
+assert trace_file is not None
+assert os.path.exists(trace_file)
+
+if expand:
+ msg_args = ['STATUS', 'fff', 'fff;sss; SPACES !!! ', ' 42 space in string!', ' SPACES !!! ']
+else:
+ msg_args = ['STATUS', 'fff', '${ASDF}', ' ${FOO} ${BAR}', ' SPACES !!! ']
+
+required_traces = [
+ {
+ 'args': ['STATUS', 'JSON-V1 str', 'spaces'],
+ 'cmd': 'message',
+ },
+ {
+ 'args': ['ASDF', 'fff', 'sss', ' SPACES !!! '],
+ 'cmd': 'set',
+ },
+ {
+ 'args': ['FOO', '42'],
+ 'cmd': 'set',
+ },
+ {
+ 'args': ['BAR', ' space in string!'],
+ 'cmd': 'set',
+ },
+ {
+ 'args': msg_args,
+ 'cmd': 'message',
+ },
+]
+
+with open(trace_file, 'r') as fp:
+ # Check for version (must be the first document)
+ vers = json.loads(fp.readline())
+ assert sorted(vers.keys()) == ['version']
+ assert sorted(vers['version'].keys()) == ['major', 'minor']
+ assert vers['version']['major'] == 1
+ assert vers['version']['minor'] == 0
+
+ for i in fp.readlines():
+ line = json.loads(i)
+ assert sorted(line.keys()) == ['args', 'cmd', 'file', 'line']
+ assert isinstance(line['args'], list)
+ assert isinstance(line['cmd'], unicode)
+ assert isinstance(line['file'], unicode)
+ assert isinstance(line['line'], int)
+
+ for j in required_traces:
+ if j['cmd'] == line['cmd'] and j['args'] == line['args']:
+ j['found'] = True
+
+assert all([x.get('found', False) == True for x in required_traces])
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-expand-check.cmake b/Tests/RunCMake/CommandLine/trace-json-v1-expand-check.cmake
new file mode 100644
index 0000000..7916d2e
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-json-v1-expand-check.cmake
@@ -0,0 +1,11 @@
+if(PYTHON_EXECUTABLE)
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} "${RunCMake_SOURCE_DIR}/trace-json-v1-check.py" --expand "${RunCMake_BINARY_DIR}/json-v1-expand.trace"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE output
+ ERROR_VARIABLE output
+ )
+ if(NOT result EQUAL 0)
+ set(RunCMake_TEST_FAILED "JSON trace validation failed:\n${output}")
+ endif()
+endif()
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-expand.cmake b/Tests/RunCMake/CommandLine/trace-json-v1-expand.cmake
new file mode 100644
index 0000000..5c190e6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-json-v1-expand.cmake
@@ -0,0 +1 @@
+include(trace-json-v1.cmake)
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1.cmake b/Tests/RunCMake/CommandLine/trace-json-v1.cmake
new file mode 100644
index 0000000..ed0a0f9
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-json-v1.cmake
@@ -0,0 +1,5 @@
+message(STATUS "JSON-V1 str" "spaces")
+set(ASDF fff sss " SPACES !!! ")
+set(FOO 42)
+set(BAR " space in string!")
+message(STATUS fff ${ASDF} " ${FOO} ${BAR}" " SPACES !!! ")
diff --git a/Tests/RunCMake/CompilerLauncher/C-common.cmake b/Tests/RunCMake/CompilerLauncher/C-common.cmake
new file mode 100644
index 0000000..96b004b
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-common.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.c)
diff --git a/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/C-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/C-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/C-env.cmake b/Tests/RunCMake/CompilerLauncher/C-env.cmake
new file mode 100644
index 0000000..09b5167
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-env.cmake
@@ -0,0 +1 @@
+include(C-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/C-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/C-launch-env.cmake
new file mode 100644
index 0000000..68abcb5
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/C-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(C-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/C.cmake b/Tests/RunCMake/CompilerLauncher/C.cmake
index 67bf7c4..481e74d 100644
--- a/Tests/RunCMake/CompilerLauncher/C.cmake
+++ b/Tests/RunCMake/CompilerLauncher/C.cmake
@@ -1,4 +1,2 @@
-enable_language(C)
set(CMAKE_C_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
-set(CMAKE_VERBOSE_MAKEFILE TRUE)
-add_executable(main main.c)
+include(C-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake
new file mode 100644
index 0000000..6f7fc86
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake
@@ -0,0 +1,3 @@
+enable_language(CUDA)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.cu)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CUDA-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-env.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-env.cmake
new file mode 100644
index 0000000..cefbe9e
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-env.cmake
@@ -0,0 +1 @@
+include(CUDA-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-launch-env.cmake
new file mode 100644
index 0000000..d0d777a
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CUDA-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(CUDA-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CUDA.cmake b/Tests/RunCMake/CompilerLauncher/CUDA.cmake
index fe5560b..7f1652b 100644
--- a/Tests/RunCMake/CompilerLauncher/CUDA.cmake
+++ b/Tests/RunCMake/CompilerLauncher/CUDA.cmake
@@ -1,4 +1,2 @@
-enable_language(CUDA)
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
-set(CMAKE_VERBOSE_MAKEFILE TRUE)
-add_executable(main main.cu)
+include(CUDA-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-common.cmake b/Tests/RunCMake/CompilerLauncher/CXX-common.cmake
new file mode 100644
index 0000000..3d2ee00
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-common.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.cxx)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/CXX-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-env.cmake b/Tests/RunCMake/CompilerLauncher/CXX-env.cmake
new file mode 100644
index 0000000..db36956
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-env.cmake
@@ -0,0 +1 @@
+include(CXX-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/CXX-launch-env.cmake
new file mode 100644
index 0000000..a65cc89
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/CXX-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(CXX-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/CXX.cmake b/Tests/RunCMake/CompilerLauncher/CXX.cmake
index cdd3478..1f9a12b 100644
--- a/Tests/RunCMake/CompilerLauncher/CXX.cmake
+++ b/Tests/RunCMake/CompilerLauncher/CXX.cmake
@@ -1,4 +1,2 @@
-enable_language(CXX)
set(CMAKE_CXX_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
-set(CMAKE_VERBOSE_MAKEFILE TRUE)
-add_executable(main main.cxx)
+include(CXX-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-common.cmake b/Tests/RunCMake/CompilerLauncher/Fortran-common.cmake
new file mode 100644
index 0000000..e33c2ca
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-common.cmake
@@ -0,0 +1,3 @@
+enable_language(Fortran)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.F)
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/Fortran-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-env.cmake b/Tests/RunCMake/CompilerLauncher/Fortran-env.cmake
new file mode 100644
index 0000000..3dc27c3
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-env.cmake
@@ -0,0 +1 @@
+include(Fortran-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/Fortran-launch-env.cmake
new file mode 100644
index 0000000..30a196c
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/Fortran-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(Fortran-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/Fortran.cmake b/Tests/RunCMake/CompilerLauncher/Fortran.cmake
index 72cc03e..dc46173 100644
--- a/Tests/RunCMake/CompilerLauncher/Fortran.cmake
+++ b/Tests/RunCMake/CompilerLauncher/Fortran.cmake
@@ -1,4 +1,2 @@
-enable_language(Fortran)
set(CMAKE_Fortran_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
-set(CMAKE_VERBOSE_MAKEFILE TRUE)
-add_executable(main main.F)
+include(Fortran-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-common.cmake b/Tests/RunCMake/CompilerLauncher/OBJC-common.cmake
new file mode 100644
index 0000000..7b565f4
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-common.cmake
@@ -0,0 +1,3 @@
+enable_language(OBJC)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.m)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-env.cmake b/Tests/RunCMake/CompilerLauncher/OBJC-env.cmake
new file mode 100644
index 0000000..949e88d
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-env.cmake
@@ -0,0 +1 @@
+include(OBJC-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJC-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake
new file mode 100644
index 0000000..1cf13d3
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJC-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake b/Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake
new file mode 100644
index 0000000..43e8521
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJC.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJC.cmake b/Tests/RunCMake/CompilerLauncher/OBJC.cmake
new file mode 100644
index 0000000..3374e82
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJC.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_OBJC_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
+include(OBJC-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake
new file mode 100644
index 0000000..e2ee4eb
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-common.cmake
@@ -0,0 +1,3 @@
+enable_language(OBJCXX)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+add_executable(main main.mm)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-env-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake
new file mode 100644
index 0000000..3ed966d
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-env.cmake
@@ -0,0 +1 @@
+include(OBJCXX-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-Build-stdout.txt b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-Build-stdout.txt
new file mode 100644
index 0000000..3313e31
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-Build-stdout.txt
@@ -0,0 +1 @@
+.*-E env USED_LAUNCHER=1.*
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake
new file mode 100644
index 0000000..04c916a
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch-env.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJCXX-env.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake
new file mode 100644
index 0000000..5a54bff
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX-launch.cmake
@@ -0,0 +1,3 @@
+set(CTEST_USE_LAUNCHERS 1)
+include(CTestUseLaunchers)
+include(OBJCXX.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/OBJCXX.cmake b/Tests/RunCMake/CompilerLauncher/OBJCXX.cmake
new file mode 100644
index 0000000..993ec90
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/OBJCXX.cmake
@@ -0,0 +1,2 @@
+set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
+include(OBJCXX-common.cmake)
diff --git a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
index bb8da03..69fff20 100644
--- a/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CompilerLauncher/RunCMakeTest.cmake
@@ -9,12 +9,19 @@ function(run_compiler_launcher lang)
run_cmake(${lang})
set(RunCMake_TEST_OUTPUT_MERGE 1)
- if("${RunCMake_GENERATOR}" STREQUAL "Ninja")
+ if("${RunCMake_GENERATOR}" MATCHES "Ninja")
set(verbose_args -- -v)
endif()
run_cmake_command(${lang}-Build ${CMAKE_COMMAND} --build . ${verbose_args})
endfunction()
+function(run_compiler_launcher_env lang)
+ string(REGEX REPLACE "-.*" "" core_lang "${lang}")
+ set(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER} "${CMAKE_COMMAND};-E;env;USED_LAUNCHER=1")
+ run_compiler_launcher(${lang})
+ unset(ENV{CMAKE_${core_lang}_COMPILER_LAUNCHER})
+endfunction()
+
set(langs C CXX)
if(CMake_TEST_CUDA)
list(APPEND langs CUDA)
@@ -22,10 +29,15 @@ endif()
if(CMake_TEST_Fortran)
list(APPEND langs Fortran)
endif()
+if(CMake_TEST_OBJC)
+ list(APPEND langs OBJC OBJCXX)
+endif()
foreach(lang ${langs})
run_compiler_launcher(${lang})
+ run_compiler_launcher_env(${lang}-env)
if (NOT RunCMake_GENERATOR STREQUAL "Watcom WMake")
run_compiler_launcher(${lang}-launch)
+ run_compiler_launcher_env(${lang}-launch-env)
endif()
endforeach()
diff --git a/Tests/RunCMake/CompilerLauncher/main.m b/Tests/RunCMake/CompilerLauncher/main.m
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/main.m
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CompilerLauncher/main.mm b/Tests/RunCMake/CompilerLauncher/main.mm
new file mode 100644
index 0000000..f8b643a
--- /dev/null
+++ b/Tests/RunCMake/CompilerLauncher/main.mm
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/FPHSA/FindNameMismatch.cmake b/Tests/RunCMake/FPHSA/FindNameMismatch.cmake
new file mode 100644
index 0000000..540aa67
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindNameMismatch.cmake
@@ -0,0 +1,4 @@
+set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}")
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(NAMEMISMATCH REQUIRED_VARS "${CMAKE_FIND_PACKAGE_NAME}_MODULE")
+set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1)
diff --git a/Tests/RunCMake/FPHSA/FindNameMismatchOld.cmake b/Tests/RunCMake/FPHSA/FindNameMismatchOld.cmake
new file mode 100644
index 0000000..d155ea7
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindNameMismatchOld.cmake
@@ -0,0 +1,4 @@
+set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}")
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(NAMEMISMATCH "old signature" "${CMAKE_FIND_PACKAGE_NAME}_MODULE")
+set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1)
diff --git a/Tests/RunCMake/FPHSA/FindNameMismatchSuppressed.cmake b/Tests/RunCMake/FPHSA/FindNameMismatchSuppressed.cmake
new file mode 100644
index 0000000..042a59a
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindNameMismatchSuppressed.cmake
@@ -0,0 +1,6 @@
+set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}")
+include(FindPackageHandleStandardArgs)
+set(FPHSA_NAME_MISMATCHED 1)
+find_package_handle_standard_args(NAMEMISMATCH "old signature" "${CMAKE_FIND_PACKAGE_NAME}_MODULE")
+unset(FPHSA_NAME_MISMATCHED)
+set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1)
diff --git a/Tests/RunCMake/FPHSA/FindNameMismatchSuppressedArg.cmake b/Tests/RunCMake/FPHSA/FindNameMismatchSuppressedArg.cmake
new file mode 100644
index 0000000..6a0e964
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindNameMismatchSuppressedArg.cmake
@@ -0,0 +1,4 @@
+set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}")
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(NAMEMISMATCH NAME_MISMATCHED REQUIRED_VARS "${CMAKE_FIND_PACKAGE_NAME}_MODULE")
+set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1)
diff --git a/Tests/RunCMake/FPHSA/FindNameMismatchSuppressedCompat.cmake b/Tests/RunCMake/FPHSA/FindNameMismatchSuppressedCompat.cmake
new file mode 100644
index 0000000..791cfee
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindNameMismatchSuppressedCompat.cmake
@@ -0,0 +1,6 @@
+set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}")
+include(FindPackageHandleStandardArgs)
+set(FPHSA_NAME_MISMATCHED 1)
+find_package_handle_standard_args(NAMEMISMATCH REQUIRED_VARS "${CMAKE_FIND_PACKAGE_NAME}_MODULE")
+unset(FPHSA_NAME_MISMATCHED)
+set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1)
diff --git a/Tests/RunCMake/FPHSA/NameMismatch-stderr.txt b/Tests/RunCMake/FPHSA/NameMismatch-stderr.txt
new file mode 100644
index 0000000..722b50b
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/NameMismatch-stderr.txt
@@ -0,0 +1,23 @@
+CMake Warning \(dev\) at .*/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ The package name passed to `find_package_handle_standard_args`
+ \(NAMEMISMATCH\) does not match the name of the calling package
+ \(NameMismatch\). This can lead to problems in calling code that expects
+ `find_package` result variables \(e.g., `_FOUND`\) to follow a certain
+ pattern.
+Call Stack \(most recent call first\):
+ FindNameMismatch.cmake:3 \(find_package_handle_standard_args\)
+ NameMismatch.cmake:3 \(find_package\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
+
+CMake Warning \(dev\) at .*/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ The package name passed to `find_package_handle_standard_args`
+ \(NAMEMISMATCH\) does not match the name of the calling package
+ \(NameMismatchOld\). This can lead to problems in calling code that expects
+ `find_package` result variables \(e.g., `_FOUND`\) to follow a certain
+ pattern.
+Call Stack \(most recent call first\):
+ FindNameMismatchOld.cmake:3 \(find_package_handle_standard_args\)
+ NameMismatch.cmake:4 \(find_package\)
+ CMakeLists.txt:3 \(include\)
+This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/FPHSA/NameMismatch.cmake b/Tests/RunCMake/FPHSA/NameMismatch.cmake
new file mode 100644
index 0000000..9ca3cc6
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/NameMismatch.cmake
@@ -0,0 +1,7 @@
+set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
+
+find_package(NameMismatch REQUIRED)
+find_package(NameMismatchOld REQUIRED)
+find_package(NameMismatchSuppressed REQUIRED)
+find_package(NameMismatchSuppressedCompat REQUIRED)
+find_package(NameMismatchSuppressedArg REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
index f3e6c3e..286915d 100644
--- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
@@ -1,6 +1,7 @@
include(RunCMake)
run_cmake(BadFoundVar)
+run_cmake(NameMismatch)
# The pseudo module will "find" a package with the given version. Check if the
# version selection code in FPHSA works correctly.
diff --git a/Tests/RunCMake/FileAPI/check_index.py b/Tests/RunCMake/FileAPI/check_index.py
index cda7234..20243c0 100644
--- a/Tests/RunCMake/FileAPI/check_index.py
+++ b/Tests/RunCMake/FileAPI/check_index.py
@@ -109,10 +109,11 @@ def check_cmake_generator(g):
name = g.get("name", None)
assert is_string(name)
if name.startswith("Visual Studio"):
- assert sorted(g.keys()) == ["name", "platform"]
+ assert sorted(g.keys()) == ["multiConfig", "name", "platform"]
assert is_string(g["platform"])
else:
- assert sorted(g.keys()) == ["name"]
+ assert sorted(g.keys()) == ["multiConfig", "name"]
+ assert is_bool(g["multiConfig"], matches(name, "^(Visual Studio |Xcode$|Ninja Multi-Config$)"))
def check_index_object(indexEntry, kind, major, minor, check):
assert is_dict(indexEntry)
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 66c559d..de6253f 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -621,12 +621,12 @@ def gen_check_directories(c, g):
},
]
- if matches(g, "^Visual Studio "):
+ if matches(g["name"], "^Visual Studio "):
for e in expected:
if e["parentSource"] is not None:
e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"])
- elif g == "Xcode":
+ elif g["name"] == "Xcode":
if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
for e in expected:
e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"])
@@ -5087,13 +5087,13 @@ def gen_check_targets(c, g, inSource):
for s in e["sources"]:
s["path"] = s["path"].replace("^.*/Tests/RunCMake/FileAPI/", "^", 1)
if e["sourceGroups"] is not None:
- for g in e["sourceGroups"]:
- g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]]
+ for group in e["sourceGroups"]:
+ group["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in group["sourcePaths"]]
if e["compileGroups"] is not None:
- for g in e["compileGroups"]:
- g["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in g["sourcePaths"]]
+ for group in e["compileGroups"]:
+ group["sourcePaths"] = [p.replace("^.*/Tests/RunCMake/FileAPI/", "^", 1) for p in group["sourcePaths"]]
- if matches(g, "^Visual Studio "):
+ if matches(g["name"], "^Visual Studio "):
expected = filter_list(lambda e: e["name"] not in ("ZERO_CHECK") or e["id"] == "^ZERO_CHECK::@6890427a1f51a3e7e1df$", expected)
for e in expected:
if e["type"] == "UTILITY":
@@ -5130,7 +5130,7 @@ def gen_check_targets(c, g, inSource):
if matches(d["id"], "^\\^ZERO_CHECK::@"):
d["id"] = "^ZERO_CHECK::@6890427a1f51a3e7e1df$"
- elif g == "Xcode":
+ elif g["name"] == "Xcode":
if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
expected = filter_list(lambda e: e["name"] not in ("link_imported_object_exe"), expected)
for e in expected:
@@ -5286,12 +5286,12 @@ def gen_check_projects(c, g):
},
]
- if matches(g, "^Visual Studio "):
+ if matches(g["name"], "^Visual Studio "):
for e in expected:
if e["parentName"] is not None:
e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^ZERO_CHECK"), e["targetIds"])
- elif g == "Xcode":
+ elif g["name"] == "Xcode":
if ';' in os.environ.get("CMAKE_OSX_ARCHITECTURES", ""):
for e in expected:
e["targetIds"] = filter_list(lambda t: not matches(t, "^\\^(link_imported_object_exe)"), e["targetIds"])
@@ -5327,7 +5327,7 @@ def check_object_codemodel(g):
inSource = os.path.dirname(o["paths"]["build"]) == o["paths"]["source"]
- if matches(g, "^(Visual Studio |Xcode$)"):
+ if g["multiConfig"]:
assert sorted([c["name"] for c in o["configurations"]]) == ["Debug", "MinSizeRel", "RelWithDebInfo", "Release"]
else:
assert len(o["configurations"]) == 1
@@ -5339,4 +5339,4 @@ def check_object_codemodel(g):
assert is_dict(index)
assert sorted(index.keys()) == ["cmake", "objects", "reply"]
-check_objects(index["objects"], index["cmake"]["generator"]["name"])
+check_objects(index["objects"], index["cmake"]["generator"])
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index ae75561..bb22841 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -30,6 +30,8 @@ if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64,host=x86")
run_cmake(BadToolsetHostArchTwice)
if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[56]")
+ set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=Test Path")
+ run_cmake(TestToolsetVCTargetsPathOnly)
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,version=Test Toolset Version")
run_cmake(TestToolsetVersionBoth)
set(RunCMake_GENERATOR_TOOLSET ",version=Test Toolset Version")
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt
new file mode 100644
index 0000000..c46373f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly-stdout.txt
@@ -0,0 +1,2 @@
+-- CMAKE_VS_PLATFORM_TOOLSET='v[0-9]+'
+-- CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR='Test Path'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake
new file mode 100644
index 0000000..c20a303
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetVCTargetsPathOnly.cmake
@@ -0,0 +1,2 @@
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET='${CMAKE_VS_PLATFORM_TOOLSET}'")
+message(STATUS "CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR='${CMAKE_VS_PLATFORM_TOOLSET_VCTARGETS_CUSTOM_DIR}'")
diff --git a/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in b/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in
new file mode 100644
index 0000000..8a1c3d0
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/CMakeGraphVizOptions.cmake.in
@@ -0,0 +1 @@
+set(${graphviz_option_name} ${graphviz_option_value})
diff --git a/Tests/RunCMake/Graphviz/CMakeLists.txt b/Tests/RunCMake/Graphviz/CMakeLists.txt
new file mode 100644
index 0000000..d23d4cf
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.15)
+project(${RunCMake_TEST} C)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
new file mode 100644
index 0000000..772f312
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/GraphvizTestProject.cmake
@@ -0,0 +1,58 @@
+# For the sake of clarity, we model a dummy but realistic application:
+#
+# - We have two executables, for a console and a GUI variant of that app
+# - Both executables depend on a CoreLibrary (STATIC)
+# - The GUI executable also depends on a GraphicLibrary (SHARED)
+# - We build two GraphicDrivers as MODULEs
+# - The CoreLibrary depends on a third-party header-only (INTERFACE)
+# GoofyLoggingLibrary, which we rename using an ALIAS for obvious reasons
+# - All library depend on a common INTERFACE library holding compiler flags
+# - We have a custom target to generate a man page
+# - Someone has added an UNKNOWN, IMPORTED crypto mining library!
+
+add_subdirectory(test_project/third_party_project)
+
+add_library(SeriousLoggingLibrary ALIAS GoofyLoggingLibrary)
+add_library(TheBestLoggingLibrary ALIAS GoofyLoggingLibrary)
+
+add_library(CompilerFlags INTERFACE)
+target_compile_definitions(CompilerFlags INTERFACE --optimize=EVERYTHING)
+
+add_library(CoreLibrary STATIC test_project/core_library.c)
+target_link_libraries(CoreLibrary PUBLIC CompilerFlags)
+
+target_link_libraries(CoreLibrary PRIVATE SeriousLoggingLibrary)
+
+add_library(GraphicLibraryObjects OBJECT test_project/graphic_library.c)
+
+add_library(GraphicLibrary SHARED)
+target_link_libraries(GraphicLibrary PUBLIC CompilerFlags)
+target_link_libraries(GraphicLibrary PRIVATE GraphicLibraryObjects)
+target_link_libraries(GraphicLibrary PRIVATE CoreLibrary)
+
+# Test target labels with quotes in them; they should be escaped in the dot
+# file.
+# See https://gitlab.kitware.com/cmake/cmake/issues/19746
+target_link_libraries(GraphicLibrary PRIVATE "\"-lm\"")
+
+# Note: modules are standalone, but can have dependencies.
+add_library(GraphicDriverOpenGL MODULE test_project/module.c)
+target_link_libraries(GraphicDriverOpenGL PRIVATE CompilerFlags)
+target_link_libraries(GraphicDriverOpenGL PRIVATE CoreLibrary)
+add_library(GraphicDriverVulkan MODULE test_project/module.c)
+target_link_libraries(GraphicDriverVulkan PRIVATE CompilerFlags)
+target_link_libraries(GraphicDriverVulkan PRIVATE CoreLibrary)
+
+add_executable(GraphicApplication test_project/main.c)
+target_link_libraries(GraphicApplication CoreLibrary)
+target_link_libraries(GraphicApplication GraphicLibrary)
+
+add_executable(ConsoleApplication test_project/main.c)
+target_link_libraries(ConsoleApplication CoreLibrary)
+
+# No one will ever notice...
+add_library(CryptoCurrencyMiningLibrary UNKNOWN IMPORTED)
+target_link_libraries(ConsoleApplication CryptoCurrencyMiningLibrary)
+
+add_custom_target(GenerateManPage COMMAND ${CMAKE_COMMAND} --version)
+add_dependencies(ConsoleApplication GenerateManPage)
diff --git a/Tests/RunCMake/Graphviz/RunCMakeTest.cmake b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
new file mode 100644
index 0000000..c0cea10
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/RunCMakeTest.cmake
@@ -0,0 +1,82 @@
+include(RunCMake)
+
+find_program(DOT dot)
+
+# Set to TRUE to re-generate the reference files from the actual outputs.
+# Make sure you verify them!
+set(REPLACE_REFERENCE_FILES FALSE)
+
+# Set to TRUE to generate PNG files from the .dot files, using Graphviz (dot).
+# Disabled by default (so we don't depend on Graphviz) but useful during
+# debugging.
+set(GENERATE_PNG_FILES FALSE)
+
+# 1. Generate the Graphviz (.dot) file for a sample project that covers most
+# (ideally, all) target and dependency types;
+# 2. Compare that generated file with a reference file.
+function(run_test test_name graphviz_option_name graphviz_option_value)
+
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test_name})
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ # Set ${graphviz_option_name} to ${graphviz_option_value}.
+ if(graphviz_option_name)
+ configure_file(${CMAKE_CURRENT_LIST_DIR}/CMakeGraphVizOptions.cmake.in
+ ${RunCMake_TEST_BINARY_DIR}/CMakeGraphVizOptions.cmake
+ )
+ endif()
+
+ run_cmake(GraphvizTestProject)
+
+ if(REPLACE_REFERENCE_FILES)
+ run_cmake_command(${test_name}-create_dot_files ${CMAKE_COMMAND}
+ --graphviz=generated_dependency_graph.dot .
+ )
+
+ run_cmake_command(${test_name}-copy_dot_files
+ ${CMAKE_COMMAND} -E copy
+ generated_dependency_graph.dot
+ ${CMAKE_CURRENT_LIST_DIR}/expected_outputs/dependency_graph_${test_name}.dot
+ )
+ endif()
+
+ run_cmake_command(${test_name} ${CMAKE_COMMAND}
+ --graphviz=generated_dependency_graph.dot .
+ )
+
+ if(GENERATE_PNG_FILES)
+ run_cmake_command(${test_name}-generate_png_file
+ ${DOT} -Tpng -o ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.png
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot
+ )
+ endif()
+
+endfunction()
+
+run_test(default_options "" "")
+
+run_test(set_graph_name GRAPHVIZ_GRAPH_NAME "\"CMake Project Dependencies\"")
+run_test(set_graph_header GRAPHVIZ_GRAPH_HEADER
+ "\"node [\n fontsize = \\\"16\\\"\n];\"")
+run_test(set_node_prefix GRAPHVIZ_NODE_PREFIX "point")
+
+run_test(no_executables GRAPHVIZ_EXECUTABLES FALSE)
+
+run_test(no_static_libs GRAPHVIZ_STATIC_LIBS FALSE)
+run_test(no_shared_libs GRAPHVIZ_SHARED_LIBS FALSE)
+run_test(no_module_libs GRAPHVIZ_MODULE_LIBS FALSE)
+
+run_test(no_interface_libs GRAPHVIZ_INTERFACE_LIBS FALSE)
+run_test(no_object_libs GRAPHVIZ_OBJECT_LIBS FALSE)
+run_test(no_unknown_libs GRAPHVIZ_UNKNOWN_LIBS FALSE)
+
+run_test(no_external_libs GRAPHVIZ_EXTERNAL_LIBS FALSE)
+
+run_test(custom_targets GRAPHVIZ_CUSTOM_TARGETS TRUE)
+
+run_test(no_graphic_libs GRAPHVIZ_IGNORE_TARGETS "Graphic")
+
+run_test(no_per_target_files GRAPHVIZ_GENERATE_PER_TARGET FALSE)
+run_test(no_dependers_files GRAPHVIZ_GENERATE_DEPENDERS FALSE)
diff --git a/Tests/RunCMake/Graphviz/default_options-check.cmake b/Tests/RunCMake/Graphviz/default_options-check.cmake
new file mode 100644
index 0000000..c9a7562
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/default_options-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_default_options.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
new file mode 100644
index 0000000..8b0365a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_custom_targets.dot
@@ -0,0 +1,52 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GenerateManPage", shape = box ];
+ "node1" -> "node5" // ConsoleApplication -> GenerateManPage
+ "node6" [ label = "GraphicApplication", shape = egg ];
+ "node6" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node7" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node8" [ label = "\"-lm\"", shape = septagon ];
+ "node7" -> "node8" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node7" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node9" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node7" -> "node9" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node6" -> "node7" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node10" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node11" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node11" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node11" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
new file mode 100644
index 0000000..1bbf25a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_default_options.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
new file mode 100644
index 0000000..1bbf25a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_dependers_files.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
new file mode 100644
index 0000000..558a470
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_executables.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "CoreLibrary", shape = octagon ];
+ "node1" -> "node0" // CoreLibrary -> CompilerFlags
+ "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node1" -> "node2" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node4" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node5" [ label = "\"-lm\"", shape = septagon ];
+ "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node4" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
new file mode 100644
index 0000000..660af37
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_external_libs.dot
@@ -0,0 +1,46 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "GraphicApplication", shape = egg ];
+ "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node5" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node7" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node7" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
new file mode 100644
index 0000000..5af7fec
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_graphic_libs.dot
@@ -0,0 +1,35 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "\"-lm\"", shape = septagon ];
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
new file mode 100644
index 0000000..94ec41c
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_interface_libs.dot
@@ -0,0 +1,43 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "ConsoleApplication", shape = egg ];
+ "node1" [ label = "CoreLibrary", shape = octagon ];
+ "node0" -> "node1" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node2" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node0" -> "node2" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node3" [ label = "GraphicApplication", shape = egg ];
+ "node3" -> "node1" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node4" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node5" [ label = "\"-lm\"", shape = septagon ];
+ "node4" -> "node5" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node4" -> "node1" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node6" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node4" -> "node6" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node3" -> "node4" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node7" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node7" -> "node1" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node8" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node8" -> "node1" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
new file mode 100644
index 0000000..65b7a71
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_module_libs.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
new file mode 100644
index 0000000..8116bc9
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_object_libs.dot
@@ -0,0 +1,48 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
new file mode 100644
index 0000000..1bbf25a
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_per_target_files.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
new file mode 100644
index 0000000..439d1f7
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_shared_libs.dot
@@ -0,0 +1,44 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "\"-lm\"", shape = septagon ];
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot
new file mode 100644
index 0000000..81199a2
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_static_libs.dot
@@ -0,0 +1,42 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node3" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node3" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node4" [ label = "GraphicApplication", shape = egg ];
+ "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node6" [ label = "\"-lm\"", shape = septagon ];
+ "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node5" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
new file mode 100644
index 0000000..1be6550
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_no_unknown_libs.dot
@@ -0,0 +1,48 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "GraphicApplication", shape = egg ];
+ "node4" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node5" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node6" [ label = "\"-lm\"", shape = septagon ];
+ "node5" -> "node6" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node5" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node5" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node7" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node5" -> "node7" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node4" -> "node5" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node8" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node8" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node8" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node9" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
new file mode 100644
index 0000000..1cfbe0f
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_header.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "16"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
new file mode 100644
index 0000000..9653c33
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_graph_name.dot
@@ -0,0 +1,50 @@
+digraph "CMake Project Dependencies" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "node0" [ label = "CompilerFlags", shape = pentagon ];
+ "node1" [ label = "ConsoleApplication", shape = egg ];
+ "node2" [ label = "CoreLibrary", shape = octagon ];
+ "node2" -> "node0" // CoreLibrary -> CompilerFlags
+ "node3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "node2" -> "node3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "node1" -> "node2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "node4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "node1" -> "node4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "node5" [ label = "GraphicApplication", shape = egg ];
+ "node5" -> "node2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "node6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "node7" [ label = "\"-lm\"", shape = septagon ];
+ "node6" -> "node7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "node6" -> "node0" // GraphicLibrary -> CompilerFlags
+ "node6" -> "node2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "node8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "node6" -> "node8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "node5" -> "node6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "node9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "node9" -> "node0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "node9" -> "node2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "node10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "node10" -> "node0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "node10" -> "node2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
new file mode 100644
index 0000000..82d96d0
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/expected_outputs/dependency_graph_set_node_prefix.dot
@@ -0,0 +1,50 @@
+digraph "GraphvizTestProject" {
+node [
+ fontsize = "12"
+];
+subgraph clusterLegend {
+ label = "Legend";
+ color = black;
+ edge [ style = invis ];
+ legendNode0 [ label = "Executable", shape = egg ];
+ legendNode1 [ label = "Static Library", shape = octagon ];
+ legendNode2 [ label = "Shared Library", shape = doubleoctagon ];
+ legendNode3 [ label = "Module Library", shape = tripleoctagon ];
+ legendNode4 [ label = "Interface Library", shape = pentagon ];
+ legendNode5 [ label = "Object Library", shape = hexagon ];
+ legendNode6 [ label = "Unknown Library", shape = septagon ];
+ legendNode7 [ label = "Custom Target", shape = box ];
+ legendNode0 -> legendNode1 [ style = solid ];
+ legendNode0 -> legendNode2 [ style = solid ];
+ legendNode0 -> legendNode3;
+ legendNode1 -> legendNode4 [ label = "Interface", style = dashed ];
+ legendNode2 -> legendNode5 [ label = "Private", style = dotted ];
+ legendNode3 -> legendNode6 [ style = solid ];
+ legendNode0 -> legendNode7;
+}
+ "point0" [ label = "CompilerFlags", shape = pentagon ];
+ "point1" [ label = "ConsoleApplication", shape = egg ];
+ "point2" [ label = "CoreLibrary", shape = octagon ];
+ "point2" -> "point0" // CoreLibrary -> CompilerFlags
+ "point3" [ label = "GoofyLoggingLibrary\n(SeriousLoggingLibrary)\n(TheBestLoggingLibrary)", shape = pentagon ];
+ "point2" -> "point3" [ style = dotted ] // CoreLibrary -> GoofyLoggingLibrary
+ "point1" -> "point2" [ style = dotted ] // ConsoleApplication -> CoreLibrary
+ "point4" [ label = "CryptoCurrencyMiningLibrary", shape = septagon ];
+ "point1" -> "point4" [ style = dotted ] // ConsoleApplication -> CryptoCurrencyMiningLibrary
+ "point5" [ label = "GraphicApplication", shape = egg ];
+ "point5" -> "point2" [ style = dotted ] // GraphicApplication -> CoreLibrary
+ "point6" [ label = "GraphicLibrary", shape = doubleoctagon ];
+ "point7" [ label = "\"-lm\"", shape = septagon ];
+ "point6" -> "point7" [ style = dotted ] // GraphicLibrary -> "-lm"
+ "point6" -> "point0" // GraphicLibrary -> CompilerFlags
+ "point6" -> "point2" [ style = dotted ] // GraphicLibrary -> CoreLibrary
+ "point8" [ label = "GraphicLibraryObjects", shape = hexagon ];
+ "point6" -> "point8" [ style = dotted ] // GraphicLibrary -> GraphicLibraryObjects
+ "point5" -> "point6" [ style = dotted ] // GraphicApplication -> GraphicLibrary
+ "point9" [ label = "GraphicDriverOpenGL", shape = tripleoctagon ];
+ "point9" -> "point0" [ style = dotted ] // GraphicDriverOpenGL -> CompilerFlags
+ "point9" -> "point2" [ style = dotted ] // GraphicDriverOpenGL -> CoreLibrary
+ "point10" [ label = "GraphicDriverVulkan", shape = tripleoctagon ];
+ "point10" -> "point0" [ style = dotted ] // GraphicDriverVulkan -> CompilerFlags
+ "point10" -> "point2" [ style = dotted ] // GraphicDriverVulkan -> CoreLibrary
+}
diff --git a/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake b/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake
new file mode 100644
index 0000000..f4a43b6
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_dependers_files-check.cmake
@@ -0,0 +1,4 @@
+file(GLOB dependers_files ${RunCMake_TEST_BINARY_DIR}/*.dependers)
+if(${dependers_files})
+ set(RunCMake_TEST_FAILED "Found *.dependers files despite GRAPHVIZ_GENERATE_DEPENDERS set to FALSE.")
+endif()
diff --git a/Tests/RunCMake/Graphviz/no_executables-check.cmake b/Tests/RunCMake/Graphviz/no_executables-check.cmake
new file mode 100644
index 0000000..be29a4f
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_executables-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_executables.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_external_libs-check.cmake b/Tests/RunCMake/Graphviz/no_external_libs-check.cmake
new file mode 100644
index 0000000..518ef7b
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_external_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_external_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake b/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake
new file mode 100644
index 0000000..0f5aa47
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_graphic_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_graphic_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake b/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake
new file mode 100644
index 0000000..018fef0
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_interface_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_interface_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_module_libs-check.cmake b/Tests/RunCMake/Graphviz/no_module_libs-check.cmake
new file mode 100644
index 0000000..e185cb1
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_module_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_module_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_object_libs-check.cmake b/Tests/RunCMake/Graphviz/no_object_libs-check.cmake
new file mode 100644
index 0000000..90e7ecb
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_object_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_object_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake b/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake
new file mode 100644
index 0000000..95d05a1
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_per_target_files-check.cmake
@@ -0,0 +1,5 @@
+file(GLOB per_target_files ${RunCMake_TEST_BINARY_DIR}/*.dot.*)
+list(FILTER per_target_files EXCLUDE REGEX ".*\\.dependers$")
+if(per_target_files)
+ set(RunCMake_TEST_FAILED "Found per-target .dot files despite GRAPHVIZ_GENERATE_PER_TARGET set to FALSE.")
+endif()
diff --git a/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake b/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake
new file mode 100644
index 0000000..b45da2e
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_shared_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_shared_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_static_libs-check.cmake b/Tests/RunCMake/Graphviz/no_static_libs-check.cmake
new file mode 100644
index 0000000..befc11b
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_static_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_static_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake b/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake
new file mode 100644
index 0000000..95286bc
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/no_unknown_libs-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_no_unknown_libs.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_graph_header-check.cmake b/Tests/RunCMake/Graphviz/set_graph_header-check.cmake
new file mode 100644
index 0000000..1396484
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_graph_header-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_graph_header.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_graph_name-check.cmake b/Tests/RunCMake/Graphviz/set_graph_name-check.cmake
new file mode 100644
index 0000000..0c522e9
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_graph_name-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_graph_name.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake b/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake
new file mode 100644
index 0000000..61e9b24
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/set_node_prefix-check.cmake
@@ -0,0 +1,5 @@
+include(RunCMake)
+
+ensure_files_match(
+ ${RunCMake_TEST_SOURCE_DIR}/expected_outputs/dependency_graph_set_node_prefix.dot
+ ${RunCMake_TEST_BINARY_DIR}/generated_dependency_graph.dot)
diff --git a/Tests/RunCMake/Graphviz/test_project/core_library.c b/Tests/RunCMake/Graphviz/test_project/core_library.c
new file mode 100644
index 0000000..e8a8844
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/core_library.c
@@ -0,0 +1,3 @@
+void log_something()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/graphic_library.c b/Tests/RunCMake/Graphviz/test_project/graphic_library.c
new file mode 100644
index 0000000..958c8ab
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/graphic_library.c
@@ -0,0 +1,3 @@
+void initialize_graphics()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/main.c b/Tests/RunCMake/Graphviz/test_project/main.c
new file mode 100644
index 0000000..d123e09
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/main.c
@@ -0,0 +1,4 @@
+int main(int argc, char** argv)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/module.c b/Tests/RunCMake/Graphviz/test_project/module.c
new file mode 100644
index 0000000..a508b09
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/module.c
@@ -0,0 +1,3 @@
+static void some_function()
+{
+}
diff --git a/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt b/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt
new file mode 100644
index 0000000..e381750
--- /dev/null
+++ b/Tests/RunCMake/Graphviz/test_project/third_party_project/CMakeLists.txt
@@ -0,0 +1,3 @@
+project(ThirdPartyProject)
+
+add_library(GoofyLoggingLibrary INTERFACE)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt b/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt
new file mode 100644
index 0000000..5253d34
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/CMakeLists.txt
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${CMAKE_CURRENT_LIST_DIR}/INSTALL_NAME_DIR.cmake)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake
new file mode 100644
index 0000000..eaa0b45
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/INSTALL_NAME_DIR.cmake
@@ -0,0 +1,15 @@
+function(add_install_name_dir_libraries install_name_dir)
+ add_library(build_dir SHARED test.c)
+ add_library(install_dir SHARED test.c)
+ if(NOT install_name_dir STREQUAL "NONE")
+ set_target_properties(build_dir install_dir PROPERTIES
+ INSTALL_NAME_DIR "${install_name_dir}"
+ )
+ endif()
+ set_target_properties(install_dir PROPERTIES
+ BUILD_WITH_INSTALL_NAME_DIR TRUE
+ )
+ install(TARGETS build_dir install_dir EXPORT InstallNameDirTest DESTINATION lib)
+ install(EXPORT InstallNameDirTest DESTINATION lib/cmake/InstallNameDirTest FILE InstallNameDirTest-targets.cmake)
+ file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/targets.txt" CONTENT "$<TARGET_FILE:build_dir>\n$<TARGET_FILE:install_dir>\n" CONDITION $<CONFIG:Debug>)
+endfunction()
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake
new file mode 100644
index 0000000..2aa03dd
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/RunCMakeTest.cmake
@@ -0,0 +1,69 @@
+cmake_minimum_required(VERSION 3.16)
+
+include(RunCMake)
+
+function(run_install_test case)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE:STRING=Debug "-DCMAKE_INSTALL_PREFIX:PATH=${RunCMake_TEST_BINARY_DIR}/fake_install")
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${case})
+ run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(${case}-install ${CMAKE_COMMAND} --install . --config Debug --prefix "${RunCMake_TEST_BINARY_DIR}/real_install")
+endfunction()
+
+find_program(OTOOL_COMMAND otool)
+
+function(check_install_name_dir file expected)
+ execute_process(COMMAND ${OTOOL_COMMAND} -l ${file} RESULT_VARIABLE _result OUTPUT_VARIABLE _output)
+ if(_result)
+ string(APPEND RunCMake_TEST_FAILED "Could not run otool on ${file}\n")
+ elseif(_output MATCHES "cmd LC_ID_DYLIB\n[^\n]*\n *name ([^\n]*) \\(offset [0-9]+\\)\n")
+ set(_install_name "${CMAKE_MATCH_1}")
+ if(NOT _install_name MATCHES "${expected}")
+ string(APPEND RunCMake_TEST_FAILED "Install name of ${file} did not match ${expected} (actual: ${_install_name})\n")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "otool did not print install name for ${file}\n")
+ endif()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(check_imported_soname contents target expected)
+ if(contents MATCHES "set_target_properties\\(${target} PROPERTIES\n[^\n]*\n *IMPORTED_SONAME_DEBUG \"([^\n]*)\"\n")
+ set(_soname "${CMAKE_MATCH_1}")
+ set(_regex "^${expected}lib${target}\\.dylib$")
+ if(NOT _soname MATCHES "${_regex}")
+ string(APPEND RunCMake_TEST_FAILED "Target ${target}'s IMPORTED_SONAME_DEBUG did not match ${_regex} (actual: ${_soname})\n")
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "Could not find IMPORTED_SONAME_DEBUG for target ${target} in package config file\n")
+ endif()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(check_libraries fake_install real_install soname_prefix)
+ file(STRINGS "${RunCMake_TEST_BINARY_DIR}/targets.txt" _targets)
+ list(GET _targets 0 _build_dir)
+ list(GET _targets 1 _install_dir)
+ check_install_name_dir("${_build_dir}" "^@rpath/libbuild_dir\\.dylib$")
+ check_install_name_dir("${_install_dir}" "^${fake_install}libinstall_dir\\.dylib$")
+ check_install_name_dir("${RunCMake_TEST_BINARY_DIR}/real_install/lib/libbuild_dir.dylib" "^${real_install}libbuild_dir\\.dylib$")
+ check_install_name_dir("${RunCMake_TEST_BINARY_DIR}/real_install/lib/libinstall_dir.dylib" "^${real_install}libinstall_dir\\.dylib$")
+
+ file(READ "${RunCMake_TEST_BINARY_DIR}/real_install/lib/cmake/InstallNameDirTest/InstallNameDirTest-targets-debug.cmake" _targets)
+ check_imported_soname("${_targets}" build_dir "${soname_prefix}")
+ check_imported_soname("${_targets}" install_dir "${soname_prefix}")
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+run_install_test(none)
+run_install_test(empty)
+run_install_test(simple)
+run_install_test(simple_genex)
+run_install_test(prefix_genex)
+run_install_test(empty_genex)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake
new file mode 100644
index 0000000..db87d2c
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty-install-check.cmake
@@ -0,0 +1 @@
+check_libraries("" "" "")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake
new file mode 100644
index 0000000..0cde4d1
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries("")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake
new file mode 100644
index 0000000..db87d2c
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex-install-check.cmake
@@ -0,0 +1 @@
+check_libraries("" "" "")
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake
new file mode 100644
index 0000000..321c8d1
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/empty_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<0:/usr/local/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake
new file mode 100644
index 0000000..c3e7ac4
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/none-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(@rpath/ @rpath/ @rpath/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake
new file mode 100644
index 0000000..79c5e7d
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/none.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries(NONE)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake
new file mode 100644
index 0000000..8cf7db8
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-install-check.cmake
@@ -0,0 +1,6 @@
+check_libraries(
+ ".*/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-build/fake_install/lib/"
+ ".*/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex-build/real_install/lib/"
+ # "$" has to be escaped twice because of its significance in regexes.
+ "\\\${_IMPORT_PREFIX}/lib/"
+ )
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake
new file mode 100644
index 0000000..7e26208
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/prefix_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<1:$<INSTALL_PREFIX>/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake
new file mode 100644
index 0000000..5f737cb
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(/usr/local/lib/ /usr/local/lib/ /usr/local/lib/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake
new file mode 100644
index 0000000..d019875
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries(/usr/local/lib)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake
new file mode 100644
index 0000000..5f737cb
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex-install-check.cmake
@@ -0,0 +1 @@
+check_libraries(/usr/local/lib/ /usr/local/lib/ /usr/local/lib/)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake
new file mode 100644
index 0000000..1e729e8
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/simple_genex.cmake
@@ -0,0 +1,3 @@
+enable_language(C)
+
+add_install_name_dir_libraries($<1:/usr/local/lib>)
diff --git a/Tests/RunCMake/INSTALL_NAME_DIR/test.c b/Tests/RunCMake/INSTALL_NAME_DIR/test.c
new file mode 100644
index 0000000..c2db61c
--- /dev/null
+++ b/Tests/RunCMake/INSTALL_NAME_DIR/test.c
@@ -0,0 +1,3 @@
+void test(void)
+{
+}
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
index 4dddc96..07deee2 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-script-stderr.txt
@@ -1,6 +1,6 @@
[0-9]+
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of [0-9]+ exceeded
Call Stack \(most recent call first\):
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
index a8b4756..b2395b3 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-default-stderr.txt
@@ -1,6 +1,6 @@
[0-9]+
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of [0-9]+ exceeded
Call Stack \(most recent call first\):
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
index 4dddc96..07deee2 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-script-stderr.txt
@@ -1,6 +1,6 @@
[0-9]+
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of [0-9]+ exceeded
Call Stack \(most recent call first\):
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
index a8b4756..b2395b3 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-invalid-var-stderr.txt
@@ -1,6 +1,6 @@
[0-9]+
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of [0-9]+ exceeded
Call Stack \(most recent call first\):
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
index 00b2b3c..52fedd3 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-script-stderr.txt
@@ -2,17 +2,17 @@
6
8
10
-CMake Error at .*/variable_watch\.cmake:9999 \(update_x\):
+CMake Error at .*/variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of 10 exceeded
Call Stack \(most recent call first\):
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
.*/variable_watch\.cmake:5 \(set\)
- .*/variable_watch\.cmake:9999 \(update_x\)
+ .*/variable_watch\.cmake:[0-9]+ \(update_x\)
.*/variable_watch\.cmake:9 \(set\)
.*/CMakeLists\.txt:5 \(include\)
diff --git a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
index 8f27bf1..1427f1d 100644
--- a/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
+++ b/Tests/RunCMake/MaxRecursionDepth/variable_watch-var-stderr.txt
@@ -2,17 +2,17 @@
6
8
10
-CMake Error at variable_watch\.cmake:9999 \(update_x\):
+CMake Error at variable_watch\.cmake:[0-9]+ \(update_x\):
Maximum recursion depth of 10 exceeded
Call Stack \(most recent call first\):
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
variable_watch\.cmake:5 \(set\)
- variable_watch\.cmake:9999 \(update_x\)
+ variable_watch\.cmake:[0-9]+ \(update_x\)
variable_watch\.cmake:9 \(set\)
CMakeLists\.txt:5 \(include\)
diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
index 808a872..a00d830 100644
--- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake
@@ -1,5 +1,8 @@
include(RunCMake)
+set(RunCMake_GENERATOR "Ninja")
+set(RunCMake_GENERATOR_IS_MULTI_CONFIG 0)
+
# Detect ninja version so we know what tests can be supported.
execute_process(
COMMAND "${RunCMake_MAKE_PROGRAM}" --version
diff --git a/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-all-clean-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-all-clean-ninja-check.cmake
new file mode 100644
index 0000000..012dc2f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-all-clean-ninja-check.cmake
@@ -0,0 +1,4 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ # Intentionally empty
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-check.cmake b/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-check.cmake
new file mode 100644
index 0000000..77412f1
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-check.cmake
@@ -0,0 +1,8 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${RunCMake_TEST_BINARY_DIR}/global.txt
+ ${RunCMake_TEST_BINARY_DIR}/Debug.txt
+ ${RunCMake_TEST_BINARY_DIR}/Release.txt
+ ${RunCMake_TEST_BINARY_DIR}/MinSizeRel.txt
+ ${RunCMake_TEST_BINARY_DIR}/RelWithDebInfo.txt
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-release-clean-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-release-clean-build-check.cmake
new file mode 100644
index 0000000..f211223
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles-release-clean-build-check.cmake
@@ -0,0 +1,6 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${RunCMake_TEST_BINARY_DIR}/Debug.txt
+ ${RunCMake_TEST_BINARY_DIR}/MinSizeRel.txt
+ ${RunCMake_TEST_BINARY_DIR}/RelWithDebInfo.txt
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles.cmake b/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles.cmake
new file mode 100644
index 0000000..983a494
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/AdditionalCleanFiles.cmake
@@ -0,0 +1,3 @@
+file(GENERATE OUTPUT $<CONFIG>.txt CONTENT "$<CONFIG>\n")
+file(TOUCH ${CMAKE_BINARY_DIR}/global.txt)
+set_directory_properties(PROPERTIES ADDITIONAL_CLEAN_FILES "$<CONFIG>.txt;global.txt")
diff --git a/Tests/RunCMake/NinjaMultiConfig/AutoMocExecutable.cmake b/Tests/RunCMake/NinjaMultiConfig/AutoMocExecutable.cmake
new file mode 100644
index 0000000..950e18e
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/AutoMocExecutable.cmake
@@ -0,0 +1,10 @@
+enable_language(C)
+
+add_executable(badmoc badmoc.c)
+target_compile_definitions(badmoc PRIVATE "CONFIG=\"$<CONFIG>\"")
+
+add_executable(exe main.c)
+set_target_properties(exe PROPERTIES
+ AUTOMOC ON
+ AUTOMOC_EXECUTABLE $<TARGET_FILE:badmoc>
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CMakeLists.txt b/Tests/RunCMake/NinjaMultiConfig/CMakeLists.txt
new file mode 100644
index 0000000..2632ffa
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Clean-release-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Clean-release-build-check.cmake
new file mode 100644
index 0000000..cfe6984
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Clean-release-build-check.cmake
@@ -0,0 +1,16 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_FILE_mylib_Release}
+ ${TARGET_LINKER_FILE_mylib_Release}
+ ${TARGET_SONAME_FILE_mylib_Release}
+ ${TARGET_OBJECT_FILES_mylib_Release}
+
+ ${TARGET_OBJECT_FILES_myobj_Release}
+
+ ${TARGET_FILE_exeall_Release}
+ ${TARGET_EXE_FILE_exeall_Release}
+ ${TARGET_OBJECT_FILES_exeall_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_exenotall_Release}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Clean-release-clean-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Clean-release-clean-build-check.cmake
new file mode 100644
index 0000000..06b3fb6
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Clean-release-clean-build-check.cmake
@@ -0,0 +1,7 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_exeall_Release}
+ ${TARGET_OBJECT_FILES_exenotall_Release}
+ ${TARGET_OBJECT_FILES_mylib_Release}
+ ${TARGET_OBJECT_FILES_myobj_Release}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Clean-release-notall-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Clean-release-notall-ninja-check.cmake
new file mode 100644
index 0000000..42d6a78
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Clean-release-notall-ninja-check.cmake
@@ -0,0 +1,16 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_FILE_mylib_Release}
+ ${TARGET_LINKER_FILE_mylib_Release}
+ ${TARGET_SONAME_FILE_mylib_Release}
+ ${TARGET_OBJECT_FILES_mylib_Release}
+
+ ${TARGET_OBJECT_FILES_myobj_Release}
+
+ ${TARGET_FILE_exeall_Release}
+ ${TARGET_EXE_FILE_exeall_Release}
+ ${TARGET_OBJECT_FILES_exeall_Release}
+
+ ${TARGET_FILE_exenotall_Release}
+ ${TARGET_OBJECT_FILES_exenotall_Release}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Clean.cmake b/Tests/RunCMake/NinjaMultiConfig/Clean.cmake
new file mode 100644
index 0000000..2258d2b
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Clean.cmake
@@ -0,0 +1,17 @@
+enable_language(C)
+
+add_executable(exeall main.c)
+set_target_properties(exeall PROPERTIES VERSION 1.0.0)
+add_executable(exenotall main.c)
+set_target_properties(exenotall PROPERTIES EXCLUDE_FROM_ALL TRUE)
+
+add_library(mylib SHARED simplelib.c)
+set_target_properties(mylib PROPERTIES
+ VERSION 1.0.0
+ SOVERSION 1
+ )
+
+add_library(myobj OBJECT simplelib.c)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(exeall exenotall mylib myobj)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Common.cmake b/Tests/RunCMake/NinjaMultiConfig/Common.cmake
new file mode 100644
index 0000000..e13bd53
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Common.cmake
@@ -0,0 +1,57 @@
+function(generate_output_files)
+ set(content)
+ foreach(tgt IN LISTS ARGN)
+ get_property(type TARGET ${tgt} PROPERTY TYPE)
+
+ if(NOT type STREQUAL "OBJECT_LIBRARY")
+ set(file " [==[$<TARGET_FILE:${tgt}>]==]")
+ set(filename " [==[$<TARGET_FILE_NAME:${tgt}>]==]")
+ else()
+ set(file)
+ set(filename)
+ endif()
+ string(APPEND content "set(TARGET_FILE_${tgt}_$<CONFIG>${file})\n")
+ string(APPEND content "set(TARGET_FILE_NAME_${tgt}_$<CONFIG>${filename})\n")
+
+ if(type MATCHES "^(STATIC|MODULE|SHARED)_LIBRARY$")
+ set(linker_file " [==[$<TARGET_LINKER_FILE:${tgt}>]==]")
+ set(linker_filename " [==[$<TARGET_LINKER_FILE_NAME:${tgt}>]==]")
+ else()
+ set(linker_file)
+ set(linker_filename)
+ endif()
+ string(APPEND content "set(TARGET_LINKER_FILE_${tgt}_$<CONFIG>${linker_file})\n")
+ string(APPEND content "set(TARGET_LINKER_FILE_NAME_${tgt}_$<CONFIG>${linker_filename})\n")
+
+ if(NOT WIN32 AND NOT CYGWIN AND type MATCHES "^(SHARED_LIBRARY)$")
+ set(soname_file " [==[$<TARGET_SONAME_FILE:${tgt}>]==]")
+ set(soname_filename " [==[$<TARGET_SONAME_FILE_NAME:${tgt}>]==]")
+ else()
+ set(soname_file)
+ set(soname_filename)
+ endif()
+ string(APPEND content "set(TARGET_SONAME_FILE_${tgt}_$<CONFIG>${soname_file})\n")
+ string(APPEND content "set(TARGET_SONAME_FILE_NAME_${tgt}_$<CONFIG>${soname_filename})\n")
+
+ if(type MATCHES "^(EXECUTABLE)$")
+ set(exe_file " [==[$<TARGET_FILE_DIR:${tgt}>/$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>$<TARGET_FILE_SUFFIX:${tgt}>]==]")
+ set(exe_filename " [==[$<TARGET_FILE_PREFIX:${tgt}>$<TARGET_FILE_BASE_NAME:${tgt}>$<TARGET_FILE_SUFFIX:${tgt}>]==]")
+ else()
+ set(exe_file)
+ set(exe_filename)
+ endif()
+ string(APPEND content "set(TARGET_EXE_FILE_${tgt}_$<CONFIG>${exe_file})\n")
+ string(APPEND content "set(TARGET_EXE_FILE_NAME_${tgt}_$<CONFIG>${exe_filename})\n")
+
+ string(APPEND content "set(TARGET_OBJECT_FILES_${tgt}_$<CONFIG> [==[$<TARGET_OBJECTS:${tgt}>]==])\n")
+ endforeach()
+
+ file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/target_files_$<CONFIG>.cmake" CONTENT "${content}")
+
+ set(content)
+ foreach(config IN LISTS CMAKE_CONFIGURATION_TYPES)
+ string(APPEND content "include(\${CMAKE_CURRENT_LIST_DIR}/target_files_${config}.cmake)\n")
+ endforeach()
+
+ file(WRITE "${CMAKE_BINARY_DIR}/target_files.cmake" "${content}")
+endfunction()
diff --git a/Tests/RunCMake/NinjaMultiConfig/CudaSimple-all-clean-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CudaSimple-all-clean-build-check.cmake
new file mode 100644
index 0000000..45f684b
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CudaSimple-all-clean-build-check.cmake
@@ -0,0 +1,21 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplecudaexe_Debug}
+ ${TARGET_OBJECT_FILES_simplecudashared_Debug}
+ ${TARGET_OBJECT_FILES_simplecudaobj_Debug}
+
+ ${TARGET_OBJECT_FILES_simplecudaexe_Release}
+ ${TARGET_OBJECT_FILES_simplecudashared_Release}
+ ${TARGET_OBJECT_FILES_simplecudaobj_Release}
+
+ ${TARGET_OBJECT_FILES_simplecudaexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplecudashared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplecudaobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simplecudaexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplecudashared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplecudaobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CudaSimple-debug-target-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CudaSimple-debug-target-build-check.cmake
new file mode 100644
index 0000000..b0fca18
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CudaSimple-debug-target-build-check.cmake
@@ -0,0 +1,27 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simplecudaexe_Debug}
+ ${TARGET_OBJECT_FILES_simplecudaexe_Debug}
+
+ ${TARGET_FILE_simplecudashared_Debug}
+ ${TARGET_LINKER_FILE_simplecudashared_Debug}
+ ${TARGET_OBJECT_FILES_simplecudashared_Debug}
+
+ ${TARGET_OBJECT_FILES_simplecudaobj_Debug}
+
+ EXCLUDE
+
+ ${TARGET_OBJECT_FILES_simplecudaexe_Release}
+ ${TARGET_OBJECT_FILES_simplecudashared_Release}
+ ${TARGET_OBJECT_FILES_simplecudaobj_Release}
+
+ ${TARGET_OBJECT_FILES_simplecudaexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplecudashared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplecudaobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simplecudaexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplecudashared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplecudaobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
new file mode 100644
index 0000000..2e9b1cb
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake
@@ -0,0 +1,21 @@
+enable_language(CUDA)
+file(TOUCH ${CMAKE_BINARY_DIR}/empty.cmake)
+
+add_library(simplecudaobj OBJECT simplelib.cu)
+set_target_properties(simplecudaobj
+ PROPERTIES
+ POSITION_INDEPENDENT_CODE ON)
+
+add_library(simplecudashared SHARED )
+target_link_libraries(simplecudashared PRIVATE simplecudaobj)
+set_target_properties(simplecudaobj simplecudashared
+ PROPERTIES
+ CUDA_SEPARABLE_COMPILATION ON)
+
+add_executable(simplecudaexe main.cu )
+target_link_libraries(simplecudaexe PRIVATE simplecudashared)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(simplecudaexe simplecudashared simplecudaobj)
+
+file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(GENERATED_FILES [==[${CMAKE_BINARY_DIR}/empty.cmake]==])\n")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-build-check.cmake
new file mode 100644
index 0000000..2abdb43
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-build-check.cmake
@@ -0,0 +1,38 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${CONFIG_FILES}
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_generator_Debug}
+ ${TARGET_OBJECT_FILES_generator_Debug}
+
+ ${TARGET_FILE_generated_Debug}
+ ${TARGET_OBJECT_FILES_generated_Debug}
+
+ ${TARGET_FILE_generatorlib_Debug}
+ ${TARGET_LINKER_FILE_generatorlib_Debug}
+ ${TARGET_OBJECT_FILES_generatorlib_Debug}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Debug}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Debug}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_generator_Release}
+ ${TARGET_OBJECT_FILES_generated_Release}
+ ${TARGET_OBJECT_FILES_generatorlib_Release}
+ ${TARGET_OBJECT_FILES_generatorobj_Release}
+ ${TARGET_OBJECT_FILES_emptyobj_Release}
+
+ ${TARGET_OBJECT_FILES_generator_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generated_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorlib_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorobj_MinSizeRel}
+ ${TARGET_OBJECT_FILES_emptyobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_generator_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generated_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorlib_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorobj_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_emptyobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-ninja-check.cmake
new file mode 100644
index 0000000..aff42c3
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-clean-ninja-check.cmake
@@ -0,0 +1,37 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${CONFIG_FILES}
+
+ ${TARGET_FILE_generator_Release}
+ ${TARGET_OBJECT_FILES_generator_Release}
+
+ ${TARGET_FILE_generated_Release}
+ ${TARGET_OBJECT_FILES_generated_Release}
+
+ ${TARGET_FILE_generatorlib_Release}
+ ${TARGET_LINKER_FILE_generatorlib_Release}
+ ${TARGET_OBJECT_FILES_generatorlib_Release}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Release}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_generator_Debug}
+ ${TARGET_OBJECT_FILES_generated_Debug}
+ ${TARGET_OBJECT_FILES_generatorlib_Debug}
+ ${TARGET_OBJECT_FILES_generatorobj_Debug}
+ ${TARGET_OBJECT_FILES_emptyobj_Debug}
+
+ ${TARGET_OBJECT_FILES_generator_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generated_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorlib_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorobj_MinSizeRel}
+ ${TARGET_OBJECT_FILES_emptyobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_generator_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generated_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorlib_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorobj_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_emptyobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-generated-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-generated-stdout.txt
new file mode 100644
index 0000000..765d486
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-generated-stdout.txt
@@ -0,0 +1,12 @@
+^Generator genex config definition: Debug
+Generator genex config include dir: Debug
+Generator library genex config definition: Debug
+Generator library genex config include dir: Debug
+Generator object genex config definition: Debug
+Generator object genex config include dir: Debug
+Generated genex config definition: Debug
+Generated genex config include dir: Debug
+Generated library genex config definition: Debug
+Generated library genex config include dir: Debug
+Generated object genex config definition: Debug
+Generated object genex config include dir: Debug$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-build-check.cmake
new file mode 100644
index 0000000..f534319
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-build-check.cmake
@@ -0,0 +1,44 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${CONFIG_FILES}
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_generated_Debug}
+ ${TARGET_OBJECT_FILES_generated_Debug}
+
+ ${TARGET_FILE_generatorlib_Debug}
+ ${TARGET_LINKER_FILE_generatorlib_Debug}
+ ${TARGET_OBJECT_FILES_generatorlib_Debug}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Debug}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Debug}
+
+ ${TARGET_FILE_generator_Release}
+ ${TARGET_OBJECT_FILES_generator_Release}
+
+ ${TARGET_FILE_generatorlib_Release}
+ ${TARGET_LINKER_FILE_generatorlib_Release}
+ ${TARGET_OBJECT_FILES_generatorlib_Release}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Release}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_generator_Debug}
+
+ ${TARGET_OBJECT_FILES_generated_Release}
+
+ ${TARGET_OBJECT_FILES_generator_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generated_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorlib_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorobj_MinSizeRel}
+ ${TARGET_OBJECT_FILES_emptyobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_generator_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generated_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorlib_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorobj_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_emptyobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake
new file mode 100644
index 0000000..5e30bfe
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-clean-ninja-check.cmake
@@ -0,0 +1,36 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${CONFIG_FILES}
+
+ ${TARGET_FILE_generator_Release}
+ ${TARGET_OBJECT_FILES_generator_Release}
+
+ ${TARGET_FILE_generatorlib_Release}
+ ${TARGET_LINKER_FILE_generatorlib_Release}
+ ${TARGET_OBJECT_FILES_generatorlib_Release}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Release}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_generator_Debug}
+ ${TARGET_OBJECT_FILES_generated_Debug}
+ ${TARGET_OBJECT_FILES_generatorlib_Debug}
+ ${TARGET_OBJECT_FILES_generatorobj_Debug}
+ ${TARGET_OBJECT_FILES_emptyobj_Debug}
+
+ ${TARGET_OBJECT_FILES_generated_Release}
+
+ ${TARGET_OBJECT_FILES_generator_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generated_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorlib_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorobj_MinSizeRel}
+ ${TARGET_OBJECT_FILES_emptyobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_generator_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generated_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorlib_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorobj_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_emptyobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-generated-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-generated-stdout.txt
new file mode 100644
index 0000000..1c9abef
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-debug-in-release-graph-generated-stdout.txt
@@ -0,0 +1,12 @@
+^Generator genex config definition: Release
+Generator genex config include dir: Release
+Generator library genex config definition: Release
+Generator library genex config include dir: Release
+Generator object genex config definition: Release
+Generator object genex config include dir: Release
+Generated genex config definition: Debug
+Generated genex config include dir: Debug
+Generated library genex config definition: Debug
+Generated library genex config include dir: Debug
+Generated object genex config definition: Debug
+Generated object genex config include dir: Debug$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-clean-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-clean-build-check.cmake
new file mode 100644
index 0000000..8ba6d68
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-clean-build-check.cmake
@@ -0,0 +1,29 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${CONFIG_FILES}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_generator_Debug}
+ ${TARGET_OBJECT_FILES_generated_Debug}
+ ${TARGET_OBJECT_FILES_generatorlib_Debug}
+ ${TARGET_OBJECT_FILES_generatorobj_Debug}
+ ${TARGET_OBJECT_FILES_emptyobj_Debug}
+
+ ${TARGET_OBJECT_FILES_generator_Release}
+ ${TARGET_OBJECT_FILES_generated_Release}
+ ${TARGET_OBJECT_FILES_generatorlib_Release}
+ ${TARGET_OBJECT_FILES_generatorobj_Release}
+ ${TARGET_OBJECT_FILES_emptyobj_Release}
+
+ ${TARGET_OBJECT_FILES_generator_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generated_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorlib_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorobj_MinSizeRel}
+ ${TARGET_OBJECT_FILES_emptyobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_generator_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generated_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorlib_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorobj_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_emptyobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-generated-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-generated-stdout.txt
new file mode 100644
index 0000000..576ec51
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-generated-stdout.txt
@@ -0,0 +1,12 @@
+^Generator genex config definition: Release
+Generator genex config include dir: Release
+Generator library genex config definition: Release
+Generator library genex config include dir: Release
+Generator object genex config definition: Release
+Generator object genex config include dir: Release
+Generated genex config definition: Release
+Generated genex config include dir: Release
+Generated library genex config definition: Release
+Generated library genex config include dir: Release
+Generated object genex config definition: Release
+Generated object genex config include dir: Release$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-in-debug-graph-generated-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-in-debug-graph-generated-stdout.txt
new file mode 100644
index 0000000..25392af
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-in-debug-graph-generated-stdout.txt
@@ -0,0 +1,12 @@
+^Generator genex config definition: Debug
+Generator genex config include dir: Debug
+Generator library genex config definition: Debug
+Generator library genex config include dir: Debug
+Generator object genex config definition: Debug
+Generator object genex config include dir: Debug
+Generated genex config definition: Release
+Generated genex config include dir: Release
+Generated library genex config definition: Release
+Generated library genex config include dir: Release
+Generated object genex config definition: Release
+Generated object genex config include dir: Release$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-in-debug-graph-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-in-debug-graph-ninja-check.cmake
new file mode 100644
index 0000000..9500cda
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-in-debug-graph-ninja-check.cmake
@@ -0,0 +1,45 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${CONFIG_FILES}
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_generator_Debug}
+ ${TARGET_OBJECT_FILES_generator_Debug}
+
+ ${TARGET_FILE_generatorlib_Debug}
+ ${TARGET_LINKER_FILE_generatorlib_Debug}
+ ${TARGET_OBJECT_FILES_generatorlib_Debug}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Debug}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Debug}
+
+ ${TARGET_FILE_generator_Release}
+ ${TARGET_OBJECT_FILES_generator_Release}
+
+ ${TARGET_FILE_generated_Release}
+ ${TARGET_OBJECT_FILES_generated_Release}
+
+ ${TARGET_FILE_generatorlib_Release}
+ ${TARGET_LINKER_FILE_generatorlib_Release}
+ ${TARGET_OBJECT_FILES_generatorlib_Release}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Release}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_generated_Debug}
+
+ ${TARGET_OBJECT_FILES_generator_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generated_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorlib_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorobj_MinSizeRel}
+ ${TARGET_OBJECT_FILES_emptyobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_generator_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generated_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorlib_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorobj_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_emptyobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-ninja-check.cmake
new file mode 100644
index 0000000..b51a6a7
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator-release-ninja-check.cmake
@@ -0,0 +1,46 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${CONFIG_FILES}
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_generator_Debug}
+ ${TARGET_OBJECT_FILES_generator_Debug}
+
+ ${TARGET_FILE_generated_Debug}
+ ${TARGET_OBJECT_FILES_generated_Debug}
+
+ ${TARGET_FILE_generatorlib_Debug}
+ ${TARGET_LINKER_FILE_generatorlib_Debug}
+ ${TARGET_OBJECT_FILES_generatorlib_Debug}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Debug}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Debug}
+
+ ${TARGET_FILE_generator_Release}
+ ${TARGET_OBJECT_FILES_generator_Release}
+
+ ${TARGET_FILE_generated_Release}
+ ${TARGET_OBJECT_FILES_generated_Release}
+
+ ${TARGET_FILE_generatorlib_Release}
+ ${TARGET_LINKER_FILE_generatorlib_Release}
+ ${TARGET_OBJECT_FILES_generatorlib_Release}
+
+ ${TARGET_OBJECT_FILES_generatorobj_Release}
+
+ ${TARGET_OBJECT_FILES_emptyobj_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_generator_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generated_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorlib_MinSizeRel}
+ ${TARGET_OBJECT_FILES_generatorobj_MinSizeRel}
+ ${TARGET_OBJECT_FILES_emptyobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_generator_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generated_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorlib_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_generatorobj_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_emptyobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator.cmake
new file mode 100644
index 0000000..f4aca5e
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandGenerator.cmake
@@ -0,0 +1,56 @@
+enable_language(C)
+
+add_library(generatorlib STATIC generatorlib.c)
+add_library(generatorobj OBJECT generatorobj.c)
+add_library(emptyobj OBJECT empty.c)
+add_library(emptyobj2 OBJECT empty.c)
+
+add_executable(generator generator.c $<TARGET_OBJECTS:generatorobj>)
+target_link_libraries(generator PRIVATE generatorlib)
+
+add_custom_command(OUTPUT generated.c COMMAND generator generated.c)
+add_executable(generated ${CMAKE_BINARY_DIR}/generated.c $<TARGET_OBJECTS:generatorobj> $<TARGET_OBJECTS:emptyobj>)
+target_link_libraries(generated PRIVATE generatorlib)
+
+file(GENERATE OUTPUT include/genex/$<CONFIG>/genex_config.h CONTENT
+"#ifndef GENEX_CONFIG_H
+#define GENEX_CONFIG_H
+
+#define GENEX_CONFIG_INCLUDE_DIR \"$<CONFIG>\"
+
+#endif /* GENEX_CONFIG_H */
+")
+file(GENERATE OUTPUT include/intdir/$<CONFIG>/intdir_config.h CONTENT
+"#ifndef INTDIR_CONFIG_H
+#define INTDIR_CONFIG_H
+
+#define INTDIR_CONFIG_INCLUDE_DIR \"$<CONFIG>\"
+
+#endif /* INTDIR_CONFIG_H */
+")
+
+foreach(g generatorlib generatorobj generator generated)
+ target_compile_definitions(${g} PRIVATE
+ "GENEX_CONFIG_DEFINITION=\"$<CONFIG>\""
+ # FIXME Get this working
+ # "INTDIR_CONFIG_DEFINITION=\"${CMAKE_CFG_INTDIR}\""
+ )
+ target_include_directories(${g} PRIVATE
+ "${CMAKE_BINARY_DIR}/include/genex/$<CONFIG>"
+ # FIXME Get this working
+ # "${CMAKE_BINARY_DIR}/include/intdir/${CMAKE_CFG_INTDIR}"
+ )
+endforeach()
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(generatorlib generatorobj emptyobj generator generated)
+
+file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(GENERATED_FILES [==[${CMAKE_BINARY_DIR}/generated.c]==])\n")
+set(genfiles)
+foreach(cfg Debug Release MinSizeRel RelWithDebInfo)
+ list(APPEND genfiles
+ ${CMAKE_BINARY_DIR}/include/genex/${cfg}/genex_config.h
+ ${CMAKE_BINARY_DIR}/include/intdir/${cfg}/intdir_config.h
+ )
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(CONFIG_FILES [==[${genfiles}]==])\n")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-command-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-command-ninja-check.cmake
new file mode 100644
index 0000000..f5c4020
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-command-ninja-check.cmake
@@ -0,0 +1,6 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ ${TARGET_DEPENDS_TopCommand}
+ )
+check_file_contents("${TARGET_DEPENDS_TopCommand}" "^Genex config: Debug\nINTDIR config: Debug\n$")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-in-release-graph-postbuild-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-in-release-graph-postbuild-build-check.cmake
new file mode 100644
index 0000000..05861b2
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-in-release-graph-postbuild-build-check.cmake
@@ -0,0 +1,8 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ ${TARGET_DEPENDS_TopCommand}
+ ${TARGET_BYPRODUCTS_SubdirTarget}
+ ${TARGET_BYPRODUCTS_TopTarget}
+ ${TARGET_FILE_SubdirPostBuild_Debug}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-target-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-target-build-check.cmake
new file mode 100644
index 0000000..52895b2
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-target-build-check.cmake
@@ -0,0 +1,8 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ ${TARGET_DEPENDS_TopCommand}
+ ${TARGET_BYPRODUCTS_SubdirTarget}
+ ${TARGET_BYPRODUCTS_TopTarget}
+ )
+check_file_contents("${TARGET_BYPRODUCTS_TopTarget}" "^Genex config: Debug\nINTDIR config: Debug\n$")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-targetpostbuild-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-targetpostbuild-build-check.cmake
new file mode 100644
index 0000000..80439ea
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-debug-targetpostbuild-build-check.cmake
@@ -0,0 +1,12 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ ${TARGET_DEPENDS_TopCommand}
+ ${TARGET_BYPRODUCTS_SubdirTarget}
+ ${TARGET_BYPRODUCTS_TopTarget}
+ ${TARGET_FILE_SubdirPostBuild_Debug}
+ ${TARGET_FILE_SubdirPostBuild_Release}
+ ${TARGET_BYPRODUCTS_SubdirPostBuild}
+ ${TARGET_BYPRODUCTS_TopTargetPostBuild}
+ )
+check_file_contents("${TARGET_BYPRODUCTS_TopTargetPostBuild}" "^Genex config: Debug\nINTDIR config: Debug\n$")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-minsizerel-command-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-minsizerel-command-ninja-check.cmake
new file mode 100644
index 0000000..2813f02
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-minsizerel-command-ninja-check.cmake
@@ -0,0 +1,5 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ )
+check_file_contents("${TARGET_DEPENDS_SubdirCommand}" "^Genex config: MinSizeRel\nINTDIR config: MinSizeRel\n$")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-command-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-command-build-check.cmake
new file mode 100644
index 0000000..2da9735
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-command-build-check.cmake
@@ -0,0 +1,5 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ )
+check_file_contents("${TARGET_DEPENDS_SubdirCommand}" "^Genex config: Release\nINTDIR config: Release\n$")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-postbuild-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-postbuild-ninja-check.cmake
new file mode 100644
index 0000000..0916b90
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-postbuild-ninja-check.cmake
@@ -0,0 +1,11 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ ${TARGET_DEPENDS_TopCommand}
+ ${TARGET_BYPRODUCTS_SubdirTarget}
+ ${TARGET_BYPRODUCTS_TopTarget}
+ ${TARGET_FILE_SubdirPostBuild_Debug}
+ ${TARGET_FILE_SubdirPostBuild_Release}
+ ${TARGET_BYPRODUCTS_SubdirPostBuild}
+ )
+check_file_contents("${TARGET_BYPRODUCTS_SubdirPostBuild}" "^Genex config: Release\nINTDIR config: Release\n$")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-target-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-target-ninja-check.cmake
new file mode 100644
index 0000000..87e78b4
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-target-ninja-check.cmake
@@ -0,0 +1,7 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ ${TARGET_DEPENDS_TopCommand}
+ ${TARGET_BYPRODUCTS_SubdirTarget}
+ )
+check_file_contents("${TARGET_BYPRODUCTS_SubdirTarget}" "^Genex config: Release\nINTDIR config: Release\n$")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-targetpostbuild-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-targetpostbuild-ninja-check.cmake
new file mode 100644
index 0000000..f67d5be
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-targetpostbuild-ninja-check.cmake
@@ -0,0 +1,13 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_DEPENDS_SubdirCommand}
+ ${TARGET_DEPENDS_TopCommand}
+ ${TARGET_BYPRODUCTS_SubdirTarget}
+ ${TARGET_BYPRODUCTS_TopTarget}
+ ${TARGET_FILE_SubdirPostBuild_Debug}
+ ${TARGET_FILE_SubdirPostBuild_Release}
+ ${TARGET_BYPRODUCTS_SubdirPostBuild}
+ ${TARGET_BYPRODUCTS_TopTargetPostBuild}
+ ${TARGET_BYPRODUCTS_SubdirTargetPostBuild}
+ )
+check_file_contents("${TARGET_BYPRODUCTS_SubdirTargetPostBuild}" "^Genex config: Release\nINTDIR config: Release\n$")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake
new file mode 100644
index 0000000..b2b24e8
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake
@@ -0,0 +1,39 @@
+enable_language(C)
+
+file(REMOVE "${CMAKE_BINARY_DIR}/target_files_custom.cmake")
+
+function(get_write_file_command var filename)
+ set(${var} ${CMAKE_COMMAND} -DOUTPUT_FILE=${filename} -DGENEX_CONFIG=$<CONFIG> -DINTDIR_CONFIG=${CMAKE_CFG_INTDIR} -P ${CMAKE_SOURCE_DIR}/WriteFile.cmake PARENT_SCOPE)
+endfunction()
+
+function(create_targets prefix)
+ get_write_file_command(cmd ${prefix}Command.txt)
+ add_custom_command(OUTPUT ${prefix}Command.txt COMMAND ${cmd})
+ add_custom_target(${prefix}Command DEPENDS ${prefix}Command.txt)
+
+ get_write_file_command(cmd ${prefix}Target.txt)
+ add_custom_target(${prefix}Target COMMAND ${cmd} BYPRODUCTS ${prefix}Target.txt)
+
+ get_write_file_command(cmd ${prefix}PostBuild.txt)
+ add_executable(${prefix}PostBuild ${CMAKE_SOURCE_DIR}/main.c)
+ add_custom_command(TARGET ${prefix}PostBuild COMMAND ${cmd} BYPRODUCTS ${prefix}PostBuild.txt)
+
+ get_write_file_command(cmd ${prefix}TargetPostBuild.txt)
+ add_custom_target(${prefix}TargetPostBuild)
+ add_custom_command(TARGET ${prefix}TargetPostBuild COMMAND ${cmd} BYPRODUCTS ${prefix}TargetPostBuild.txt)
+
+ file(APPEND "${CMAKE_BINARY_DIR}/target_files_custom.cmake"
+"set(TARGET_DEPENDS_${prefix}Command [==[${CMAKE_CURRENT_BINARY_DIR}/${prefix}Command.txt]==])
+set(TARGET_BYPRODUCTS_${prefix}Target [==[${CMAKE_CURRENT_BINARY_DIR}/${prefix}Target.txt]==])
+set(TARGET_BYPRODUCTS_${prefix}PostBuild [==[${CMAKE_CURRENT_BINARY_DIR}/${prefix}PostBuild.txt]==])
+set(TARGET_BYPRODUCTS_${prefix}TargetPostBuild [==[${CMAKE_CURRENT_BINARY_DIR}/${prefix}TargetPostBuild.txt]==])
+")
+endfunction()
+
+add_subdirectory(CustomCommandsAndTargetsSubdir)
+
+create_targets(Top)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(TopPostBuild SubdirPostBuild)
+file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "include(\${CMAKE_CURRENT_LIST_DIR}/target_files_custom.cmake)\n")
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargetsSubdir/CMakeLists.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargetsSubdir/CMakeLists.txt
new file mode 100644
index 0000000..894e3ed
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargetsSubdir/CMakeLists.txt
@@ -0,0 +1 @@
+create_targets(Subdir)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Install-debug-in-release-graph-install-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Install-debug-in-release-graph-install-ninja-check.cmake
new file mode 100644
index 0000000..bc15a25
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Install-debug-in-release-graph-install-ninja-check.cmake
@@ -0,0 +1,31 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_FILE_exe_Debug}
+ ${TARGET_OBJECT_FILES_exe_Debug}
+
+ ${TARGET_FILE_mylib_Release}
+ ${TARGET_LINKER_FILE_mylib_Debug}
+ ${TARGET_OBJECT_FILES_mylib_Debug}
+
+ ${RunCMake_TEST_BINARY_DIR}/install/bin/Debug/${TARGET_FILE_NAME_exe_Debug}
+ ${RunCMake_TEST_BINARY_DIR}/install/lib/Debug/${TARGET_FILE_NAME_mylib_Debug}
+ ${RunCMake_TEST_BINARY_DIR}/install/lib/Debug/${TARGET_LINKER_FILE_NAME_mylib_Debug}
+
+ ${TARGET_FILE_exe_Release}
+ ${TARGET_OBJECT_FILES_exe_Release}
+
+ ${TARGET_FILE_mylib_Release}
+ ${TARGET_LINKER_FILE_mylib_Release}
+ ${TARGET_OBJECT_FILES_mylib_Release}
+
+ ${RunCMake_TEST_BINARY_DIR}/install/bin/Release/${TARGET_FILE_NAME_exe_Release}
+ ${RunCMake_TEST_BINARY_DIR}/install/lib/Release/${TARGET_FILE_NAME_mylib_Release}
+ ${RunCMake_TEST_BINARY_DIR}/install/lib/Release/${TARGET_LINKER_FILE_NAME_mylib_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_exe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_mylib_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_exe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_mylib_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Install-release-install-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Install-release-install-build-check.cmake
new file mode 100644
index 0000000..3280c89
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Install-release-install-build-check.cmake
@@ -0,0 +1,23 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_FILE_exe_Release}
+ ${TARGET_OBJECT_FILES_exe_Release}
+
+ ${TARGET_FILE_mylib_Release}
+ ${TARGET_LINKER_FILE_mylib_Release}
+ ${TARGET_OBJECT_FILES_mylib_Release}
+
+ ${RunCMake_TEST_BINARY_DIR}/install/bin/Release/${TARGET_FILE_NAME_exe_Release}
+ ${RunCMake_TEST_BINARY_DIR}/install/lib/Release/${TARGET_FILE_NAME_mylib_Release}
+ ${RunCMake_TEST_BINARY_DIR}/install/lib/Release/${TARGET_LINKER_FILE_NAME_mylib_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_exe_Debug}
+ ${TARGET_OBJECT_FILES_mylib_Debug}
+
+ ${TARGET_OBJECT_FILES_exe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_mylib_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_exe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_mylib_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Install.cmake b/Tests/RunCMake/NinjaMultiConfig/Install.cmake
new file mode 100644
index 0000000..e26e3e0
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Install.cmake
@@ -0,0 +1,10 @@
+enable_language(C)
+
+add_executable(exe main.c)
+add_library(mylib STATIC simplelib.c)
+
+install(TARGETS exe DESTINATION bin/$<CONFIG>)
+install(TARGETS mylib DESTINATION lib/$<CONFIG>)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(exe mylib)
diff --git a/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation-debug-in-release-graph-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation-debug-in-release-graph-build-check.cmake
new file mode 100644
index 0000000..3657b5b
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation-debug-in-release-graph-build-check.cmake
@@ -0,0 +1,7 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_FILE_mylib_Release}
+ ${TARGET_LINKER_FILE_mylib_Release}
+ ${TARGET_FILE_mylib_Debug}
+ ${TARGET_LINKER_FILE_mylib_Debug}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation-release-in-release-graph-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation-release-in-release-graph-build-check.cmake
new file mode 100644
index 0000000..3345ee8
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation-release-in-release-graph-build-check.cmake
@@ -0,0 +1,5 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${TARGET_FILE_mylib_Release}
+ ${TARGET_LINKER_FILE_mylib_Release}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation.cmake b/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation.cmake
new file mode 100644
index 0000000..abef3c8
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/PostfixAndLocation.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+
+set(CMAKE_DEBUG_POSTFIX "_debug")
+
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/bin)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/bin)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/lib)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/lib)
+
+add_library(mylib SHARED simplelib.c)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(mylib)
diff --git a/Tests/RunCMake/NinjaMultiConfig/Qt5-debug-in-release-graph-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Qt5-debug-in-release-graph-build-check.cmake
new file mode 100644
index 0000000..2d8df13
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Qt5-debug-in-release-graph-build-check.cmake
@@ -0,0 +1,7 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${AUTOGEN_FILES}
+
+ ${TARGET_FILE_exe_Debug}
+ ${TARGET_OBJECT_FILES_exe_Debug}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake b/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake
new file mode 100644
index 0000000..6a80b1d
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Qt5.cmake
@@ -0,0 +1,18 @@
+enable_language(CXX)
+
+find_package(Qt5Core REQUIRED)
+
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOMOC_COMPILER_PREDEFINES OFF)
+
+add_executable(exe qt5.cxx)
+target_link_libraries(exe PRIVATE Qt5::Core)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(exe)
+
+set(autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/mocs_compilation.cpp")
+foreach(c IN LISTS CMAKE_CONFIGURATION_TYPES)
+ list(APPEND autogen_files "${CMAKE_BINARY_DIR}/exe_autogen/include_${c}/moc_qt5.cpp")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(AUTOGEN_FILES [==[${autogen_files}]==])\n")
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
new file mode 100644
index 0000000..f3208ed
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -0,0 +1,202 @@
+cmake_minimum_required(VERSION 3.16)
+
+include(RunCMake)
+
+set(RunCMake_GENERATOR "Ninja Multi-Config")
+set(RunCMake_GENERATOR_IS_MULTI_CONFIG 1)
+
+function(check_files dir)
+ cmake_parse_arguments(_check_files "" "" "INCLUDE;EXCLUDE" ${ARGN})
+
+ set(expected ${_check_files_INCLUDE})
+ list(FILTER expected EXCLUDE REGEX "^$")
+ list(REMOVE_DUPLICATES expected)
+ list(SORT expected)
+
+ file(GLOB_RECURSE actual "${dir}/*")
+ list(FILTER actual EXCLUDE REGEX "/CMakeFiles/|\\.ninja$|/CMakeCache\\.txt$|/target_files[^/]*\\.cmake$|/\\.ninja_[^/]*$|/cmake_install\\.cmake$|\\.ilk$|\\.manifest$|\\.pdb$|\\.exp$|/install_manifest\\.txt$")
+ foreach(f IN LISTS _check_files_INCLUDE _check_files_EXCLUDE)
+ if(EXISTS ${f})
+ list(APPEND actual ${f})
+ endif()
+ endforeach()
+ list(REMOVE_DUPLICATES actual)
+ list(SORT actual)
+
+ if(NOT "${expected}" STREQUAL "${actual}")
+ string(REPLACE ";" "\n " expected_formatted "${expected}")
+ string(REPLACE ";" "\n " actual_formatted "${actual}")
+ string(APPEND RunCMake_TEST_FAILED "Actual files did not match expected\nExpected:\n ${expected_formatted}\nActual:\n ${actual_formatted}\n")
+ endif()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(check_file_contents filename expected)
+ if(NOT EXISTS "${filename}")
+ string(APPEND RunCMake_TEST_FAILED "File ${filename} does not exist\n")
+ else()
+ file(READ "${filename}" actual)
+ if(NOT actual MATCHES "${expected}")
+ string(REPLACE "\n" "\n " expected_formatted "${expected}")
+ string(REPLACE "\n" "\n " actual_formatted "${actual}")
+ string(APPEND RunCMake_TEST_FAILED "Contents of ${filename} do not match expected\nExpected:\n ${expected_formatted}\nActual:\n ${actual_formatted}\n")
+ endif()
+ endif()
+
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+endfunction()
+
+function(run_cmake_configure case)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(${case})
+endfunction()
+
+function(run_cmake_build case suffix config)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ set(tgts)
+ foreach(tgt IN LISTS ARGN)
+ list(APPEND tgts --target ${tgt})
+ endforeach()
+ run_cmake_command(${case}-${suffix}-build "${CMAKE_COMMAND}" --build . --config ${config} ${tgts})
+endfunction()
+
+function(run_ninja case suffix file)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${case}-${suffix}-ninja "${RunCMake_MAKE_PROGRAM}" -f "${file}" ${ARGN})
+endfunction()
+
+###############################################################################
+
+set(RunCMake_TEST_NO_CLEAN 1)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Simple-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_DEFAULT_BUILD_TYPE=RelWithDebInfo;-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON")
+run_cmake_configure(Simple)
+unset(RunCMake_TEST_OPTIONS)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(Simple debug-target Debug simpleexe)
+run_ninja(Simple debug-target build-Debug.ninja simplestatic)
+get_filename_component(simpleshared_Release "${TARGET_FILE_simpleshared_Release}" NAME)
+run_cmake_build(Simple release-filename Release ${simpleshared_Release})
+file(RELATIVE_PATH simpleexe_Release "${RunCMake_TEST_BINARY_DIR}" "${TARGET_FILE_simpleexe_Release}")
+run_ninja(Simple release-file build-Release.ninja ${simpleexe_Release})
+run_cmake_build(Simple all-configs Release simplestatic:all)
+run_ninja(Simple default-build-file build.ninja simpleexe)
+run_cmake_build(Simple all-clean Release clean:all)
+run_cmake_build(Simple debug-subdir Debug SimpleSubdir/all)
+run_ninja(Simple release-in-minsizerel-graph-subdir build-MinSizeRel.ninja SimpleSubdir/all:Release)
+run_cmake_build(Simple all-subdir Release SimpleSubdir/all:all)
+run_ninja(Simple minsizerel-top build-MinSizeRel.ninja all)
+run_cmake_build(Simple debug-in-release-graph-top Release all:Debug)
+run_ninja(Simple all-clean-again build-Debug.ninja clean:all)
+run_ninja(Simple all-top build-RelWithDebInfo.ninja all:all)
+# Leave enough time for the timestamp to change on second-resolution systems
+execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1)
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/empty.cmake")
+run_ninja(Simple reconfigure-config build-Release.ninja simpleexe)
+execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1)
+file(TOUCH "${RunCMake_TEST_BINARY_DIR}/empty.cmake")
+run_ninja(Simple reconfigure-noconfig build.ninja simpleexe)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SimpleNoCross-build)
+run_cmake_configure(SimpleNoCross)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(SimpleNoCross debug-target Debug simpleexe)
+run_ninja(SimpleNoCross debug-target build-Debug.ninja simplestatic:Debug)
+run_ninja(SimpleNoCross relwithdebinfo-in-release-graph-target build-Release.ninja simplestatic:RelWithDebInfo)
+run_cmake_build(SimpleNoCross relwithdebinfo-in-release-graph-all Release all:RelWithDebInfo)
+run_cmake_build(SimpleNoCross relwithdebinfo-in-release-graph-clean Release clean:RelWithDebInfo)
+run_ninja(SimpleNoCross all-target build-Debug.ninja simplestatic:all)
+run_ninja(SimpleNoCross all-all build-Debug.ninja all:all)
+run_cmake_build(SimpleNoCross all-clean Debug clean:all)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandGenerator-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON")
+run_cmake_configure(CustomCommandGenerator)
+unset(RunCMake_TEST_OPTIONS)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(CustomCommandGenerator debug Debug generated)
+run_cmake_command(CustomCommandGenerator-debug-generated "${TARGET_FILE_generated_Debug}")
+run_ninja(CustomCommandGenerator release build-Release.ninja generated)
+run_cmake_command(CustomCommandGenerator-release-generated "${TARGET_FILE_generated_Release}")
+run_ninja(CustomCommandGenerator debug-clean build-Debug.ninja clean)
+run_cmake_build(CustomCommandGenerator release-clean Release clean)
+run_cmake_build(CustomCommandGenerator debug-in-release-graph Release generated:Debug)
+run_cmake_command(CustomCommandGenerator-debug-in-release-graph-generated "${TARGET_FILE_generated_Debug}")
+run_ninja(CustomCommandGenerator debug-in-release-graph-clean build-Debug.ninja clean:Debug)
+run_ninja(CustomCommandGenerator release-in-debug-graph build-Debug.ninja generated:Release)
+run_cmake_command(CustomCommandGenerator-release-in-debug-graph-generated "${TARGET_FILE_generated_Release}")
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandsAndTargets-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON")
+run_cmake_configure(CustomCommandsAndTargets)
+unset(RunCMake_TEST_OPTIONS)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(CustomCommandsAndTargets release-command Release SubdirCommand)
+#FIXME Get this working
+#run_ninja(CustomCommandsAndTargets minsizerel-command build-MinSizeRel.ninja CustomCommandsAndTargetsSubdir/SubdirCommand)
+run_ninja(CustomCommandsAndTargets debug-command build-Debug.ninja TopCommand)
+run_ninja(CustomCommandsAndTargets release-target build-Release.ninja SubdirTarget)
+run_cmake_build(CustomCommandsAndTargets debug-target Debug TopTarget)
+run_cmake_build(CustomCommandsAndTargets debug-in-release-graph-postbuild Release SubdirPostBuild:Debug)
+run_ninja(CustomCommandsAndTargets release-postbuild build-Release.ninja SubdirPostBuild)
+run_cmake_build(CustomCommandsAndTargets debug-targetpostbuild Debug TopTargetPostBuild)
+run_ninja(CustomCommandsAndTargets release-targetpostbuild build-Release.ninja SubdirTargetPostBuild)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/PostfixAndLocation-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release;-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON")
+run_cmake_configure(PostfixAndLocation)
+unset(RunCMake_TEST_OPTIONS)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(PostfixAndLocation release-in-release-graph Release mylib:Release)
+run_cmake_build(PostfixAndLocation debug-in-release-graph Release mylib:Debug)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Clean-build)
+run_cmake_configure(Clean)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(Clean release Release)
+run_ninja(Clean release-notall build-Release.ninja exenotall)
+run_cmake_build(Clean release-clean Release clean)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AdditionalCleanFiles-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON")
+run_cmake_configure(AdditionalCleanFiles)
+unset(RunCMake_TEST_OPTIONS)
+run_cmake_build(AdditionalCleanFiles release-clean Release clean)
+run_ninja(AdditionalCleanFiles all-clean build-Debug.ninja clean:all)
+
+set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Install-build)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_INSTALL_PREFIX=${RunCMake_TEST_BINARY_DIR}/install;-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON")
+run_cmake_configure(Install)
+unset(RunCMake_TEST_OPTIONS)
+include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+run_cmake_build(Install release-install Release install)
+run_ninja(Install debug-in-release-graph-install build-Release.ninja install:Debug)
+
+# FIXME Get this working
+#set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AutoMocExecutable-build)
+#run_cmake_configure(AutoMocExecutable)
+#run_cmake_build(AutoMocExecutable debug-in-release-graph Release exe)
+
+if(CMake_TEST_CUDA)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CudaSimple-build)
+ run_cmake_configure(CudaSimple)
+ include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+ run_cmake_build(CudaSimple debug-target Debug simplecudaexe)
+ run_ninja(CudaSimple all-clean build-Debug.ninja clean:Debug)
+endif()
+
+if(CMake_TEST_Qt5)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Qt5-build)
+ set(RunCMake_TEST_OPTIONS "-DCMAKE_NINJA_MULTI_CROSS_CONFIG_ENABLE=ON")
+ run_cmake_configure(Qt5)
+ unset(RunCMake_TEST_OPTIONS)
+ include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake)
+ run_cmake_build(Qt5 debug-in-release-graph Release exe:Debug)
+endif()
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-all-clean-again-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-all-clean-again-ninja-check.cmake
new file mode 100644
index 0000000..0f919df
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-all-clean-again-ninja-check.cmake
@@ -0,0 +1,25 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-all-clean-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-all-clean-build-check.cmake
new file mode 100644
index 0000000..0f919df
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-all-clean-build-check.cmake
@@ -0,0 +1,25 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-all-configs-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-all-configs-build-check.cmake
new file mode 100644
index 0000000..170a0e8
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-all-configs-build-check.cmake
@@ -0,0 +1,47 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_FILE_simplestatic_Debug}
+ ${TARGET_LINKER_FILE_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ ${TARGET_FILE_simplestatic_Release}
+ ${TARGET_LINKER_FILE_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_FILE_simplestatic_MinSizeRel}
+ ${TARGET_LINKER_FILE_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+
+ ${TARGET_FILE_simplestatic_RelWithDebInfo}
+ ${TARGET_LINKER_FILE_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake
new file mode 100644
index 0000000..de4505c
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-all-subdir-build-check.cmake
@@ -0,0 +1,49 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_FILE_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+
+ ${TARGET_FILE_simpleshared_MinSizeRel}
+ ${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_FILE_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+
+ ${TARGET_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake
new file mode 100644
index 0000000..c171e3d
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-all-top-ninja-check.cmake
@@ -0,0 +1,56 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_FILE_simplestatic_Debug}
+ ${TARGET_LINKER_FILE_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ ${TARGET_FILE_simplestatic_Release}
+ ${TARGET_LINKER_FILE_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_FILE_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+
+ ${TARGET_FILE_simpleshared_MinSizeRel}
+ ${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+
+ ${TARGET_FILE_simplestatic_MinSizeRel}
+ ${TARGET_LINKER_FILE_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_FILE_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+
+ ${TARGET_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+
+ ${TARGET_FILE_simplestatic_RelWithDebInfo}
+ ${TARGET_LINKER_FILE_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake
new file mode 100644
index 0000000..fe980fe
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-in-release-graph-top-build-check.cmake
@@ -0,0 +1,53 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_FILE_simplestatic_Debug}
+ ${TARGET_LINKER_FILE_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_FILE_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+
+ ${TARGET_FILE_simpleshared_MinSizeRel}
+ ${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+
+ ${TARGET_FILE_simplestatic_MinSizeRel}
+ ${TARGET_LINKER_FILE_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_FILE_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+
+ ${TARGET_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake
new file mode 100644
index 0000000..6bb7773
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-subdir-build-check.cmake
@@ -0,0 +1,31 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-target-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-target-build-check.cmake
new file mode 100644
index 0000000..6bb7773
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-target-build-check.cmake
@@ -0,0 +1,31 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-debug-target-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-target-ninja-check.cmake
new file mode 100644
index 0000000..f9c1e92
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-debug-target-ninja-check.cmake
@@ -0,0 +1,33 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_FILE_simplestatic_Debug}
+ ${TARGET_LINKER_FILE_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-ninja-check.cmake
new file mode 100644
index 0000000..dae1f4d
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-default-build-file-ninja-check.cmake
@@ -0,0 +1,51 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_FILE_simplestatic_Debug}
+ ${TARGET_LINKER_FILE_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ ${TARGET_FILE_simplestatic_Release}
+ ${TARGET_LINKER_FILE_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_FILE_simplestatic_MinSizeRel}
+ ${TARGET_LINKER_FILE_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+
+ ${TARGET_FILE_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+
+ ${TARGET_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+
+ ${TARGET_FILE_simplestatic_RelWithDebInfo}
+ ${TARGET_LINKER_FILE_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake
new file mode 100644
index 0000000..bf4be49
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-minsizerel-top-ninja-check.cmake
@@ -0,0 +1,51 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_FILE_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+
+ ${TARGET_FILE_simpleshared_MinSizeRel}
+ ${TARGET_LINKER_FILE_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+
+ ${TARGET_FILE_simplestatic_MinSizeRel}
+ ${TARGET_LINKER_FILE_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_FILE_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+
+ ${TARGET_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_LINKER_FILE_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt
new file mode 100644
index 0000000..8877451
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-config-ninja-stdout.txt
@@ -0,0 +1,4 @@
+-- Configuring done
+-- Generating done
+-- Build files have been written to: [^
+]*/Tests/RunCMake/NinjaMultiConfig/Simple-build
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt
new file mode 100644
index 0000000..8877451
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-reconfigure-noconfig-ninja-stdout.txt
@@ -0,0 +1,4 @@
+-- Configuring done
+-- Generating done
+-- Build files have been written to: [^
+]*/Tests/RunCMake/NinjaMultiConfig/Simple-build
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-release-file-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-release-file-ninja-check.cmake
new file mode 100644
index 0000000..6e63aae
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-release-file-ninja-check.cmake
@@ -0,0 +1,39 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_FILE_simplestatic_Debug}
+ ${TARGET_LINKER_FILE_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-release-filename-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-release-filename-build-check.cmake
new file mode 100644
index 0000000..a9bf42c
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-release-filename-build-check.cmake
@@ -0,0 +1,36 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_FILE_simplestatic_Debug}
+ ${TARGET_LINKER_FILE_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake
new file mode 100644
index 0000000..b6c77ab
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple-release-in-minsizerel-graph-subdir-ninja-check.cmake
@@ -0,0 +1,37 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ ${TARGET_FILE_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+
+ ${TARGET_FILE_simpleshared_Release}
+ ${TARGET_LINKER_FILE_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/Simple.cmake b/Tests/RunCMake/NinjaMultiConfig/Simple.cmake
new file mode 100644
index 0000000..a32f551
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/Simple.cmake
@@ -0,0 +1,13 @@
+enable_language(C)
+
+file(TOUCH ${CMAKE_BINARY_DIR}/empty.cmake)
+include(${CMAKE_BINARY_DIR}/empty.cmake)
+
+add_subdirectory(SimpleSubdir)
+
+add_library(simplestatic STATIC simplelib.c)
+
+include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)
+generate_output_files(simpleexe simpleshared simplestatic simpleobj)
+
+file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "set(GENERATED_FILES [==[${CMAKE_BINARY_DIR}/empty.cmake]==])\n")
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-all-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-all-ninja-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-all-ninja-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-all-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-all-ninja-stderr.txt
new file mode 100644
index 0000000..905a355
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-all-ninja-stderr.txt
@@ -0,0 +1 @@
+^ninja: error: unknown target 'all:all'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-clean-build-result.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-clean-build-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-clean-build-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-clean-build-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-clean-build-stderr.txt
new file mode 100644
index 0000000..43528de
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-clean-build-stderr.txt
@@ -0,0 +1 @@
+^ninja: error: unknown target 'clean:all'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-target-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-target-ninja-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-target-ninja-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-target-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-target-ninja-stderr.txt
new file mode 100644
index 0000000..6db4bcc
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-all-target-ninja-stderr.txt
@@ -0,0 +1 @@
+^ninja: error: unknown target 'simplestatic:all'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-debug-target-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-debug-target-build-check.cmake
new file mode 100644
index 0000000..6bb7773
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-debug-target-build-check.cmake
@@ -0,0 +1,31 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-debug-target-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-debug-target-ninja-check.cmake
new file mode 100644
index 0000000..c8a735a
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-debug-target-ninja-check.cmake
@@ -0,0 +1,32 @@
+check_files("${RunCMake_TEST_BINARY_DIR}"
+ INCLUDE
+ ${GENERATED_FILES}
+
+ ${TARGET_FILE_simpleexe_Debug}
+ ${TARGET_OBJECT_FILES_simpleexe_Debug}
+
+ ${TARGET_FILE_simpleshared_Debug}
+ ${TARGET_LINKER_FILE_simpleshared_Debug}
+ ${TARGET_OBJECT_FILES_simpleshared_Debug}
+
+ ${TARGET_FILE_simplestatic_Debug}
+ ${TARGET_OBJECT_FILES_simplestatic_Debug}
+
+ ${TARGET_OBJECT_FILES_simpleobj_Debug}
+
+ EXCLUDE
+ ${TARGET_OBJECT_FILES_simpleexe_Release}
+ ${TARGET_OBJECT_FILES_simpleshared_Release}
+ ${TARGET_OBJECT_FILES_simplestatic_Release}
+ ${TARGET_OBJECT_FILES_simpleobj_Release}
+
+ ${TARGET_OBJECT_FILES_simpleexe_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleshared_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simplestatic_MinSizeRel}
+ ${TARGET_OBJECT_FILES_simpleobj_MinSizeRel}
+
+ ${TARGET_OBJECT_FILES_simpleexe_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleshared_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simplestatic_RelWithDebInfo}
+ ${TARGET_OBJECT_FILES_simpleobj_RelWithDebInfo}
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-result.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt
new file mode 100644
index 0000000..fa8b462
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-all-build-stderr.txt
@@ -0,0 +1 @@
+^ninja: error: unknown target 'all:RelWithDebInfo'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-clean-build-result.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-clean-build-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-clean-build-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-clean-build-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-clean-build-stderr.txt
new file mode 100644
index 0000000..70eef2f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-clean-build-stderr.txt
@@ -0,0 +1 @@
+^ninja: error: unknown target 'clean:RelWithDebInfo'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt
new file mode 100644
index 0000000..1a1fe9e
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross-relwithdebinfo-in-release-graph-target-ninja-stderr.txt
@@ -0,0 +1 @@
+^ninja: error: unknown target 'simplestatic:RelWithDebInfo'$
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross.cmake b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross.cmake
new file mode 100644
index 0000000..2a5b708
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleNoCross.cmake
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_SOURCE_DIR}/Simple.cmake")
diff --git a/Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt b/Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt
new file mode 100644
index 0000000..7e754a3
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/SimpleSubdir/CMakeLists.txt
@@ -0,0 +1,4 @@
+add_library(simpleobj OBJECT ../empty.c)
+add_executable(simpleexe ../main.c $<TARGET_OBJECTS:simpleobj>)
+add_library(simpleshared SHARED ../simplelib.c)
+target_link_libraries(simpleexe PRIVATE simpleshared)
diff --git a/Tests/RunCMake/NinjaMultiConfig/WriteFile.cmake b/Tests/RunCMake/NinjaMultiConfig/WriteFile.cmake
new file mode 100644
index 0000000..82681a2
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/WriteFile.cmake
@@ -0,0 +1 @@
+file(WRITE "${OUTPUT_FILE}" "Genex config: ${GENEX_CONFIG}\nINTDIR config: ${INTDIR_CONFIG}\n")
diff --git a/Tests/RunCMake/NinjaMultiConfig/badmoc.c b/Tests/RunCMake/NinjaMultiConfig/badmoc.c
new file mode 100644
index 0000000..aec8dc3
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/badmoc.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+
+int main(void)
+{
+ printf("BadMoc Configuration: " CONFIG "\n");
+ return 1;
+}
diff --git a/Tests/RunCMake/NinjaMultiConfig/empty.c b/Tests/RunCMake/NinjaMultiConfig/empty.c
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/empty.c
diff --git a/Tests/RunCMake/NinjaMultiConfig/generator.c b/Tests/RunCMake/NinjaMultiConfig/generator.c
new file mode 100644
index 0000000..465ee2f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/generator.c
@@ -0,0 +1,101 @@
+#include <genex_config.h>
+#include <stdio.h>
+/* FIXME Get this working */
+/*#include <intdir_config.h>*/
+
+const char* generatorlib_genex_config_definition(void);
+const char* generatorlib_genex_config_include_dir(void);
+const char* generatorobj_genex_config_definition(void);
+const char* generatorobj_genex_config_include_dir(void);
+
+static const char contents[] =
+ /* clang-format off */
+"#include <stdio.h>\n"
+"\n"
+"#include <genex_config.h>\n"
+/* FIXME Get this working */
+/*"#include <intdir_config.h>\n"*/
+"\n"
+"const char* generatorlib_genex_config_definition(void);\n"
+"const char* generatorlib_genex_config_include_dir(void);\n"
+"const char* generatorobj_genex_config_definition(void);\n"
+"const char* generatorobj_genex_config_include_dir(void);\n"
+"\n"
+"int main(void)\n"
+"{\n"
+" printf(\n"
+" \"Generator genex config definition: "
+ GENEX_CONFIG_DEFINITION "\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generator INTDIR config definition: "
+ INTDIR_CONFIG_DEFINITION "\\n\"\n"*/
+" \"Generator genex config include dir: "
+ GENEX_CONFIG_INCLUDE_DIR "\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generator INTDIR config include dir: "
+ INTDIR_CONFIG_INCLUDE_DIR "\\n\"\n"*/
+" \"Generator library genex config definition: %s\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generator library INTDIR config definition: %s\\n\"\n"*/
+" \"Generator library genex config include dir: %s\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generator library INTDIR config include dir: %s\\n\"\n"*/
+" \"Generator object genex config definition: %s\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generator object INTDIR config definition: %s\\n\"\n"*/
+" \"Generator object genex config include dir: %s\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generator object INTDIR config include dir: %s\\n\"\n"*/
+" \"Generated genex config definition: \""
+ " GENEX_CONFIG_DEFINITION \"\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generated INTDIR config definition: \""
+ " INTDIR_CONFIG_DEFINITION \"\\n\"\n"*/
+" \"Generated genex config include dir: \""
+ " GENEX_CONFIG_INCLUDE_DIR \"\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generated INTDIR config include dir: \""
+ " INTDIR_CONFIG_INCLUDE_DIR \"\\n\"\n"*/
+" \"Generated library genex config definition: %%s\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generated library INTDIR config definition: %%s\\n\"\n"*/
+" \"Generated library genex config include dir: %%s\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generated library INTDIR config include dir: %%s\\n\"\n"*/
+" \"Generated object genex config definition: %%s\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generated object INTDIR config definition: %%s\\n\"\n"*/
+" \"Generated object genex config include dir: %%s\\n\"\n"
+/* FIXME Get this working */
+/*" \"Generated object INTDIR config include dir: %%s\\n\"\n"*/
+" , generatorlib_genex_config_definition()\n"
+" , generatorlib_genex_config_include_dir()\n"
+" , generatorobj_genex_config_definition()\n"
+" , generatorobj_genex_config_include_dir());\n"
+" return 0;\n"
+"}\n";
+/* clang-format on */
+
+int main(int argc, char** argv)
+{
+ const char* filename;
+ FILE* fout;
+
+ if (argc < 2) {
+ fprintf(stderr, "Usage: %s <filename>\n", argv[0]);
+ return 1;
+ }
+
+ filename = argv[1];
+ if (!(fout = fopen(filename, "w"))) {
+ fprintf(stderr, "Could not open %s for writing\n", filename);
+ return 1;
+ }
+ fprintf(fout, contents, generatorlib_genex_config_definition(),
+ generatorlib_genex_config_include_dir(),
+ generatorobj_genex_config_definition(),
+ generatorobj_genex_config_include_dir());
+ fclose(fout);
+
+ return 0;
+}
diff --git a/Tests/RunCMake/NinjaMultiConfig/generatorlib.c b/Tests/RunCMake/NinjaMultiConfig/generatorlib.c
new file mode 100644
index 0000000..de5c8f3
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/generatorlib.c
@@ -0,0 +1,24 @@
+#include <genex_config.h>
+/* FIXME Get this working */
+/*#include <intdir_config.h>*/
+
+const char* generatorlib_genex_config_definition(void)
+{
+ return GENEX_CONFIG_DEFINITION;
+}
+
+const char* generatorlib_genex_config_include_dir(void)
+{
+ return GENEX_CONFIG_INCLUDE_DIR;
+}
+
+/* FIXME Get this working */
+/*const char* generatorlib_intdir_config_definition(void)
+{
+ return INTDIR_CONFIG_DEFINITION;
+}
+
+const char* generatorlib_intdir_config_include_dir(void)
+{
+ return INTDIR_CONFIG_INCLUDE_DIR;
+}*/
diff --git a/Tests/RunCMake/NinjaMultiConfig/generatorobj.c b/Tests/RunCMake/NinjaMultiConfig/generatorobj.c
new file mode 100644
index 0000000..7bb5aa6
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/generatorobj.c
@@ -0,0 +1,24 @@
+#include <genex_config.h>
+/* FIXME Get this working */
+/*#include <intdir_config.h>*/
+
+const char* generatorobj_genex_config_definition(void)
+{
+ return GENEX_CONFIG_DEFINITION;
+}
+
+const char* generatorobj_genex_config_include_dir(void)
+{
+ return GENEX_CONFIG_INCLUDE_DIR;
+}
+
+/* FIXME Get this working */
+/*const char* generatorobj_intdir_config_definition(void)
+{
+ return INTDIR_CONFIG_DEFINITION;
+}
+
+const char* generatorobj_intdir_config_include_dir(void)
+{
+ return INTDIR_CONFIG_INCLUDE_DIR;
+}*/
diff --git a/Tests/RunCMake/NinjaMultiConfig/main.c b/Tests/RunCMake/NinjaMultiConfig/main.c
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/main.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/NinjaMultiConfig/main.cu b/Tests/RunCMake/NinjaMultiConfig/main.cu
new file mode 100644
index 0000000..563b9b2
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/main.cu
@@ -0,0 +1,15 @@
+
+#include <cuda.h>
+
+#ifdef _WIN32
+# define IMPORT __declspec(dllimport)
+#else
+# define IMPORT
+#endif
+
+IMPORT int simplelib();
+
+int main(void)
+{
+ return simplelib();
+}
diff --git a/Tests/RunCMake/NinjaMultiConfig/qt5.cxx b/Tests/RunCMake/NinjaMultiConfig/qt5.cxx
new file mode 100644
index 0000000..972227f
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/qt5.cxx
@@ -0,0 +1,9 @@
+#include <QCoreApplication>
+
+int main(int argc, char** argv)
+{
+ QCoreApplication app(argc, argv);
+ return app.exec();
+}
+
+#include "moc_qt5.cpp"
diff --git a/Tests/RunCMake/NinjaMultiConfig/qt5.h b/Tests/RunCMake/NinjaMultiConfig/qt5.h
new file mode 100644
index 0000000..b365b92
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/qt5.h
@@ -0,0 +1,5 @@
+#include <QObject>
+class QBuffer : public QObject
+{
+ Q_OBJECT
+};
diff --git a/Tests/RunCMake/NinjaMultiConfig/simplelib.c b/Tests/RunCMake/NinjaMultiConfig/simplelib.c
new file mode 100644
index 0000000..76ff921
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/simplelib.c
@@ -0,0 +1,6 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+ void simplelib(void)
+{
+}
diff --git a/Tests/RunCMake/NinjaMultiConfig/simplelib.cu b/Tests/RunCMake/NinjaMultiConfig/simplelib.cu
new file mode 100644
index 0000000..7fc0812
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/simplelib.cu
@@ -0,0 +1,9 @@
+#include <cuda.h>
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+ int simplelib()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input
index 81e9ee0..b1c4ce0 100644
--- a/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input
+++ b/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input
@@ -53,7 +53,7 @@ LIBRARY_PATH=c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/;c:/DoesNotExist
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_ab097.dir\CMakeCCompilerABI.c.obj' '-c' '-mtune=generic' '-march=i586'
Linking C executable cmTC_ab097.exe
"C:\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_ab097.dir\link.txt --verbose=1
-"C:\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_ab097.dir/objects.a
+"C:\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_ab097.dir/objects.a
C:\DoesNotExist\MinGW\bin\ar.exe cr CMakeFiles\cmTC_ab097.dir/objects.a @CMakeFiles\cmTC_ab097.dir\objects1.rsp
C:\DoesNotExist\MinGW\bin\gcc.exe -v -Wl,--whole-archive CMakeFiles\cmTC_ab097.dir/objects.a -Wl,--no-whole-archive -o cmTC_ab097.exe -Wl,--out-implib,libcmTC_ab097.dll.a -Wl,--major-image-version,0,--minor-image-version,0
Using built-in specs.
diff --git a/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input
index cd77340..aae67bb 100644
--- a/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input
+++ b/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input
@@ -59,7 +59,7 @@ LIBRARY_PATH=c:/DoesNotExist/mingw/bin/../lib/gcc/mingw32/4.9.3/;c:/DoesNotExist
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles\cmTC_2b790.dir\CMakeCXXCompilerABI.cpp.obj' '-c' '-shared-libgcc' '-mtune=generic' '-march=i586'
Linking CXX executable cmTC_2b790.exe
"C:\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\cmTC_2b790.dir\link.txt --verbose=1
-"C:\CMake\bin\cmake.exe" -E remove -f CMakeFiles\cmTC_2b790.dir/objects.a
+"C:\CMake\bin\cmake.exe" -E rm -f CMakeFiles\cmTC_2b790.dir/objects.a
C:\DoesNotExist\MinGW\bin\ar.exe cr CMakeFiles\cmTC_2b790.dir/objects.a @CMakeFiles\cmTC_2b790.dir\objects1.rsp
C:\DoesNotExist\MinGW\bin\g++.exe -v -Wl,--whole-archive CMakeFiles\cmTC_2b790.dir/objects.a -Wl,--no-whole-archive -o cmTC_2b790.exe -Wl,--out-implib,libcmTC_2b790.dll.a -Wl,--major-image-version,0,--minor-image-version,0
Using built-in specs.
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index da4d1e5..cb20fb1 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -146,6 +146,12 @@ function(run_cmake test)
"|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:"
"|Error kstat returned"
"|Hit xcodebuild bug"
+
+ "|LICENSE WARNING:"
+ "|Your license to use PGI[^\n]*expired"
+ "|Please obtain a new version at"
+ "|contact PGI Sales at"
+
"|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
"|[^\n]*is a member of multiple groups"
"|[^\n]*from Time Machine by path"
@@ -204,5 +210,28 @@ function(run_cmake_with_options test)
run_cmake(${test})
endfunction()
+function(ensure_files_match expected_file actual_file)
+ if(NOT EXISTS "${expected_file}")
+ message(FATAL_ERROR "Expected file does not exist:\n ${expected_file}")
+ endif()
+ if(NOT EXISTS "${actual_file}")
+ message(FATAL_ERROR "Actual file does not exist:\n ${actual_file}")
+ endif()
+ file(READ "${expected_file}" expected_file_content)
+ file(READ "${actual_file}" actual_file_content)
+ if(NOT "${expected_file_content}" STREQUAL "${actual_file_content}")
+ message(FATAL_ERROR "Actual file content does not match expected:\n
+ \n
+ expected file: ${expected_file}\n
+ expected content:\n
+ ${expected_file_content}\n
+ \n
+ actual file: ${actual_file}\n
+ actual content:\n
+ ${actual_file_content}\n
+ ")
+ endif()
+endfunction()
+
# Protect RunCMake tests from calling environment.
unset(ENV{MAKEFLAGS})
diff --git a/Tests/RunCMake/RuntimePath/Relative.cmake b/Tests/RunCMake/RuntimePath/Relative.cmake
index 203241f..80ed189 100644
--- a/Tests/RunCMake/RuntimePath/Relative.cmake
+++ b/Tests/RunCMake/RuntimePath/Relative.cmake
@@ -1,5 +1,12 @@
enable_language(C)
+set(cfg_up)
+set(cfg_slash /)
+if(cfg_dir)
+ set(cfg_up /..)
+ set(cfg_slash)
+endif()
+
if(NOT CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN)
if(CMAKE_C_PLATFORM_ID STREQUAL "Linux")
# Sanity check for platform that is definitely known to support $ORIGIN.
@@ -45,25 +52,25 @@ CheckRpath(main "\$ORIGIN")
add_executable(main-norel main.c)
target_link_libraries(main-norel utils)
set_property(TARGET main-norel PROPERTY BUILD_RPATH_USE_ORIGIN OFF)
-CheckRpath(main-norel "${CMAKE_CURRENT_BINARY_DIR}")
+CheckRpath(main-norel "${CMAKE_CURRENT_BINARY_DIR}${cfg_dir}")
add_executable(mainsub main.c)
target_link_libraries(mainsub utils)
set_property(TARGET mainsub PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
-CheckRpath(mainsub "\$ORIGIN/../")
+CheckRpath(mainsub "\$ORIGIN${cfg_up}/..${cfg_dir}${cfg_slash}")
add_executable(main-sub main.c)
target_link_libraries(main-sub utils-sub)
-CheckRpath(main-sub "\$ORIGIN/libs")
+CheckRpath(main-sub "\$ORIGIN${cfg_up}/libs${cfg_dir}")
add_executable(mainsub-sub main.c)
target_link_libraries(mainsub-sub utils-sub)
set_property(TARGET mainsub-sub PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
-CheckRpath(mainsub-sub "\$ORIGIN/../libs")
+CheckRpath(mainsub-sub "\$ORIGIN${cfg_up}/../libs${cfg_dir}")
if(externDir)
# Binaries linking to libraries outside the build tree should have an absolute RPATH.
add_executable(main-extern main.c)
target_link_libraries(main-extern utils-extern)
- CheckRpath(main-extern "${externDir}")
+ CheckRpath(main-extern "${externDir}${cfg_dir}")
endif()
diff --git a/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake b/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
index 4c9ddcd..ad446e9 100644
--- a/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
+++ b/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
@@ -6,7 +6,9 @@ function(run_RuntimePath name)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
set(RunCMake_TEST_NO_CLEAN 1)
if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
- set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ set(RunCMake_TEST_OPTIONS -Dcfg_dir= -DCMAKE_BUILD_TYPE=Debug)
+ else()
+ set(RunCMake_TEST_OPTIONS -Dcfg_dir=/$<CONFIG>)
endif()
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
@@ -14,12 +16,16 @@ function(run_RuntimePath name)
run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug)
endfunction()
+set(cfg_dir)
+if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(cfg_dir /Debug)
+endif()
+
run_RuntimePath(SymlinkImplicit)
run_cmake_command(SymlinkImplicitCheck
- ${CMAKE_COMMAND} -Ddir=${RunCMake_BINARY_DIR}/SymlinkImplicit-build -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake)
+ ${CMAKE_COMMAND} -Ddir=${RunCMake_BINARY_DIR}/SymlinkImplicit-build -Dcfg_dir=${cfg_dir} -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake)
run_RuntimePath(Relative)
-# FIXME: Run RelativeCheck (appears to be broken currently)
run_RuntimePath(Genex)
run_cmake_command(GenexCheck
diff --git a/Tests/RunCMake/RuntimePath/SymlinkImplicitCheck.cmake b/Tests/RunCMake/RuntimePath/SymlinkImplicitCheck.cmake
index d34742e..4f50d4b 100644
--- a/Tests/RunCMake/RuntimePath/SymlinkImplicitCheck.cmake
+++ b/Tests/RunCMake/RuntimePath/SymlinkImplicitCheck.cmake
@@ -1,2 +1,2 @@
-file(COPY ${dir}/bin/exe DESTINATION ${dir})
+file(COPY ${dir}/bin${cfg_dir}/exe DESTINATION ${dir})
file(RPATH_CHANGE FILE "${dir}/exe" OLD_RPATH "${dir}/libLink" NEW_RPATH "old-should-not-exist")
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 6d72fac..9a1e027 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -28,6 +28,7 @@
\* CMP0081
\* CMP0083
\* CMP0095
+ \* CMP0099
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/TargetProperties/CMakeLists.txt b/Tests/RunCMake/TargetProperties/CMakeLists.txt
new file mode 100644
index 0000000..be9d403
--- /dev/null
+++ b/Tests/RunCMake/TargetProperties/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST})
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetProperties/Deprecation-stderr.txt b/Tests/RunCMake/TargetProperties/Deprecation-stderr.txt
new file mode 100644
index 0000000..11a4cd8
--- /dev/null
+++ b/Tests/RunCMake/TargetProperties/Deprecation-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Warning \(dev\) at Deprecation\.cmake:[0-9]+ \(target_link_libraries\):
+ The library that is being linked to, testLibDeprecation, is marked as being
+ deprecated by the owner\. The message provided by the developer is:
+
+ Deprecated version\. Please use latest version
+
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/TargetProperties/Deprecation.cmake b/Tests/RunCMake/TargetProperties/Deprecation.cmake
new file mode 100644
index 0000000..9361273
--- /dev/null
+++ b/Tests/RunCMake/TargetProperties/Deprecation.cmake
@@ -0,0 +1,5 @@
+add_library(testLibDeprecation STATIC empty.cpp)
+set_property(TARGET testLibDeprecation PROPERTY DEPRECATION "Deprecated version. Please use latest version")
+
+add_executable(testExe1 empty.cpp)
+target_link_libraries(testExe1 testLibDeprecation)
diff --git a/Tests/RunCMake/TargetProperties/RunCMakeTest.cmake b/Tests/RunCMake/TargetProperties/RunCMakeTest.cmake
new file mode 100644
index 0000000..5af31da
--- /dev/null
+++ b/Tests/RunCMake/TargetProperties/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(Deprecation)
diff --git a/Tests/RunCMake/TargetProperties/empty.cpp b/Tests/RunCMake/TargetProperties/empty.cpp
new file mode 100644
index 0000000..4086dcc
--- /dev/null
+++ b/Tests/RunCMake/TargetProperties/empty.cpp
@@ -0,0 +1,4 @@
+int empty()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
index bee8c4e..0d462ba 100644
--- a/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/TargetSources/RunCMakeTest.cmake
@@ -1,6 +1,6 @@
include(RunCMake)
-if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode")
+if(RunCMake_GENERATOR STREQUAL "Xcode")
run_cmake(ConfigNotAllowed)
endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake
index 32bb8e7..72cc2b9 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake
@@ -1,5 +1,5 @@
-set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
-set(unitybuild_c1 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_1.c")
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
+set(unitybuild_c1 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_1_c.c")
if(NOT EXISTS "${unitybuild_c0}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake
index c980df0..024286d 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(NOT EXISTS "${unitybuild_c}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} does not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake
index 32c2992..269d545 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake
@@ -1,10 +1,10 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(NOT EXISTS "${unitybuild_c}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} does not exist.")
return()
endif()
-set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.cxx")
+set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_cxx.cxx")
if(NOT EXISTS "${unitybuild_cxx}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_cxx} does not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake
index cb71ea3..22d2fc6 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(EXISTS "${unitybuild_c}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} should not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake
index 8fcb18f..e0935c7 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
file(STRINGS ${unitybuild_c} unitybuild_c_strings)
string(REGEX MATCH "#define NOMINMAX.*#include.*s1.c.*#undef NOMINMAX" matched_code ${unitybuild_c_strings})
if(NOT matched_code)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake
index 89a037a..9ef4c21 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.cxx")
+set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_cxx.cxx")
if(NOT EXISTS "${unitybuild_cxx}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_cxx} does not exist.")
return()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake
index 7dfc007..9d39a70 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
file(STRINGS ${unitybuild_c0} unitybuild_c_strings REGEX "/s[0-9]+.c\"$" )
list(LENGTH unitybuild_c_strings number_of_includes)
if(NOT number_of_includes EQUAL 8)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
index 533a89c..f26ec2e 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
file(STRINGS ${unitybuild_c} unitybuild_c_strings)
string(REGEX MATCH ".*#include.*s3.c.*#include.*s1.c.*#include.*s2.c.*" matched_code ${unitybuild_c_strings})
if(NOT matched_code)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
index fdd45bc..e94ad72 100644
--- a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
+++ b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
file(STRINGS ${unitybuild_c} unitybuild_c_strings)
string(REGEX MATCH "\\/s[1-6].c" matched_files_1_6 ${unitybuild_c_strings})
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 44ccd6b..5cbe333 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -1,3 +1,5 @@
+cmake_policy(SET CMP0057 NEW)
+
include(RunCMake)
cmake_policy(SET CMP0054 NEW)
@@ -15,6 +17,7 @@ run_cmake(VsDebuggerCommand)
run_cmake(VsDebuggerCommandArguments)
run_cmake(VsDebuggerEnvironment)
run_cmake(VsCSharpCustomTags)
+run_cmake(VsCSharpDocumentationFile)
run_cmake(VsCSharpReferenceProps)
run_cmake(VsCSharpWithoutSources)
run_cmake(VsCSharpDeployFiles)
@@ -28,6 +31,12 @@ run_cmake(VsDpiAwareBadParam)
run_cmake(VsPrecompileHeaders)
run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
+run_cmake(VsWinRTByDefault)
+
+set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=$(VCTargetsPath)")
+run_cmake(VsVCTargetsPath)
+unset(RunCMake_GENERATOR_TOOLSET)
+
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
run_cmake(VsJustMyCode)
endif()
diff --git a/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake
index 87f247d..693dcd9 100644
--- a/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake
+++ b/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(NOT EXISTS "${unitybuild_c0}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
return()
@@ -32,7 +32,7 @@ if (NOT have_unity_support)
endif()
string(REPLACE "\\" "/" unity_source_line "${unity_source_line}")
-string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0.c" unity_source_file_position)
+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.")
return()
diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
index 1c6bab8..17e7b46 100644
--- a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
+++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
@@ -1,4 +1,4 @@
-set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0_c.c")
if(NOT EXISTS "${unitybuild_c0}")
set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
return()
@@ -28,7 +28,7 @@ foreach(line IN LISTS tgt_projects_strings)
endforeach()
string(REPLACE "\\" "/" unity_source_line ${unity_source_line})
-string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0.c" unity_source_file_position)
+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.")
return()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
new file mode 100644
index 0000000..0393362
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile-check.cmake
@@ -0,0 +1,26 @@
+#
+# Check C# VS project for required elements
+#
+set(csProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.csproj")
+if(NOT EXISTS "${csProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${csProjectFile} does not exist.")
+ return()
+endif()
+
+file(STRINGS "${csProjectFile}" lines)
+
+set(HAVE_DocumentationFile 0)
+foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<DocumentationFile>([^<>]+)</DocumentationFile>")
+ if(HAVE_DocumentationFile)
+ set(RunCMake_TEST_FAILED "Documentation node has been generated more than once for\n ${csProjectFile}")
+ return()
+ endif()
+ set(HAVE_DocumentationFile 1)
+ endif()
+endforeach()
+
+if(NOT HAVE_DocumentationFile)
+ set(RunCMake_TEST_FAILED "Documentation node has not been generated for\n ${csProjectFile}")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake
new file mode 100644
index 0000000..83b6b97
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsCSharpDocumentationFile.cmake
@@ -0,0 +1,8 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(CSharp)
+
+add_library(foo SHARED
+ foo.cs)
+
+set_target_properties(foo PROPERTIES
+ VS_DOTNET_DOCUMENTATION_FILE foo.xml)
diff --git a/Tests/RunCMake/VS10Project/VsGlobals-check.cmake b/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
index 0e7fd45..6a30099 100644
--- a/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsGlobals-check.cmake
@@ -1,44 +1,65 @@
-set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
-if(NOT EXISTS "${vcProjectFile}")
- set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
- return()
-endif()
+macro(check_project_file projectFile)
+ if(NOT EXISTS "${projectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${projectFile} does not exist.")
+ return()
+ endif()
+
+ string(REPLACE "${RunCMake_TEST_BINARY_DIR}/" "" projectName ${projectFile})
-set(InsideGlobals FALSE)
-set(DefaultLanguageSet FALSE)
-set(MinimumVisualStudioVersionSet FALSE)
+ set(InsideGlobals FALSE)
+ set(DefaultLanguageSet FALSE)
+ set(MinimumVisualStudioVersionSet FALSE)
+ set(TestPropertySet FALSE)
-file(STRINGS "${vcProjectFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "^ *<PropertyGroup Label=\"Globals\"> *$")
- set(InsideGlobals TRUE)
- elseif(line MATCHES "^ *<DefaultLanguage>([a-zA-Z\\-]+)</DefaultLanguage> *$")
- if("${CMAKE_MATCH_1}" STREQUAL "en-US")
- if(InsideGlobals)
- message(STATUS "foo.vcxproj has correct DefaultLanguage global property")
- set(DefaultLanguageSet TRUE)
- else()
- message(STATUS "DefaultLanguage is set but not within \"Globals\" property group")
+ file(STRINGS "${projectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<PropertyGroup Label=\"Globals\"> *$")
+ set(InsideGlobals TRUE)
+ elseif(line MATCHES "^ *<DefaultLanguage>([a-zA-Z\\-]+)</DefaultLanguage> *$")
+ if("${CMAKE_MATCH_1}" STREQUAL "en-US")
+ if(InsideGlobals)
+ message(STATUS "${projectName} has correct DefaultLanguage global property")
+ set(DefaultLanguageSet TRUE)
+ else()
+ message(STATUS "DefaultLanguage is set but not within \"Globals\" property group")
+ endif()
endif()
- endif()
- elseif(line MATCHES "^ *<MinimumVisualStudioVersion>([0-9\\.]+)</MinimumVisualStudioVersion> *$")
- if("${CMAKE_MATCH_1}" STREQUAL "14.0")
- if(InsideGlobals)
- message(STATUS "foo.vcxproj has correct MinimumVisualStudioVersion global property")
- set(MinimumVisualStudioVersionSet TRUE)
- else()
- message(STATUS "MinimumVisualStudioVersion is set but not within \"Globals\" property group")
+ elseif(line MATCHES "^ *<MinimumVisualStudioVersion>([0-9\\.]+)</MinimumVisualStudioVersion> *$")
+ if("${CMAKE_MATCH_1}" STREQUAL "10.0")
+ if(InsideGlobals)
+ message(STATUS "${projectName} has correct MinimumVisualStudioVersion global property")
+ set(MinimumVisualStudioVersionSet TRUE)
+ else()
+ message(STATUS "MinimumVisualStudioVersion is set but not within \"Globals\" property group")
+ endif()
+ endif()
+ elseif(line MATCHES "^ *<TestProperty>(.+)</TestProperty> *$")
+ if("${CMAKE_MATCH_1}" STREQUAL "TestValue")
+ if(InsideGlobals)
+ message(STATUS "${projectName} has correct TestProperty global property")
+ set(TestPropertySet TRUE)
+ else()
+ message(STATUS "TestProperty is set but not within \"Globals\" property group")
+ endif()
endif()
endif()
+ endforeach()
+
+ if(NOT DefaultLanguageSet)
+ set(RunCMake_TEST_FAILED "DefaultLanguage not found or not set correctly in ${projectName}.")
+ return()
+ endif()
+
+ if(NOT MinimumVisualStudioVersionSet)
+ set(RunCMake_TEST_FAILED "MinimumVisualStudioVersion not found or not set correctly in ${projectName}.")
+ return()
endif()
-endforeach()
-if(NOT DefaultLanguageSet)
- set(RunCMake_TEST_FAILED "DefaultLanguageSet not found or not set correctly.")
- return()
-endif()
+ if(NOT TestPropertySet)
+ set(RunCMake_TEST_FAILED "TestProperty not found or not set correctly in ${projectName}.")
+ return()
+ endif()
+endmacro()
-if(NOT MinimumVisualStudioVersionSet)
- set(RunCMake_TEST_FAILED "MinimumVisualStudioVersionSet not found or not set correctly.")
- return()
-endif()
+check_project_file("${RunCMake_TEST_BINARY_DIR}/CMakeFiles/${CMAKE_VERSION}/CompilerIdCXX/CompilerIdCXX.vcxproj")
+check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
diff --git a/Tests/RunCMake/VS10Project/VsGlobals.cmake b/Tests/RunCMake/VS10Project/VsGlobals.cmake
index a3ed5af..09d806d 100644
--- a/Tests/RunCMake/VS10Project/VsGlobals.cmake
+++ b/Tests/RunCMake/VS10Project/VsGlobals.cmake
@@ -1,8 +1,9 @@
-enable_language(CXX)
-
set(CMAKE_VS_GLOBALS
"DefaultLanguage=en-US"
- "MinimumVisualStudioVersion=14.0"
+ "MinimumVisualStudioVersion=10.0"
+ "TestProperty=TestValue"
)
+enable_language(CXX)
+
add_library(foo foo.cpp)
diff --git a/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake b/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake
new file mode 100644
index 0000000..5b1701c
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsVCTargetsPath-check.cmake
@@ -0,0 +1,32 @@
+macro(check_project_file projectFile)
+ set(insideGlobals FALSE)
+ set(pathFound 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 Label=\"Globals\">.*$")
+ set(insideGlobals TRUE)
+ elseif(insideGlobals)
+ if(line MATCHES "^ *</PropertyGroup>.*$")
+ set(insideGlobals FALSE)
+ elseif(line MATCHES "^ *<VCTargetsPath>(.+)</VCTargetsPath>*$")
+ message(STATUS "Found VCTargetsPath = ${CMAKE_MATCH_1} in PropertyGroup 'Globals' in ${projectName}")
+ set(pathFound TRUE)
+ endif()
+ endif()
+ endforeach()
+ if(NOT pathFound)
+ set(RunCMake_TEST_FAILED "VCTargetsPath not found in \"Globals\" 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")
+check_project_file("${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
diff --git a/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake b/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake
new file mode 100644
index 0000000..6a6088f
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsVCTargetsPath.cmake
@@ -0,0 +1,3 @@
+enable_language(CXX)
+
+add_library(foo foo.cpp)
diff --git a/Tests/RunCMake/VS10Project/VsWinRTByDefault-check.cmake b/Tests/RunCMake/VS10Project/VsWinRTByDefault-check.cmake
new file mode 100644
index 0000000..15bbaf2
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsWinRTByDefault-check.cmake
@@ -0,0 +1,66 @@
+macro(checkCompileAsWinRT projectPath)
+ if(RunCMake_TEST_FAILED)
+ return()
+ endif()
+
+ if (NOT EXISTS "${projectPath}")
+ set(RunCMake_TEST_FAILED "Project file ${projectPath} does not exist.")
+ return()
+ endif()
+
+ get_filename_component(projectName "${projectPath}" NAME_WE)
+
+ cmake_parse_arguments("" "" "GLOBAL" "OVERRIDES_ENABLE;OVERRIDES_DISABLE" ${ARGN})
+
+ unset(sourceOverride)
+
+ file(STRINGS "${projectPath}" lines)
+ set(foundGlobalWinRT false)
+
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<CompileAsWinRT( Condition=\"[^\\\"]+\")?>(true|false)</CompileAsWinRT>$")
+ set(value ${CMAKE_MATCH_2})
+
+ if(sourceOverride)
+ set(expectedList)
+
+ if(value)
+ set(expectedList _OVERRIDES_ENABLE)
+ else()
+ set(expectedList _OVERRIDES_DISABLE)
+ endif()
+
+ if(NOT sourceOverride IN_LIST ${expectedList})
+ set(RunCMake_TEST_FAILED
+ "${projectName}: Unexpected CompileAsWinRT override ${value} for ${sourceOverride}")
+ return()
+ endif()
+ else()
+ if (NOT _GLOBAL STREQUAL value)
+ set(RunCMake_TEST_FAILED
+ "${projectName}: Global CompileAsWinRT value is ${value}, but expected ${_GLOBAL}")
+ return()
+ endif()
+
+ set(foundGlobalWinRT true)
+ endif()
+ elseif(line MATCHES "^ *<ClCompile Include=\"([^\"]+)\">$")
+ get_filename_component(sourceOverride "${CMAKE_MATCH_1}" NAME)
+ elseif(line MATCHES "^ *</ClCompile>$")
+ unset(sourceOverride)
+ endif()
+ endforeach()
+
+ if(NOT foundGlobalWinRT AND DEFINED _GLOBAL)
+ set(RunCMake_TEST_FAILED "${projectName}: Global CompileAsWinRT not found or have invalid value, but expected")
+ return()
+ endif()
+endmacro()
+
+checkCompileAsWinRT("${RunCMake_TEST_BINARY_DIR}/noFlagOnlyC.vcxproj" GLOBAL false)
+checkCompileAsWinRT("${RunCMake_TEST_BINARY_DIR}/noFlagMixedCAndCxx.vcxproj" GLOBAL false)
+checkCompileAsWinRT("${RunCMake_TEST_BINARY_DIR}/noFlagOnlyCxx.vcxproj" GLOBAL false)
+
+checkCompileAsWinRT("${RunCMake_TEST_BINARY_DIR}/flagOnlyC.vcxproj" GLOBAL true OVERRIDES_DISABLE empty.c)
+checkCompileAsWinRT("${RunCMake_TEST_BINARY_DIR}/flagMixedCAndCxx.vcxproj" GLOBAL true OVERRIDES_DISABLE empty.c)
+checkCompileAsWinRT("${RunCMake_TEST_BINARY_DIR}/flagOnlyCxx.vcxproj" GLOBAL true)
diff --git a/Tests/RunCMake/VS10Project/VsWinRTByDefault.cmake b/Tests/RunCMake/VS10Project/VsWinRTByDefault.cmake
new file mode 100644
index 0000000..139048b
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsWinRTByDefault.cmake
@@ -0,0 +1,16 @@
+set(CMAKE_VS_WINRT_BY_DEFAULT true)
+
+enable_language(C)
+enable_language(CXX)
+
+add_library(noFlagOnlyC empty.c)
+add_library(noFlagMixedCAndCXX empty.c foo.cpp)
+add_library(noFlagOnlyCXX foo.cpp)
+
+add_library(flagOnlyC empty.c)
+add_library(flagMixedCAndCXX empty.c foo.cpp)
+add_library(flagOnlyCXX foo.cpp)
+
+target_compile_options(flagOnlyC PRIVATE /ZW)
+target_compile_options(flagMixedCAndCXX PRIVATE /ZW)
+target_compile_options(flagOnlyCXX PRIVATE /ZW)
diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake
index 7d83a70..c742f50 100644
--- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty-check.cmake
@@ -45,6 +45,7 @@ check_property("ENVIRONMENT" [=[key="FOO"]=])
check_property("ENVIRONMENT" [=[value="foo"]=])
check_property("ENVIRONMENT" [=[key="BAR"]=])
check_property("ENVIRONMENT" [=[value="bar"]=])
+check_property("WORKING_DIRECTORY" [=["/working/dir"]=])
expect_no_schema("NoSchema")
diff --git a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake
index be219f4..ce5c0c9 100644
--- a/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeSchemaProperty.cmake
@@ -35,6 +35,7 @@ endfunction()
create_scheme_for_property(EXECUTABLE myExecutable)
create_scheme_for_property(ARGUMENTS "--foo;--bar=baz")
create_scheme_for_property(ENVIRONMENT "FOO=foo;BAR=bar")
+create_scheme_for_property(WORKING_DIRECTORY "/working/dir")
add_executable(NoSchema main.cpp)
set_target_properties(NoSchema PROPERTIES XCODE_GENERATE_SCHEME OFF)
diff --git a/Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake b/Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake
index 34dcc67..c77b43c 100644
--- a/Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake
+++ b/Tests/RunCMake/add_link_options/LINKER_expansion-list.cmake
@@ -11,7 +11,7 @@ string(REPLACE "${CMAKE_END_TEMP_FILE}" "" CMAKE_C_CREATE_SHARED_LIBRARY "${CMAK
add_library(example SHARED LinkOptionsLib.c)
# use LAUNCH facility to dump linker command
-set_property(TARGET example PROPERTY RULE_LAUNCH_LINK "\"${CMAKE_CURRENT_BINARY_DIR}/dump${CMAKE_EXECUTABLE_SUFFIX}\"")
+set_property(TARGET example PROPERTY RULE_LAUNCH_LINK "\"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/dump${CMAKE_EXECUTABLE_SUFFIX}\"")
add_dependencies (example dump)
diff --git a/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt
index 38566fb..206ab21 100644
--- a/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt
+++ b/Tests/RunCMake/ctest_labels_for_subprojects/CTestScriptVariableCommandLine-stderr.txt
@@ -1 +1,2 @@
-Unable to find executable:.*MyThirdPartyDependency/src/thirdparty
+Unable to find executable:.*MyThirdPartyDependency/src(/[^/
+]+)?/thirdparty
diff --git a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
index 6877e6a..84d1d66 100644
--- a/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_test/RunCMakeTest.cmake
@@ -1,6 +1,9 @@
include(RunCTest)
set(RunCMake_TEST_TIMEOUT 60)
+unset(ENV{CTEST_PARALLEL_LEVEL})
+unset(ENV{CTEST_OUTPUT_ON_FAILURE})
+
set(CASE_CTEST_TEST_ARGS "")
set(CASE_CTEST_TEST_LOAD "")
@@ -71,7 +74,24 @@ add_test(NAME PassingTest COMMAND ${CMAKE_COMMAND} -E echo PassingTestOutput)
add_test(NAME FailingTest COMMAND ${CMAKE_COMMAND} -E no_such_command)
]])
- unset(ENV{CTEST_PARALLEL_LEVEL})
run_ctest(TestOutputSize)
endfunction()
run_TestOutputSize()
+
+run_ctest_test(TestRepeatBad1 REPEAT UNKNOWN:3)
+run_ctest_test(TestRepeatBad2 REPEAT UNTIL_FAIL:-1)
+
+function(run_TestRepeat case)
+ set(CASE_CTEST_TEST_ARGS EXCLUDE RunCMakeVersion ${ARGN})
+ string(CONCAT CASE_CMAKELISTS_SUFFIX_CODE [[
+add_test(NAME testRepeat
+ COMMAND ${CMAKE_COMMAND} -D COUNT_FILE=${CMAKE_CURRENT_BINARY_DIR}/count.cmake
+ -P "]] "${RunCMake_SOURCE_DIR}/TestRepeat${case}" [[.cmake")
+set_property(TEST testRepeat PROPERTY TIMEOUT 5)
+ ]])
+
+ run_ctest(TestRepeat${case})
+endfunction()
+run_TestRepeat(UntilFail REPEAT UNTIL_FAIL:3)
+run_TestRepeat(UntilPass REPEAT UNTIL_PASS:3)
+run_TestRepeat(AfterTimeout REPEAT AFTER_TIMEOUT:3)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt
new file mode 100644
index 0000000..17657c5
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-stdout.txt
@@ -0,0 +1,10 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout-build
+ Start 1: testRepeat
+1/1 Test #1: testRepeat .......................\*\*\*Timeout +[0-9.]+ sec
+ Start 1: testRepeat
+ Test #1: testRepeat ....................... 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/TestRepeatAfterTimeout.cmake b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake
new file mode 100644
index 0000000..abde4f0
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatAfterTimeout.cmake
@@ -0,0 +1,10 @@
+include("${COUNT_FILE}" OPTIONAL)
+if(NOT COUNT)
+ set(COUNT 0)
+endif()
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n")
+if(NOT COUNT EQUAL 2)
+ message("this test times out except on the 2nd run")
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 10)
+endif()
diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt b/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatBad1-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt b/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt
new file mode 100644
index 0000000..37cffbf
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatBad1-stderr.txt
@@ -0,0 +1 @@
+Repeat option invalid value: UNKNOWN:3
diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt b/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt
new file mode 100644
index 0000000..b57e2de
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatBad2-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt b/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt
new file mode 100644
index 0000000..ca5cef7
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatBad2-stderr.txt
@@ -0,0 +1 @@
+Repeat option invalid value: UNTIL_FAIL:-1
diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt
new file mode 100644
index 0000000..5f91a67
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatUntilFail-stdout.txt
@@ -0,0 +1,13 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestRepeatUntilFail-build
+ Start 1: testRepeat
+ Test #1: testRepeat ....................... Passed +[0-9.]+ sec
+ Start 1: testRepeat
+ Test #1: testRepeat .......................\*\*\*Failed +[0-9.]+ sec
++
+0% tests passed, 1 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec
++
+The following tests FAILED:
+[ ]+1 - testRepeat \(Failed\)$
diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake b/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake
new file mode 100644
index 0000000..5eb0d8a
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatUntilFail.cmake
@@ -0,0 +1,9 @@
+include("${COUNT_FILE}" OPTIONAL)
+if(NOT COUNT)
+ set(COUNT 0)
+endif()
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n")
+if(COUNT EQUAL 2)
+ message(FATAL_ERROR "this test fails on the 2nd run")
+endif()
diff --git a/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt b/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt
new file mode 100644
index 0000000..bc6939a
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatUntilPass-stdout.txt
@@ -0,0 +1,10 @@
+Test project [^
+]*/Tests/RunCMake/ctest_test/TestRepeatUntilPass-build
+ Start 1: testRepeat
+1/1 Test #1: testRepeat .......................\*\*\*Failed +[0-9.]+ sec
+ Start 1: testRepeat
+ Test #1: testRepeat ....................... 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/TestRepeatUntilPass.cmake b/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake
new file mode 100644
index 0000000..0662522
--- /dev/null
+++ b/Tests/RunCMake/ctest_test/TestRepeatUntilPass.cmake
@@ -0,0 +1,9 @@
+include("${COUNT_FILE}" OPTIONAL)
+if(NOT COUNT)
+ set(COUNT 0)
+endif()
+math(EXPR COUNT "${COUNT} + 1")
+file(WRITE "${COUNT_FILE}" "set(COUNT ${COUNT})\n")
+if(NOT COUNT EQUAL 2)
+ message(FATAL_ERROR "this test passes only on the 2nd run")
+endif()
diff --git a/Tests/RunCMake/file/RunCMakeTest.cmake b/Tests/RunCMake/file/RunCMakeTest.cmake
index 5db4b3b..8d1b981 100644
--- a/Tests/RunCMake/file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/file/RunCMakeTest.cmake
@@ -69,7 +69,7 @@ if(NOT WIN32 OR CYGWIN)
run_cmake(INSTALL-FOLLOW_SYMLINK_CHAIN)
endif()
-if(RunCMake_GENERATOR STREQUAL "Ninja")
+if(RunCMake_GENERATOR MATCHES "Ninja")
# Detect ninja version so we know what tests can be supported.
execute_process(
COMMAND "${RunCMake_MAKE_PROGRAM}" --version
@@ -90,7 +90,7 @@ if(RunCMake_GENERATOR STREQUAL "Ninja")
endif()
endif()
-if(RunCMake_GENERATOR STREQUAL "Ninja" AND "${ninja_version}" VERSION_LESS 1.8)
+if(RunCMake_GENERATOR MATCHES "Ninja" AND "${ninja_version}" VERSION_LESS 1.8)
run_cmake(GLOB_RECURSE-warn-CONFIGURE_DEPENDS-ninja-version)
else()
run_cmake(GLOB-warn-CONFIGURE_DEPENDS-late)
diff --git a/Tests/RunCMake/find_file/PrefixInPATH-stderr.txt b/Tests/RunCMake/find_file/PrefixInPATH-stderr.txt
new file mode 100644
index 0000000..0d77571
--- /dev/null
+++ b/Tests/RunCMake/find_file/PrefixInPATH-stderr.txt
@@ -0,0 +1,13 @@
+ find_file called with the following settings:.*
+ VAR: PrefixInPATH_INCLUDE_DIR
+ NAMES: \"PrefixInPATH\.h\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_file considered the following locations:.*
+.*include/PrefixInPATH.*
diff --git a/Tests/RunCMake/find_file/PrefixInPATH.cmake b/Tests/RunCMake/find_file/PrefixInPATH.cmake
index 1e33c08..c334d89 100644
--- a/Tests/RunCMake/find_file/PrefixInPATH.cmake
+++ b/Tests/RunCMake/find_file/PrefixInPATH.cmake
@@ -1,4 +1,10 @@
set(ENV_PATH "$ENV{PATH}")
+
+set(CMAKE_FIND_DEBUG_MODE 1)
+set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/bin")
+find_file(PrefixInPATH_INCLUDE_DIR NAMES PrefixInPATH.h)
+set(CMAKE_FIND_DEBUG_MODE 0)
+
foreach(path "/does_not_exist" "" "/bin" "/sbin")
unset(PrefixInPATH_INCLUDE_DIR CACHE)
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
diff --git a/Tests/RunCMake/find_library/FromPATHEnv-stderr.txt b/Tests/RunCMake/find_library/FromPATHEnv-stderr.txt
new file mode 100644
index 0000000..a690eec
--- /dev/null
+++ b/Tests/RunCMake/find_library/FromPATHEnv-stderr.txt
@@ -0,0 +1,28 @@
+ find_library called with the following settings:.*
+ VAR: CREATED_LIBRARY
+ NAMES: \"created\"
+ \"created_no_exist\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 0
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_library considered the following locations:.*
+ The item was not found.*
+ find_library called with the following settings:.*
+ VAR: CREATED_LIBRARY
+ NAMES: \"created\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_library considered the following locations:.*
+ The item was found at.*
+.*lib/libcreated.a
diff --git a/Tests/RunCMake/find_library/FromPATHEnv.cmake b/Tests/RunCMake/find_library/FromPATHEnv.cmake
index fec041d..c24e640 100644
--- a/Tests/RunCMake/find_library/FromPATHEnv.cmake
+++ b/Tests/RunCMake/find_library/FromPATHEnv.cmake
@@ -4,6 +4,19 @@ set(ENV_PATH "$ENV{PATH}")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created")
+set(CMAKE_FIND_DEBUG_MODE 1)
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+
+set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}/lib")
+find_library(CREATED_LIBRARY NAMES created created_no_exist)
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+
+set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}/lib")
+find_library(CREATED_LIBRARY NAMES created)
+set(CMAKE_FIND_DEBUG_MODE 0)
+
+
foreach(path "/does_not_exist" "/lib" "")
unset(CREATED_LIBRARY CACHE)
set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}${path}")
diff --git a/Tests/RunCMake/find_library/PrefixInPATH-stderr.txt b/Tests/RunCMake/find_library/PrefixInPATH-stderr.txt
new file mode 100644
index 0000000..1d24c84
--- /dev/null
+++ b/Tests/RunCMake/find_library/PrefixInPATH-stderr.txt
@@ -0,0 +1,14 @@
+ find_library called with the following settings:.*
+ VAR: PrefixInPATH_LIBRARY
+ NAMES: \"PrefixInPATH\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_library considered the following locations:.*
+.*/does_not_exist.*
+ The item was not found
diff --git a/Tests/RunCMake/find_library/PrefixInPATH.cmake b/Tests/RunCMake/find_library/PrefixInPATH.cmake
index f1b8b18..e27d362 100644
--- a/Tests/RunCMake/find_library/PrefixInPATH.cmake
+++ b/Tests/RunCMake/find_library/PrefixInPATH.cmake
@@ -2,6 +2,12 @@ list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
set(ENV_PATH "$ENV{PATH}")
+
+set(CMAKE_FIND_DEBUG_MODE 1)
+set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist")
+find_library(PrefixInPATH_LIBRARY NAMES PrefixInPATH)
+set(CMAKE_FIND_DEBUG_MODE 0)
+
foreach(path "/does_not_exist" "" "/bin" "/sbin")
unset(PrefixInPATH_LIBRARY CACHE)
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
diff --git a/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt
new file mode 100644
index 0000000..b35f05e
--- /dev/null
+++ b/Tests/RunCMake/find_package/FromPATHEnv-stderr.txt
@@ -0,0 +1,20 @@
+CMake Debug Log at FromPATHEnv.cmake:5 \(find_package\):
+ find_package considered the following paths for Resolved.cmake.*
+.*/Modules/FindResolved.cmake.*
+ The file was not found.*
+ <PackageName>_ROOT CMake variable.*
+ CMAKE_PREFIX_PATH variable.*
+ CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables.*
+ Env variable Resolved_DIR.*
+ CMAKE_PREFIX_PATH env variable.*
+ Paths specified by the find_package HINTS option.*
+ Standard system environment variables.*
+.*Tests/RunCMake/find_package/PackageRoot.*
+ CMake User Package Registry.*
+ CMake variables defined in the Platform file.*
+ CMake System Package Registry.*
+ Paths specified by the find_package PATHS option.*
+ find_package considered the following locations for the Config module:.*
+.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake.*
+ The file was found at.*
+.*Tests/RunCMake/find_package/PackageRoot/ResolvedConfig\.cmake
diff --git a/Tests/RunCMake/find_package/FromPATHEnv.cmake b/Tests/RunCMake/find_package/FromPATHEnv.cmake
index 4822b13..ceb79b6 100644
--- a/Tests/RunCMake/find_package/FromPATHEnv.cmake
+++ b/Tests/RunCMake/find_package/FromPATHEnv.cmake
@@ -1,4 +1,10 @@
set(ENV_PATH "$ENV{PATH}")
+
+set(CMAKE_FIND_DEBUG_MODE ON)
+set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/PackageRoot")
+find_package(Resolved QUIET)
+set(CMAKE_FIND_DEBUG_MODE OFF)
+
foreach(path "/does_not_exist" "/PackageRoot" "")
unset(Resolved_FOUND CACHE)
set(Resolved_DIR "")
diff --git a/Tests/RunCMake/find_package/MissingConfigDebug-stderr.txt b/Tests/RunCMake/find_package/MissingConfigDebug-stderr.txt
new file mode 100644
index 0000000..379bf7a
--- /dev/null
+++ b/Tests/RunCMake/find_package/MissingConfigDebug-stderr.txt
@@ -0,0 +1,18 @@
+ <PackageName>_ROOT CMake variable.*
+ CMAKE_PREFIX_PATH variable.*
+ CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables.*
+ Env variable NotHere_DIR.*
+ CMAKE_PREFIX_PATH env variable.*
+ Standard system environment variables.*
+ CMake User Package Registry.*
+ CMake variables defined in the Platform file.*
+ CMake System Package Registry.*
+ Paths specified by the find_package PATHS option.*
+.*
+ .*NotHereConfig.cmake
+ .*nothere-config.cmake
+.*
+CMake Warning at MissingConfigDebug.cmake:3 \(message\):
+ This warning must be reachable.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/find_package/MissingConfigDebug.cmake b/Tests/RunCMake/find_package/MissingConfigDebug.cmake
new file mode 100644
index 0000000..4e3bb22
--- /dev/null
+++ b/Tests/RunCMake/find_package/MissingConfigDebug.cmake
@@ -0,0 +1,4 @@
+set(CMAKE_FIND_DEBUG_MODE ON)
+find_package(NotHere CONFIG)
+message(WARNING "This warning must be reachable.")
+set(CMAKE_FIND_DEBUG_MODE OFF)
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake
index 208f83c..5186297 100644
--- a/Tests/RunCMake/find_package/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake
@@ -13,6 +13,7 @@ run_cmake(MissingNormalWarnNoModuleNew)
run_cmake(MissingModule)
run_cmake(MissingModuleRequired)
run_cmake(MissingConfig)
+run_cmake(MissingConfigDebug)
run_cmake(MissingConfigOneName)
run_cmake(MissingConfigRequired)
run_cmake(MissingConfigVersion)
diff --git a/Tests/RunCMake/find_path/FromPATHEnv-stderr.txt b/Tests/RunCMake/find_path/FromPATHEnv-stderr.txt
new file mode 100644
index 0000000..088efd5
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnv-stderr.txt
@@ -0,0 +1,27 @@
+ find_path called with the following settings:.*
+ VAR: PATH_IN_ENV_PATH
+ NAMES: \"PrefixInPATH\.h\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 0
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_path considered the following locations:.*
+ The item was not found.*
+ find_path called with the following settings:.*
+ VAR: PATH_IN_ENV_PATH
+ NAMES: \"PrefixInPATH\.h\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_path considered the following locations:.*
+ The item was found at.*
+.*include/PrefixInPATH.*
diff --git a/Tests/RunCMake/find_path/FromPATHEnv.cmake b/Tests/RunCMake/find_path/FromPATHEnv.cmake
index af13d09..535e624 100644
--- a/Tests/RunCMake/find_path/FromPATHEnv.cmake
+++ b/Tests/RunCMake/find_path/FromPATHEnv.cmake
@@ -1,4 +1,16 @@
set(ENV_PATH "$ENV{PATH}")
+
+set(CMAKE_FIND_DEBUG_MODE 1)
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+
+set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}/include")
+find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h)
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h)
+
+set(CMAKE_FIND_DEBUG_MODE 0)
+
foreach(path "/does_not_exist" "/include" "")
unset(PATH_IN_ENV_PATH CACHE)
set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
diff --git a/Tests/RunCMake/find_program/EnvAndHints-stderr.txt b/Tests/RunCMake/find_program/EnvAndHints-stderr.txt
new file mode 100644
index 0000000..8951345
--- /dev/null
+++ b/Tests/RunCMake/find_program/EnvAndHints-stderr.txt
@@ -0,0 +1,28 @@
+ find_program called with the following settings:.*
+ VAR: PROG
+ NAMES: \"testAandB\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_program considered the following locations:.*
+ The item was found at.*
+.*testAandB
+.*
+ find_program called with the following settings:.*
+ VAR: PROG
+ NAMES: \"testAandB\"
+ Documentation.*
+ Framework.*
+ AppBundle.*
+ CMAKE_FIND_USE_CMAKE_PATH: 1
+ CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: 1
+ CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: 0
+ CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: 1
+
+ find_program considered the following locations:.*
+ The item was not found.*
diff --git a/Tests/RunCMake/find_program/EnvAndHints.cmake b/Tests/RunCMake/find_program/EnvAndHints.cmake
index 0f12eff..beed873 100644
--- a/Tests/RunCMake/find_program/EnvAndHints.cmake
+++ b/Tests/RunCMake/find_program/EnvAndHints.cmake
@@ -1,4 +1,5 @@
+set(CMAKE_FIND_DEBUG_MODE 1)
set(ENV_PATH "$ENV{PATH}")
set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/A)
find_program(PROG
@@ -13,6 +14,7 @@ find_program(PROG
)
message(STATUS "PROG='${PROG}'")
unset(PROG CACHE)
+set(CMAKE_FIND_DEBUG_MODE 0)
find_program(PROG
NAMES testAandB
diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake
index 4b74cfe..8f50203 100644
--- a/Tests/RunCMake/foreach/RunCMakeTest.cmake
+++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake
@@ -1,3 +1,14 @@
include(RunCMake)
run_cmake(BadRangeInFunction)
+run_cmake(foreach-all-test)
+run_cmake(foreach-ITEMS-multiple-iter-vars-test)
+run_cmake(foreach-LISTS-multiple-iter-vars-test)
+run_cmake(foreach-ZIP_LISTS-test)
+run_cmake(foreach-ITEMS-with-ZIP_LISTS-mix-test)
+run_cmake(foreach-LISTS-with-ZIP_LISTS-mix-test)
+run_cmake(foreach-ZIP_LISTS-with-ITEMS-mix-test)
+run_cmake(foreach-ZIP_LISTS-with-LISTS-mix-test)
+run_cmake(foreach-ZIP_LISTS-multiple-iter-vars-test)
+run_cmake(foreach-ZIP_LISTS-iter-vars-mismatch-test-1)
+run_cmake(foreach-ZIP_LISTS-iter-vars-mismatch-test-2)
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-result.txt b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-stderr.txt b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-stderr.txt
new file mode 100644
index 0000000..d174bb1
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ITEMS-multiple-iter-vars-test.cmake:1 \(foreach\):
+ ITEMS or LISTS require exactly one iteration variable
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test.cmake b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test.cmake
new file mode 100644
index 0000000..55d33a8
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-multiple-iter-vars-test.cmake
@@ -0,0 +1,2 @@
+foreach(one two IN ITEMS one two)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-result.txt b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-stderr.txt b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-stderr.txt
new file mode 100644
index 0000000..f7d5ae7
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake:1 \(foreach\):
+ ZIP_LISTS can not be used with LISTS or ITEMS
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake
new file mode 100644
index 0000000..28099a0
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ITEMS-with-ZIP_LISTS-mix-test.cmake
@@ -0,0 +1,2 @@
+foreach(i IN ITEMS one two three ZIP_LISTS blah)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-result.txt b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-stderr.txt b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-stderr.txt
new file mode 100644
index 0000000..f2f83c2
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-LISTS-multiple-iter-vars-test.cmake:1 \(foreach\):
+ ITEMS or LISTS require exactly one iteration variable
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test.cmake b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test.cmake
new file mode 100644
index 0000000..78f3847
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-multiple-iter-vars-test.cmake
@@ -0,0 +1,2 @@
+foreach(one two IN LISTS one two)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-result.txt b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-stderr.txt b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-stderr.txt
new file mode 100644
index 0000000..42f8d1e
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-LISTS-with-ZIP_LISTS-mix-test.cmake:1 \(foreach\):
+ ZIP_LISTS can not be used with LISTS or ITEMS
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test.cmake b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test.cmake
new file mode 100644
index 0000000..8a919dd
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-LISTS-with-ZIP_LISTS-mix-test.cmake
@@ -0,0 +1,2 @@
+foreach(i IN LISTS one two three ZIP_LISTS blah)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-result.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-stderr.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-stderr.txt
new file mode 100644
index 0000000..fa51e46
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake:1 \(foreach\):
+ Expected 3 list variables, but given 4
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake
new file mode 100644
index 0000000..458b6ca
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-1.cmake
@@ -0,0 +1,2 @@
+foreach(less than lists IN ZIP_LISTS list_1 list_2 list_3 list_4)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-result.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-stderr.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-stderr.txt
new file mode 100644
index 0000000..7b6b484
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake:1 \(foreach\):
+ Expected 3 list variables, but given 2
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake
new file mode 100644
index 0000000..d24d99c
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-iter-vars-mismatch-test-2.cmake
@@ -0,0 +1,2 @@
+foreach(greater than lists IN ZIP_LISTS list_1 list_2)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test-stdout.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test-stdout.txt
new file mode 100644
index 0000000..e009d15
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test-stdout.txt
@@ -0,0 +1,6 @@
+-- foreach\(\.\.\. IN ZIP_LISTS\):
+-- Begin output
+-- | one, satu, raz
+-- | two, dua, dva
+-- | three, tiga, tri
+-- End output
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake
new file mode 100644
index 0000000..9647dea
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-multiple-iter-vars-test.cmake
@@ -0,0 +1,42 @@
+function(foreachTest result list_var_1 list_var_2 list_var_3)
+ set(_options MUTE)
+ set(_one_value_args)
+ set(_multi_value_args)
+ cmake_parse_arguments(PARSE_ARGV 3 _arg "${_options}" "${_one_value_args}" "${_multi_value_args}")
+
+ set(_has_any_output FALSE)
+ list(APPEND CMAKE_MESSAGE_INDENT "| ")
+ foreach(first second third IN ZIP_LISTS ${list_var_1} ${list_var_2} ${list_var_3})
+ if(NOT first)
+ set(first "[undefiend]")
+ endif()
+ if(NOT second)
+ set(second "[undefiend]")
+ endif()
+ if(NOT third)
+ set(third "[undefiend]")
+ endif()
+ if(NOT _arg_MUTE)
+ message(STATUS "${first}, ${second}, ${third}")
+ endif()
+ set(_has_any_output TRUE)
+ endforeach()
+ set(${result} ${_has_any_output} PARENT_SCOPE)
+endfunction()
+
+function(foreachTestDecorated list_var_1 list_var_2 list_var_3)
+ list(APPEND CMAKE_MESSAGE_INDENT " ")
+ message(STATUS "Begin output")
+ foreachTest(_has_any_output ${list_var_1} ${list_var_2} ${list_var_3})
+ if(NOT _has_any_output)
+ message(STATUS "--> empty-output <--")
+ endif()
+ message(STATUS "End output")
+endfunction()
+
+list(APPEND english one two three)
+list(APPEND bahasa satu dua tiga)
+list(APPEND russian raz dva tri)
+
+message(STATUS "foreach(... IN ZIP_LISTS):")
+foreachTestDecorated(english bahasa russian)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt
new file mode 100644
index 0000000..25433fd
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test-stdout.txt
@@ -0,0 +1,19 @@
+-- foreach\(IN ZIP_LISTS\):
+-- <<< empty lists case >>>
+-- Begin output
+-- --> empty-output <--
+-- End output
+-- <<< same lengths lists case >>>
+-- Begin output
+-- | one, satu, raz
+-- | two, dua, dva
+-- | three, tiga, tri
+-- End output
+-- <<< different lengths lists case >>>
+-- Begin output
+-- | one, satu, raz
+-- | two, dua, dva
+-- | three, tiga, tri
+-- | \[undefiend\], empat, \[undefiend\]
+-- End output
+-- <<< test variable value restored -- PASSED >>>
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake
new file mode 100644
index 0000000..56cfe64
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-test.cmake
@@ -0,0 +1,68 @@
+function(foreachTest result list_var_1 list_var_2 list_var_3)
+ set(_options MUTE)
+ set(_one_value_args)
+ set(_multi_value_args)
+ cmake_parse_arguments(PARSE_ARGV 3 _arg "${_options}" "${_one_value_args}" "${_multi_value_args}")
+
+ set(_has_any_output FALSE)
+ list(APPEND CMAKE_MESSAGE_INDENT "| ")
+ foreach(num IN ZIP_LISTS ${list_var_1} ${list_var_2} ${list_var_3})
+ foreach(i RANGE 2)
+ if(NOT num_${i})
+ set(num_${i} "[undefiend]")
+ endif()
+ endforeach()
+ if(NOT _arg_MUTE)
+ message(STATUS "${num_0}, ${num_1}, ${num_2}")
+ endif()
+ set(_has_any_output TRUE)
+ endforeach()
+ set(${result} ${_has_any_output} PARENT_SCOPE)
+endfunction()
+
+function(foreachTestDecorated list_var_1 list_var_2 list_var_3)
+ list(APPEND CMAKE_MESSAGE_INDENT " ")
+ message(STATUS "Begin output")
+ foreachTest(_has_any_output ${list_var_1} ${list_var_2} ${list_var_3})
+ if(NOT _has_any_output)
+ message(STATUS "--> empty-output <--")
+ endif()
+ message(STATUS "End output")
+endfunction()
+
+message(STATUS "foreach(IN ZIP_LISTS):")
+list(APPEND CMAKE_MESSAGE_INDENT " ")
+
+set(english)
+set(bahasa)
+set(russian)
+
+message(STATUS "<<< empty lists case >>>")
+foreachTestDecorated(english bahasa russian)
+
+list(APPEND english one two three)
+list(APPEND bahasa satu dua tiga)
+list(APPEND russian raz dva tri)
+
+message(STATUS "<<< same lengths lists case >>>")
+foreachTestDecorated(english bahasa russian)
+
+list(APPEND bahasa empat)
+
+message(STATUS "<<< different lengths lists case >>>")
+foreachTestDecorated(english bahasa russian)
+
+set(num_0 "old-0")
+set(num_1 "old-1")
+set(num_2 "old-2")
+foreachTest(_ english bahasa russian MUTE)
+set(check PASSED)
+foreach(i RANGE 2)
+ if(NOT "${num_${i}}" STREQUAL "old-${i}")
+ message(SEND_ERROR "num_${i} value is corrupted")
+ set(check FAILED)
+ endif()
+endforeach()
+message(STATUS "<<< test variable value restored -- ${check} >>>")
+
+list(POP_BACK CMAKE_MESSAGE_INDENT)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-result.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-stderr.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-stderr.txt
new file mode 100644
index 0000000..0dcab01
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake:1 \(foreach\):
+ ZIP_LISTS can not be used with LISTS or ITEMS
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake
new file mode 100644
index 0000000..71ed842
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-ITEMS-mix-test.cmake
@@ -0,0 +1,2 @@
+foreach(i IN ZIP_LISTS blah ITEMS blah)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-result.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-stderr.txt b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-stderr.txt
new file mode 100644
index 0000000..a6b6e9c
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at foreach-ZIP_LISTS-with-LISTS-mix-test.cmake:1 \(foreach\):
+ ZIP_LISTS can not be used with LISTS or ITEMS
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test.cmake b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test.cmake
new file mode 100644
index 0000000..11a97b2
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-ZIP_LISTS-with-LISTS-mix-test.cmake
@@ -0,0 +1,2 @@
+foreach(i IN ZIP_LISTS blah LISTS blah)
+endforeach()
diff --git a/Tests/RunCMake/foreach/foreach-all-test-stdout.txt b/Tests/RunCMake/foreach/foreach-all-test-stdout.txt
new file mode 100644
index 0000000..e8f622d
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-all-test-stdout.txt
@@ -0,0 +1,44 @@
+-- foreach\(RANGE\):
+-- \[0\.\.1\]/1
+-- < 0
+-- < 1
+-- \[1\.\.1\]/1
+-- < 1
+-- \[0\.\.10\]/2
+-- < 0
+-- < 2
+-- < 4
+-- < 6
+-- < 8
+-- < 10
+-- \[-10\.\.0\]/3
+-- < -10
+-- < -7
+-- < -4
+-- < -1
+-- \[0\.\.-10\]/-5
+-- < 0
+-- < -5
+-- < -10
+-- foreach\(IN ITEMS\):
+-- < one
+-- < two
+-- < three
+-- foreach\(IN LISTS\):
+-- < satu
+-- < dua
+-- < tiga
+-- foreach\(IN LISTS and ITEMS\):
+-- < satu
+-- < dua
+-- < tiga
+-- < one
+-- < two
+-- < three
+-- foreach\(IN ITEMS and LISTS\):
+-- < one
+-- < two
+-- < three
+-- < satu
+-- < dua
+-- < tiga
diff --git a/Tests/RunCMake/foreach/foreach-all-test.cmake b/Tests/RunCMake/foreach/foreach-all-test.cmake
new file mode 100644
index 0000000..2e377c8
--- /dev/null
+++ b/Tests/RunCMake/foreach/foreach-all-test.cmake
@@ -0,0 +1,67 @@
+message(STATUS "foreach(RANGE):")
+list(APPEND CMAKE_MESSAGE_INDENT " ")
+
+message(STATUS "[0..1]/1")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE 1)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[1..1]/1")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE 1 1)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[0..10]/2")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE 0 10 2)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[-10..0]/3")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE -10 0 3)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "[0..-10]/-5")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i RANGE 0 -10 -5)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN ITEMS):")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i IN ITEMS one two three)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN LISTS):")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+list(APPEND count satu dua tiga)
+foreach(i IN LISTS count)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN LISTS and ITEMS):")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i IN LISTS count ITEMS one two three)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
+
+message(STATUS "foreach(IN ITEMS and LISTS):")
+list(APPEND CMAKE_MESSAGE_INDENT " < ")
+foreach(i IN ITEMS one two three LISTS count)
+ message(STATUS ${i})
+endforeach()
+list(POP_BACK CMAKE_MESSAGE_INDENT)
diff --git a/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION-stdout.txt b/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION-stdout.txt
new file mode 100644
index 0000000..5ebc89a
--- /dev/null
+++ b/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION-stdout.txt
@@ -0,0 +1,7 @@
+function\(print_self\)
+ file\(STRINGS "\${CMAKE_CURRENT_FUNCTION_LIST_FILE}" _lines\)
+ math\(EXPR _begin "\${CMAKE_CURRENT_FUNCTION_LIST_LINE} - 1"\)
+ list\(SUBLIST _lines \${_begin} 7 _lines\) # This function has 7 lines only
+ list\(JOIN _lines "\\n" _lines\)
+ message\(STATUS "Print the `\${CMAKE_CURRENT_FUNCTION}` function:\\n\${_lines}"\)
+endfunction\(\)
diff --git a/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake b/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake
new file mode 100644
index 0000000..38c032f
--- /dev/null
+++ b/Tests/RunCMake/function/CMAKE_CURRENT_FUNCTION.cmake
@@ -0,0 +1,94 @@
+set(_THIS_FILE "${CMAKE_CURRENT_LIST_FILE}")
+set(_THIS_DIR "${CMAKE_CURRENT_LIST_DIR}")
+
+if(CMAKE_CURRENT_FUNCTION)
+ message(SEND_ERROR "`CMAKE_CURRENT_FUNCTION` is not expected to be set here")
+endif()
+if(CMAKE_CURRENT_FUNCTION_LIST_FILE)
+ message(SEND_ERROR "`CMAKE_CURRENT_FUNCTION_LIST_FILE` is not expected to be set here")
+endif()
+if(CMAKE_CURRENT_FUNCTION_LIST_DIR)
+ message(SEND_ERROR "`CMAKE_CURRENT_FUNCTION_LIST_DIR` is not expected to be set here")
+endif()
+if(CMAKE_CURRENT_FUNCTION_LIST_LINE)
+ message(SEND_ERROR "`CMAKE_CURRENT_FUNCTION_LIST_LINE` is not expected to be set here")
+endif()
+
+function(bar)
+ if(NOT CMAKE_CURRENT_FUNCTION STREQUAL "bar")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_FILE MATCHES "^.*/CMAKE_CURRENT_FUNCTION.cmake$")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_FILE`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_FILE STREQUAL _THIS_FILE)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_FILE`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_DIR MATCHES "^.*/Tests/RunCMake/function$")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_DIR`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_DIR STREQUAL _THIS_DIR)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_DIR`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_LINE EQUAL 17)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_LINE`")
+ endif()
+endfunction()
+
+function(foo)
+ if(NOT CMAKE_CURRENT_FUNCTION STREQUAL "foo")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_FILE MATCHES "^.*/function/CMAKE_CURRENT_FUNCTION.cmake$")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_FILE`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_FILE STREQUAL _THIS_FILE)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_FILE`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_DIR MATCHES "^.*/Tests/RunCMake/function$")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_DIR`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_LINE EQUAL 38)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_LINE`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_DIR STREQUAL _THIS_DIR)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_DIR`")
+ endif()
+ bar()
+endfunction()
+
+foo()
+
+if(CMAKE_CURRENT_FUNCTION)
+ message(SEND_ERROR "`CMAKE_CURRENT_FUNCTION` is not expected to be set here")
+endif()
+if(CMAKE_CURRENT_FUNCTION_LIST_FILE)
+ message(SEND_ERROR "`CMAKE_CURRENT_FUNCTION_LIST_FILE` is not expected to be set here")
+endif()
+if(CMAKE_CURRENT_FUNCTION_LIST_DIR)
+ message(SEND_ERROR "`CMAKE_CURRENT_FUNCTION_LIST_DIR` is not expected to be set here")
+endif()
+if(CMAKE_CURRENT_FUNCTION_LIST_LINE)
+ message(SEND_ERROR "`CMAKE_CURRENT_FUNCTION_LIST_LINE` is not expected to be set here")
+endif()
+
+include("${CMAKE_CURRENT_LIST_DIR}/DummyMacro.cmake")
+
+function(calling_macro)
+ dummy()
+endfunction()
+
+calling_macro()
+
+cmake_policy(SET CMP0007 NEW)
+
+# ATTENTION `CMAKE_CURRENT_LIST_LINE` can't be used in `math()'
+function(print_self)
+ file(STRINGS "${CMAKE_CURRENT_FUNCTION_LIST_FILE}" _lines)
+ math(EXPR _begin "${CMAKE_CURRENT_FUNCTION_LIST_LINE} - 1")
+ list(SUBLIST _lines ${_begin} 7 _lines) # This function has 7 lines only
+ list(JOIN _lines "\n" _lines)
+ message(STATUS "Print the `${CMAKE_CURRENT_FUNCTION}` function:\n${_lines}")
+endfunction()
+
+print_self()
diff --git a/Tests/RunCMake/function/CMakeLists.txt b/Tests/RunCMake/function/CMakeLists.txt
new file mode 100644
index 0000000..2632ffa
--- /dev/null
+++ b/Tests/RunCMake/function/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/function/DummyMacro.cmake b/Tests/RunCMake/function/DummyMacro.cmake
new file mode 100644
index 0000000..1ab53e4
--- /dev/null
+++ b/Tests/RunCMake/function/DummyMacro.cmake
@@ -0,0 +1,20 @@
+macro(dummy)
+ if(NOT CMAKE_CURRENT_FUNCTION STREQUAL "calling_macro")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_FILE MATCHES "^.*/function/CMAKE_CURRENT_FUNCTION.cmake$")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_FILE`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_FILE STREQUAL _THIS_FILE)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_FILE`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_DIR MATCHES "^.*/Tests/RunCMake/function$")
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_DIR`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_LINE EQUAL 77)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_LINE`")
+ endif()
+ if(NOT CMAKE_CURRENT_FUNCTION_LIST_DIR STREQUAL _THIS_DIR)
+ message(SEND_ERROR "Bad value of `CMAKE_CURRENT_FUNCTION_LIST_DIR`")
+ endif()
+endmacro()
diff --git a/Tests/RunCMake/function/RunCMakeTest.cmake b/Tests/RunCMake/function/RunCMakeTest.cmake
new file mode 100644
index 0000000..88f48af
--- /dev/null
+++ b/Tests/RunCMake/function/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(CMAKE_CURRENT_FUNCTION)
diff --git a/Tests/RunCMake/get_property/RunCMakeTest.cmake b/Tests/RunCMake/get_property/RunCMakeTest.cmake
index 06a0c67..6e36473 100644
--- a/Tests/RunCMake/get_property/RunCMakeTest.cmake
+++ b/Tests/RunCMake/get_property/RunCMakeTest.cmake
@@ -27,7 +27,7 @@ run_cmake(NoCache)
# don't rely on RunCMake_GENERATOR_IS_MULTI_CONFIG being set correctly
# and instead explicitly check for a match against those generators we
# expect to be multi-config
-if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode")
+if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode|Ninja Multi-Config")
run_cmake(IsMultiConfig)
else()
run_cmake(NotMultiConfig)
diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt
index 1e123f6..2561263 100644
--- a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt
+++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt
@@ -1,4 +1,4 @@
-^CMake Warning \(dev\) at TARGETS-FILE_RPATH_CHANGE-new_rpath\.cmake:[0-9]+ \(install\):
+CMake Warning \(dev\) at TARGETS-FILE_RPATH_CHANGE-new_rpath\.cmake:[0-9]+ \(install\):
Policy CMP0095 is not set: RPATH entries are properly escaped in the
intermediary CMake install script\. Run "cmake --help-policy CMP0095" for
policy details\. Use the cmake_policy command to set the policy and
@@ -20,4 +20,4 @@ CMake Warning \(dev\) at TARGETS-FILE_RPATH_CHANGE-new_rpath\.cmake:[0-9]+ \(ins
intermediary cmake_install\.cmake script\.
Call Stack \(most recent call first\):
CMakeLists\.txt:[0-9]+ \(include\)
-This warning is for project developers\. Use -Wno-dev to suppress it\.$
+This warning is for project developers\. Use -Wno-dev to suppress it\.
diff --git a/Tests/RunCMake/load_cache/CMakeLists.txt b/Tests/RunCMake/load_cache/CMakeLists.txt
new file mode 100644
index 0000000..2632ffa
--- /dev/null
+++ b/Tests/RunCMake/load_cache/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.16)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/load_cache/NewForm_Project.cmake b/Tests/RunCMake/load_cache/NewForm_Project.cmake
new file mode 100644
index 0000000..13a450b
--- /dev/null
+++ b/Tests/RunCMake/load_cache/NewForm_Project.cmake
@@ -0,0 +1,16 @@
+load_cache(${CMAKE_CURRENT_BINARY_DIR}/../test_project READ_WITH_PREFIX LOAD_CACHE_TEST_
+ CACHE_STRING
+ CACHE_BOOL
+ CACHE_INTERNAL)
+
+if(NOT LOAD_CACHE_TEST_CACHE_STRING STREQUAL "cache string")
+ message(FATAL_ERROR "CACHE_STRING: was ${CACHE_STRING}, expected \"cache string\"")
+endif()
+
+if(NOT LOAD_CACHE_TEST_CACHE_BOOL)
+ message(FATAL_ERROR "CACHE_BOOL: was falsey, expected ON")
+endif()
+
+if(NOT LOAD_CACHE_TEST_CACHE_INTERNAL STREQUAL "cache internal")
+ message(FATAL_ERROR "CACHE_INTERNAL: was ${CACHE_INTENRAL}, expected \"cache internal\"")
+endif()
diff --git a/Tests/RunCMake/load_cache/NewForm_Script.cmake b/Tests/RunCMake/load_cache/NewForm_Script.cmake
new file mode 100644
index 0000000..f3cee92
--- /dev/null
+++ b/Tests/RunCMake/load_cache/NewForm_Script.cmake
@@ -0,0 +1,16 @@
+load_cache(${RunCMake_BINARY_DIR}/test_project READ_WITH_PREFIX LOAD_CACHE_TEST_
+ CACHE_STRING
+ CACHE_BOOL
+ CACHE_INTERNAL)
+
+if(NOT LOAD_CACHE_TEST_CACHE_STRING STREQUAL "cache string")
+ message(FATAL_ERROR "CACHE_STRING: was ${CACHE_STRING}, expected \"cache string\"")
+endif()
+
+if(NOT LOAD_CACHE_TEST_CACHE_BOOL)
+ message(FATAL_ERROR "CACHE_BOOL: was falsey, expected ON")
+endif()
+
+if(NOT LOAD_CACHE_TEST_CACHE_INTERNAL STREQUAL "cache internal")
+ message(FATAL_ERROR "CACHE_INTERNAL: was ${CACHE_INTENRAL}, expected \"cache internal\"")
+endif()
diff --git a/Tests/RunCMake/load_cache/OldForm_Script-result.txt b/Tests/RunCMake/load_cache/OldForm_Script-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/load_cache/OldForm_Script-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/load_cache/OldForm_Script-stderr.txt b/Tests/RunCMake/load_cache/OldForm_Script-stderr.txt
new file mode 100644
index 0000000..9ad5c80
--- /dev/null
+++ b/Tests/RunCMake/load_cache/OldForm_Script-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error at.*/Tests/RunCMake/load_cache/OldForm_Script.cmake:1 \(load_cache\):
+ load_cache Only load_cache\(READ_WITH_PREFIX\) may be used in script mode$
diff --git a/Tests/RunCMake/load_cache/OldForm_Script.cmake b/Tests/RunCMake/load_cache/OldForm_Script.cmake
new file mode 100644
index 0000000..9560f61
--- /dev/null
+++ b/Tests/RunCMake/load_cache/OldForm_Script.cmake
@@ -0,0 +1,13 @@
+load_cache(${RunCMake_BINARY_DIR}/test_project INCLUDE_INTERNALS CACHE_INTERNAL)
+
+if(NOT CACHE_STRING STREQUAL "cache string")
+ message(FATAL_ERROR "CACHE_STRING: was ${CACHE_STRING}, expected \"cache string\"")
+endif()
+
+if(NOT CACHE_BOOL)
+ message(FATAL_ERROR "CACHE_BOOL: was falsey, expected ON")
+endif()
+
+if(NOT CACHE_INTERNAL STREQUAL "cache internal")
+ message(FATAL_ERROR "CACHE_INTERNAL: was ${CACHE_INTENRAL}, expected \"cache internal\"")
+endif()
diff --git a/Tests/RunCMake/load_cache/RunCMakeTest.cmake b/Tests/RunCMake/load_cache/RunCMakeTest.cmake
new file mode 100644
index 0000000..a0d54ea
--- /dev/null
+++ b/Tests/RunCMake/load_cache/RunCMakeTest.cmake
@@ -0,0 +1,13 @@
+include(RunCMake)
+
+file(WRITE ${RunCMake_BINARY_DIR}/test_project/CMakeCache.txt [[
+CACHE_STRING:STRING=cache string
+CACHE_BOOL:BOOL=ON
+CACHE_INTERNAL:INTERNAL=cache internal
+]])
+
+run_cmake(NewForm_Project)
+run_cmake_command(NewForm_Script ${CMAKE_COMMAND} -DRunCMake_BINARY_DIR=${RunCMake_BINARY_DIR}
+ -P "${RunCMake_SOURCE_DIR}/NewForm_Script.cmake")
+run_cmake_command(OldForm_Script ${CMAKE_COMMAND} -DRunCMake_BINARY_DIR=${RunCMake_BINARY_DIR}
+ -P "${RunCMake_SOURCE_DIR}/OldForm_Script.cmake")
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake
index 681839d..0313ed1 100644
--- a/Tests/RunCMake/message/RunCMakeTest.cmake
+++ b/Tests/RunCMake/message/RunCMakeTest.cmake
@@ -65,6 +65,11 @@ foreach(opt IN ITEMS loglevel log-level)
endforeach()
run_cmake_command(
+ message-log-level-override
+ ${CMAKE_COMMAND} --log-level=debug -DCMAKE_MESSAGE_LOG_LEVEL=TRACE -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+
+run_cmake_command(
message-indent
${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent.cmake
)
@@ -72,3 +77,23 @@ run_cmake_command(
message-indent-multiline
${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent-multiline.cmake
)
+
+run_cmake_command(
+ message-context-cli
+ ${CMAKE_COMMAND} --log-level=trace --log-context -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+ )
+
+run_cmake_command(
+ message-context-cache
+ ${CMAKE_COMMAND} -DCMAKE_MESSAGE_LOG_LEVEL=TRACE -DCMAKE_MESSAGE_CONTEXT_SHOW=ON -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+ )
+
+run_cmake_command(
+ message-context-cli-wins-cache
+ ${CMAKE_COMMAND} --log-level=verbose --log-context -DCMAKE_MESSAGE_CONTEXT_SHOW=OFF -P ${RunCMake_SOURCE_DIR}/message-context.cmake
+ )
+
+run_cmake_command(
+ message-checks
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-checks.cmake
+ )
diff --git a/Tests/RunCMake/message/message-checks-stderr.txt b/Tests/RunCMake/message/message-checks-stderr.txt
new file mode 100644
index 0000000..fdacdb2
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks-stderr.txt
@@ -0,0 +1,3 @@
+^CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-checks.cmake:13 \(message\):
+ Ignored CHECK_FAIL without CHECK_START
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/message/message-checks-stdout.txt b/Tests/RunCMake/message/message-checks-stdout.txt
new file mode 100644
index 0000000..4f5f2ef
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks-stdout.txt
@@ -0,0 +1,10 @@
+-- Find `libfoo`
+-- Looking for `libfoo\.h`
+-- Looking for `libfoo\.h` - found \[/usr/include\]
+-- Looking for `libfoo\.so`
+-- Looking for `libfoo\.so` - found \[/usr/lib/libfoo\.so\]
+-- Getting `libfoo` version
+-- Looking for `libfoo/version\.h`
+-- Looking for `libfoo/version\.h` - found
+-- Getting `libfoo` version - 1\.2\.3
+-- Find `libfoo` - required version 4\.5\.6 but found 1\.2\.3
diff --git a/Tests/RunCMake/message/message-checks.cmake b/Tests/RunCMake/message/message-checks.cmake
new file mode 100644
index 0000000..605846e
--- /dev/null
+++ b/Tests/RunCMake/message/message-checks.cmake
@@ -0,0 +1,13 @@
+message(CHECK_START "Find `libfoo`")
+message(CHECK_START "Looking for `libfoo.h`")
+message(CHECK_PASS "found [/usr/include]")
+message(CHECK_START "Looking for `libfoo.so`")
+message(CHECK_PASS "found [/usr/lib/libfoo.so]")
+message(CHECK_START "Getting `libfoo` version")
+message(CHECK_START "Looking for `libfoo/version.h`")
+message(CHECK_PASS "found")
+message(CHECK_PASS "1.2.3")
+message(CHECK_FAIL "required version 4.5.6 but found 1.2.3")
+
+# Should generate an error, no associated CHECK_START
+message(CHECK_FAIL "unmatched check fail case")
diff --git a/Tests/RunCMake/message/message-context-cache-stdout.txt b/Tests/RunCMake/message/message-context-cache-stdout.txt
new file mode 100644
index 0000000..af18c15
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cache-stdout.txt
@@ -0,0 +1,8 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\.foo\] foo TRACE message
+-- \[top\.foo\.baz\] This is the multi-line
+\[top\.foo\.baz\] baz DEBUG message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context-cli-stdout.txt b/Tests/RunCMake/message/message-context-cli-stdout.txt
new file mode 100644
index 0000000..af18c15
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cli-stdout.txt
@@ -0,0 +1,8 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\.foo\] foo TRACE message
+-- \[top\.foo\.baz\] This is the multi-line
+\[top\.foo\.baz\] baz DEBUG message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt b/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt
new file mode 100644
index 0000000..157db97
--- /dev/null
+++ b/Tests/RunCMake/message/message-context-cli-wins-cache-stdout.txt
@@ -0,0 +1,5 @@
+-- Begin context output test
+-- \[top\] Top: before
+-- \[top\.foo\.bar\] <-- indent -->bar VERBOSE message
+-- \[top\] Top: after
+-- End of context output test
diff --git a/Tests/RunCMake/message/message-context.cmake b/Tests/RunCMake/message/message-context.cmake
new file mode 100644
index 0000000..93d4cd9
--- /dev/null
+++ b/Tests/RunCMake/message/message-context.cmake
@@ -0,0 +1,27 @@
+function(bar)
+ list(APPEND CMAKE_MESSAGE_CONTEXT "bar")
+ list(APPEND CMAKE_MESSAGE_INDENT "<-- indent -->")
+ message(VERBOSE "bar VERBOSE message")
+endfunction()
+
+function(baz)
+ list(APPEND CMAKE_MESSAGE_CONTEXT "baz")
+ message(DEBUG "This is the multi-line\nbaz DEBUG message")
+endfunction()
+
+function(foo)
+ list(APPEND CMAKE_MESSAGE_CONTEXT "foo")
+ bar()
+ message(TRACE "foo TRACE message")
+ baz()
+endfunction()
+
+message(STATUS "Begin context output test")
+list(APPEND CMAKE_MESSAGE_CONTEXT "top")
+
+message(STATUS "Top: before")
+foo()
+message(STATUS "Top: after")
+
+list(POP_BACK CMAKE_MESSAGE_CONTEXT)
+message(STATUS "End of context output test")
diff --git a/Tests/RunCMake/message/message-log-level-debug-stdout.txt b/Tests/RunCMake/message/message-log-level-debug-stdout.txt
index 1452137..feee110 100644
--- a/Tests/RunCMake/message/message-log-level-debug-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-debug-stdout.txt
@@ -1,3 +1,3 @@
-- STATUS message
-- VERBOSE message
--- DEBUG message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-log-level-default-stdout.txt b/Tests/RunCMake/message/message-log-level-default-stdout.txt
index 809f4cc..b5d6acb 100644
--- a/Tests/RunCMake/message/message-log-level-default-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-default-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-log-level-override-stderr.txt b/Tests/RunCMake/message/message-log-level-override-stderr.txt
new file mode 100644
index 0000000..efec736
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-override-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Deprecation Warning at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:2 \(message\):
+ Deprecation warning
++
+CMake Warning \(dev\) at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:3 \(message\):
+ Author warning message
+This warning is for project developers\. Use -Wno-dev to suppress it\.
++
+CMake Warning at.*/Tests/RunCMake/message/message-all-loglevels\.cmake:4 \(message\):
+ Warning message
++
+Default NOTICE message
+NOTICE message$
diff --git a/Tests/RunCMake/message/message-log-level-override-stdout.txt b/Tests/RunCMake/message/message-log-level-override-stdout.txt
new file mode 100644
index 0000000..feee110
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-override-stdout.txt
@@ -0,0 +1,3 @@
+-- STATUS message
+-- VERBOSE message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-log-level-status-stdout.txt b/Tests/RunCMake/message/message-log-level-status-stdout.txt
index 809f4cc..b5d6acb 100644
--- a/Tests/RunCMake/message/message-log-level-status-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-status-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-log-level-trace-stdout.txt b/Tests/RunCMake/message/message-log-level-trace-stdout.txt
index 1cfce6f..3d36a7f 100644
--- a/Tests/RunCMake/message/message-log-level-trace-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-trace-stdout.txt
@@ -1,4 +1,4 @@
-- STATUS message
-- VERBOSE message
-- DEBUG message
--- TRACE message
+-- TRACE message$
diff --git a/Tests/RunCMake/message/message-log-level-verbose-stdout.txt b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
index c15d43f..47c0846 100644
--- a/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
+++ b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
@@ -1,2 +1,2 @@
-- STATUS message
--- VERBOSE message
+-- VERBOSE message$
diff --git a/Tests/RunCMake/message/message-loglevel-debug-stdout.txt b/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
index 1452137..feee110 100644
--- a/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-debug-stdout.txt
@@ -1,3 +1,3 @@
-- STATUS message
-- VERBOSE message
--- DEBUG message
+-- DEBUG message$
diff --git a/Tests/RunCMake/message/message-loglevel-default-stdout.txt b/Tests/RunCMake/message/message-loglevel-default-stdout.txt
index 809f4cc..b5d6acb 100644
--- a/Tests/RunCMake/message/message-loglevel-default-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-default-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-loglevel-status-stdout.txt b/Tests/RunCMake/message/message-loglevel-status-stdout.txt
index 809f4cc..b5d6acb 100644
--- a/Tests/RunCMake/message/message-loglevel-status-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-status-stdout.txt
@@ -1 +1 @@
--- STATUS message
+-- STATUS message$
diff --git a/Tests/RunCMake/message/message-loglevel-trace-stdout.txt b/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
index 1cfce6f..3d36a7f 100644
--- a/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-trace-stdout.txt
@@ -1,4 +1,4 @@
-- STATUS message
-- VERBOSE message
-- DEBUG message
--- TRACE message
+-- TRACE message$
diff --git a/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt b/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
index c15d43f..47c0846 100644
--- a/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
+++ b/Tests/RunCMake/message/message-loglevel-verbose-stdout.txt
@@ -1,2 +1,2 @@
-- STATUS message
--- VERBOSE message
+-- VERBOSE message$
diff --git a/Tests/RunCMake/target_compile_options/BEFORE_keyword.cmake b/Tests/RunCMake/target_compile_options/BEFORE_keyword.cmake
new file mode 100644
index 0000000..8016230
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/BEFORE_keyword.cmake
@@ -0,0 +1,8 @@
+
+add_executable (CMP0101_OLD CMP0101.c)
+target_compile_options (main PRIVATE -UBEFORE_KEYWORD)
+target_compile_options (main BEFORE PRIVATE -DBEFORE_KEYWORD)
+
+add_executable (CMP0101_NEW CMP0101.c)
+target_compile_options (main PRIVATE -UBEFORE_KEYWORD)
+target_compile_options (main BEFORE PRIVATE -DBEFORE_KEYWORD)
diff --git a/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-NEW-result.txt b/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-NEW-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-NEW-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-OLD-result.txt b/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-OLD-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-OLD-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-OLD-stdout.txt b/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-OLD-stdout.txt
new file mode 100644
index 0000000..850aa65
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword-OLD-stdout.txt
@@ -0,0 +1 @@
+BEFORE not honored
diff --git a/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword.cmake b/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword.cmake
new file mode 100644
index 0000000..577427f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/CMP0101-BEFORE_keyword.cmake
@@ -0,0 +1,15 @@
+
+enable_language(C)
+
+cmake_policy (SET CMP0101 OLD)
+
+add_executable (CMP0101_OLD CMP0101.c)
+target_compile_options (CMP0101_OLD PRIVATE -UBEFORE_KEYWORD)
+target_compile_options (CMP0101_OLD BEFORE PRIVATE -DBEFORE_KEYWORD)
+
+
+cmake_policy (SET CMP0101 NEW)
+
+add_executable (CMP0101_NEW CMP0101.c)
+target_compile_options (CMP0101_NEW PRIVATE -UBEFORE_KEYWORD)
+target_compile_options (CMP0101_NEW BEFORE PRIVATE -DBEFORE_KEYWORD)
diff --git a/Tests/RunCMake/target_compile_options/CMP0101.c b/Tests/RunCMake/target_compile_options/CMP0101.c
new file mode 100644
index 0000000..250869a
--- /dev/null
+++ b/Tests/RunCMake/target_compile_options/CMP0101.c
@@ -0,0 +1,9 @@
+
+#if defined(BEFORE_KEYWORD)
+# error "BEFORE not honored"
+#endif
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
index b67c598..9f51a9a 100644
--- a/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_compile_options/RunCMakeTest.cmake
@@ -1,3 +1,21 @@
include(RunCMake)
run_cmake(empty_keyword_args)
+
+if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
+ macro(run_cmake_target test subtest target)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_OUTPUT_MERGE 1)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+ unset(RunCMake_TEST_NO_CLEAN)
+ endmacro()
+
+ run_cmake(CMP0101-BEFORE_keyword)
+
+ run_cmake_target(CMP0101-BEFORE_keyword OLD CMP0101_OLD)
+ run_cmake_target(CMP0101-BEFORE_keyword NEW CMP0101_NEW)
+endif()
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-check.cmake b/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-check.cmake
new file mode 100644
index 0000000..2fffddd
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "DIR_INTERFACE")
+ string (APPEND RunCMake_TEST_FAILED "\nNot found expected 'DIR_INTERFACE'.")
+endif()
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-result.txt b/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-NEW-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-NEW.cmake b/Tests/RunCMake/target_link_directories/CMP0099-NEW.cmake
new file mode 100644
index 0000000..17dd68e
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0099 NEW)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMP0099.cmake)
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-check.cmake b/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-check.cmake
new file mode 100644
index 0000000..16573a7
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-check.cmake
@@ -0,0 +1,4 @@
+
+if (actual_stdout MATCHES "DIR_INTERFACE")
+ string (APPEND RunCMake_TEST_FAILED "\nFound unexpected 'DIR_INTERFACE'.")
+endif()
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-result.txt b/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-OLD-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_directories/CMP0099-OLD.cmake b/Tests/RunCMake/target_link_directories/CMP0099-OLD.cmake
new file mode 100644
index 0000000..193a4c7
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0099 OLD)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMP0099.cmake)
diff --git a/Tests/RunCMake/target_link_directories/CMP0099.cmake b/Tests/RunCMake/target_link_directories/CMP0099.cmake
new file mode 100644
index 0000000..a2be279
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/CMP0099.cmake
@@ -0,0 +1,14 @@
+
+enable_language(C)
+
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+
+add_library(LinkDirs_interface INTERFACE)
+target_link_directories (LinkDirs_interface INTERFACE "/DIR_INTERFACE"})
+
+add_library(LinkDirs_static STATIC lib.c)
+target_link_libraries (LinkDirs_static PRIVATE LinkDirs_interface)
+
+add_executable(LinkDirs_exe exe.c)
+target_link_libraries (LinkDirs_exe PRIVATE LinkDirs_static)
diff --git a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
index b67c598..a74ee25 100644
--- a/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_directories/RunCMakeTest.cmake
@@ -1,3 +1,33 @@
include(RunCMake)
+macro(run_cmake_target test subtest target)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${test}-${subtest} ${CMAKE_COMMAND} --build . --target ${target} ${ARGN})
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endmacro()
+
run_cmake(empty_keyword_args)
+
+if(RunCMake_GENERATOR MATCHES "(Ninja|Makefiles)" AND
+ NOT RunCMake_GENERATOR MATCHES "(NMake|Borland)")
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ endif()
+ if (RunCMake_GENERATOR MATCHES "Ninja")
+ set(VERBOSE -- -v)
+ endif()
+
+ run_cmake(CMP0099-NEW)
+ run_cmake_target(CMP0099-NEW basic LinkDirs_exe ${VERBOSE})
+
+
+ run_cmake(CMP0099-OLD)
+ run_cmake_target(CMP0099-OLD basic LinkDirs_exe ${VERBOSE})
+
+ unset(RunCMake_TEST_OPTIONS)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+endif()
diff --git a/Tests/RunCMake/target_link_directories/exe.c b/Tests/RunCMake/target_link_directories/exe.c
new file mode 100644
index 0000000..8488f4e
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/exe.c
@@ -0,0 +1,4 @@
+int main(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/target_link_directories/lib.c b/Tests/RunCMake/target_link_directories/lib.c
new file mode 100644
index 0000000..9bbd24c
--- /dev/null
+++ b/Tests/RunCMake/target_link_directories/lib.c
@@ -0,0 +1,7 @@
+#if defined(_WIN32)
+__declspec(dllexport)
+#endif
+ int flags_lib(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-iface-NEW-stdout.txt b/Tests/RunCMake/target_link_libraries/CMP0079-iface-NEW-stdout.txt
index 89cd806..1c5cf45 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-iface-NEW-stdout.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-iface-NEW-stdout.txt
@@ -1 +1 @@
--- INTERFACE_LINK_LIBRARIES='foo::@<[Xx0-9A-Fa-f]+>'
+-- INTERFACE_LINK_LIBRARIES='::@\([Xx0-9A-Fa-f]+\);\$<\$<CONFIG:DEBUG>:\$<1:foo;foo>>;\$<\$<NOT:\$<CONFIG:DEBUG>>:\$<1:foo;foo>>;::@'
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-iface-OLD-stdout.txt b/Tests/RunCMake/target_link_libraries/CMP0079-iface-OLD-stdout.txt
index e575e16..4eb06d9 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-iface-OLD-stdout.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-iface-OLD-stdout.txt
@@ -1 +1 @@
--- INTERFACE_LINK_LIBRARIES='foo'
+-- INTERFACE_LINK_LIBRARIES='\$<\$<CONFIG:DEBUG>:\$<1:foo;foo>>;\$<\$<NOT:\$<CONFIG:DEBUG>>:\$<1:foo;foo>>'
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stderr.txt
index 6dd7d30..4c09a1f 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stderr.txt
@@ -10,7 +10,25 @@
is not created in this directory. For compatibility with older versions of
CMake, link library
- foo
+ \$<1:foo;foo>
+
+ will be looked up in the directory in which the target was created rather
+ than in this calling directory.
+This warning is for project developers. Use -Wno-dev to suppress it.
++
+CMake Warning \(dev\) at CMP0079-iface/CMakeLists.txt:[0-9]+ \(target_link_libraries\):
+ Policy CMP0079 is not set: target_link_libraries allows use with targets in
+ other directories. Run "cmake --help-policy CMP0079" for policy details.
+ Use the cmake_policy command to set the policy and suppress this warning.
+
+ Target
+
+ top
+
+ is not created in this directory. For compatibility with older versions of
+ CMake, link library
+
+ \$<1:foo;foo>
will be looked up in the directory in which the target was created rather
than in this calling directory.
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stdout.txt b/Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stdout.txt
index e575e16..4eb06d9 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stdout.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-iface-WARN-stdout.txt
@@ -1 +1 @@
--- INTERFACE_LINK_LIBRARIES='foo'
+-- INTERFACE_LINK_LIBRARIES='\$<\$<CONFIG:DEBUG>:\$<1:foo;foo>>;\$<\$<NOT:\$<CONFIG:DEBUG>>:\$<1:foo;foo>>'
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-iface/CMakeLists.txt b/Tests/RunCMake/target_link_libraries/CMP0079-iface/CMakeLists.txt
index 4b15b32..e410607 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-iface/CMakeLists.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-iface/CMakeLists.txt
@@ -1 +1 @@
-target_link_libraries(top INTERFACE foo)
+target_link_libraries(top INTERFACE debug "$<1:foo;foo>" optimized "$<1:foo;foo>")
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
index 8ef35c1..9e38bec 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error at CMP0079-link-NEW-bogus.cmake:[0-9]+ \(add_executable\):
- Target "top" links to target "foo::@<0xdeadbeef>" but the target was not
+ Target "top" links to target "::@\(0xdeadbeef\)" but the target was not
found. Perhaps a find_package\(\) call is missing for an IMPORTED target, or
an ALIAS target is missing\?
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake
index 8622f14..8932521 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-bogus.cmake
@@ -3,4 +3,4 @@ cmake_policy(SET CMP0079 NEW)
enable_language(C)
add_executable(top empty.c)
-set_property(TARGET top APPEND PROPERTY LINK_LIBRARIES "foo::@<0xdeadbeef>")
+set_property(TARGET top APPEND PROPERTY LINK_LIBRARIES "::@(0xdeadbeef);foo;::@")
diff --git a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-stdout.txt b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-stdout.txt
index 84b30bd..fa5d4a3 100644
--- a/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-stdout.txt
+++ b/Tests/RunCMake/target_link_libraries/CMP0079-link-NEW-stdout.txt
@@ -1 +1 @@
--- LINK_LIBRARIES='foo::@<[Xx0-9A-Fa-f]+>'
+-- LINK_LIBRARIES='::@\([Xx0-9A-Fa-f]+\);foo;::@'
diff --git a/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-check.cmake b/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-check.cmake
new file mode 100644
index 0000000..555bc37
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "BADFLAG_INTERFACE")
+ string (APPEND RunCMake_TEST_FAILED "\nNot found expected 'BADFLAG_INTERFACE'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-result.txt b/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-NEW-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/CMP0099-NEW.cmake b/Tests/RunCMake/target_link_options/CMP0099-NEW.cmake
new file mode 100644
index 0000000..17dd68e
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-NEW.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0099 NEW)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMP0099.cmake)
diff --git a/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-check.cmake b/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-check.cmake
new file mode 100644
index 0000000..4f159f1
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-check.cmake
@@ -0,0 +1,4 @@
+
+if (actual_stdout MATCHES "BADFLAG_INTERFACE")
+ string (APPEND RunCMake_TEST_FAILED "\nFound unexpected 'BADFLAG_INTERFACE'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-result.txt b/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-OLD-basic-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/CMP0099-OLD.cmake b/Tests/RunCMake/target_link_options/CMP0099-OLD.cmake
new file mode 100644
index 0000000..193a4c7
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099-OLD.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy(SET CMP0099 OLD)
+
+include(${CMAKE_CURRENT_SOURCE_DIR}/CMP0099.cmake)
diff --git a/Tests/RunCMake/target_link_options/CMP0099.cmake b/Tests/RunCMake/target_link_options/CMP0099.cmake
new file mode 100644
index 0000000..edb457e
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/CMP0099.cmake
@@ -0,0 +1,19 @@
+
+enable_language(C)
+
+set(obj "${CMAKE_C_OUTPUT_EXTENSION}")
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_library(LinkOptions_interface INTERFACE)
+target_link_options (LinkOptions_interface INTERFACE ${pre}BADFLAG_INTERFACE${obj})
+
+add_library(LinkOptions_static1 STATIC LinkOptionsLib.c)
+target_link_libraries (LinkOptions_static1 PRIVATE LinkOptions_interface)
+
+add_library(LinkOptions_static2 STATIC LinkOptionsLib.c)
+target_link_libraries (LinkOptions_static2 PRIVATE LinkOptions_static1)
+
+add_executable(LinkOptions_exe LinkOptionsExe.c)
+target_link_libraries (LinkOptions_exe PRIVATE LinkOptions_static2)
diff --git a/Tests/RunCMake/target_link_options/LINKER_expansion.cmake b/Tests/RunCMake/target_link_options/LINKER_expansion.cmake
index b344867..f86d19f 100644
--- a/Tests/RunCMake/target_link_options/LINKER_expansion.cmake
+++ b/Tests/RunCMake/target_link_options/LINKER_expansion.cmake
@@ -1,6 +1,13 @@
enable_language(C)
+set(cfg_dir)
+get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+if(_isMultiConfig)
+ set(cfg_dir /Debug)
+endif()
+set(DUMP_EXE "${CMAKE_CURRENT_BINARY_DIR}${cfg_dir}/dump${CMAKE_EXECUTABLE_SUFFIX}")
+
add_executable(dump dump.c)
# ensure no temp file will be used
@@ -13,7 +20,7 @@ add_library(linker SHARED LinkOptionsLib.c)
target_link_options(linker PRIVATE "LINKER:-foo,bar")
# use LAUNCH facility to dump linker command
-set_property(TARGET linker PROPERTY RULE_LAUNCH_LINK "\"${CMAKE_CURRENT_BINARY_DIR}/dump${CMAKE_EXECUTABLE_SUFFIX}\"")
+set_property(TARGET linker PROPERTY RULE_LAUNCH_LINK "\"${DUMP_EXE}\"")
add_dependencies (linker dump)
@@ -23,7 +30,7 @@ add_library(linker_shell SHARED LinkOptionsLib.c)
target_link_options(linker_shell PRIVATE "LINKER:SHELL:-foo bar")
# use LAUNCH facility to dump linker command
-set_property(TARGET linker_shell PROPERTY RULE_LAUNCH_LINK "\"${CMAKE_CURRENT_BINARY_DIR}/dump${CMAKE_EXECUTABLE_SUFFIX}\"")
+set_property(TARGET linker_shell PROPERTY RULE_LAUNCH_LINK "\"${DUMP_EXE}\"")
add_dependencies (linker_shell dump)
diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
index 1d9ef8b..cdfdd7b 100644
--- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
@@ -41,3 +41,21 @@ if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)")
endif()
run_cmake(empty_keyword_args)
+
+if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
+ # Intel compiler does not reject bad flags or objects!
+ set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
+ set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ endif()
+
+ run_cmake(CMP0099-NEW)
+ run_cmake_target(CMP0099-NEW basic LinkOptions_exe)
+
+
+ run_cmake(CMP0099-OLD)
+ run_cmake_target(CMP0099-OLD basic LinkOptions_exe)
+
+ unset(RunCMake_TEST_OPTIONS)
+ unset(RunCMake_TEST_OUTPUT_MERGE)
+endif()
diff --git a/Tests/RunCMake/try_compile/CleanupNoFollowSymlink.cmake b/Tests/RunCMake/try_compile/CleanupNoFollowSymlink.cmake
new file mode 100644
index 0000000..dea0f61
--- /dev/null
+++ b/Tests/RunCMake/try_compile/CleanupNoFollowSymlink.cmake
@@ -0,0 +1,21 @@
+enable_language(C)
+
+set(out "${CMAKE_CURRENT_BINARY_DIR}/folder")
+set(link_folder "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeTmp")
+set(link_dir "${link_folder}/link_dir")
+file(MAKE_DIRECTORY "${out}")
+file(MAKE_DIRECTORY "${link_folder}")
+file(WRITE ${out}/empty_file "")
+file(CREATE_LINK ${out} ${link_dir} SYMBOLIC)
+
+try_compile(res ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.c)
+
+if(EXISTS ${link_dir})
+ message(FATAL_ERROR "did not remove ${link_dir}")
+endif()
+if(NOT EXISTS ${out})
+ message(FATAL_ERROR "should not have removed ${out}/dir")
+endif()
+
+file(REMOVE_RECURSE "${out}")
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 91f014e..bee9e5b 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -49,11 +49,7 @@ if(CMAKE_OBJCXX_STANDARD_DEFAULT)
run_cmake(ObjCxxStandard)
endif()
if(CMake_TEST_CUDA)
- if(CMAKE_HOST_WIN32)
- run_cmake(CudaStandardNoDefault)
- else()
- run_cmake(CudaStandard)
- endif()
+ run_cmake(CudaStandard)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
run_cmake(CStandardGNU)
@@ -98,3 +94,7 @@ if(RunCMake_GENERATOR MATCHES "Make|Ninja")
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
endif()
+
+if(UNIX)
+ run_cmake(CleanupNoFollowSymlink)
+endif()
diff --git a/Tests/StagingPrefix/CMakeLists.txt b/Tests/StagingPrefix/CMakeLists.txt
index 8d2519e..9ed5c12 100644
--- a/Tests/StagingPrefix/CMakeLists.txt
+++ b/Tests/StagingPrefix/CMakeLists.txt
@@ -5,7 +5,7 @@ project(StagingPrefix)
# Wipe out the install tree
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/CleanupProject
- COMMAND ${CMAKE_COMMAND} -E remove_directory
+ COMMAND ${CMAKE_COMMAND} -E rm -rf
${CMAKE_BINARY_DIR}/ConsumerBuild
${CMAKE_BINARY_DIR}/ProducerBuild
${CMAKE_BINARY_DIR}/stage
diff --git a/Tests/SubDir/Examples/example1/CMakeLists.txt b/Tests/SubDir/Examples/example1/CMakeLists.txt
index 20d065e..8ec1c02 100644
--- a/Tests/SubDir/Examples/example1/CMakeLists.txt
+++ b/Tests/SubDir/Examples/example1/CMakeLists.txt
@@ -3,5 +3,5 @@ project(example1)
add_executable(example1 example1.cxx)
add_custom_command(TARGET example1 POST_BUILD
- COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere
+ COMMAND "${CMAKE_COMMAND}" ARGS -E rm -f ${SUBDIR_BINARY_DIR}/ShouldBeHere
COMMENT "Remove marker file that should exist because this should not be run")
diff --git a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt
index 20d065e..8ec1c02 100644
--- a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt
+++ b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt
@@ -3,5 +3,5 @@ project(example1)
add_executable(example1 example1.cxx)
add_custom_command(TARGET example1 POST_BUILD
- COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere
+ COMMAND "${CMAKE_COMMAND}" ARGS -E rm -f ${SUBDIR_BINARY_DIR}/ShouldBeHere
COMMENT "Remove marker file that should exist because this should not be run")
diff --git a/Tests/VSMidl/CMakeLists.txt b/Tests/VSMidl/CMakeLists.txt
index 432506c..3ff7c27 100644
--- a/Tests/VSMidl/CMakeLists.txt
+++ b/Tests/VSMidl/CMakeLists.txt
@@ -56,8 +56,8 @@ set(source_dir "${base_dir}/src")
#
ExternalProject_Add(clean-${PROJECT_NAME}
DOWNLOAD_COMMAND ""
- CONFIGURE_COMMAND ${CMAKE_COMMAND} -E remove_directory "${source_dir}"
- BUILD_COMMAND ${CMAKE_COMMAND} -E remove_directory "${binary_dir}"
+ CONFIGURE_COMMAND ${CMAKE_COMMAND} -E rm -rf "${source_dir}"
+ BUILD_COMMAND ${CMAKE_COMMAND} -E rm -rf "${binary_dir}"
INSTALL_COMMAND ""
)