summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:14:18 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:14:18 +0900
commitd40909a98298a97d879ceeb3b29dcdc858e85628 (patch)
tree0a9255654a9376c5e9f29aa53d15f0ae173751a0 /Tests
parentc5223aaf98b2d10aee32aa614519ee7a23698998 (diff)
downloadcmake-upstream/3.16.0.tar.gz
cmake-upstream/3.16.0.tar.bz2
cmake-upstream/3.16.0.zip
Imported Upstream version 3.16.0upstream/3.16.0
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Assembler/CMakeLists.txt5
-rw-r--r--Tests/BuildDepends/CMakeLists.txt16
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt6
-rw-r--r--Tests/BuildDepends/Project/ninjadep.cpp3
-rw-r--r--Tests/BuildDepends/Project/zot.cxx5
-rw-r--r--Tests/BuildDepends/Project/zot_pch.cxx6
-rw-r--r--Tests/BundleTest/BundleLib.cxx3
-rw-r--r--Tests/BundleTest/BundleSubDir/CMakeLists.txt6
-rw-r--r--Tests/BundleTest/BundleTest.cxx3
-rw-r--r--Tests/BundleTest/CMakeLists.txt6
-rw-r--r--Tests/BundleUtilities/framework.cpp1
-rw-r--r--Tests/BundleUtilities/module.cpp1
-rw-r--r--Tests/BundleUtilities/shared.cpp1
-rw-r--r--Tests/BundleUtilities/shared2.cpp1
-rw-r--r--Tests/CFBundleTest/CMakeLists.txt2
-rw-r--r--Tests/CMakeCommands/target_include_directories/consumer.cpp1
-rw-r--r--Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.h3
-rw-r--r--Tests/CMakeCommands/target_link_libraries/depB.cpp1
-rw-r--r--Tests/CMakeCommands/target_link_libraries/depC.h3
-rw-r--r--Tests/CMakeCommands/target_link_libraries/depD.h3
-rw-r--r--Tests/CMakeCommands/target_link_libraries/newsignature1.cpp1
-rw-r--r--Tests/CMakeCommands/target_link_libraries/targetA.cpp1
-rw-r--r--Tests/CMakeCommands/target_link_libraries/targetC.cpp3
-rw-r--r--Tests/CMakeLib/CMakeLists.txt10
-rw-r--r--Tests/CMakeLib/run_compile_commands.cxx9
-rw-r--r--Tests/CMakeLib/testAffinity.cxx4
-rw-r--r--Tests/CMakeLib/testArgumentParser.cxx11
-rw-r--r--Tests/CMakeLib/testCTestBinPacker.cxx300
-rw-r--r--Tests/CMakeLib/testCTestResourceAllocator.cxx426
-rw-r--r--Tests/CMakeLib/testCTestResourceGroups.cxx141
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec.cxx101
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec1.json27
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec10.json15
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec11.json16
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec12.json1
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec13.json1
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec14.json12
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec15.json12
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec16.json12
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec17.json15
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec18.json15
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec19.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec2.json8
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec20.json8
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec21.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec22.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec23.json7
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec24.json7
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec25.json8
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec26.json8
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec27.json8
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec28.json8
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec29.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec3.json12
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec30.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec31.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec32.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec33.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec34.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec35.json5
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec4.json8
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec5.json6
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec6.json9
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec7.json12
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec8.json13
-rw-r--r--Tests/CMakeLib/testCTestResourceSpec_data/spec9.json14
-rw-r--r--Tests/CMakeLib/testEncoding.cxx3
-rw-r--r--Tests/CMakeLib/testGeneratedFileStream.cxx6
-rw-r--r--Tests/CMakeLib/testOptional.cxx701
-rw-r--r--Tests/CMakeLib/testRST.cxx9
-rw-r--r--Tests/CMakeLib/testRange.cxx4
-rw-r--r--Tests/CMakeLib/testString.cxx12
-rw-r--r--Tests/CMakeLib/testStringAlgorithms.cxx230
-rw-r--r--Tests/CMakeLib/testSystemTools.cxx19
-rw-r--r--Tests/CMakeLib/testUTF8.cxx3
-rw-r--r--Tests/CMakeLib/testUVProcessChain.cxx19
-rw-r--r--Tests/CMakeLib/testUVProcessChainHelper.cxx8
-rw-r--r--Tests/CMakeLib/testUVRAII.cxx4
-rw-r--r--Tests/CMakeLib/testUVStreambuf.cxx16
-rw-r--r--Tests/CMakeLib/testVisualStudioSlnParser.cxx4
-rw-r--r--Tests/CMakeLib/testXMLParser.cxx4
-rw-r--r--Tests/CMakeLib/testXMLSafe.cxx3
-rw-r--r--Tests/CMakeLists.txt480
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt13
-rw-r--r--Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt14
-rw-r--r--Tests/CMakeOnly/CheckLanguage/CMakeLists.txt12
-rw-r--r--Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt17
-rw-r--r--Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt17
-rw-r--r--Tests/CMakeOnly/CompilerIdOBJC/CMakeLists.txt14
-rw-r--r--Tests/CMakeOnly/CompilerIdOBJCXX/CMakeLists.txt14
-rw-r--r--Tests/CMakeServerLib/testServerBuffering.cpp6
-rw-r--r--Tests/CMakeTests/ELFTest.cmake.in29
-rw-r--r--Tests/COnly/CMakeLists.txt6
-rw-r--r--Tests/COnly/conly.c5
-rw-r--r--Tests/CPackComponents/mylib.cpp1
-rw-r--r--Tests/CPackComponentsDEB/CMakeLists.txt8
-rw-r--r--Tests/CPackComponentsDEB/MyLibCPackConfig-components-description1.cmake.in7
-rw-r--r--Tests/CPackComponentsDEB/MyLibCPackConfig-components-description2.cmake.in10
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake32
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake36
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake28
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake26
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake8
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake12
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake19
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake12
-rw-r--r--Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake31
-rw-r--r--Tests/CPackComponentsDEB/mylib.cpp1
-rw-r--r--Tests/CPackComponentsForAll/mylib.cpp1
-rw-r--r--Tests/CPackWiXGenerator/mylib.cpp1
-rw-r--r--Tests/CompileFeatures/CMakeLists.txt6
-rw-r--r--Tests/CompileFeatures/default_dialect.cpp12
-rw-r--r--Tests/Complex/Executable/complex.cxx8
-rw-r--r--Tests/Complex/Library/testConly.c1
-rw-r--r--Tests/ComplexOneConfig/Executable/complex.cxx8
-rw-r--r--Tests/ComplexOneConfig/Library/testConly.c1
-rw-r--r--Tests/ConfigSources/CMakeLists.txt22
-rw-r--r--Tests/ConfigSources/iface.h10
-rw-r--r--Tests/ConfigSources/iface_debug.h4
-rw-r--r--Tests/ConfigSources/iface_debug_src.cpp8
-rw-r--r--Tests/ConfigSources/iface_other_src.cpp13
-rw-r--r--Tests/ConfigSources/main.cpp7
-rw-r--r--Tests/ConfigSources/main_debug.cpp13
-rw-r--r--Tests/ConfigSources/main_other.cpp13
-rw-r--r--Tests/Cuda/CMakeLists.txt1
-rw-r--r--Tests/Cuda/Complex/dynamic.cu3
-rw-r--r--Tests/Cuda/ObjectLibrary/Conflicts/static.cu3
-rw-r--r--Tests/Cuda/ObjectLibrary/static.cu3
-rw-r--r--Tests/Cuda/ProperDeviceLibraries/main.cu3
-rw-r--r--Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt3
-rw-r--r--Tests/Cuda/SeparableCompCXXOnly/main.cpp5
-rw-r--r--Tests/Cuda/WithC/cuda.cu4
-rw-r--r--Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt2
-rw-r--r--Tests/CudaOnly/GPUDebugFlag/main.cu3
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt23
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/file1.h3
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/file2.cu16
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/file2.h2
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/file2_launch.cu18
-rw-r--r--Tests/CudaOnly/ResolveDeviceSymbols/main.cu24
-rw-r--r--Tests/CudaOnly/WithDefs/main.notcu4
-rw-r--r--Tests/CustomCommandByproducts/CMakeLists.txt49
-rw-r--r--Tests/CustomCommandByproducts/CustomCommandByproducts.c3
-rw-r--r--Tests/CustomCommandByproducts/byproduct9.c.in1
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt10
-rw-r--r--Tests/ExportImport/Export/Interface/CMakeLists.txt12
-rw-r--r--Tests/ExportImport/Export/Interface/pch/pch.h1
-rw-r--r--Tests/ExportImport/Export/testSharedLibDepends.h3
-rw-r--r--Tests/ExportImport/Export/testSharedLibRequiredUser2.h3
-rw-r--r--Tests/ExportImport/Import/A/deps_iface.c9
-rw-r--r--Tests/ExportImport/Import/Interface/CMakeLists.txt11
-rw-r--r--Tests/ExportImport/Import/Interface/pch_iface_test.cpp16
-rw-r--r--Tests/ExternalProject/CMakeLists.txt21
-rw-r--r--Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx7
-rw-r--r--Tests/ExternalProjectLocal/Step5/tutorial.cxx3
-rw-r--r--Tests/FindDoxygen/CMakeLists.txt10
-rw-r--r--Tests/FindDoxygen/StampFile/CMakeLists.txt24
-rw-r--r--Tests/FindDoxygen/StampFile/main.cpp4
-rw-r--r--Tests/FindDoxygen/StampFile/main2.cpp4
-rw-r--r--Tests/FindEnvModules/EnvModules.cmake16
-rw-r--r--Tests/FindGIF/Test/main.c3
-rw-r--r--Tests/FindGSL/rng/main.cc3
-rw-r--r--Tests/FindGTK2/cairomm/main.cpp8
-rw-r--r--Tests/FindGTK2/gtkmm/helloworld.cpp1
-rw-r--r--Tests/FindGTK2/gtkmm/main.cpp3
-rw-r--r--Tests/FindGTK2/sigc++/main.cpp1
-rw-r--r--Tests/FindGnuTLS/CMakeLists.txt10
-rw-r--r--Tests/FindGnuTLS/Test/CMakeLists.txt17
-rw-r--r--Tests/FindGnuTLS/Test/main.c21
-rw-r--r--Tests/FindICU/Test/main.cpp7
-rw-r--r--Tests/FindJPEG/Test/main.c3
-rw-r--r--Tests/FindMatlab/basic_checks/CMakeLists.txt12
-rw-r--r--Tests/FindMatlab/matlab_wrapper_failure.cpp13
-rw-r--r--Tests/FindOpenACC/CMakeLists.txt20
-rw-r--r--Tests/FindOpenACC/CTest/CMakeLists.txt13
-rw-r--r--Tests/FindOpenACC/CTest/main.c44
-rw-r--r--Tests/FindOpenACC/CXXTest/CMakeLists.txt13
-rw-r--r--Tests/FindOpenACC/CXXTest/main.cxx43
-rw-r--r--Tests/FindOpenACC/FortranTest/CMakeLists.txt11
-rw-r--r--Tests/FindOpenACC/FortranTest/main.f909
-rw-r--r--Tests/FindOpenMP/Test/CMakeLists.txt1
-rw-r--r--Tests/FindPackageTest/CMakeLists.txt34
-rw-r--r--Tests/FindProtobuf/Test/CMakeLists.txt4
-rw-r--r--Tests/FindProtobuf/Test/main-desc.cxx7
-rw-r--r--Tests/FindPython/CMakeLists.txt13
-rw-r--r--Tests/FindPython/FindPythonScript.cmake10
-rw-r--r--Tests/FindPython/NumPy/arraytest.c4
-rw-r--r--Tests/FindPython/Python2/CMakeLists.txt1
-rw-r--r--Tests/FindPython/Python3/CMakeLists.txt53
-rw-r--r--Tests/FindPython/RequiredArtifacts/CMakeLists.txt110
-rw-r--r--Tests/FindPython/RequiredArtifacts/Check/CMakeLists.txt41
-rw-r--r--Tests/FindSQLite3/Test/main.c3
-rw-r--r--Tests/FindX11/Test/main.c5
-rw-r--r--Tests/FortranModules/Library/a.f903
-rw-r--r--Tests/FortranModules/Library/b.f903
-rw-r--r--Tests/FortranModules/Subdir/subdir.f903
-rw-r--r--Tests/FortranOnly/CMakeLists.txt8
-rw-r--r--Tests/FortranOnly/IntelIfDef.f3
-rw-r--r--Tests/FortranOnly/IntelIfDef.inc3
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt28
-rw-r--r--Tests/GeneratorExpression/check-part5.cmake1
-rw-r--r--Tests/GoogleTest/Test/main1.cxx4
-rw-r--r--Tests/IPO/CMakeLists.txt7
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp3
-rw-r--r--Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h3
-rw-r--r--Tests/Java/CMakeLists.txt9
-rw-r--r--Tests/JavaJavah/B.cpp4
-rw-r--r--Tests/JavaJavah/C.cpp4
-rw-r--r--Tests/JavaJavah/CMakeLists.txt5
-rw-r--r--Tests/JavaNativeHeaders/CMakeLists.txt6
-rw-r--r--Tests/JavaNativeHeaders/D.cpp4
-rw-r--r--Tests/JavaNativeHeaders/E.cpp4
-rw-r--r--Tests/LoadCommand/CMakeCommands/cmTestCommand.c3
-rw-r--r--Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c3
-rw-r--r--Tests/MFC/mfc1/ChildFrm.cpp2
-rw-r--r--Tests/MFC/mfc1/MainFrm.cpp2
-rw-r--r--Tests/MFC/mfc1/mfc1.cpp2
-rw-r--r--Tests/MFC/mfc1/mfc1Doc.cpp2
-rw-r--r--Tests/MFC/mfc1/mfc1View.cpp2
-rw-r--r--Tests/MFC/mfc1/stdafx.h7
-rw-r--r--Tests/MacRuntimePath/A/framework.cpp1
-rw-r--r--Tests/MacRuntimePath/A/framework2.cpp1
-rw-r--r--Tests/MacRuntimePath/A/shared.cpp1
-rw-r--r--Tests/MathTest/CMakeLists.txt2
-rw-r--r--Tests/Module/CheckIPOSupported-C/CMakeLists.txt12
-rw-r--r--Tests/Module/CheckIPOSupported-C/bar.c4
-rw-r--r--Tests/Module/CheckIPOSupported-C/main.c3
-rw-r--r--Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt15
-rw-r--r--Tests/Module/CheckIPOSupported-CXX/bar.cpp4
-rw-r--r--Tests/Module/CheckIPOSupported-CXX/main.cpp3
-rw-r--r--Tests/NewlineArgs/cxxonly.cxx4
-rw-r--r--Tests/ObjC++/CMakeLists.txt6
-rw-r--r--Tests/ObjC/CMakeLists.txt4
-rw-r--r--Tests/ObjC/c-file-extension-test/CMakeLists.txt5
-rw-r--r--Tests/ObjC/c-file-extension-test/main.m8
-rw-r--r--Tests/ObjC/cxx-file-extension-test/CMakeLists.txt8
-rw-r--r--Tests/ObjC/cxx-file-extension-test/main.m8
-rw-r--r--Tests/ObjC/objc-file-extension-test/CMakeLists.txt6
-rw-r--r--Tests/ObjC/objc-file-extension-test/main.m12
-rw-r--r--Tests/ObjC/simple-build-test/CMakeLists.txt11
-rw-r--r--Tests/ObjC/simple-build-test/foo.h9
-rw-r--r--Tests/ObjC/simple-build-test/foo.m7
-rw-r--r--Tests/ObjC/simple-build-test/main.m12
-rw-r--r--Tests/ObjCXX/CMakeLists.txt4
-rw-r--r--Tests/ObjCXX/ObjC++/CMakeLists.txt5
-rw-r--r--Tests/ObjCXX/ObjC++/objc++.mm (renamed from Tests/ObjC++/objc++.mm)0
-rw-r--r--Tests/ObjCXX/cxx-file-extension-test/CMakeLists.txt5
-rw-r--r--Tests/ObjCXX/cxx-file-extension-test/main.mm8
-rw-r--r--Tests/ObjCXX/objcxx-file-extension-test/CMakeLists.txt6
-rw-r--r--Tests/ObjCXX/objcxx-file-extension-test/main.mm14
-rw-r--r--Tests/ObjCXX/simple-build-test/CMakeLists.txt11
-rw-r--r--Tests/ObjCXX/simple-build-test/foo.h9
-rw-r--r--Tests/ObjCXX/simple-build-test/foo.mm7
-rw-r--r--Tests/ObjCXX/simple-build-test/main.mm14
-rw-r--r--Tests/PDBDirectoryAndName/CMakeLists.txt4
-rw-r--r--Tests/Plugin/CMakeLists.txt12
-rw-r--r--Tests/Plugin/include/DynamicLoader.hxx49
-rw-r--r--Tests/Plugin/src/DynamicLoader.cxx263
-rw-r--r--Tests/Plugin/src/example_exe.cxx25
-rw-r--r--Tests/Plugin/src/example_exe.h.in2
-rw-r--r--Tests/Plugin/src/example_mod_1.c1
-rw-r--r--Tests/Preprocess/CMakeLists.txt7
-rw-r--r--Tests/Qt4Targets/main.cpp3
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp1
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp6
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp1
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp6
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOff/main.cpp3
-rw-r--r--Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp3
-rw-r--r--Tests/QtAutogen/Complex/Adir/libA.h4
-rw-r--r--Tests/QtAutogen/Complex/Bdir/libB.h4
-rw-r--r--Tests/QtAutogen/Complex/abc.cpp3
-rw-r--r--Tests/QtAutogen/Complex/abc_p.h4
-rw-r--r--Tests/QtAutogen/Complex/calwidget.cpp4
-rw-r--r--Tests/QtAutogen/Complex/codeeditor.cpp4
-rw-r--r--Tests/QtAutogen/Complex/debug_class.cpp1
-rw-r--r--Tests/QtAutogen/Complex/libC.h4
-rw-r--r--Tests/QtAutogen/Complex/main.cpp3
-rw-r--r--Tests/QtAutogen/Complex/second_widget.cpp1
-rw-r--r--Tests/QtAutogen/Complex/yaf.cpp3
-rw-r--r--Tests/QtAutogen/Complex/yaf_p.h4
-rw-r--r--Tests/QtAutogen/LowMinimumVersion/item.cpp1
-rw-r--r--Tests/QtAutogen/MacOsFW/test/testMacosFWLib.cpp3
-rw-r--r--Tests/QtAutogen/MocCMP0071/Obj.cpp1
-rw-r--r--Tests/QtAutogen/MocInclude/CMakeLists.txt112
-rw-r--r--Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.cpp11
-rw-r--r--Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/DualSubMocked.cpp9
-rw-r--r--Tests/QtAutogen/MocInclude/Common/DualSubMocked.hpp15
-rw-r--r--Tests/QtAutogen/MocInclude/Common/ExternDot.cpp11
-rw-r--r--Tests/QtAutogen/MocInclude/Common/ExternDot.hpp15
-rw-r--r--Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.cpp.in11
-rw-r--r--Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.hpp.in15
-rw-r--r--Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.cpp44
-rw-r--r--Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.hpp17
-rw-r--r--Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot_p.hpp18
-rw-r--r--Tests/QtAutogen/MocInclude/Common/InIncludesMoc.cpp4
-rw-r--r--Tests/QtAutogen/MocInclude/Common/MixedCustom.cpp32
-rw-r--r--Tests/QtAutogen/MocInclude/Common/MixedCustom.hpp20
-rw-r--r--Tests/QtAutogen/MocInclude/Common/MixedSkipped.cpp40
-rw-r--r--Tests/QtAutogen/MocInclude/Common/MixedSkipped.hpp17
-rw-r--r--Tests/QtAutogen/MocInclude/Common/None.cpp21
-rw-r--r--Tests/QtAutogen/MocInclude/Common/None.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/Common/None_p.h14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscore.cpp45
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscore.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.cpp21
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.hpp18
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra_p.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.cpp46
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.cpp21
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.hpp18
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra_p.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub_p.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OtherUnderscore_p.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnDot.cpp40
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnDot.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.cpp41
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore_p.h14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnDot_p.h14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnUnderscore.cpp23
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnUnderscore.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/Common/OwnUnderscore_p.h14
-rw-r--r--Tests/QtAutogen/MocInclude/Common/common.cpp.in32
-rw-r--r--Tests/QtAutogen/MocInclude/Common/moc_MixedCustom.cpp.in5
-rw-r--r--Tests/QtAutogen/MocInclude/EObjA.cpp44
-rw-r--r--Tests/QtAutogen/MocInclude/EObjA.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/EObjAExtra.cpp20
-rw-r--r--Tests/QtAutogen/MocInclude/EObjAExtra.hpp18
-rw-r--r--Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/EObjA_p.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/EObjB.cpp45
-rw-r--r--Tests/QtAutogen/MocInclude/EObjB.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/EObjB_p.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/LObjA.cpp39
-rw-r--r--Tests/QtAutogen/MocInclude/LObjA.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/LObjA_p.h14
-rw-r--r--Tests/QtAutogen/MocInclude/LObjB.cpp40
-rw-r--r--Tests/QtAutogen/MocInclude/LObjB.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/LObjB_p.h14
-rw-r--r--Tests/QtAutogen/MocInclude/ObjA.cpp20
-rw-r--r--Tests/QtAutogen/MocInclude/ObjA.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/ObjA_p.h14
-rw-r--r--Tests/QtAutogen/MocInclude/ObjB.cpp22
-rw-r--r--Tests/QtAutogen/MocInclude/ObjB.hpp19
-rw-r--r--Tests/QtAutogen/MocInclude/ObjB_p.h14
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/CMakeLists.txt17
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/RObjA.cpp (renamed from Tests/QtAutogen/MocIncludeRelaxed/RObjA.cpp)0
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/RObjA.hpp (renamed from Tests/QtAutogen/MocIncludeRelaxed/RObjA.hpp)0
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/RObjB.cpp23
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/RObjB.hpp (renamed from Tests/QtAutogen/MocIncludeRelaxed/RObjB.hpp)0
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/RObjBExtra.hpp (renamed from Tests/QtAutogen/MocIncludeRelaxed/RObjBExtra.hpp)0
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/RObjC.cpp31
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/RObjC.hpp (renamed from Tests/QtAutogen/MocIncludeRelaxed/RObjC.hpp)0
-rw-r--r--Tests/QtAutogen/MocInclude/Relaxed/relaxed.cpp21
-rw-r--r--Tests/QtAutogen/MocInclude/SObjA.cpp11
-rw-r--r--Tests/QtAutogen/MocInclude/SObjA.hpp15
-rw-r--r--Tests/QtAutogen/MocInclude/SObjB.cpp.in11
-rw-r--r--Tests/QtAutogen/MocInclude/SObjB.hpp.in15
-rw-r--r--Tests/QtAutogen/MocInclude/SObjC.cpp35
-rw-r--r--Tests/QtAutogen/MocInclude/SObjC.hpp15
-rw-r--r--Tests/QtAutogen/MocInclude/SObjCExtra.cpp31
-rw-r--r--Tests/QtAutogen/MocInclude/SObjCExtra.hpp15
-rw-r--r--Tests/QtAutogen/MocInclude/SObjCExtra.moc.in4
-rw-r--r--Tests/QtAutogen/MocInclude/Strict/CMakeLists.txt14
-rw-r--r--Tests/QtAutogen/MocInclude/Strict/strict.cpp7
-rw-r--r--Tests/QtAutogen/MocInclude/main.cpp9
-rw-r--r--Tests/QtAutogen/MocInclude/shared.cmake71
-rw-r--r--Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp20
-rw-r--r--Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp18
-rw-r--r--Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp14
-rw-r--r--Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp41
-rw-r--r--Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp17
-rw-r--r--Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp17
-rw-r--r--Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt20
-rw-r--r--Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp12
-rw-r--r--Tests/QtAutogen/MocIncludeRelaxed/RObjB.cpp22
-rw-r--r--Tests/QtAutogen/MocIncludeRelaxed/RObjC.cpp30
-rw-r--r--Tests/QtAutogen/MocIncludeRelaxed/main.cpp26
-rw-r--r--Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt10
-rw-r--r--Tests/QtAutogen/MocIncludeStrict/main.cpp26
-rw-r--r--Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt80
-rw-r--r--Tests/QtAutogen/MocOnly/main.cpp3
-rw-r--r--Tests/QtAutogen/MocOsMacros/TestClass.cpp1
-rw-r--r--Tests/QtAutogen/MocOsMacros/main.cpp3
-rw-r--r--Tests/QtAutogen/ObjectLibrary/a/classa.cpp1
-rw-r--r--Tests/QtAutogen/ObjectLibrary/b/classb.cpp1
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp3
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp3
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp3
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp3
-rw-r--r--Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp3
-rw-r--r--Tests/QtAutogen/SameName/CMakeLists.txt2
-rw-r--r--Tests/QtAutogen/SameName/main.cpp4
-rw-r--r--Tests/QtAutogen/SameName/object.hh13
-rw-r--r--Tests/QtAutogen/SameName/object_upper_ext.H13
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/a.cpp1
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/b.cpp1
-rw-r--r--Tests/QtAutogen/StaticLibraryCycle/c.cpp1
-rw-r--r--Tests/QtAutogen/Tests.cmake4
-rw-r--r--Tests/QtAutogen/UicInterface/libwidget.h3
-rw-r--r--Tests/QtAutogen/UicInterface/mywidget.h3
-rw-r--r--Tests/QtAutogen/UicSkipSource/skipUicGen.cpp1
-rw-r--r--Tests/QtAutogen/UicSkipSource/skipUicNoGen1.cpp1
-rw-r--r--Tests/QtAutogen/UicSkipSource/skipUicNoGen2.cpp1
-rw-r--r--Tests/RunCMake/Android/common.cmake37
-rw-r--r--Tests/RunCMake/Android/ndk-arm64-v8a-stdout.txt2
-rw-r--r--Tests/RunCMake/Android/ndk-armeabi-arm-stdout.txt2
-rw-r--r--Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stdout.txt2
-rw-r--r--Tests/RunCMake/Android/ndk-armeabi-v7a-stdout.txt2
-rw-r--r--Tests/RunCMake/Android/ndk-badver-stderr.txt5
-rw-r--r--Tests/RunCMake/Android/ndk-badvernum-stderr.txt6
-rw-r--r--Tests/RunCMake/Android/ndk-mips-stdout.txt2
-rw-r--r--Tests/RunCMake/Android/ndk-mips64-stdout.txt2
-rw-r--r--Tests/RunCMake/Android/ndk-x86-stdout.txt2
-rw-r--r--Tests/RunCMake/Android/ndk-x86_64-stdout.txt2
-rw-r--r--Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake35
-rw-r--r--Tests/RunCMake/AutoExportDll/hello.cxx1
-rw-r--r--Tests/RunCMake/AutoExportDll/say.cxx3
-rw-r--r--Tests/RunCMake/CMP0065/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/CMakeLists.txt67
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake11
-rw-r--r--Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/ExpectedFiles.cmake (renamed from Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/ExpectedFiles.cmake)0
-rw-r--r--Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt1
-rw-r--r--Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake26
-rw-r--r--Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/ExpectedFiles.cmake16
-rw-r--r--Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake65
-rw-r--r--Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake45
-rw-r--r--Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake9
-rw-r--r--Tests/RunCMake/CPackCommandLine/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CPackCommandLine/MultiConfig-check-stdout.txt4
-rw-r--r--Tests/RunCMake/CPackCommandLine/MultiConfig-package-stdout.txt8
-rw-r--r--Tests/RunCMake/CPackCommandLine/MultiConfig.cmake9
-rw-r--r--Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake23
-rw-r--r--Tests/RunCMake/CPackCommandLine/foo.c4
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt.in3
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/compare_options.cmake14
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stderr.txt1
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stdout.txt13
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand.cmake10
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-stdout.txt7
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult.cmake19
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-result.txt1
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stderr.txt2
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt2
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions.cmake8
-rw-r--r--Tests/RunCMake/CTestCommandExpandLists/test.cmake.in15
-rw-r--r--Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake13
-rw-r--r--Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake13
-rw-r--r--Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake16
-rw-r--r--Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake57
-rw-r--r--Tests/RunCMake/CTestCommandLine/SkipRegexFound-check.cmake13
-rw-r--r--Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py65
-rw-r--r--Tests/RunCMake/CTestCommandLine/show_only_json_check.pycbin1829 -> 0 bytes
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in9
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake23
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake169
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree1.cmake7
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree2-ctest-s-res-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/checkfree2.cmake8
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/combine.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc.log2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1.log1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2.log2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3.log3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4.log3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5.log1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good1.log14
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good2.log (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak.log1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin.log (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output)0
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend.log1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid.log2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nolog-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores.log2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough.log2
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-noproc-count-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badcount-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badres-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets1-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets2-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets3-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets4-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets5-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets6-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets7-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good1-check.cmake20
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good2-check.cmake6
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nocount-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nores-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nowidgets-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx399
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ensure_parallel-ctest-s-res-check.cmake16
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/ensure_parallel.cmake11
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/lotsoftests-ctest-s-res-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/lotsoftests.cmake16
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough1.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough2.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-check.cmake3
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-result.txt1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt4
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/notenough3.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake1
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/process_count.cmake5
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/resspec.json59
-rw-r--r--Tests/RunCMake/CTestResourceAllocation/test.cmake.in23
-rw-r--r--Tests/RunCMake/CommandLine/C-no-file-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/C_basic-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/C_basic-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/C_basic.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt4
-rw-r--r--Tests/RunCMake/CommandLine/C_basic_fullpath-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/C_basic_fullpath.cmake2
-rw-r--r--Tests/RunCMake/CommandLine/C_basic_initial-cache.txt5
-rw-r--r--Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt8
-rw-r--r--Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt2
-rw-r--r--Tests/RunCMake/CommandLine/C_buildsrcdir.cmake (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-empty.output)0
-rw-r--r--Tests/RunCMake/CommandLine/C_buildsrcdir/initial-cache.txt6
-rw-r--r--Tests/RunCMake/CommandLine/C_buildsrcdir/src/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/CommandLine/C_buildsrcdir/src/PreLoad.cmake6
-rw-r--r--Tests/RunCMake/CommandLine/Cno-file-stderr.txt2
-rw-r--r--Tests/RunCMake/CommandLine/E_false-extraargs-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_false-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-check.cmake6
-rw-r--r--Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-stderr.txt (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-empty.output)0
-rw-r--r--Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-check.cmake6
-rw-r--r--Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-stderr.txt (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output)0
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake39
-rw-r--r--Tests/RunCMake/CommandLine/trace-redirect-check.cmake13
-rw-r--r--Tests/RunCMake/CommandLine/trace-redirect-nofile-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/trace-redirect-nofile-stderr.txt1
-rw-r--r--Tests/RunCMake/CommandLine/trace-redirect-nofile.cmake (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output)0
-rw-r--r--Tests/RunCMake/CommandLine/trace-redirect-stdout.txt1
-rw-r--r--Tests/RunCMake/CommandLine/trace-redirect.cmake (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output)0
-rw-r--r--Tests/RunCMake/Configure/RerunCMake-build3-result.txt1
-rw-r--r--Tests/RunCMake/Configure/RerunCMake-build3-stdout.txt1
-rw-r--r--Tests/RunCMake/Configure/RerunCMake-build4-result.txt1
-rw-r--r--Tests/RunCMake/Configure/RerunCMake-build4-stdout.txt1
-rw-r--r--Tests/RunCMake/Configure/RerunCMake.cmake6
-rw-r--r--Tests/RunCMake/Configure/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/FPHSA/CustomMessageConfig.cmake1
-rw-r--r--Tests/RunCMake/FPHSA/CustomMessageConfigVersion.cmake4
-rw-r--r--Tests/RunCMake/FPHSA/FindCustomMessage.cmake17
-rw-r--r--Tests/RunCMake/FPHSA/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_1-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_1-stderr.txt7
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_1.cmake4
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_2-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_2-stderr.txt8
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_2.cmake5
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_3-result.txt1
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_3-stderr.txt9
-rw-r--r--Tests/RunCMake/FPHSA/custom_message_3.cmake5
-rw-r--r--Tests/RunCMake/FileAPI/check_index.pycbin8146 -> 0 bytes
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py238
-rw-r--r--Tests/RunCMake/FileAPI/cxx/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/FindBoost/CMakePackage-stdout.txt2
-rw-r--r--Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt2
-rw-r--r--Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt2
-rw-r--r--Tests/RunCMake/FindBoost/MissingTarget-stdout.txt2
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake28
-rw-r--r--Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake49
-rw-r--r--Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt3
-rw-r--r--Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt3
-rw-r--r--Tests/RunCMake/Framework/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp10
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake2
-rw-r--r--Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake12
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly-stderr.txt12
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly.cmake1
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetCudaVersionOnly-stdout.txt2
-rw-r--r--Tests/RunCMake/GeneratorToolset/TestToolsetCudaVersionOnly.cmake (renamed from Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake)0
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt2
-rw-r--r--Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt6
-rw-r--r--Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt2
-rw-r--r--Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt2
-rw-r--r--Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt2
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt2
-rw-r--r--Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt6
-rw-r--r--Tests/RunCMake/ObjectLibrary/InstallLinkedObj1-stderr.txt2
-rw-r--r--Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.c17
-rw-r--r--Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake12
-rw-r--r--Tests/RunCMake/ParseImplicitData/CMakeLists.txt91
-rw-r--r--Tests/RunCMake/ParseImplicitData/README26
-rw-r--r--Tests/RunCMake/ParseImplicitData/aix-C-XL-13.1.3.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/aix-C-XLClang-16.1.0.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XLClang-16.1.0.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/aix-CXX-XL-13.1.3.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/aix-CXX-XLClang-16.1.0.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XLClang-16.1.0.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-C-Cray-8.7.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-C-Cray-9.0-hlist-ad.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-C-GNU-7.3.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-C-Intel-18.0.2.20180210.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-CXX-Cray-8.7.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-CXX-Cray-9.0-hlist-ad.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-CXX-GNU-7.3.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-CXX-Intel-18.0.2.20180210.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-8.7.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-9.0-hlist-ad.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-Fortran-GNU-7.3.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/craype-Fortran-Intel-18.0.2.20180210.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/darwin-C-AppleClang-8.0.0.8000042.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/darwin-CXX-AppleClang-8.0.0.8000042.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/freebsd-C-Clang-3.3.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/freebsd-CXX-Clang-3.3.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/freebsd-Fortran-GNU-4.6.4.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/hand-C-empty.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-empty.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/hand-C-relative.input23
-rw-r--r--Tests/RunCMake/ParseImplicitData/hand-CXX-empty.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-empty.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/hand-CXX-relative.input23
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-C-GNU-7.3.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-C-Intel-18.0.0.20170811.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-C-PGI-18.10.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-C-XL-12.1.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-C-XL-16.1.0.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-10.1.168-CLANG.input242
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-10.1.168-XLClang-v.input51
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-9.2.148-GCC.input125
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CXX-GNU-7.3.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CXX-Intel-18.0.0.20170811.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CXX-PGI-18.10.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CXX-XL-12.1.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-CXX-XL-16.1.0.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-Fortran-GNU-7.3.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-Fortran-PGI-18.10.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux-Fortran-XL-14.1.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux_nostdinc-C-PGI-18.10.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux_nostdinc-C-XL-12.1.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux_nostdinc-CXX-PGI-18.10.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux_nostdinc-CXX-XL-12.1.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux_nostdinc-Fortran-PGI-18.10.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux_nostdinc_i-C-XL-12.1.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux_nostdinc_i-CXX-XL-12.1.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/linux_pgf77-Fortran-PGI-18.10.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/netbsd-C-GNU-4.8.5.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/netbsd-CXX-GNU-4.8.5.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/netbsd_nostdinc-C-GNU-4.8.5.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/netbsd_nostdinc-CXX-GNU-4.8.5.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/openbsd-C-Clang-5.0.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/openbsd-CXX-Clang-5.0.1.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos-C-SunPro-5.13.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos-CXX-SunPro-5.13.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitData/sunos-Fortran-SunPro-8.8.0.input (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake21
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt90
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/README25
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-relative.input21
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-relative.input21
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.input124
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-C-XL-13.1.3.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-C-XLClang-16.1.0.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XLClang-16.1.0.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-CXX-XL-13.1.3.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-CXX-XLClang-16.1.0.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XLClang-16.1.0.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Cray-8.7.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Cray-9.0-hlist-ad.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-GNU-7.3.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Intel-18.0.2.20180210.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Cray-8.7.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Cray-9.0-hlist-ad.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-GNU-7.3.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Intel-18.0.2.20180210.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-8.7.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-9.0-hlist-ad.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-GNU-7.3.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Intel-18.0.2.20180210.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin-C-AppleClang-8.0.0.8000042.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin-CXX-AppleClang-8.0.0.8000042.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-C-Clang-3.3.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-CXX-Clang-3.3.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-Fortran-GNU-4.6.4.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-C-empty.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-C-relative.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-relative.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-CXX-empty.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-CXX-relative.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-relative.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-GNU-7.3.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-Intel-18.0.0.20170811.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-PGI-18.10.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-XL-12.1.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-XL-16.1.0.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output1
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-GNU-7.3.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-Intel-18.0.0.20170811.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-PGI-18.10.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-XL-12.1.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-XL-16.1.0.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-GNU-7.3.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-PGI-18.10.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-XL-14.1.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-C-PGI-18.10.1.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-C-XL-12.1.0.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-CXX-XL-12.1.0.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc_i-C-XL-12.1.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc_i-CXX-XL-12.1.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/mingw.org-C-GNU-4.9.3.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/mingw.org-CXX-GNU-4.9.3.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd-C-GNU-4.8.5.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd-CXX-GNU-4.8.5.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/openbsd-C-Clang-5.0.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/openbsd-CXX-Clang-5.0.1.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-C-SunPro-5.13.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-CXX-SunPro-5.13.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-Fortran-SunPro-8.8.0.output (renamed from Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output)0
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake146
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XL-13.1.3.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XLClang-16.1.0.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XL-13.1.3.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XLClang-16.1.0.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-8.7.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-9.0-hlist-ad.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-GNU-7.3.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Intel-18.0.2.20180210.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-8.7.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-9.0-hlist-ad.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-GNU-7.3.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Intel-18.0.2.20180210.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-8.7.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-9.0-hlist-ad.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-GNU-7.3.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Intel-18.0.2.20180210.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-C-AppleClang-8.0.0.8000042.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-CXX-AppleClang-8.0.0.8000042.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-C-Clang-3.3.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-CXX-Clang-3.3.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-Fortran-GNU-4.6.4.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-empty.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-relative.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-empty.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-relative.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-C-GNU-4.9.3.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-CXX-GNU-4.9.3.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-C-GNU-4.8.5.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-CXX-GNU-4.8.5.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-C-Clang-5.0.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-CXX-Clang-5.0.1.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-C-SunPro-5.13.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-CXX-SunPro-5.13.0.output2
-rw-r--r--Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-Fortran-SunPro-8.8.0.output2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/DisabledPch-check.cmake12
-rw-r--r--Tests/RunCMake/PrecompileHeaders/DisabledPch.cmake14
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchInterface-check.cmake26
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchInterface.cmake21
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake26
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake12
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue-check.cmake8
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue.cmake11
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFrom.cmake27
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir-build-stderr.txt2
-rw-r--r--Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake18
-rw-r--r--Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake21
-rw-r--r--Tests/RunCMake/PrecompileHeaders/SkipPrecompileHeaders.cmake13
-rw-r--r--Tests/RunCMake/PrecompileHeaders/empty.c3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/foo.c13
-rw-r--r--Tests/RunCMake/PrecompileHeaders/foobar.c14
-rw-r--r--Tests/RunCMake/PrecompileHeaders/include/bar.h9
-rw-r--r--Tests/RunCMake/PrecompileHeaders/include/foo.h6
-rw-r--r--Tests/RunCMake/PrecompileHeaders/include/foo2.h6
-rw-r--r--Tests/RunCMake/PrecompileHeaders/main.cpp4
-rw-r--r--Tests/RunCMake/PrecompileHeaders/non-pch.cpp3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/pch.h3
-rw-r--r--Tests/RunCMake/PrecompileHeaders/subdir/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/README.rst6
-rw-r--r--Tests/RunCMake/RunCMake.cmake12
-rw-r--r--Tests/RunCMake/RuntimePath/Genex.cmake29
-rw-r--r--Tests/RunCMake/RuntimePath/GenexCheck.cmake7
-rw-r--r--Tests/RunCMake/RuntimePath/RunCMakeTest.cmake34
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/UnityBuild/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/UnityBuild/RunCMakeTest.cmake23
-rw-r--r--Tests/RunCMake/UnityBuild/func.c6
-rw-r--r--Tests/RunCMake/UnityBuild/func.h6
-rw-r--r--Tests/RunCMake/UnityBuild/main.c6
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake11
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_batchsize.cmake16
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake5
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c.cmake12
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake11
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx.cmake17
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake5
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build.cmake10
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake7
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include.cmake13
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake5
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_cxx.cmake12
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake7
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_default_batchsize.cmake15
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake7
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_order.cmake12
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake9
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake14
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_skip.cmake30
-rw-r--r--Tests/RunCMake/VS10Project/Dir/DirNested/foo_nested.cpp3
-rw-r--r--Tests/RunCMake/VS10Project/Dir/foo.cpp3
-rw-r--r--Tests/RunCMake/VS10Project/Prefixed/PrefixedNested/bar_nested.cpp3
-rw-r--r--Tests/RunCMake/VS10Project/Prefixed/bar.cpp3
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake14
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake30
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake35
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake26
-rw-r--r--Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake45
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake45
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildNative.cmake12
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake48
-rw-r--r--Tests/RunCMake/VS10Project/UnityBuildPre2017.cmake12
-rw-r--r--Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsConfigurationType.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAware-check.cmake41
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAware.cmake19
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt1
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt3
-rw-r--r--Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake8
-rw-r--r--Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake2
-rw-r--r--Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake66
-rw-r--r--Tests/RunCMake/VS10Project/VsPrecompileHeaders.cmake4
-rw-r--r--Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName-result.txt1
-rw-r--r--Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName-stderr.txt7
-rw-r--r--Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName.cmake9
-rw-r--r--Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake17
-rw-r--r--Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake20
-rw-r--r--Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake0
-rw-r--r--Tests/RunCMake/XcodeProject/RunCMakeTest.cmake16
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeBundles.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake1
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake12
-rw-r--r--Tests/RunCMake/XcodeProject/XcodeObjcxxFlags.cmake12
-rw-r--r--Tests/RunCMake/XcodeProject/XcodePrecompileHeaders-check.cmake35
-rw-r--r--Tests/RunCMake/XcodeProject/XcodePrecompileHeaders.cmake4
-rw-r--r--Tests/RunCMake/XcodeProject/myfuncs.m3
-rw-r--r--Tests/RunCMake/XcodeProject/myfuncs.mm3
-rw-r--r--Tests/RunCMake/add_custom_command/AppendLiteralQuotes-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/AppendLiteralQuotes-stderr.txt7
-rw-r--r--Tests/RunCMake/add_custom_command/AppendLiteralQuotes.cmake2
-rw-r--r--Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt2
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt36
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct.cmake6
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput-stderr.txt36
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput.cmake6
-rw-r--r--Tests/RunCMake/add_custom_command/GeneratedProperty.cmake10
-rw-r--r--Tests/RunCMake/add_custom_command/LiteralQuotes-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/LiteralQuotes-stderr.txt7
-rw-r--r--Tests/RunCMake/add_custom_command/LiteralQuotes.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/add_custom_command/TargetLiteralQuotes-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_command/TargetLiteralQuotes-stderr.txt7
-rw-r--r--Tests/RunCMake/add_custom_command/TargetLiteralQuotes.cmake2
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt36
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct.cmake6
-rw-r--r--Tests/RunCMake/add_custom_target/GeneratedProperty.cmake14
-rw-r--r--Tests/RunCMake/add_custom_target/LiteralQuotes-result.txt1
-rw-r--r--Tests/RunCMake/add_custom_target/LiteralQuotes-stderr.txt7
-rw-r--r--Tests/RunCMake/add_custom_target/LiteralQuotes.cmake1
-rw-r--r--Tests/RunCMake/add_custom_target/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt2
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake2
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/SubSub/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/SubSub/subsub.cpp4
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/check-sub.cmake2
-rw-r--r--Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake2
-rw-r--r--Tests/RunCMake/color_warning.c7
-rw-r--r--Tests/RunCMake/ctest_build/IgnoreColor-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_build/RunCMakeTest.cmake8
-rw-r--r--Tests/RunCMake/ctest_build/test.cmake.in5
-rw-r--r--Tests/RunCMake/ctest_start/AppendDifferentGroup-stderr.txt1
-rw-r--r--Tests/RunCMake/ctest_start/AppendDifferentGroup-stdout.txt8
-rw-r--r--Tests/RunCMake/ctest_start/AppendDifferentTrack-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_start/MissingGroupArg-result.txt1
-rw-r--r--Tests/RunCMake/ctest_start/MissingGroupArg-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_start/MissingGroupArgAppend-result.txt1
-rw-r--r--Tests/RunCMake/ctest_start/MissingGroupArgAppend-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_start/MissingGroupArgQuiet-result.txt1
-rw-r--r--Tests/RunCMake/ctest_start/MissingGroupArgQuiet-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_start/MissingTrackArg-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_start/MissingTrackArgAppend-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_start/MissingTrackArgQuiet-stderr.txt2
-rw-r--r--Tests/RunCMake/ctest_start/NoAppendDifferentGroup-stdout.txt7
-rw-r--r--Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt2
-rw-r--r--Tests/RunCMake/ctest_start/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/ctest_start/WriteModelToTagNoMatchingGroup-check.cmake1
-rw-r--r--Tests/RunCMake/export/DependOnDoubleExport-result.txt1
-rw-r--r--Tests/RunCMake/export/DependOnDoubleExport-stderr.txt13
-rw-r--r--Tests/RunCMake/export/DependOnDoubleExport.cmake7
-rw-r--r--Tests/RunCMake/export/DependOnNotExport-result.txt1
-rw-r--r--Tests/RunCMake/export/DependOnNotExport-stderr.txt6
-rw-r--r--Tests/RunCMake/export/DependOnNotExport.cmake4
-rw-r--r--Tests/RunCMake/export/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/find_file/FromPATHEnv-stdout-cygwin.txt9
-rw-r--r--Tests/RunCMake/find_file/FromPATHEnv-stdout-windows.txt9
-rw-r--r--Tests/RunCMake/find_file/FromPATHEnv-stdout.txt9
-rw-r--r--Tests/RunCMake/find_file/FromPATHEnv.cmake24
-rw-r--r--Tests/RunCMake/find_file/FromPrefixPath-stdout.txt6
-rw-r--r--Tests/RunCMake/find_file/FromPrefixPath.cmake19
-rw-r--r--Tests/RunCMake/find_file/PrefixInPATH-stdout-cygwin.txt4
-rw-r--r--Tests/RunCMake/find_file/PrefixInPATH-stdout-windows.txt4
-rw-r--r--Tests/RunCMake/find_file/PrefixInPATH-stdout.txt6
-rw-r--r--Tests/RunCMake/find_file/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/find_library/FromPATHEnv-stdout-cygwin.txt6
-rw-r--r--Tests/RunCMake/find_library/FromPATHEnv-stdout-windows.txt6
-rw-r--r--Tests/RunCMake/find_library/FromPATHEnv-stdout.txt6
-rw-r--r--Tests/RunCMake/find_library/FromPATHEnv.cmake22
-rw-r--r--Tests/RunCMake/find_library/FromPrefixPath-stdout.txt6
-rw-r--r--Tests/RunCMake/find_library/FromPrefixPath.cmake24
-rw-r--r--Tests/RunCMake/find_library/PrefixInPATH-stdout-cygwin.txt4
-rw-r--r--Tests/RunCMake/find_library/PrefixInPATH-stdout-windows.txt4
-rw-r--r--Tests/RunCMake/find_library/PrefixInPATH-stdout.txt6
-rw-r--r--Tests/RunCMake/find_library/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnv-stdout.txt9
-rw-r--r--Tests/RunCMake/find_package/FromPATHEnv.cmake27
-rw-r--r--Tests/RunCMake/find_package/FromPrefixPath-stdout.txt9
-rw-r--r--Tests/RunCMake/find_package/FromPrefixPath.cmake29
-rw-r--r--Tests/RunCMake/find_package/RunCMakeTest.cmake2
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnv-stdout-cygwin.txt9
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnv-stdout-windows.txt9
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnv-stdout.txt9
-rw-r--r--Tests/RunCMake/find_path/FromPATHEnv.cmake25
-rw-r--r--Tests/RunCMake/find_path/PrefixInPATH-stdout-cygwin.txt4
-rw-r--r--Tests/RunCMake/find_path/PrefixInPATH-stdout-windows.txt4
-rw-r--r--Tests/RunCMake/find_path/PrefixInPATH-stdout.txt6
-rw-r--r--Tests/RunCMake/find_path/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/find_program/EnvAndHints-stdout.txt3
-rw-r--r--Tests/RunCMake/find_program/EnvAndHints.cmake23
-rw-r--r--Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt2
-rw-r--r--Tests/RunCMake/find_program/RelAndAbsPath.cmake23
-rw-r--r--Tests/RunCMake/install/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/install/RunCMakeTest.cmake46
-rw-r--r--Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake30
-rw-r--r--Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake63
-rw-r--r--Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt23
-rw-r--r--Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake72
-rw-r--r--Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake15
-rw-r--r--Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake18
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt18
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake2
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt18
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake2
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake44
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt119
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake54
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake30
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt2
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake18
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake169
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c9
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c8
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake157
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake55
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake30
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt2
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake18
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake216
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c6
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt13
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt5
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake2
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake38
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake47
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt5
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake28
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt1
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt2
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake18
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake114
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c7
-rw-r--r--Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c6
-rw-r--r--Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt4
-rw-r--r--Tests/RunCMake/message/RunCMakeTest.cmake92
-rw-r--r--Tests/RunCMake/message/message-indent-multiline-stderr.txt3
-rw-r--r--Tests/RunCMake/message/message-indent-multiline-stdout.txt8
-rw-r--r--Tests/RunCMake/message/message-indent-multiline.cmake13
-rw-r--r--Tests/RunCMake/message/message-indent-stdout.txt13
-rw-r--r--Tests/RunCMake/message/message-indent.cmake19
-rw-r--r--Tests/RunCMake/message/message-log-level-debug-stderr.txt12
-rw-r--r--Tests/RunCMake/message/message-log-level-debug-stdout.txt3
-rw-r--r--Tests/RunCMake/message/message-log-level-default-stderr.txt12
-rw-r--r--Tests/RunCMake/message/message-log-level-default-stdout.txt1
-rw-r--r--Tests/RunCMake/message/message-log-level-invalid-result.txt1
-rw-r--r--Tests/RunCMake/message/message-log-level-invalid-stderr.txt1
-rw-r--r--Tests/RunCMake/message/message-log-level-notice-stderr.txt12
-rw-r--r--Tests/RunCMake/message/message-log-level-status-stderr.txt12
-rw-r--r--Tests/RunCMake/message/message-log-level-status-stdout.txt1
-rw-r--r--Tests/RunCMake/message/message-log-level-trace-stderr.txt12
-rw-r--r--Tests/RunCMake/message/message-log-level-trace-stdout.txt4
-rw-r--r--Tests/RunCMake/message/message-log-level-verbose-stderr.txt12
-rw-r--r--Tests/RunCMake/message/message-log-level-verbose-stdout.txt2
-rw-r--r--Tests/RunCMake/message/message-log-level-warning-stderr.txt9
-rw-r--r--Tests/RunCMake/message/warnmessage-rootdir-stderr.txt1
-rw-r--r--Tests/RunCMake/message/warnmessage-rootdir.cmake5
-rw-r--r--Tests/RunCMake/project/CMP0048-NEW.cmake7
-rw-r--r--Tests/RunCMake/project/CMP0096-NEW-stdout.txt30
-rw-r--r--Tests/RunCMake/project/CMP0096-NEW.cmake6
-rw-r--r--Tests/RunCMake/project/CMP0096-OLD-stdout.txt20
-rw-r--r--Tests/RunCMake/project/CMP0096-OLD.cmake3
-rw-r--r--Tests/RunCMake/project/CMP0096-WARN-stdout.txt20
-rw-r--r--Tests/RunCMake/project/CMP0096-WARN.cmake3
-rw-r--r--Tests/RunCMake/project/CMP0096-common.cmake9
-rw-r--r--Tests/RunCMake/project/PrintVersions.cmake6
-rw-r--r--Tests/RunCMake/project/RunCMakeTest.cmake5
-rw-r--r--Tests/RunCMake/project/VersionMax.cmake32
-rw-r--r--Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake11
-rw-r--r--Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/CMP0067-stderr.txt11
-rw-r--r--Tests/RunCMake/try_compile/ObjCStandard-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/ObjCStandard-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/ObjCStandard.cmake7
-rw-r--r--Tests/RunCMake/try_compile/ObjCxxStandard-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt7
-rw-r--r--Tests/RunCMake/try_compile/ObjCxxStandard.cmake7
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake6
-rw-r--r--Tests/RunCMake/try_compile/src.m4
-rw-r--r--Tests/RunCMake/try_compile/src.mm4
-rw-r--r--Tests/RuntimePath/CMakeLists.txt13
-rw-r--r--Tests/SourceFileProperty/CMakeLists.txt22
-rw-r--r--Tests/SystemInformation/DumpInformation.cxx2
-rw-r--r--Tests/TestsWorkingDirectory/main.c3
-rw-r--r--Tests/TryCompile/CMakeLists.txt73
-rw-r--r--Tests/TryCompile/fail.m1
-rw-r--r--Tests/TryCompile/pass.m4
-rw-r--r--Tests/Tutorial/Complete/CMakeLists.txt116
-rw-r--r--Tests/Tutorial/Complete/Config.cmake.in4
-rw-r--r--Tests/Tutorial/Complete/License.txt2
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt68
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Complete/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Complete/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Complete/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Consumer/CMakeLists.txt51
-rw-r--r--Tests/Tutorial/Consumer/Config.cmake.in14
-rw-r--r--Tests/Tutorial/Consumer/consumer.cxx11
-rw-r--r--Tests/Tutorial/Consumer/directions.txt6
-rw-r--r--Tests/Tutorial/MultiPackage/CMakeLists.txt109
-rw-r--r--Tests/Tutorial/MultiPackage/Config.cmake.in4
-rw-r--r--Tests/Tutorial/MultiPackage/License.txt2
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt68
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake7
-rw-r--r--Tests/Tutorial/MultiPackage/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/MultiPackage/directions.txt34
-rw-r--r--Tests/Tutorial/MultiPackage/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Readme.txt16
-rw-r--r--Tests/Tutorial/Step1/CMakeLists.txt3
-rw-r--r--Tests/Tutorial/Step1/TutorialConfig.h.in4
-rw-r--r--Tests/Tutorial/Step1/directions.txt95
-rw-r--r--Tests/Tutorial/Step1/tutorial.cxx20
-rw-r--r--Tests/Tutorial/Step10/CMakeLists.txt77
-rw-r--r--Tests/Tutorial/Step10/License.txt2
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt61
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Step10/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step10/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step10/directions.txt38
-rw-r--r--Tests/Tutorial/Step10/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step11/CMakeLists.txt77
-rw-r--r--Tests/Tutorial/Step11/License.txt2
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt60
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/MathFunctions.h14
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx45
-rw-r--r--Tests/Tutorial/Step11/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step11/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step11/directions.txt104
-rw-r--r--Tests/Tutorial/Step11/tutorial.cxx25
-rw-r--r--Tests/Tutorial/Step2/CMakeLists.txt25
-rw-r--r--Tests/Tutorial/Step2/MathFunctions/CMakeLists.txt1
-rw-r--r--Tests/Tutorial/Step2/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx23
-rw-r--r--Tests/Tutorial/Step2/TutorialConfig.h.in4
-rw-r--r--Tests/Tutorial/Step2/directions.txt102
-rw-r--r--Tests/Tutorial/Step2/tutorial.cxx23
-rw-r--r--Tests/Tutorial/Step3/CMakeLists.txt38
-rw-r--r--Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt1
-rw-r--r--Tests/Tutorial/Step3/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx23
-rw-r--r--Tests/Tutorial/Step3/TutorialConfig.h.in5
-rw-r--r--Tests/Tutorial/Step3/directions.txt26
-rw-r--r--Tests/Tutorial/Step3/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step4/CMakeLists.txt36
-rw-r--r--Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt7
-rw-r--r--Tests/Tutorial/Step4/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx23
-rw-r--r--Tests/Tutorial/Step4/TutorialConfig.h.in5
-rw-r--r--Tests/Tutorial/Step4/directions.txt72
-rw-r--r--Tests/Tutorial/Step4/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step5/CMakeLists.txt70
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt10
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx23
-rw-r--r--Tests/Tutorial/Step5/TutorialConfig.h.in5
-rw-r--r--Tests/Tutorial/Step5/directions.txt69
-rw-r--r--Tests/Tutorial/Step5/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step6/CMakeLists.txt76
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt14
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx33
-rw-r--r--Tests/Tutorial/Step6/TutorialConfig.h.in9
-rw-r--r--Tests/Tutorial/Step6/directions.txt104
-rw-r--r--Tests/Tutorial/Step6/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step7/CMakeLists.txt76
-rw-r--r--Tests/Tutorial/Step7/License.txt2
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt29
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx34
-rw-r--r--Tests/Tutorial/Step7/TutorialConfig.h.in9
-rw-r--r--Tests/Tutorial/Step7/build1.cmake5
-rw-r--r--Tests/Tutorial/Step7/directions.txt40
-rw-r--r--Tests/Tutorial/Step7/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step8/CMakeLists.txt82
-rw-r--r--Tests/Tutorial/Step8/License.txt2
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt29
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx42
-rw-r--r--Tests/Tutorial/Step8/TutorialConfig.h.in8
-rw-r--r--Tests/Tutorial/Step8/directions.txt38
-rw-r--r--Tests/Tutorial/Step8/tutorial.cxx32
-rw-r--r--Tests/Tutorial/Step9/CMakeLists.txt81
-rw-r--r--Tests/Tutorial/Step9/CTestConfig.cmake15
-rw-r--r--Tests/Tutorial/Step9/License.txt2
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt35
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx25
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx18
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/MathFunctions.h1
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx41
-rw-r--r--Tests/Tutorial/Step9/MathFunctions/mysqrt.h6
-rw-r--r--Tests/Tutorial/Step9/TutorialConfig.h.in3
-rw-r--r--Tests/Tutorial/Step9/directions.txt166
-rw-r--r--Tests/Tutorial/Step9/tutorial.cxx33
-rw-r--r--Tests/VSExternalInclude/Lib2/lib2.cpp1
-rw-r--r--Tests/VSMidl/src/main.cpp3
-rw-r--r--Tests/VSNsightTegra/jni/second.c3
-rw-r--r--Tests/VSResource/main.cpp3
-rw-r--r--Tests/VSWinStorePhone/CMakeLists.txt3
-rw-r--r--Tests/VSWinStorePhone/CxxDLL/CMakeLists.txt3
-rw-r--r--Tests/VSWinStorePhone/CxxDLL/cxxdll.cpp8
-rw-r--r--Tests/VSWinStorePhone/CxxDLL/cxxdll.h5
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp2
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.h2
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.cpp2
-rw-r--r--Tests/VSWinStorePhone/Direct3DApp1/pch.h3
-rw-r--r--Tests/VSWinStorePhone/VerifyAppPackage.cmake34
-rw-r--r--Tests/VSXaml/App.xaml.cpp3
-rw-r--r--Tests/VSXaml/MainPage.xaml.cpp4
-rw-r--r--Tests/X11/HelloWorldX11.cxx1
1256 files changed, 12433 insertions, 5922 deletions
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
index fb17ebb60..21b265cea 100644
--- a/Tests/Assembler/CMakeLists.txt
+++ b/Tests/Assembler/CMakeLists.txt
@@ -7,9 +7,10 @@ set(SRCS)
# (at least) the following toolchains can process assembler files directly
# and also generate assembler files from C:
-if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode" AND
+if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode|Ninja" AND
NOT CMAKE_OSX_ARCHITECTURES)
- if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX))
+ if((CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang|HP|SunPro|XL)$") OR (CMAKE_C_COMPILER_ID STREQUAL "Intel" AND UNIX)
+ AND NOT (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC"))
set(C_FLAGS "${CMAKE_C_FLAGS}")
separate_arguments(C_FLAGS)
if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND NOT ";${C_FLAGS};" MATCHES ";${CMAKE_C_SYSROOT_FLAG};")
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index 39a5131fe..c1ad17cd3 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -62,6 +62,12 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_dir.hxx
"static const char* zot_macro_dir = \"zot_macro_dir\";\n")
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx
"static const char* zot_macro_tgt = \"zot_macro_tgt\";\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_pch.hxx
+ "#ifndef ZOT_PCH_HXX\n"
+ "#define ZOT_PCH_HXX\n"
+ "static const char* zot_pch = \"zot_pch\";\n"
+ "#endif\n"
+ )
file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_lib.h
"#define link_depends_no_shared_lib_value 1\n")
@@ -155,7 +161,7 @@ execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
string(REGEX REPLACE "[\r\n]" " " out "${out}")
message("Run result: ${runResult} Output: \"${out}\"")
-set(VALUE_UNCHANGED "[zot] [zot_custom] [zot_macro_dir] [zot_macro_tgt] ")
+set(VALUE_UNCHANGED "[zot] [zot_custom] [zot_macro_dir] [zot_macro_tgt] [zot_pch] ")
if("${out}" STREQUAL "${VALUE_UNCHANGED}")
message("Worked!")
else()
@@ -245,6 +251,12 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_dir.hxx
"static const char* zot_macro_dir = \"zot_macro_dir changed\";\n")
file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx
"static const char* zot_macro_tgt = \"zot_macro_tgt changed\";\n")
+file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_pch.hxx
+ "#ifndef ZOT_PCH_HXX\n"
+ "#define ZOT_PCH_HXX\n"
+ "static const char* zot_pch = \"zot_pch changed\";\n"
+ "#endif\n"
+ )
file(WRITE ${BuildDepends_BINARY_DIR}/Project/link_depends_no_shared_lib.h
"#define link_depends_no_shared_lib_value 0\n")
@@ -326,7 +338,7 @@ string(REGEX REPLACE "[\r\n]" " " out "${out}")
message("Run result: ${runResult} Output: \"${out}\"")
set(VALUE_CHANGED
- "[zot changed] [zot_custom changed] [zot_macro_dir changed] [zot_macro_tgt changed] "
+ "[zot changed] [zot_custom changed] [zot_macro_dir changed] [zot_macro_tgt changed] [zot_pch changed] "
)
if("${out}" STREQUAL "${VALUE_CHANGED}")
message("Worked!")
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index 3f41b26d0..833880098 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -93,6 +93,12 @@ add_executable(zot zot.cxx ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx
zot_macro_dir.cxx zot_macro_tgt.cxx)
add_dependencies(zot zot_custom)
+add_library(zot_pch zot_pch.cxx)
+target_link_libraries(zot zot_pch)
+if(NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]")
+ target_precompile_headers(zot_pch PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/zot_pch.hxx)
+endif()
+
# Test the #include line macro transformation rule support.
set_property(
TARGET zot
diff --git a/Tests/BuildDepends/Project/ninjadep.cpp b/Tests/BuildDepends/Project/ninjadep.cpp
index e794448f2..d3447e2e2 100644
--- a/Tests/BuildDepends/Project/ninjadep.cpp
+++ b/Tests/BuildDepends/Project/ninjadep.cpp
@@ -1,6 +1,7 @@
-#include "dir/header.h"
#include <stdio.h>
+#include "dir/header.h"
+
int main()
{
printf("HEADER_STRING: %s\n", HEADER_STRING);
diff --git a/Tests/BuildDepends/Project/zot.cxx b/Tests/BuildDepends/Project/zot.cxx
index faee7d3ce..2d08c4b78 100644
--- a/Tests/BuildDepends/Project/zot.cxx
+++ b/Tests/BuildDepends/Project/zot.cxx
@@ -4,11 +4,12 @@
const char* zot_macro_dir_f();
const char* zot_macro_tgt_f();
+const char* zot_pch_f();
int main()
{
- printf("[%s] [%s] [%s] [%s]\n", zot, zot_custom, zot_macro_dir_f(),
- zot_macro_tgt_f());
+ printf("[%s] [%s] [%s] [%s] [%s]\n", zot, zot_custom, zot_macro_dir_f(),
+ zot_macro_tgt_f(), zot_pch_f());
fflush(stdout);
return 0;
}
diff --git a/Tests/BuildDepends/Project/zot_pch.cxx b/Tests/BuildDepends/Project/zot_pch.cxx
new file mode 100644
index 000000000..d9d04c7fa
--- /dev/null
+++ b/Tests/BuildDepends/Project/zot_pch.cxx
@@ -0,0 +1,6 @@
+#include <zot_pch.hxx>
+
+const char* zot_pch_f()
+{
+ return zot_pch;
+}
diff --git a/Tests/BundleTest/BundleLib.cxx b/Tests/BundleTest/BundleLib.cxx
index 2e4325cf9..b7fd70d9a 100644
--- a/Tests/BundleTest/BundleLib.cxx
+++ b/Tests/BundleTest/BundleLib.cxx
@@ -1,10 +1,9 @@
+#include <CoreFoundation/CoreFoundation.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <CoreFoundation/CoreFoundation.h>
-
int fileExists(char* filename)
{
#ifndef R_OK
diff --git a/Tests/BundleTest/BundleSubDir/CMakeLists.txt b/Tests/BundleTest/BundleSubDir/CMakeLists.txt
index 2f7f2c44b..5f91f20d1 100644
--- a/Tests/BundleTest/BundleSubDir/CMakeLists.txt
+++ b/Tests/BundleTest/BundleSubDir/CMakeLists.txt
@@ -35,7 +35,11 @@ install(TARGETS SecondBundle DESTINATION Applications)
# installed into a location that uses this output name this will fail if the
# bundle does not respect the name. Also the executable will not be found by
# the test driver if this does not work.
-set_target_properties(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe)
+set_target_properties(SecondBundle PROPERTIES
+ OUTPUT_NAME SecondBundleExe
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
+ XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO"
+ )
# Express one app bundle in terms of another's SOURCES to verify that
# the generators do not expose the Info.plist of one to the other.
diff --git a/Tests/BundleTest/BundleTest.cxx b/Tests/BundleTest/BundleTest.cxx
index a5e8f5997..9b70e526e 100644
--- a/Tests/BundleTest/BundleTest.cxx
+++ b/Tests/BundleTest/BundleTest.cxx
@@ -1,6 +1,5 @@
-#include <stdio.h>
-
#include <CoreFoundation/CoreFoundation.h>
+#include <stdio.h>
extern int foo(char* exec);
diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt
index 853da3538..1bedc708d 100644
--- a/Tests/BundleTest/CMakeLists.txt
+++ b/Tests/BundleTest/CMakeLists.txt
@@ -56,7 +56,11 @@ install(TARGETS BundleTest DESTINATION Applications)
# installed into a location that uses this output name this will fail if the
# bundle does not respect the name. Also the executable will not be found by
# the test driver if this does not work.
-set_target_properties(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe)
+set_target_properties(BundleTest PROPERTIES
+ OUTPUT_NAME BundleTestExe
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
+ XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO"
+ )
# Test executable versioning if it is supported.
if(NOT XCODE)
diff --git a/Tests/BundleUtilities/framework.cpp b/Tests/BundleUtilities/framework.cpp
index abda195ed..b5a95d89d 100644
--- a/Tests/BundleUtilities/framework.cpp
+++ b/Tests/BundleUtilities/framework.cpp
@@ -1,5 +1,6 @@
#include "framework.h"
+
#include "stdio.h"
void framework()
diff --git a/Tests/BundleUtilities/module.cpp b/Tests/BundleUtilities/module.cpp
index 51730d9de..64bc369af 100644
--- a/Tests/BundleUtilities/module.cpp
+++ b/Tests/BundleUtilities/module.cpp
@@ -1,5 +1,6 @@
#include "module.h"
+
#include "shared2.h"
#include "stdio.h"
diff --git a/Tests/BundleUtilities/shared.cpp b/Tests/BundleUtilities/shared.cpp
index e5e7dc5ae..13791c269 100644
--- a/Tests/BundleUtilities/shared.cpp
+++ b/Tests/BundleUtilities/shared.cpp
@@ -1,5 +1,6 @@
#include "shared.h"
+
#include "stdio.h"
void shared()
diff --git a/Tests/BundleUtilities/shared2.cpp b/Tests/BundleUtilities/shared2.cpp
index 84af5d061..bed19048b 100644
--- a/Tests/BundleUtilities/shared2.cpp
+++ b/Tests/BundleUtilities/shared2.cpp
@@ -1,5 +1,6 @@
#include "shared2.h"
+
#include "stdio.h"
void shared2()
diff --git a/Tests/CFBundleTest/CMakeLists.txt b/Tests/CFBundleTest/CMakeLists.txt
index 0fe6bb771..b2b1b7316 100644
--- a/Tests/CFBundleTest/CMakeLists.txt
+++ b/Tests/CFBundleTest/CMakeLists.txt
@@ -50,6 +50,8 @@ set_source_files_properties(
set_target_properties(CFBundleTest PROPERTIES
BUNDLE 1
BUNDLE_EXTENSION plugin
+ XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ""
+ XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO"
XCODE_ATTRIBUTE_MACH_O_TYPE mh_bundle
XCODE_ATTRIBUTE_INFOPLIST_FILE ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_BINARY_DIR}/Info.plist
diff --git a/Tests/CMakeCommands/target_include_directories/consumer.cpp b/Tests/CMakeCommands/target_include_directories/consumer.cpp
index 267b0a342..d34965022 100644
--- a/Tests/CMakeCommands/target_include_directories/consumer.cpp
+++ b/Tests/CMakeCommands/target_include_directories/consumer.cpp
@@ -1,5 +1,6 @@
#include "consumer.h"
+
#include "common.h"
#include "cxx_only.h"
#include "interfaceinclude.h"
diff --git a/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.h b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.h
index 3235b9bf1..e93901335 100644
--- a/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.h
+++ b/Tests/CMakeCommands/target_link_libraries/cmp0022/cmp0022lib.h
@@ -1,6 +1,5 @@
-#include "cmp0022lib_export.h"
-
#include "cmp0022ifacelib.h"
+#include "cmp0022lib_export.h"
CMP0022Iface CMP0022LIB_EXPORT cmp0022();
diff --git a/Tests/CMakeCommands/target_link_libraries/depB.cpp b/Tests/CMakeCommands/target_link_libraries/depB.cpp
index 4f46552d7..276a91ae4 100644
--- a/Tests/CMakeCommands/target_link_libraries/depB.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/depB.cpp
@@ -2,7 +2,6 @@
#include "depB.h"
#include "depA.h"
-
#include "libgenex.h"
int DepB::foo()
diff --git a/Tests/CMakeCommands/target_link_libraries/depC.h b/Tests/CMakeCommands/target_link_libraries/depC.h
index 01c9e06bb..af7bfa3d9 100644
--- a/Tests/CMakeCommands/target_link_libraries/depC.h
+++ b/Tests/CMakeCommands/target_link_libraries/depC.h
@@ -1,7 +1,6 @@
-#include "depc_export.h"
-
#include "depA.h"
+#include "depc_export.h"
struct DEPC_EXPORT DepC
{
diff --git a/Tests/CMakeCommands/target_link_libraries/depD.h b/Tests/CMakeCommands/target_link_libraries/depD.h
index d24ff5f7c..e3700c36a 100644
--- a/Tests/CMakeCommands/target_link_libraries/depD.h
+++ b/Tests/CMakeCommands/target_link_libraries/depD.h
@@ -1,7 +1,6 @@
-#include "depd_export.h"
-
#include "depA.h"
+#include "depd_export.h"
struct DEPD_EXPORT DepD
{
diff --git a/Tests/CMakeCommands/target_link_libraries/newsignature1.cpp b/Tests/CMakeCommands/target_link_libraries/newsignature1.cpp
index 1caa516ad..b23b7a0aa 100644
--- a/Tests/CMakeCommands/target_link_libraries/newsignature1.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/newsignature1.cpp
@@ -2,7 +2,6 @@
#include "depB.h"
#include "depC.h"
#include "depIfaceOnly.h"
-
#include "subdirlib.h"
int main(int, char**)
diff --git a/Tests/CMakeCommands/target_link_libraries/targetA.cpp b/Tests/CMakeCommands/target_link_libraries/targetA.cpp
index 1caa516ad..b23b7a0aa 100644
--- a/Tests/CMakeCommands/target_link_libraries/targetA.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/targetA.cpp
@@ -2,7 +2,6 @@
#include "depB.h"
#include "depC.h"
#include "depIfaceOnly.h"
-
#include "subdirlib.h"
int main(int, char**)
diff --git a/Tests/CMakeCommands/target_link_libraries/targetC.cpp b/Tests/CMakeCommands/target_link_libraries/targetC.cpp
index cae02b9cd..11efb3d5f 100644
--- a/Tests/CMakeCommands/target_link_libraries/targetC.cpp
+++ b/Tests/CMakeCommands/target_link_libraries/targetC.cpp
@@ -1,7 +1,6 @@
-#include "depG.h"
-
#include "bar.h"
+#include "depG.h"
#include "foo.h"
#ifndef TEST_DEF
diff --git a/Tests/CMakeLib/CMakeLists.txt b/Tests/CMakeLib/CMakeLists.txt
index a25f25af0..840afc168 100644
--- a/Tests/CMakeLib/CMakeLists.txt
+++ b/Tests/CMakeLib/CMakeLists.txt
@@ -2,14 +2,21 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMake_BINARY_DIR}/Source
${CMake_SOURCE_DIR}/Source
+ ${CMake_SOURCE_DIR}/Source/CTest
)
set(CMakeLib_TESTS
testArgumentParser.cxx
+ testCTestBinPacker.cxx
+ testCTestResourceAllocator.cxx
+ testCTestResourceSpec.cxx
+ testCTestResourceGroups.cxx
testGeneratedFileStream.cxx
testRST.cxx
testRange.cxx
+ testOptional.cxx
testString.cxx
+ testStringAlgorithms.cxx
testSystemTools.cxx
testUTF8.cxx
testXMLParser.cxx
@@ -25,6 +32,7 @@ add_executable(testUVProcessChainHelper testUVProcessChainHelper.cxx)
set(testRST_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
set(testUVProcessChain_ARGS $<TARGET_FILE:testUVProcessChainHelper>)
set(testUVStreambuf_ARGS $<TARGET_FILE:cmake>)
+set(testCTestResourceSpec_ARGS ${CMAKE_CURRENT_SOURCE_DIR})
if(WIN32)
list(APPEND CMakeLib_TESTS
@@ -39,7 +47,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testXMLParser.h.in
create_test_sourcelist(CMakeLib_TEST_SRCS CMakeLibTests.cxx ${CMakeLib_TESTS})
add_executable(CMakeLibTests ${CMakeLib_TEST_SRCS})
-target_link_libraries(CMakeLibTests CMakeLib)
+target_link_libraries(CMakeLibTests CMakeLib CTestLib)
set_property(TARGET CMakeLibTests PROPERTY C_CLANG_TIDY "")
set_property(TARGET CMakeLibTests PROPERTY CXX_CLANG_TIDY "")
diff --git a/Tests/CMakeLib/run_compile_commands.cxx b/Tests/CMakeLib/run_compile_commands.cxx
index b49803bd6..2c77accf1 100644
--- a/Tests/CMakeLib/run_compile_commands.cxx
+++ b/Tests/CMakeLib/run_compile_commands.cxx
@@ -1,13 +1,14 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include "cmsys/FStream.hxx"
+#include <cstdlib>
#include <iostream>
#include <map>
-#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
+#include "cmsys/FStream.hxx"
+
#include "cmSystemTools.h"
class CompileCommandParser
@@ -18,7 +19,7 @@ public:
public:
std::string const& at(std::string const& k) const
{
- const_iterator i = this->find(k);
+ auto i = this->find(k);
if (i != this->end()) {
return i->second;
}
@@ -26,7 +27,7 @@ public:
return emptyString;
}
};
- typedef std::vector<CommandType> TranslationUnitsType;
+ using TranslationUnitsType = std::vector<CommandType>;
CompileCommandParser(std::istream& input)
: Input(input)
diff --git a/Tests/CMakeLib/testAffinity.cxx b/Tests/CMakeLib/testAffinity.cxx
index 4b8228092..6c6857079 100644
--- a/Tests/CMakeLib/testAffinity.cxx
+++ b/Tests/CMakeLib/testAffinity.cxx
@@ -1,11 +1,11 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmAffinity.h"
-
#include <cstddef>
#include <iostream>
#include <set>
+#include "cmAffinity.h"
+
int main()
{
std::set<size_t> cpus = cmAffinity::GetProcessorsAvailable();
diff --git a/Tests/CMakeLib/testArgumentParser.cxx b/Tests/CMakeLib/testArgumentParser.cxx
index 788fecee6..20f98c2a2 100644
--- a/Tests/CMakeLib/testArgumentParser.cxx
+++ b/Tests/CMakeLib/testArgumentParser.cxx
@@ -1,16 +1,17 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmArgumentParser.h"
-
-#include "cm_static_string_view.hxx"
-#include "cm_string_view.hxx"
-
#include <initializer_list>
#include <iostream>
#include <string>
#include <vector>
+#include <cm/string_view>
+
+#include "cm_static_string_view.hxx"
+
+#include "cmArgumentParser.h"
+
namespace {
struct Result
diff --git a/Tests/CMakeLib/testCTestBinPacker.cxx b/Tests/CMakeLib/testCTestBinPacker.cxx
new file mode 100644
index 000000000..6f09af20e
--- /dev/null
+++ b/Tests/CMakeLib/testCTestBinPacker.cxx
@@ -0,0 +1,300 @@
+#include <cstddef>
+#include <iostream>
+#include <map>
+#include <string>
+#include <vector>
+
+#include "cmCTestBinPacker.h"
+#include "cmCTestResourceAllocator.h"
+
+struct ExpectedPackResult
+{
+ std::vector<int> SlotsNeeded;
+ std::map<std::string, cmCTestResourceAllocator::Resource> Resources;
+ bool ExpectedReturnValue;
+ std::vector<cmCTestBinPackerAllocation> ExpectedRoundRobinAllocations;
+ std::vector<cmCTestBinPackerAllocation> ExpectedBlockAllocations;
+};
+
+static const std::vector<ExpectedPackResult> expectedResults
+{
+ /* clang-format off */
+ {
+ { 2, 2, 2, 2 },
+ { { "0", { 4, 0 } }, { "1", { 4, 0 } }, { "2", { 4, 0 } },
+ { "3", { 4, 0 } } },
+ true,
+ {
+ { 0, 2, "0" },
+ { 1, 2, "1" },
+ { 2, 2, "2" },
+ { 3, 2, "3" },
+ },
+ {
+ { 0, 2, "0" },
+ { 1, 2, "0" },
+ { 2, 2, "1" },
+ { 3, 2, "1" },
+ },
+ },
+ {
+ { 2, 3, 2 },
+ { { "0", { 5, 0 } }, { "1", { 2, 0 } } },
+ true,
+ {
+ { 0, 2, "0" },
+ { 1, 3, "0" },
+ { 2, 2, "1" },
+ },
+ {
+ { 0, 2, "0" },
+ { 1, 3, "0" },
+ { 2, 2, "1" },
+ },
+ },
+ {
+ { 1, 2, 3 },
+ { { "0", { 1, 0 } }, { "1", { 2, 0 } }, { "2", { 2, 0 } } },
+ false,
+ { },
+ { },
+ },
+ {
+ { 48, 21, 31, 10, 40 },
+ { { "0", { 81, 0 } }, { "1", { 68, 0 } }, { "2", { 20, 0 } },
+ { "3", { 13, 0 } } },
+ true,
+ {
+ { 0, 48, "0" },
+ { 1, 21, "1" },
+ { 2, 31, "0" },
+ { 3, 10, "2" },
+ { 4, 40, "1" },
+ },
+ {
+ { 0, 48, "0" },
+ { 1, 21, "1" },
+ { 2, 31, "0" },
+ { 3, 10, "2" },
+ { 4, 40, "1" },
+ },
+ },
+ {
+ { 30, 31, 39, 67 },
+ { { "0", { 16, 0 } }, { "1", { 81, 0 } }, { "2", { 97, 0 } } },
+ true,
+ {
+ { 0, 30, "2" },
+ { 1, 31, "1" },
+ { 2, 39, "1" },
+ { 3, 67, "2" },
+ },
+ {
+ { 0, 30, "2" },
+ { 1, 31, "1" },
+ { 2, 39, "1" },
+ { 3, 67, "2" },
+ },
+ },
+ {
+ { 63, 47, 1, 9 },
+ { { "0", { 18, 0 } }, { "1", { 29, 0 } }, { "2", { 9, 0 } },
+ { "3", { 52, 0 } } },
+ false,
+ { },
+ { },
+ },
+ {
+ { 22, 29, 46, 85 },
+ { { "0", { 65, 0 } }, { "1", { 85, 0 } }, { "2", { 65, 0 } },
+ { "3", { 78, 0 } } },
+ true,
+ {
+ { 0, 22, "2" },
+ { 1, 29, "0" },
+ { 2, 46, "3" },
+ { 3, 85, "1" },
+ },
+ {
+ { 0, 22, "0" },
+ { 1, 29, "3" },
+ { 2, 46, "3" },
+ { 3, 85, "1" },
+ },
+ },
+ {
+ { 66, 11, 34, 21 },
+ { { "0", { 24, 0 } }, { "1", { 57, 0 } }, { "2", { 61, 0 } },
+ { "3", { 51, 0 } } },
+ false,
+ { },
+ { },
+ },
+ {
+ { 72, 65, 67, 45 },
+ { { "0", { 29, 0 } }, { "1", { 77, 0 } }, { "2", { 98, 0 } },
+ { "3", { 58, 0 } } },
+ false,
+ { },
+ { },
+ },
+ /*
+ * The following is a contrived attack on the bin-packing algorithm that
+ * causes it to execute with n! complexity, where n is the number of
+ * resources. This case is very unrepresentative of real-world usage, and
+ * has been documented but disabled. The bin-packing problem is NP-hard, and
+ * we may not be able to fix this case at all.
+ */
+#if 0
+ {
+ { 1000, 999, 998, 997, 996, 995, 994, 993, 992, 991, 19 },
+ { { "0", { 1000, 0 } }, { "1", { 1001, 0 } }, { "2", { 1002, 0 } },
+ { "3", { 1003, 0 } }, { "4", { 1004, 0 } }, { "5", { 1005, 0 } },
+ { "6", { 1006, 0 } }, { "7", { 1007, 0 } }, { "8", { 1008, 0 } },
+ { "9", { 1009, 0 } } },
+ false,
+ { },
+ { },
+ },
+#endif
+ /*
+ * These cases are more representative of real-world usage (the resource
+ * sizes are all the same.)
+ */
+ {
+ { 1000, 999, 998, 997, 996, 995, 994, 993, 992, 991, 10 },
+ { { "0", { 1000, 0 } }, { "1", { 1000, 0 } }, { "2", { 1000, 0 } },
+ { "3", { 1000, 0 } }, { "4", { 1000, 0 } }, { "5", { 1000, 0 } },
+ { "6", { 1000, 0 } }, { "7", { 1000, 0 } }, { "8", { 1000, 0 } },
+ { "9", { 1000, 0 } } },
+ false,
+ { },
+ { },
+ },
+ {
+ { 1000, 999, 998, 997, 996, 995, 994, 993, 992, 991, 9 },
+ { { "0", { 1000, 0 } }, { "1", { 1000, 0 } }, { "2", { 1000, 0 } },
+ { "3", { 1000, 0 } }, { "4", { 1000, 0 } }, { "5", { 1000, 0 } },
+ { "6", { 1000, 0 } }, { "7", { 1000, 0 } }, { "8", { 1000, 0 } },
+ { "9", { 1000, 0 } } },
+ true,
+ {
+ { 0, 1000, "0" },
+ { 1, 999, "1" },
+ { 2, 998, "2" },
+ { 3, 997, "3" },
+ { 4, 996, "4" },
+ { 5, 995, "5" },
+ { 6, 994, "6" },
+ { 7, 993, "7" },
+ { 8, 992, "8" },
+ { 9, 991, "9" },
+ { 10, 9, "9" },
+ },
+ {
+ { 0, 1000, "0" },
+ { 1, 999, "1" },
+ { 2, 998, "2" },
+ { 3, 997, "3" },
+ { 4, 996, "4" },
+ { 5, 995, "5" },
+ { 6, 994, "6" },
+ { 7, 993, "7" },
+ { 8, 992, "8" },
+ { 9, 991, "9" },
+ { 10, 9, "9" },
+ },
+ },
+ /* clang-format on */
+};
+
+struct AllocationComparison
+{
+ cmCTestBinPackerAllocation First;
+ cmCTestBinPackerAllocation Second;
+ bool Equal;
+};
+
+static const std::vector<AllocationComparison> comparisons{
+ /* clang-format off */
+ { { 0, 1, "0" }, { 0, 1, "0" }, true },
+ { { 0, 1, "0" }, { 1, 1, "0" }, false },
+ { { 0, 1, "0" }, { 0, 2, "0" }, false },
+ { { 0, 1, "0" }, { 0, 1, "1" }, false },
+ /* clang-format on */
+};
+
+bool TestExpectedPackResult(const ExpectedPackResult& expected)
+{
+ std::vector<cmCTestBinPackerAllocation> roundRobinAllocations;
+ roundRobinAllocations.reserve(expected.SlotsNeeded.size());
+ std::size_t index = 0;
+ for (auto const& n : expected.SlotsNeeded) {
+ roundRobinAllocations.push_back({ index++, n, "" });
+ }
+
+ bool roundRobinResult = cmAllocateCTestResourcesRoundRobin(
+ expected.Resources, roundRobinAllocations);
+ if (roundRobinResult != expected.ExpectedReturnValue) {
+ std::cout
+ << "cmAllocateCTestResourcesRoundRobin did not return expected value"
+ << std::endl;
+ return false;
+ }
+
+ if (roundRobinResult &&
+ roundRobinAllocations != expected.ExpectedRoundRobinAllocations) {
+ std::cout << "cmAllocateCTestResourcesRoundRobin did not return expected "
+ "allocations"
+ << std::endl;
+ return false;
+ }
+
+ std::vector<cmCTestBinPackerAllocation> blockAllocations;
+ blockAllocations.reserve(expected.SlotsNeeded.size());
+ index = 0;
+ for (auto const& n : expected.SlotsNeeded) {
+ blockAllocations.push_back({ index++, n, "" });
+ }
+
+ bool blockResult =
+ cmAllocateCTestResourcesBlock(expected.Resources, blockAllocations);
+ if (blockResult != expected.ExpectedReturnValue) {
+ std::cout << "cmAllocateCTestResourcesBlock did not return expected value"
+ << std::endl;
+ return false;
+ }
+
+ if (blockResult && blockAllocations != expected.ExpectedBlockAllocations) {
+ std::cout << "cmAllocateCTestResourcesBlock did not return expected"
+ " allocations"
+ << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+int testCTestBinPacker(int /*unused*/, char* /*unused*/ [])
+{
+ int retval = 0;
+
+ for (auto const& comparison : comparisons) {
+ if ((comparison.First == comparison.Second) != comparison.Equal) {
+ std::cout << "Comparison did not match expected" << std::endl;
+ retval = 1;
+ }
+ if ((comparison.First != comparison.Second) == comparison.Equal) {
+ std::cout << "Comparison did not match expected" << std::endl;
+ retval = 1;
+ }
+ }
+
+ for (auto const& expected : expectedResults) {
+ if (!TestExpectedPackResult(expected)) {
+ retval = 1;
+ }
+ }
+
+ return retval;
+}
diff --git a/Tests/CMakeLib/testCTestResourceAllocator.cxx b/Tests/CMakeLib/testCTestResourceAllocator.cxx
new file mode 100644
index 000000000..33d6b913d
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceAllocator.cxx
@@ -0,0 +1,426 @@
+#include <iostream>
+#include <map>
+#include <string>
+#include <vector>
+
+#include "cmCTestResourceAllocator.h"
+#include "cmCTestResourceSpec.h"
+
+static const cmCTestResourceSpec spec{ { {
+ /* clang-format off */
+ { "gpus", { { "0", 4 }, { "1", 8 }, { "2", 0 }, { "3", 8 } } },
+ /* clang-format on */
+} } };
+
+bool testInitializeFromResourceSpec()
+{
+ bool retval = true;
+
+ cmCTestResourceAllocator allocator;
+ allocator.InitializeFromResourceSpec(spec);
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 0 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.GetResources() != expected) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ return retval;
+}
+
+bool testAllocateResource()
+{
+ bool retval = true;
+
+ cmCTestResourceAllocator allocator;
+ allocator.InitializeFromResourceSpec(spec);
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected1{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 2 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (!allocator.AllocateResource("gpus", "0", 2)) {
+ std::cout
+ << "AllocateResource(\"gpus\", \"0\", 2) returned false, should be "
+ "true\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected1) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected2{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 4 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (!allocator.AllocateResource("gpus", "0", 2)) {
+ std::cout
+ << "AllocateResource(\"gpus\", \"0\", 2) returned false, should be "
+ "true\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected2) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected3{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 4 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.AllocateResource("gpus", "0", 1)) {
+ std::cout
+ << "AllocateResource(\"gpus\", \"0\", 1) returned true, should be "
+ "false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected3) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected4{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 4 } },
+ { "1", { 8, 7 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (!allocator.AllocateResource("gpus", "1", 7)) {
+ std::cout
+ << "AllocateResource(\"gpus\", \"1\", 7) returned false, should be "
+ "true\n";
+ retval = false;
+ }
+ if (allocator.AllocateResource("gpus", "1", 2)) {
+ std::cout
+ << "AllocateResource(\"gpus\", \"1\", 2) returned true, should be "
+ "false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected4) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected5{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 4 } },
+ { "1", { 8, 7 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.AllocateResource("gpus", "2", 1)) {
+ std::cout
+ << "AllocateResource(\"gpus\", \"2\", 1) returned true, should be "
+ "false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected5) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected6{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 4 } },
+ { "1", { 8, 7 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.AllocateResource("gpus", "4", 1)) {
+ std::cout
+ << "AllocateResource(\"gpus\", \"4\", 1) returned true, should be "
+ "false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected6) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected7{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 4 } },
+ { "1", { 8, 7 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.AllocateResource("threads", "0", 1)) {
+ std::cout
+ << "AllocateResource(\"threads\", \"0\", 1) returned true, should be"
+ " false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected7) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ return retval;
+}
+
+bool testDeallocateResource()
+{
+ bool retval = true;
+
+ cmCTestResourceAllocator allocator;
+ allocator.InitializeFromResourceSpec(spec);
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected1{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 1 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (!allocator.AllocateResource("gpus", "0", 2)) {
+ std::cout
+ << "AllocateResource(\"gpus\", \"0\", 2) returned false, should be "
+ "true\n";
+ retval = false;
+ }
+ if (!allocator.DeallocateResource("gpus", "0", 1)) {
+ std::cout
+ << "DeallocateResource(\"gpus\", \"0\", 1) returned false, should be"
+ " true\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected1) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected2{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 1 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.DeallocateResource("gpus", "0", 2)) {
+ std::cout
+ << "DeallocateResource(\"gpus\", \"0\", 2) returned true, should be"
+ " false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected2) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected3{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 0 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (!allocator.DeallocateResource("gpus", "0", 1)) {
+ std::cout
+ << "DeallocateResource(\"gpus\", \"0\", 1) returned false, should be"
+ " true\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected3) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected4{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 0 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.DeallocateResource("gpus", "0", 1)) {
+ std::cout
+ << "DeallocateResource(\"gpus\", \"0\", 1) returned true, should be"
+ " false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected4) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected5{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 0 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.DeallocateResource("gpus", "4", 1)) {
+ std::cout
+ << "DeallocateResource(\"gpus\", \"4\", 1) returned true, should be"
+ " false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected5) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ static const std::map<
+ std::string, std::map<std::string, cmCTestResourceAllocator::Resource>>
+ expected6{
+ /* clang-format off */
+ { "gpus", {
+ { "0", { 4, 0 } },
+ { "1", { 8, 0 } },
+ { "2", { 0, 0 } },
+ { "3", { 8, 0 } },
+ } },
+ /* clang-format on */
+ };
+ if (allocator.DeallocateResource("threads", "0", 1)) {
+ std::cout
+ << "DeallocateResource(\"threads\", \"0\", 1) returned true, should be"
+ " false\n";
+ retval = false;
+ }
+ if (allocator.GetResources() != expected6) {
+ std::cout << "GetResources() did not return expected value\n";
+ retval = false;
+ }
+
+ return retval;
+}
+
+bool testResourceFree()
+{
+ bool retval = true;
+
+ const cmCTestResourceAllocator::Resource r1{ 5, 0 };
+ if (r1.Free() != 5) {
+ std::cout << "cmCTestResourceAllocator::Resource::Free() did not return "
+ "expected value for { 5, 0 }\n";
+ retval = false;
+ }
+
+ const cmCTestResourceAllocator::Resource r2{ 3, 2 };
+ if (r2.Free() != 1) {
+ std::cout << "cmCTestResourceAllocator::Resource::Free() did not return "
+ "expected value for { 3, 2 }\n";
+ retval = false;
+ }
+
+ const cmCTestResourceAllocator::Resource r3{ 4, 4 };
+ if (r3.Free() != 0) {
+ std::cout << "cmCTestResourceAllocator::Resource::Free() did not return "
+ "expected value for { 4, 4 }\n";
+ retval = false;
+ }
+
+ return retval;
+}
+
+int testCTestResourceAllocator(int, char** const)
+{
+ int retval = 0;
+
+ if (!testInitializeFromResourceSpec()) {
+ std::cout << "in testInitializeFromResourceSpec()\n";
+ retval = -1;
+ }
+
+ if (!testAllocateResource()) {
+ std::cout << "in testAllocateResource()\n";
+ retval = -1;
+ }
+
+ if (!testDeallocateResource()) {
+ std::cout << "in testDeallocateResource()\n";
+ retval = -1;
+ }
+
+ if (!testResourceFree()) {
+ std::cout << "in testResourceFree()\n";
+ retval = -1;
+ }
+
+ return retval;
+}
diff --git a/Tests/CMakeLib/testCTestResourceGroups.cxx b/Tests/CMakeLib/testCTestResourceGroups.cxx
new file mode 100644
index 000000000..c3532a68d
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceGroups.cxx
@@ -0,0 +1,141 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "cmCTestTestHandler.h"
+
+struct ExpectedParseResult
+{
+ std::string String;
+ bool ExpectedReturnValue;
+ std::vector<std::vector<cmCTestTestHandler::cmCTestTestResourceRequirement>>
+ ExpectedValue;
+};
+
+static const std::vector<ExpectedParseResult> expectedResults{
+ /* clang-format off */
+ { "threads:2", true, {
+ { { "threads", 2, 1 } },
+ } },
+ { "3,threads:2", true, {
+ { { "threads", 2, 1 } },
+ { { "threads", 2, 1 } },
+ { { "threads", 2, 1 } },
+ } },
+ { "3,threads:2,gpus:4", true, {
+ { { "threads", 2, 1 }, { "gpus", 4, 1 } },
+ { { "threads", 2, 1 }, { "gpus", 4, 1 } },
+ { { "threads", 2, 1 }, { "gpus", 4, 1 } },
+ } },
+ { "2,threads:2;gpus:4", true, {
+ { { "threads", 2, 1 } },
+ { { "threads", 2, 1 } },
+ { { "gpus", 4, 1 } },
+ } },
+ { "threads:2;2,gpus:4", true, {
+ { { "threads", 2, 1 } },
+ { { "gpus", 4, 1 } },
+ { { "gpus", 4, 1 } },
+ } },
+ { "threads:2;gpus:4", true, {
+ { { "threads", 2, 1 } },
+ { { "gpus", 4, 1 } },
+ } },
+ { "1,threads:2;0,gpus:4", true, {
+ { { "threads", 2, 1 } },
+ } },
+ { "1,_:1", true, {
+ { { "_", 1, 1 } },
+ } },
+ { "1,a:1", true, {
+ { { "a", 1, 1 } },
+ } },
+ { "2", true, {
+ {},
+ {},
+ } },
+ { "1;2,threads:1", true, {
+ {},
+ { { "threads", 1, 1 } },
+ { { "threads", 1, 1 } },
+ } },
+ { "1,,threads:1", true, {
+ { { "threads", 1, 1 } },
+ } },
+ { ";1,threads:1", true, {
+ { { "threads", 1, 1 } },
+ } },
+ { "1,threads:1;", true, {
+ { { "threads", 1, 1 } },
+ } },
+ { "1,threads:1,", true, {
+ { { "threads", 1, 1 } },
+ } },
+ { "threads:1,threads:1", true, {
+ { { "threads", 1, 1 }, { "threads", 1, 1 } },
+ } },
+ { "threads:1;;threads:2", true, {
+ { { "threads", 1, 1 } },
+ { { "threads", 2, 1 } },
+ } },
+ { "1,", true, {
+ {},
+ } },
+ { ";", true, {} },
+ { "", true, {} },
+ { ",", false, {} },
+ { "1,0:1", false, {} },
+ { "1,A:1", false, {} },
+ { "1,a-b:1", false, {} },
+ { "invalid", false, {} },
+ { ",1,invalid:1", false, {} },
+ { "1,1", false, {} },
+ { "-1,invalid:1", false, {} },
+ { "1,invalid:*", false, {} },
+ { "1,invalid:-1", false, {} },
+ { "1,invalid:-", false, {} },
+ { "1,invalid:ab2", false, {} },
+ { "1,invalid :2", false, {} },
+ { "1, invalid:2", false, {} },
+ { "1,invalid:ab", false, {} },
+ /* clang-format on */
+};
+
+bool TestExpectedParseResult(const ExpectedParseResult& expected)
+{
+ std::vector<std::vector<cmCTestTestHandler::cmCTestTestResourceRequirement>>
+ result;
+ bool retval;
+ if ((retval = cmCTestTestHandler::ParseResourceGroupsProperty(
+ expected.String, result)) != expected.ExpectedReturnValue) {
+ std::cout << "ParseResourceGroupsProperty(\"" << expected.String
+ << "\") returned " << retval << ", should be "
+ << expected.ExpectedReturnValue << std::endl;
+ return false;
+ }
+
+ if (result != expected.ExpectedValue) {
+ std::cout << "ParseResourceGroupsProperty(\"" << expected.String
+ << "\") did not yield expected set of resource groups"
+ << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+int testCTestResourceGroups(int /*unused*/, char* /*unused*/ [])
+{
+ int retval = 0;
+
+ for (auto const& expected : expectedResults) {
+ if (!TestExpectedParseResult(expected)) {
+ retval = 1;
+ }
+ }
+
+ return retval;
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec.cxx b/Tests/CMakeLib/testCTestResourceSpec.cxx
new file mode 100644
index 000000000..b98138756
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec.cxx
@@ -0,0 +1,101 @@
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "cmCTestResourceSpec.h"
+
+struct ExpectedSpec
+{
+ std::string Path;
+ bool 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, {{{}}}},
+ {"noexist.json", false, {{{}}}},
+ /* clang-format on */
+};
+
+static bool testSpec(const std::string& path, bool expectedResult,
+ const cmCTestResourceSpec& expected)
+{
+ cmCTestResourceSpec actual;
+ bool result = actual.ReadFromJSONFile(path);
+ if (result != expectedResult) {
+ std::cout << "ReadFromJSONFile(\"" << path << "\") returned " << result
+ << ", should be " << expectedResult << std::endl;
+ return false;
+ }
+
+ if (result && actual != expected) {
+ std::cout << "ReadFromJSONFile(\"" << path
+ << "\") did not give expected spec" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+int testCTestResourceSpec(int argc, char** const argv)
+{
+ if (argc < 2) {
+ std::cout << "Invalid arguments.\n";
+ return -1;
+ }
+
+ int retval = 0;
+ for (auto const& spec : expectedResourceSpecs) {
+ std::string path = argv[1];
+ path += "/testCTestResourceSpec_data/";
+ path += spec.Path;
+ if (!testSpec(path, spec.ParseResult, spec.Expected)) {
+ retval = -1;
+ }
+ }
+
+ return retval;
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec1.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec1.json
new file mode 100644
index 000000000..b01aa6ba5
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec1.json
@@ -0,0 +1,27 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "gpus": [
+ {
+ "id": "2",
+ "slots": 4
+ },
+ {
+ "id": "e"
+ }
+ ],
+ ".reserved": [
+ {
+ "id": "a",
+ "slots": 3
+ }
+ ],
+ "threads": [
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec10.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec10.json
new file mode 100644
index 000000000..8764907fd
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec10.json
@@ -0,0 +1,15 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "gpus": [
+ {
+ "id": 4
+ }
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec11.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec11.json
new file mode 100644
index 000000000..7551ea2da
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec11.json
@@ -0,0 +1,16 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "gpus": [
+ {
+ "id": "4",
+ "slots": "giraffe"
+ }
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec12.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec12.json
new file mode 100644
index 000000000..fe51488c7
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec12.json
@@ -0,0 +1 @@
+[]
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec13.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec13.json
new file mode 100644
index 000000000..6b7a9f4e0
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec13.json
@@ -0,0 +1 @@
+not json
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec14.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec14.json
new file mode 100644
index 000000000..83f480ca7
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec14.json
@@ -0,0 +1,12 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "0": [
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec15.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec15.json
new file mode 100644
index 000000000..10fe2e3ff
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec15.json
@@ -0,0 +1,12 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "-": [
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec16.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec16.json
new file mode 100644
index 000000000..8546759bf
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec16.json
@@ -0,0 +1,12 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "A": [
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec17.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec17.json
new file mode 100644
index 000000000..e4cdfc977
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec17.json
@@ -0,0 +1,15 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "gpus": [
+ {
+ "id": "A"
+ }
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec18.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec18.json
new file mode 100644
index 000000000..26a7c70cc
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec18.json
@@ -0,0 +1,15 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "gpus": [
+ {
+ "id": "-"
+ }
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec19.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec19.json
new file mode 100644
index 000000000..3067f0cfc
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec19.json
@@ -0,0 +1,5 @@
+{
+ "version": 1,
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec2.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec2.json
new file mode 100644
index 000000000..df4939098
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec2.json
@@ -0,0 +1,8 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec20.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec20.json
new file mode 100644
index 000000000..df4939098
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec20.json
@@ -0,0 +1,8 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec21.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec21.json
new file mode 100644
index 000000000..7459ff2a9
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec21.json
@@ -0,0 +1,5 @@
+{
+ "version": [1, 0],
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec22.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec22.json
new file mode 100644
index 000000000..23c57d809
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec22.json
@@ -0,0 +1,5 @@
+{
+ "version": 2,
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec23.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec23.json
new file mode 100644
index 000000000..a3d0a2748
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec23.json
@@ -0,0 +1,7 @@
+{
+ "version": {
+ "major": 1
+ },
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec24.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec24.json
new file mode 100644
index 000000000..d5f6b0821
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec24.json
@@ -0,0 +1,7 @@
+{
+ "version": {
+ "minor": 0
+ },
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec25.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec25.json
new file mode 100644
index 000000000..914da4bbf
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec25.json
@@ -0,0 +1,8 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 1
+ },
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec26.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec26.json
new file mode 100644
index 000000000..c06de22d1
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec26.json
@@ -0,0 +1,8 @@
+{
+ "version": {
+ "major": 2,
+ "minor": 0
+ },
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec27.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec27.json
new file mode 100644
index 000000000..9e2b6c325
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec27.json
@@ -0,0 +1,8 @@
+{
+ "version": {
+ "major": "1",
+ "minor": 0
+ },
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec28.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec28.json
new file mode 100644
index 000000000..ce3b76a7e
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec28.json
@@ -0,0 +1,8 @@
+{
+ "version": {
+ "major": 1,
+ "minor": "0"
+ },
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec29.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec29.json
new file mode 100644
index 000000000..58afd2b12
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec29.json
@@ -0,0 +1,5 @@
+{
+ "version": [1, 0, 0],
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec3.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec3.json
new file mode 100644
index 000000000..2f1045f6c
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec3.json
@@ -0,0 +1,12 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ },
+ {
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec30.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec30.json
new file mode 100644
index 000000000..9e13ff0d5
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec30.json
@@ -0,0 +1,5 @@
+{
+ "version": [1],
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec31.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec31.json
new file mode 100644
index 000000000..c0ef7f4f2
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec31.json
@@ -0,0 +1,5 @@
+{
+ "version": [1, 1],
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec32.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec32.json
new file mode 100644
index 000000000..abe977eba
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec32.json
@@ -0,0 +1,5 @@
+{
+ "version": [2, 0],
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec33.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec33.json
new file mode 100644
index 000000000..c6ca749a7
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec33.json
@@ -0,0 +1,5 @@
+{
+ "version": ["1", 0],
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec34.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec34.json
new file mode 100644
index 000000000..be258f121
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec34.json
@@ -0,0 +1,5 @@
+{
+ "version": [1, "0"],
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec35.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec35.json
new file mode 100644
index 000000000..137648c13
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec35.json
@@ -0,0 +1,5 @@
+{
+ "version": "1",
+ "local": [
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec4.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec4.json
new file mode 100644
index 000000000..17349bda8
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec4.json
@@ -0,0 +1,8 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": {
+ }
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec5.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec5.json
new file mode 100644
index 000000000..f6e6cb4e7
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec5.json
@@ -0,0 +1,6 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ }
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec6.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec6.json
new file mode 100644
index 000000000..eb8b14c47
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec6.json
@@ -0,0 +1,9 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ []
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec7.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec7.json
new file mode 100644
index 000000000..0447981a3
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec7.json
@@ -0,0 +1,12 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "gpus": {
+ }
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec8.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec8.json
new file mode 100644
index 000000000..ee7a9c2cd
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec8.json
@@ -0,0 +1,13 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "gpus": [
+ []
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testCTestResourceSpec_data/spec9.json b/Tests/CMakeLib/testCTestResourceSpec_data/spec9.json
new file mode 100644
index 000000000..ae1117bc7
--- /dev/null
+++ b/Tests/CMakeLib/testCTestResourceSpec_data/spec9.json
@@ -0,0 +1,14 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "gpus": [
+ {
+ }
+ ]
+ }
+ ]
+}
diff --git a/Tests/CMakeLib/testEncoding.cxx b/Tests/CMakeLib/testEncoding.cxx
index d608e86d7..4936898ed 100644
--- a/Tests/CMakeLib/testEncoding.cxx
+++ b/Tests/CMakeLib/testEncoding.cxx
@@ -1,7 +1,8 @@
-#include "cmsys/FStream.hxx"
#include <iostream>
#include <string>
+#include "cmsys/FStream.hxx"
+
#ifdef _WIN32
# include "cmsys/ConsoleBuf.hxx"
#endif
diff --git a/Tests/CMakeLib/testGeneratedFileStream.cxx b/Tests/CMakeLib/testGeneratedFileStream.cxx
index 1d2ec3266..de44a0b71 100644
--- a/Tests/CMakeLib/testGeneratedFileStream.cxx
+++ b/Tests/CMakeLib/testGeneratedFileStream.cxx
@@ -1,11 +1,11 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmGeneratedFileStream.h"
-#include "cmSystemTools.h"
-
#include <iostream>
#include <string>
+#include "cmGeneratedFileStream.h"
+#include "cmSystemTools.h"
+
#define cmFailed(m1, m2) \
std::cout << "FAILED: " << (m1) << (m2) << "\n"; \
failed = 1
diff --git a/Tests/CMakeLib/testOptional.cxx b/Tests/CMakeLib/testOptional.cxx
new file mode 100644
index 000000000..c6bc9c231
--- /dev/null
+++ b/Tests/CMakeLib/testOptional.cxx
@@ -0,0 +1,701 @@
+#include <iostream>
+#include <type_traits>
+#include <vector>
+
+#include <cm/optional>
+#include <cm/utility>
+
+class EventLogger;
+
+class Event
+{
+public:
+ enum EventType
+ {
+ DEFAULT_CONSTRUCT,
+ COPY_CONSTRUCT,
+ MOVE_CONSTRUCT,
+ VALUE_CONSTRUCT,
+
+ DESTRUCT,
+
+ COPY_ASSIGN,
+ MOVE_ASSIGN,
+ VALUE_ASSIGN,
+
+ REFERENCE,
+ CONST_REFERENCE,
+ RVALUE_REFERENCE,
+ CONST_RVALUE_REFERENCE,
+
+ SWAP,
+ };
+
+ EventType Type;
+ const EventLogger* Logger1;
+ const EventLogger* Logger2;
+ int Value;
+
+ bool operator==(const Event& other) const;
+ bool operator!=(const Event& other) const;
+};
+
+bool Event::operator==(const Event& other) const
+{
+ return this->Type == other.Type && this->Logger1 == other.Logger1 &&
+ this->Logger2 == other.Logger2 && this->Value == other.Value;
+}
+
+bool Event::operator!=(const Event& other) const
+{
+ return !(*this == other);
+}
+
+static std::vector<Event> events;
+
+class EventLogger
+{
+public:
+ EventLogger();
+ EventLogger(const EventLogger& other);
+ EventLogger(EventLogger&& other);
+ EventLogger(int value);
+
+ ~EventLogger();
+
+ EventLogger& operator=(const EventLogger& other);
+ EventLogger& operator=(EventLogger&& other);
+ EventLogger& operator=(int value);
+
+ void Reference() &;
+ void Reference() const&;
+ void Reference() &&;
+ void Reference() const&&;
+
+ int Value = 0;
+};
+
+// Certain builds of GCC generate false -Wmaybe-uninitialized warnings when
+// doing a release build with the system version of std::optional. These
+// warnings do not manifest when using our own cm::optional implementation.
+// Silence these false warnings.
+#if defined(__GNUC__) && !defined(__clang__)
+# define BEGIN_IGNORE_UNINITIALIZED \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define END_IGNORE_UNINITIALIZED _Pragma("GCC diagnostic pop")
+#else
+# define BEGIN_IGNORE_UNINITIALIZED
+# define END_IGNORE_UNINITIALIZED
+#endif
+
+void swap(EventLogger& e1, EventLogger& e2)
+{
+ BEGIN_IGNORE_UNINITIALIZED
+ events.push_back({ Event::SWAP, &e1, &e2, e2.Value });
+ END_IGNORE_UNINITIALIZED
+ auto tmp = e1.Value;
+ e1.Value = e2.Value;
+ e2.Value = tmp;
+}
+
+EventLogger::EventLogger()
+ : Value(0)
+{
+ events.push_back({ Event::DEFAULT_CONSTRUCT, this, nullptr, 0 });
+}
+
+EventLogger::EventLogger(const EventLogger& other)
+ : Value(other.Value)
+{
+ events.push_back({ Event::COPY_CONSTRUCT, this, &other, other.Value });
+}
+
+BEGIN_IGNORE_UNINITIALIZED
+EventLogger::EventLogger(EventLogger&& other)
+ : Value(other.Value)
+{
+ events.push_back({ Event::MOVE_CONSTRUCT, this, &other, other.Value });
+}
+END_IGNORE_UNINITIALIZED
+
+EventLogger::EventLogger(int value)
+ : Value(value)
+{
+ events.push_back({ Event::VALUE_CONSTRUCT, this, nullptr, value });
+}
+
+EventLogger::~EventLogger()
+{
+ BEGIN_IGNORE_UNINITIALIZED
+ events.push_back({ Event::DESTRUCT, this, nullptr, this->Value });
+ END_IGNORE_UNINITIALIZED
+}
+
+EventLogger& EventLogger::operator=(const EventLogger& other)
+{
+ events.push_back({ Event::COPY_ASSIGN, this, &other, other.Value });
+ this->Value = other.Value;
+ return *this;
+}
+
+EventLogger& EventLogger::operator=(EventLogger&& other)
+{
+ events.push_back({ Event::MOVE_ASSIGN, this, &other, other.Value });
+ this->Value = other.Value;
+ return *this;
+}
+
+EventLogger& EventLogger::operator=(int value)
+{
+ events.push_back({ Event::VALUE_ASSIGN, this, nullptr, value });
+ this->Value = value;
+ return *this;
+}
+
+void EventLogger::Reference() &
+{
+ events.push_back({ Event::REFERENCE, this, nullptr, this->Value });
+}
+
+void EventLogger::Reference() const&
+{
+ events.push_back({ Event::CONST_REFERENCE, this, nullptr, this->Value });
+}
+
+void EventLogger::Reference() &&
+{
+ events.push_back({ Event::RVALUE_REFERENCE, this, nullptr, this->Value });
+}
+
+void EventLogger::Reference() const&&
+{
+ events.push_back(
+ { Event::CONST_RVALUE_REFERENCE, this, nullptr, this->Value });
+}
+
+static bool testDefaultConstruct(std::vector<Event>& expected)
+{
+ const cm::optional<EventLogger> o{};
+
+ expected = {};
+ return true;
+}
+
+static bool testNulloptConstruct(std::vector<Event>& expected)
+{
+ const cm::optional<EventLogger> o{ cm::nullopt };
+
+ expected = {};
+ return true;
+}
+
+static bool testValueConstruct(std::vector<Event>& expected)
+{
+ const cm::optional<EventLogger> o{ 4 };
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o, nullptr, 4 },
+ { Event::DESTRUCT, &*o, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testInPlaceConstruct(std::vector<Event>& expected)
+{
+ const cm::optional<EventLogger> o1{ cm::in_place, 4 };
+ const cm::optional<EventLogger> o2{ cm::in_place_t{}, 4 };
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o1, nullptr, 4 },
+ { Event::VALUE_CONSTRUCT, &*o2, nullptr, 4 },
+ { Event::DESTRUCT, &*o2, nullptr, 4 },
+ { Event::DESTRUCT, &*o1, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testCopyConstruct(std::vector<Event>& expected)
+{
+ const cm::optional<EventLogger> o1{ 4 };
+ const cm::optional<EventLogger> o2{ o1 };
+ const cm::optional<EventLogger> o3{};
+ const cm::optional<EventLogger> o4{ o3 };
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o1, nullptr, 4 },
+ { Event::COPY_CONSTRUCT, &*o2, &o1.value(), 4 },
+ { Event::DESTRUCT, &*o2, nullptr, 4 },
+ { Event::DESTRUCT, &*o1, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testMoveConstruct(std::vector<Event>& expected)
+{
+ cm::optional<EventLogger> o1{ 4 };
+ const cm::optional<EventLogger> o2{ std::move(o1) };
+ cm::optional<EventLogger> o3{};
+ const cm::optional<EventLogger> o4{ std::move(o3) };
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o1, nullptr, 4 },
+ { Event::MOVE_CONSTRUCT, &*o2, &*o1, 4 },
+ { Event::DESTRUCT, &*o2, nullptr, 4 },
+ { Event::DESTRUCT, &*o1, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testNulloptAssign(std::vector<Event>& expected)
+{
+ cm::optional<EventLogger> o1{ 4 };
+ auto const* v1 = &*o1;
+ o1 = cm::nullopt;
+ cm::optional<EventLogger> o2{};
+ o2 = cm::nullopt;
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, v1, nullptr, 4 },
+ { Event::DESTRUCT, v1, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testCopyAssign(std::vector<Event>& expected)
+{
+ cm::optional<EventLogger> o1{};
+ const cm::optional<EventLogger> o2{ 4 };
+ auto const* v2 = &*o2;
+ o1 = o2;
+ auto const* v1 = &*o1;
+ const cm::optional<EventLogger> o3{ 5 };
+ auto const* v3 = &*o3;
+ o1 = o3;
+ const cm::optional<EventLogger> o4{};
+ o1 = o4;
+ o1 = o4; // Intentionally duplicated to test assigning an empty optional to
+ // an empty optional
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, v2, nullptr, 4 },
+ { Event::COPY_CONSTRUCT, v1, v2, 4 },
+ { Event::VALUE_CONSTRUCT, v3, nullptr, 5 },
+ { Event::COPY_ASSIGN, v1, v3, 5 },
+ { Event::DESTRUCT, v1, nullptr, 5 },
+ { Event::DESTRUCT, v3, nullptr, 5 },
+ { Event::DESTRUCT, v2, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testMoveAssign(std::vector<Event>& expected)
+{
+ cm::optional<EventLogger> o1{};
+ cm::optional<EventLogger> o2{ 4 };
+ auto const* v2 = &*o2;
+ o1 = std::move(o2);
+ auto const* v1 = &*o1;
+ cm::optional<EventLogger> o3{ 5 };
+ auto const* v3 = &*o3;
+ o1 = std::move(o3);
+ cm::optional<EventLogger> o4{};
+ o1 = std::move(o4);
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, v2, nullptr, 4 },
+ { Event::MOVE_CONSTRUCT, v1, v2, 4 },
+ { Event::VALUE_CONSTRUCT, v3, nullptr, 5 },
+ { Event::MOVE_ASSIGN, v1, v3, 5 },
+ { Event::DESTRUCT, v1, nullptr, 5 },
+ { Event::DESTRUCT, v3, nullptr, 5 },
+ { Event::DESTRUCT, v2, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testPointer(std::vector<Event>& expected)
+{
+ cm::optional<EventLogger> o1{ 4 };
+ const cm::optional<EventLogger> o2{ 5 };
+
+ o1->Reference();
+ o2->Reference();
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o1, nullptr, 4 },
+ { Event::VALUE_CONSTRUCT, &*o2, nullptr, 5 },
+ { Event::REFERENCE, &*o1, nullptr, 4 },
+ { Event::CONST_REFERENCE, &*o2, nullptr, 5 },
+ { Event::DESTRUCT, &*o2, nullptr, 5 },
+ { Event::DESTRUCT, &*o1, nullptr, 4 },
+ };
+ return true;
+}
+
+#if !__GNUC__ || __GNUC__ > 4
+# define ALLOW_CONST_RVALUE
+#endif
+
+static bool testDereference(std::vector<Event>& expected)
+{
+ cm::optional<EventLogger> o1{ 4 };
+ auto const* v1 = &*o1;
+ const cm::optional<EventLogger> o2{ 5 };
+ auto const* v2 = &*o2;
+
+ (*o1).Reference();
+ (*o2).Reference();
+ (*std::move(o1)).Reference();
+#ifdef ALLOW_CONST_RVALUE
+ (*std::move(o2)).Reference(); // Broken in GCC 4.9.0. Sigh...
+#endif
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, v1, nullptr, 4 },
+ { Event::VALUE_CONSTRUCT, v2, nullptr, 5 },
+ { Event::REFERENCE, v1, nullptr, 4 },
+ { Event::CONST_REFERENCE, v2, nullptr, 5 },
+ { Event::RVALUE_REFERENCE, v1, nullptr, 4 },
+#ifdef ALLOW_CONST_RVALUE
+ { Event::CONST_RVALUE_REFERENCE, v2, nullptr, 5 },
+#endif
+ { Event::DESTRUCT, v2, nullptr, 5 },
+ { Event::DESTRUCT, v1, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testHasValue(std::vector<Event>& expected)
+{
+ bool retval = true;
+
+ const cm::optional<EventLogger> o1{ 4 };
+ const cm::optional<EventLogger> o2{};
+
+ if (!o1.has_value()) {
+ std::cout << "o1 should have a value" << std::endl;
+ retval = false;
+ }
+
+ if (!o1) {
+ std::cout << "(bool)o1 should be true" << std::endl;
+ retval = false;
+ }
+
+ if (o2.has_value()) {
+ std::cout << "o2 should not have a value" << std::endl;
+ retval = false;
+ }
+
+ if (o2) {
+ std::cout << "(bool)o2 should be false" << std::endl;
+ retval = false;
+ }
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o1, nullptr, 4 },
+ { Event::DESTRUCT, &*o1, nullptr, 4 },
+ };
+ return retval;
+}
+
+static bool testValue(std::vector<Event>& expected)
+{
+ bool retval = true;
+
+ cm::optional<EventLogger> o1{ 4 };
+ const cm::optional<EventLogger> o2{ 5 };
+ cm::optional<EventLogger> o3{};
+ const cm::optional<EventLogger> o4{};
+
+ o1.value().Reference();
+ o2.value().Reference();
+
+ bool thrown = false;
+ try {
+ (void)o3.value();
+ } catch (cm::bad_optional_access&) {
+ thrown = true;
+ }
+ if (!thrown) {
+ std::cout << "o3.value() did not throw" << std::endl;
+ retval = false;
+ }
+
+ thrown = false;
+ try {
+ (void)o4.value();
+ } catch (cm::bad_optional_access&) {
+ thrown = true;
+ }
+ if (!thrown) {
+ std::cout << "o4.value() did not throw" << std::endl;
+ retval = false;
+ }
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o1, nullptr, 4 },
+ { Event::VALUE_CONSTRUCT, &*o2, nullptr, 5 },
+ { Event::REFERENCE, &*o1, nullptr, 4 },
+ { Event::CONST_REFERENCE, &*o2, nullptr, 5 },
+ { Event::DESTRUCT, &*o2, nullptr, 5 },
+ { Event::DESTRUCT, &*o1, nullptr, 4 },
+ };
+ return retval;
+}
+
+static bool testValueOr()
+{
+ bool retval = true;
+
+ const cm::optional<EventLogger> o1{ 4 };
+ cm::optional<EventLogger> o2{ 5 };
+ const cm::optional<EventLogger> o3{};
+ cm::optional<EventLogger> o4{};
+
+ EventLogger e1{ 6 };
+ EventLogger e2{ 7 };
+ EventLogger e3{ 8 };
+ EventLogger e4{ 9 };
+
+ EventLogger r1 = o1.value_or(e1);
+ if (r1.Value != 4) {
+ std::cout << "r1.Value should be 4" << std::endl;
+ retval = false;
+ }
+ EventLogger r2 = std::move(o2).value_or(e2);
+ if (r2.Value != 5) {
+ std::cout << "r2.Value should be 5" << std::endl;
+ retval = false;
+ }
+ EventLogger r3 = o3.value_or(e3);
+ if (r3.Value != 8) {
+ std::cout << "r3.Value should be 8" << std::endl;
+ retval = false;
+ }
+ EventLogger r4 = std::move(o4).value_or(e4);
+ if (r4.Value != 9) {
+ std::cout << "r4.Value should be 9" << std::endl;
+ retval = false;
+ }
+
+ return retval;
+}
+
+static bool testSwap(std::vector<Event>& expected)
+{
+ bool retval = true;
+
+ cm::optional<EventLogger> o1{ 4 };
+ auto const* v1 = &*o1;
+ cm::optional<EventLogger> o2{};
+
+ o1.swap(o2);
+ auto const* v2 = &*o2;
+
+ if (o1.has_value()) {
+ std::cout << "o1 should not have value" << std::endl;
+ retval = false;
+ }
+ if (!o2.has_value()) {
+ std::cout << "o2 should have value" << std::endl;
+ retval = false;
+ }
+ if (o2.value().Value != 4) {
+ std::cout << "value of o2 should be 4" << std::endl;
+ retval = false;
+ }
+
+ o1.swap(o2);
+
+ if (!o1.has_value()) {
+ std::cout << "o1 should have value" << std::endl;
+ retval = false;
+ }
+ if (o1.value().Value != 4) {
+ std::cout << "value of o1 should be 4" << std::endl;
+ retval = false;
+ }
+ if (o2.has_value()) {
+ std::cout << "o2 should not have value" << std::endl;
+ retval = false;
+ }
+
+ o2.emplace(5);
+ o1.swap(o2);
+
+ if (!o1.has_value()) {
+ std::cout << "o1 should have value" << std::endl;
+ retval = false;
+ }
+ if (o1.value().Value != 5) {
+ std::cout << "value of o1 should be 5" << std::endl;
+ retval = false;
+ }
+ if (!o2.has_value()) {
+ std::cout << "o2 should not have value" << std::endl;
+ retval = false;
+ }
+ if (o2.value().Value != 4) {
+ std::cout << "value of o2 should be 4" << std::endl;
+ retval = false;
+ }
+
+ o1.reset();
+ o2.reset();
+ o1.swap(o2);
+
+ if (o1.has_value()) {
+ std::cout << "o1 should not have value" << std::endl;
+ retval = false;
+ }
+ if (o2.has_value()) {
+ std::cout << "o2 should not have value" << std::endl;
+ retval = false;
+ }
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, v1, nullptr, 4 },
+ { Event::MOVE_CONSTRUCT, v2, v1, 4 },
+ { Event::DESTRUCT, v1, nullptr, 4 },
+ { Event::MOVE_CONSTRUCT, v1, v2, 4 },
+ { Event::DESTRUCT, v2, nullptr, 4 },
+ { Event::VALUE_CONSTRUCT, v2, nullptr, 5 },
+ { Event::SWAP, v1, v2, 5 },
+ { Event::DESTRUCT, v1, nullptr, 5 },
+ { Event::DESTRUCT, v2, nullptr, 4 },
+ };
+ return retval;
+}
+
+static bool testReset(std::vector<Event>& expected)
+{
+ bool retval = true;
+
+ cm::optional<EventLogger> o{ 4 };
+ auto const* v = &*o;
+
+ o.reset();
+
+ if (o.has_value()) {
+ std::cout << "o should not have value" << std::endl;
+ retval = false;
+ }
+
+ o.reset();
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, v, nullptr, 4 },
+ { Event::DESTRUCT, v, nullptr, 4 },
+ };
+ return retval;
+}
+
+static bool testEmplace(std::vector<Event>& expected)
+{
+ cm::optional<EventLogger> o{ 4 };
+
+ o.emplace(5);
+ o.reset();
+ o.emplace();
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o, nullptr, 4 },
+ { Event::DESTRUCT, &*o, nullptr, 4 },
+ { Event::VALUE_CONSTRUCT, &*o, nullptr, 5 },
+ { Event::DESTRUCT, &*o, nullptr, 5 },
+ { Event::DEFAULT_CONSTRUCT, &*o, nullptr, 0 },
+ { Event::DESTRUCT, &*o, nullptr, 0 },
+ };
+ return true;
+}
+
+static bool testMakeOptional(std::vector<Event>& expected)
+{
+ EventLogger e{ 4 };
+ cm::optional<EventLogger> o1 = cm::make_optional<EventLogger>(e);
+ cm::optional<EventLogger> o2 = cm::make_optional<EventLogger>(5);
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &e, nullptr, 4 },
+ { Event::COPY_CONSTRUCT, &*o1, &e, 4 },
+ { Event::VALUE_CONSTRUCT, &*o2, nullptr, 5 },
+ { Event::DESTRUCT, &*o2, nullptr, 5 },
+ { Event::DESTRUCT, &*o1, nullptr, 4 },
+ { Event::DESTRUCT, &e, nullptr, 4 },
+ };
+ return true;
+}
+
+static bool testMemoryRange(std::vector<Event>& expected)
+{
+ bool retval = true;
+
+ cm::optional<EventLogger> o{ 4 };
+
+ auto* ostart = &o;
+ auto* oend = ostart + 1;
+ auto* estart = &o.value();
+ auto* eend = estart + 1;
+
+ if (static_cast<void*>(estart) < static_cast<void*>(ostart) ||
+ static_cast<void*>(eend) > static_cast<void*>(oend)) {
+ std::cout << "value is not within memory range of optional" << std::endl;
+ retval = false;
+ }
+
+ expected = {
+ { Event::VALUE_CONSTRUCT, &*o, nullptr, 4 },
+ { Event::DESTRUCT, &*o, nullptr, 4 },
+ };
+ return retval;
+}
+
+int testOptional(int /*unused*/, char* /*unused*/ [])
+{
+ int retval = 0;
+
+#define DO_EVENT_TEST(name) \
+ do { \
+ events.clear(); \
+ std::vector<Event> expected; \
+ if (!name(expected)) { \
+ std::cout << "in " #name << std::endl; \
+ retval = 1; \
+ } else if (expected != events) { \
+ std::cout << #name " did not produce expected events" << std::endl; \
+ retval = 1; \
+ } \
+ } while (0)
+
+#define DO_TEST(name) \
+ do { \
+ if (!name()) { \
+ std::cout << "in " #name << std::endl; \
+ retval = 1; \
+ } \
+ } while (0)
+
+ DO_EVENT_TEST(testDefaultConstruct);
+ DO_EVENT_TEST(testNulloptConstruct);
+ DO_EVENT_TEST(testValueConstruct);
+ DO_EVENT_TEST(testInPlaceConstruct);
+ DO_EVENT_TEST(testCopyConstruct);
+ DO_EVENT_TEST(testMoveConstruct);
+ DO_EVENT_TEST(testNulloptAssign);
+ DO_EVENT_TEST(testCopyAssign);
+ DO_EVENT_TEST(testMoveAssign);
+ DO_EVENT_TEST(testPointer);
+ DO_EVENT_TEST(testDereference);
+ DO_EVENT_TEST(testHasValue);
+ DO_EVENT_TEST(testValue);
+ DO_TEST(testValueOr);
+ DO_EVENT_TEST(testSwap);
+ DO_EVENT_TEST(testReset);
+ DO_EVENT_TEST(testEmplace);
+ DO_EVENT_TEST(testMakeOptional);
+ DO_EVENT_TEST(testMemoryRange);
+
+ return retval;
+}
diff --git a/Tests/CMakeLib/testRST.cxx b/Tests/CMakeLib/testRST.cxx
index 889127650..28d80a5f6 100644
--- a/Tests/CMakeLib/testRST.cxx
+++ b/Tests/CMakeLib/testRST.cxx
@@ -1,12 +1,13 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmRST.h"
-#include "cmSystemTools.h"
-
-#include "cmsys/FStream.hxx"
#include <iostream>
#include <string>
+#include "cmsys/FStream.hxx"
+
+#include "cmRST.h"
+#include "cmSystemTools.h"
+
void reportLine(std::ostream& os, bool ret, std::string const& line, bool eol)
{
if (ret) {
diff --git a/Tests/CMakeLib/testRange.cxx b/Tests/CMakeLib/testRange.cxx
index b26b07b8c..4efe98e26 100644
--- a/Tests/CMakeLib/testRange.cxx
+++ b/Tests/CMakeLib/testRange.cxx
@@ -1,12 +1,12 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmRange.h"
-
#include <iostream>
#include <string>
#include <vector>
+#include "cmRange.h"
+
#define ASSERT_TRUE(x) \
do { \
if (!(x)) { \
diff --git a/Tests/CMakeLib/testString.cxx b/Tests/CMakeLib/testString.cxx
index af5e41ed3..d7b320039 100644
--- a/Tests/CMakeLib/testString.cxx
+++ b/Tests/CMakeLib/testString.cxx
@@ -1,11 +1,7 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include "cmString.hxx"
-
-#include "cm_static_string_view.hxx"
-#include "cm_string_view.hxx"
-
+#include <cstddef>
#include <cstring>
#include <iostream>
#include <iterator>
@@ -15,6 +11,12 @@
#include <type_traits>
#include <utility>
+#include <cm/string_view>
+
+#include "cm_static_string_view.hxx"
+
+#include "cmString.hxx"
+
#define ASSERT_TRUE(x) \
do { \
if (!(x)) { \
diff --git a/Tests/CMakeLib/testStringAlgorithms.cxx b/Tests/CMakeLib/testStringAlgorithms.cxx
new file mode 100644
index 000000000..63826cf28
--- /dev/null
+++ b/Tests/CMakeLib/testStringAlgorithms.cxx
@@ -0,0 +1,230 @@
+/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+ file Copyright.txt or https://cmake.org/licensing for details. */
+
+#include <cmConfigure.h> // IWYU pragma: keep
+
+#include <iostream>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include <cm/string_view>
+
+#include "cmStringAlgorithms.h"
+
+int testStringAlgorithms(int /*unused*/, char* /*unused*/ [])
+{
+ int failed = 0;
+
+ auto assert_ok = [&failed](bool test, cm::string_view title) {
+ if (test) {
+ std::cout << "Passed: " << title << "\n";
+ } else {
+ std::cout << "Failed: " << title << "\n";
+ ++failed;
+ }
+ };
+
+ auto assert_string = [&failed](cm::string_view generated,
+ cm::string_view expected,
+ cm::string_view title) {
+ if (generated == expected) {
+ std::cout << "Passed: " << title << "\n";
+ } else {
+ std::cout << "Failed: " << title << "\n";
+ std::cout << "Expected: " << expected << "\n";
+ std::cout << "Got: " << generated << "\n";
+ ++failed;
+ }
+ };
+
+ // ----------------------------------------------------------------------
+ // Test cmTrimWhitespace
+ {
+ std::string base = "base";
+ std::string spaces = " \f\f\n\n\r\r\t\t\v\v";
+ assert_string(cmTrimWhitespace(spaces + base), base,
+ "cmTrimWhitespace front");
+ assert_string(cmTrimWhitespace(base + spaces), base,
+ "cmTrimWhitespace back");
+ assert_string(cmTrimWhitespace(spaces + base + spaces), base,
+ "cmTrimWhitespace front and back");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmRemoveQuotes
+ {
+ auto test = [&assert_string](cm::string_view source,
+ cm::string_view expected,
+ cm::string_view title) {
+ assert_string(cmRemoveQuotes(source), expected, title);
+ };
+
+ test("", "", "cmRemoveQuotes empty");
+ test("\"", "\"", "cmRemoveQuotes single quote");
+ test("\"\"", "", "cmRemoveQuotes double quote");
+ test("\"a", "\"a", "cmRemoveQuotes quote char");
+ test("\"ab", "\"ab", "cmRemoveQuotes quote char char");
+ test("a\"", "a\"", "cmRemoveQuotes char quote");
+ test("ab\"", "ab\"", "cmRemoveQuotes char char quote");
+ test("a", "a", "cmRemoveQuotes single char");
+ test("ab", "ab", "cmRemoveQuotes two chars");
+ test("abc", "abc", "cmRemoveQuotes three chars");
+ test("\"abc\"", "abc", "cmRemoveQuotes quoted chars");
+ test("\"\"abc\"\"", "\"abc\"", "cmRemoveQuotes quoted quoted chars");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmEscapeQuotes
+ {
+ assert_string(cmEscapeQuotes("plain"), "plain", "cmEscapeQuotes plain");
+ std::string base = "\"base\"\"";
+ std::string result = "\\\"base\\\"\\\"";
+ assert_string(cmEscapeQuotes(base), result, "cmEscapeQuotes escaped");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmJoin
+ {
+ typedef std::string ST;
+ typedef std::vector<std::string> VT;
+ assert_string(cmJoin(ST("abc"), ";"), "a;b;c", "cmJoin std::string");
+ assert_string(cmJoin(VT{}, ";"), "", "cmJoin std::vector empty");
+ assert_string(cmJoin(VT{ "a" }, ";"), "a", "cmJoin std::vector single");
+ assert_string(cmJoin(VT{ "a", "b", "c" }, ";"), "a;b;c",
+ "cmJoin std::vector multiple");
+ assert_string(cmJoin(VT{ "a", "b", "c" }, "<=>"), "a<=>b<=>c",
+ "cmJoin std::vector long sep");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmTokenize
+ {
+ typedef std::vector<std::string> VT;
+ assert_ok(cmTokenize("", ";") == VT{ "" }, "cmTokenize empty");
+ assert_ok(cmTokenize(";", ";") == VT{ "" }, "cmTokenize sep");
+ assert_ok(cmTokenize("abc", ";") == VT{ "abc" }, "cmTokenize item");
+ assert_ok(cmTokenize("abc;", ";") == VT{ "abc" }, "cmTokenize item sep");
+ assert_ok(cmTokenize(";abc", ";") == VT{ "abc" }, "cmTokenize sep item");
+ assert_ok(cmTokenize("abc;;efg", ";") == VT{ "abc", "efg" },
+ "cmTokenize item sep sep item");
+ assert_ok(cmTokenize("a1;a2;a3;a4", ";") == VT{ "a1", "a2", "a3", "a4" },
+ "cmTokenize multiple items");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmStrCat
+ {
+ int ni = -1100;
+ unsigned int nui = 1100u;
+ long int nli = -12000l;
+ unsigned long int nuli = 12000ul;
+ long long int nlli = -130000ll;
+ unsigned long long int nulli = 130000ull;
+ std::string val =
+ cmStrCat("<test>", ni, ',', nui, ',', nli, ",", nuli, ", ", nlli,
+ std::string(", "), nulli, cm::string_view("</test>"));
+ std::string expect =
+ "<test>-1100,1100,-12000,12000, -130000, 130000</test>";
+ assert_string(val, expect, "cmStrCat strings and integers");
+ }
+ {
+ float const val = 1.5f;
+ float const div = 0.00001f;
+ float f = 0.0f;
+ std::istringstream(cmStrCat("", val)) >> f;
+ f -= val;
+ assert_ok((f < div) && (f > -div), "cmStrCat float");
+ }
+ {
+ double const val = 1.5;
+ double const div = 0.00001;
+ double d = 0.0;
+ std::istringstream(cmStrCat("", val)) >> d;
+ d -= val;
+ assert_ok((d < div) && (d > -div), "cmStrCat double");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmWrap
+ {
+ typedef std::vector<std::string> VT;
+ assert_string(cmWrap("<", VT{}, ">", "; "), //
+ "", //
+ "cmWrap empty, string prefix and suffix");
+ assert_string(cmWrap("<", VT{ "abc" }, ">", "; "), //
+ "<abc>", //
+ "cmWrap single, string prefix and suffix");
+ assert_string(cmWrap("<", VT{ "a1", "a2", "a3" }, ">", "; "), //
+ "<a1>; <a2>; <a3>", //
+ "cmWrap multiple, string prefix and suffix");
+
+ assert_string(cmWrap('<', VT{}, '>', "; "), //
+ "", //
+ "cmWrap empty, char prefix and suffix");
+ assert_string(cmWrap('<', VT{ "abc" }, '>', "; "), //
+ "<abc>", //
+ "cmWrap single, char prefix and suffix");
+ assert_string(cmWrap('<', VT{ "a1", "a2", "a3" }, '>', "; "), //
+ "<a1>; <a2>; <a3>", //
+ "cmWrap multiple, char prefix and suffix");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmHas(Literal)Prefix and cmHas(Literal)Suffix
+ {
+ std::string str("abc");
+ assert_ok(cmHasPrefix(str, 'a'), "cmHasPrefix char");
+ assert_ok(!cmHasPrefix(str, 'c'), "cmHasPrefix char not");
+ assert_ok(cmHasPrefix(str, "ab"), "cmHasPrefix string");
+ assert_ok(!cmHasPrefix(str, "bc"), "cmHasPrefix string not");
+ assert_ok(cmHasPrefix(str, str), "cmHasPrefix complete string");
+ assert_ok(cmHasLiteralPrefix(str, "ab"), "cmHasLiteralPrefix string");
+ assert_ok(!cmHasLiteralPrefix(str, "bc"), "cmHasLiteralPrefix string not");
+
+ assert_ok(cmHasSuffix(str, 'c'), "cmHasSuffix char");
+ assert_ok(!cmHasSuffix(str, 'a'), "cmHasSuffix char not");
+ assert_ok(cmHasSuffix(str, "bc"), "cmHasSuffix string");
+ assert_ok(!cmHasSuffix(str, "ab"), "cmHasSuffix string not");
+ assert_ok(cmHasSuffix(str, str), "cmHasSuffix complete string");
+ assert_ok(cmHasLiteralSuffix(str, "bc"), "cmHasLiteralSuffix string");
+ assert_ok(!cmHasLiteralSuffix(str, "ab"), "cmHasLiteralPrefix string not");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmStrToLong
+ {
+ long value;
+ assert_ok(cmStrToLong("1", &value) && value == 1,
+ "cmStrToLong parses a positive decimal integer.");
+ assert_ok(cmStrToLong(" 1", &value) && value == 1,
+ "cmStrToLong parses a decimal integer after whitespace.");
+
+ assert_ok(cmStrToLong("-1", &value) && value == -1,
+ "cmStrToLong parses a negative decimal integer.");
+ assert_ok(
+ cmStrToLong(" -1", &value) && value == -1,
+ "cmStrToLong parses a negative decimal integer after whitespace.");
+
+ assert_ok(!cmStrToLong("1x", &value),
+ "cmStrToLong rejects trailing content.");
+ }
+
+ // ----------------------------------------------------------------------
+ // Test cmStrToULong
+ {
+ unsigned long value;
+ assert_ok(cmStrToULong("1", &value) && value == 1,
+ "cmStrToULong parses a decimal integer.");
+ assert_ok(cmStrToULong(" 1", &value) && value == 1,
+ "cmStrToULong parses a decimal integer after whitespace.");
+ assert_ok(!cmStrToULong("-1", &value),
+ "cmStrToULong rejects a negative number.");
+ assert_ok(!cmStrToULong(" -1", &value),
+ "cmStrToULong rejects a negative number after whitespace.");
+ assert_ok(!cmStrToULong("1x", &value),
+ "cmStrToULong rejects trailing content.");
+ }
+
+ return failed;
+}
diff --git a/Tests/CMakeLib/testSystemTools.cxx b/Tests/CMakeLib/testSystemTools.cxx
index 121e63985..92f5275cd 100644
--- a/Tests/CMakeLib/testSystemTools.cxx
+++ b/Tests/CMakeLib/testSystemTools.cxx
@@ -4,10 +4,11 @@
#include <cmConfigure.h> // IWYU pragma: keep
#include <iostream>
-#include <stddef.h>
#include <string>
#include <vector>
+#include <stddef.h>
+
#include "cmSystemTools.h"
#define cmPassed(m) std::cout << "Passed: " << (m) << "\n"
@@ -94,21 +95,5 @@ int testSystemTools(int /*unused*/, char* /*unused*/ [])
cmPassed("cmSystemTools::strverscmp working");
}
- // ----------------------------------------------------------------------
- // Test cmSystemTools::StringToULong
- {
- unsigned long value;
- cmAssert(cmSystemTools::StringToULong("1", &value) && value == 1,
- "StringToULong parses a decimal integer.");
- cmAssert(cmSystemTools::StringToULong(" 1", &value) && value == 1,
- "StringToULong parses a decimal integer after whitespace.");
- cmAssert(!cmSystemTools::StringToULong("-1", &value),
- "StringToULong rejects a negative number.");
- cmAssert(!cmSystemTools::StringToULong(" -1", &value),
- "StringToULong rejects a negative number after whitespace.");
- cmAssert(!cmSystemTools::StringToULong("1x", &value),
- "StringToULong rejects trailing content.");
- }
-
return failed;
}
diff --git a/Tests/CMakeLib/testUTF8.cxx b/Tests/CMakeLib/testUTF8.cxx
index a0bb5cd23..986f5956e 100644
--- a/Tests/CMakeLib/testUTF8.cxx
+++ b/Tests/CMakeLib/testUTF8.cxx
@@ -1,8 +1,9 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
-#include <cm_utf8.h>
#include <stdio.h>
+#include <cm_utf8.h>
+
typedef char test_utf8_char[5];
static void test_utf8_char_print(test_utf8_char const c)
diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx
index 72ae60203..71a17647e 100644
--- a/Tests/CMakeLib/testUVProcessChain.cxx
+++ b/Tests/CMakeLib/testUVProcessChain.cxx
@@ -1,20 +1,19 @@
-#include "cmUVProcessChain.h"
-
-#include "cmAlgorithms.h"
-#include "cmGetPipes.h"
-#include "cmUVHandlePtr.h"
-#include "cmUVStreambuf.h"
-
-#include "cm_uv.h"
-
#include <algorithm>
+#include <csignal>
#include <functional>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
-#include <csignal>
+#include <cm/memory>
+
+#include "cm_uv.h"
+
+#include "cmGetPipes.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVProcessChain.h"
+#include "cmUVStreambuf.h"
struct ExpectedStatus
{
diff --git a/Tests/CMakeLib/testUVProcessChainHelper.cxx b/Tests/CMakeLib/testUVProcessChainHelper.cxx
index 263665d59..9c258342e 100644
--- a/Tests/CMakeLib/testUVProcessChainHelper.cxx
+++ b/Tests/CMakeLib/testUVProcessChainHelper.cxx
@@ -1,13 +1,12 @@
+#include <cctype>
#include <chrono>
+#include <cstdlib>
#include <iostream>
#include <set>
#include <sstream>
#include <string>
#include <thread>
-#include <cctype>
-#include <cstdlib>
-
std::string getStdin()
{
char buffer[1024];
@@ -44,7 +43,7 @@ int main(int argc, char** argv)
}
if (command == "dedup") {
// Use a nested scope to free all resources before aborting below.
- {
+ try {
std::string input = getStdin();
std::set<char> seen;
std::string output;
@@ -56,6 +55,7 @@ int main(int argc, char** argv)
}
std::cout << output << std::flush;
std::cerr << "3" << std::flush;
+ } catch (...) {
}
// On Windows, the exit code of abort() is different between debug and
diff --git a/Tests/CMakeLib/testUVRAII.cxx b/Tests/CMakeLib/testUVRAII.cxx
index 2aeaf2c02..cb05ace15 100644
--- a/Tests/CMakeLib/testUVRAII.cxx
+++ b/Tests/CMakeLib/testUVRAII.cxx
@@ -1,5 +1,3 @@
-#include "cmUVHandlePtr.h"
-
#include <chrono>
#include <iostream>
#include <thread>
@@ -7,6 +5,8 @@
#include "cm_uv.h"
+#include "cmUVHandlePtr.h"
+
static void signal_reset_fn(uv_async_t* handle)
{
auto ptr = static_cast<cm::uv_async_ptr*>(handle->data);
diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx
index 39655f372..cd9c9d4fa 100644
--- a/Tests/CMakeLib/testUVStreambuf.cxx
+++ b/Tests/CMakeLib/testUVStreambuf.cxx
@@ -1,18 +1,16 @@
-#include "cmUVStreambuf.h"
-
-#include "cmGetPipes.h"
-#include "cmUVHandlePtr.h"
-
-#include "cm_uv.h"
-
+#include <cstring>
#include <iostream>
#include <string>
#include <vector>
-#include <cstring>
-
#include <stdint.h>
+#include "cm_uv.h"
+
+#include "cmGetPipes.h"
+#include "cmUVHandlePtr.h"
+#include "cmUVStreambuf.h"
+
#define TEST_STR_LINE_1 "This string must be exactly 128 characters long so"
#define TEST_STR_LINE_2 "that we can test CMake's std::streambuf integration"
#define TEST_STR_LINE_3 "with libuv's uv_stream_t."
diff --git a/Tests/CMakeLib/testVisualStudioSlnParser.cxx b/Tests/CMakeLib/testVisualStudioSlnParser.cxx
index c7fd585cc..3c069600c 100644
--- a/Tests/CMakeLib/testVisualStudioSlnParser.cxx
+++ b/Tests/CMakeLib/testVisualStudioSlnParser.cxx
@@ -1,10 +1,10 @@
#include "testVisualStudioSlnParser.h"
+#include <iostream>
+
#include "cmVisualStudioSlnData.h"
#include "cmVisualStudioSlnParser.h"
-#include <iostream>
-
static bool parsedRight(cmVisualStudioSlnParser& parser,
const std::string& file, cmSlnData& data,
cmVisualStudioSlnParser::ParseResult expected =
diff --git a/Tests/CMakeLib/testXMLParser.cxx b/Tests/CMakeLib/testXMLParser.cxx
index d5e9764f9..8617cc118 100644
--- a/Tests/CMakeLib/testXMLParser.cxx
+++ b/Tests/CMakeLib/testXMLParser.cxx
@@ -1,9 +1,9 @@
#include "testXMLParser.h"
-#include "cmXMLParser.h"
-
#include <iostream>
+#include "cmXMLParser.h"
+
int testXMLParser(int /*unused*/, char* /*unused*/ [])
{
// TODO: Derive from parser and check attributes.
diff --git a/Tests/CMakeLib/testXMLSafe.cxx b/Tests/CMakeLib/testXMLSafe.cxx
index 21bb95292..dc62eb9c9 100644
--- a/Tests/CMakeLib/testXMLSafe.cxx
+++ b/Tests/CMakeLib/testXMLSafe.cxx
@@ -4,9 +4,10 @@
#include "cmConfigure.h" // IWYU pragma: keep
#include <sstream>
-#include <stdio.h>
#include <string>
+#include <stdio.h>
+
#include "cmXMLSafe.h"
struct test_pair
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index e73b277f1..57fa7fcd8 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -14,8 +14,8 @@ macro(ADD_TEST_MACRO NAME)
${build_generator_args}
--build-project ${proj}
${${NAME}_CTEST_OPTIONS}
- --build-options ${build_options}
- ${${NAME}_BUILD_OPTIONS}
+ --build-options
+ ${${NAME}_BUILD_OPTIONS}
${_test_command})
unset(_test_command)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}")
@@ -127,9 +127,10 @@ if(BUILD_TESTING)
)
endif()
- set(build_options)
if(CMake_TEST_EXPLICIT_MAKE_PROGRAM)
- list(APPEND build_options -DCMAKE_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM})
+ list(APPEND build_generator_args
+ --build-makeprogram ${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
+ )
endif()
# Look for rpmbuild to use for tests.
@@ -415,7 +416,6 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(COnly COnly)
ADD_TEST_MACRO(CxxOnly CxxOnly)
ADD_TEST_MACRO(CxxSubdirC CxxSubdirC)
- ADD_TEST_MACRO(IPO COnly/COnly)
ADD_TEST_MACRO(OutDir runtime/OutDir)
ADD_TEST_MACRO(OutName exe.OutName.exe)
ADD_TEST_MACRO(ObjectLibrary UseCshared)
@@ -451,8 +451,8 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(StagingPrefix StagingPrefix)
ADD_TEST_MACRO(ImportedSameName ImportedSameName)
ADD_TEST_MACRO(InterfaceLibrary InterfaceLibrary)
- if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]")
- set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
+ if(NOT _isMultiConfig)
+ set(ConfigSources_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>)
ADD_TEST_MACRO(ConfigSources ConfigSources)
endif()
ADD_TEST_MACRO(SourcesProperty SourcesProperty)
@@ -528,7 +528,6 @@ if(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/BundleUtilities"
${build_generator_args}
--build-project BundleUtilities
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities")
@@ -541,9 +540,9 @@ if(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/Qt4Deploy"
${build_generator_args}
--build-project Qt4Deploy
- --build-options ${build_options}
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
+ --build-options
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy")
endif()
@@ -590,7 +589,7 @@ if(BUILD_TESTING)
--build-project ExternalDataTest
--build-noclean
--force-new-ctest-process
- --build-options ${build_options}
+ --build-options
-DMAKE_SUPPORTS_SPACES=${MAKE_SUPPORTS_SPACES}
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V
)
@@ -633,7 +632,6 @@ if(BUILD_TESTING)
"${CMake_BINARY_DIR}/Tests/Visibility"
${build_generator_args}
--build-project Visibility
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS
"${CMake_BINARY_DIR}/Tests/Visibility"
@@ -648,7 +646,7 @@ if(BUILD_TESTING)
${build_generator_args}
--build-project LinkFlags
--build-target LinkFlags
- --build-options ${build_options}
+ --build-options
-DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags")
@@ -709,7 +707,6 @@ if(BUILD_TESTING)
--build-generator-platform "${CMAKE_GENERATOR_PLATFORM}"
--build-generator-toolset "${CMAKE_GENERATOR_TOOLSET}"
--build-project Simple
- --build-options ${build_options}
--test-command Simple)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${extraGeneratorTestName}")
endif ()
@@ -729,7 +726,6 @@ if(BUILD_TESTING)
--build-project SubProject
${build_generator_args}
--build-target car
- --build-options ${build_options}
--test-command car
)
@@ -755,7 +751,6 @@ if(BUILD_TESTING)
--build-project foo
--build-target foo
--build-exe-dir "${CMake_BINARY_DIR}/Tests/SubProject/foo"
- --build-options ${build_options}
--test-command foo
)
set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject)
@@ -768,7 +763,8 @@ if(BUILD_TESTING)
set(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}")
file(MAKE_DIRECTORY "${_TEST_DIR}")
file(WRITE "${_TEST_DIR}/nightly-cmake.sh"
- "cd ${_TEST_DIR}
+ "set -e
+cd ${_TEST_DIR}
${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=nightly -P ${CMake_SOURCE_DIR}/Utilities/Release/${script}
${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGHTLY_RELEASES}'
")
@@ -784,8 +780,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
win64_release.cmake)
ADD_NIGHTLY_BUILD_TEST(CMakeNightlyOSX
osx_release.cmake)
- ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux64
- linux64_release.cmake)
set_property(TEST CMakeNightlyWin64 PROPERTY DEPENDS CMakeNightlyWin32)
endif()
@@ -797,7 +791,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project Framework
- --build-options ${build_options}
+ --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install"
--test-command bar)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework")
@@ -809,7 +803,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project TargetName
- --build-options ${build_options}
--test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
@@ -823,7 +816,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project LibName
--build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
- --build-options ${build_options}
--test-command foobar
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName")
@@ -836,7 +828,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CustComDepend
--build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
- --build-options ${build_options}
--test-command foo bar.c
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend")
@@ -848,7 +839,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project ArgumentExpansion
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin"
- --build-options ${build_options}
)
set_tests_properties(ArgumentExpansion PROPERTIES
FAIL_REGULAR_EXPRESSION "Unexpected: ")
@@ -861,7 +851,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/GeneratorExpression"
${build_generator_args}
--build-project GeneratorExpression
- --build-options ${build_options}
+ --build-options
-DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} -V
)
@@ -875,7 +865,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CustomCommand
--build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin"
- --build-options ${build_options}
+ --build-options
--test-command CustomCommand
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand")
@@ -893,7 +883,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project TestWorkingDir
- --build-options ${build_options}
--test-command working
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory")
@@ -905,7 +894,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project OutOfSource
--build-two-config
- --build-options ${build_options}
--test-command
"${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource")
@@ -918,7 +906,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/BuildDepends"
${build_generator_args}
--build-project BuildDepends
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
@@ -931,7 +918,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project TestMissingInstall
--build-two-config
- --build-options ${build_options}
+ --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${MissingInstallInstallDir}")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MissingInstall")
@@ -977,7 +964,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
${build_generator_args}
--build-project CPackWiXGenerator
- --build-options ${build_options}
+ --build-options
--test-command ${CMAKE_CMAKE_COMMAND}
"-DCPackWiXGenerator_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackWiXGenerator"
"-Dconfig=\${CTEST_CONFIGURATION_TYPE}"
@@ -997,7 +984,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CPackUseDefaultVersion
--build-two-config
- --build-options ${build_options}
+ --build-options
${CPackUseDefaultVersion_BUILD_OPTIONS})
set_tests_properties(CPackUseDefaultVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=0\\.1\\.1")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseDefaultVersion")
@@ -1009,7 +996,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CPackUseProjectVersion
--build-two-config
- --build-options ${build_options}
+ --build-options
${CPackUseProjectVersion_BUILD_OPTIONS})
set_tests_properties(CPackUseProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=1\\.2\\.3")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseProjectVersion")
@@ -1021,7 +1008,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CPackUseShortProjectVersion
--build-two-config
- --build-options ${build_options}
+ --build-options
${CPackUseProjectVersion_BUILD_OPTIONS})
set_tests_properties(CPackUseShortProjectVersion PROPERTIES PASS_REGULAR_EXPRESSION "CPACK_PACKAGE_VERSION=2")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackUseShortProjectVersion")
@@ -1049,7 +1036,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project CPackComponents
--build-two-config
--build-target package
- --build-options ${build_options}
+ --build-options
-DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB}
-DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM}
${CPackComponents_BUILD_OPTIONS}
@@ -1109,7 +1096,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}"
${build_generator_args}
--build-project CPackComponentsForAll
- --build-options ${build_options}
+ --build-options
-DCPACK_GENERATOR:STRING=${CPACK_GENERATOR_STRING_${CPackGen}}
-DCPACK_BINARY_${CPackGen}:BOOL=ON
${CPackRun_CPackComponentWay}
@@ -1148,7 +1135,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/${DEB_TEST_NAMES}/build${CPackGen}-${CPackDEBConfiguration}"
${build_generator_args}
--build-project CPackComponentsDEB
- --build-options ${build_options}
+ --build-options
-DCPACK_GENERATOR:STRING=${CPackGen}
-DCPACK_BINARY_${CPackGen}:BOOL=ON
${CPackRun_CPackDEBConfiguration}
@@ -1188,7 +1175,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators"
${build_generator_args}
--build-project CPackTestAllGenerators
- --build-options ${build_options}
--test-command
${CMAKE_CMAKE_COMMAND}
-D dir=${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators
@@ -1219,7 +1205,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project CPackComponentsPrefix
--build-two-config
--build-target package
- --build-options ${build_options}
+ --build-options
-DCPACK_BINARY_DEB:BOOL=${CPACK_BINARY_DEB}
-DCPACK_BINARY_RPM:BOOL=${CPACK_BINARY_RPM}
-DCPACK_BINARY_ZIP:BOOL=ON
@@ -1242,7 +1228,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project UseX11
--build-two-config
${X11_build_target_arg}
- --build-options ${build_options}
--test-command UseX11)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11")
@@ -1285,7 +1270,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig"
${build_generator_args}
--build-project LoadCommand
- --build-options ${build_options}
--test-command LoadedCommand
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
@@ -1300,7 +1284,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Complex
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"
- --build-options ${build_options}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
--test-command complex
)
@@ -1313,7 +1296,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Complex
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
- --build-options ${build_options}
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
--test-command complex)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
@@ -1328,7 +1310,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project EnvironmentProj
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Environment"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment")
@@ -1339,7 +1320,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/QtAutomocNoQt"
${build_generator_args}
--build-project QtAutomocNoQt
- --build-options ${build_options}
+ --build-options
-DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt")
@@ -1364,7 +1345,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project Qt4Targets
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Targets"
--force-new-ctest-process
- --build-options ${build_options}
+ --build-options
-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
@@ -1379,7 +1360,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project Qt4And5Automoc
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocForward")
@@ -1391,191 +1371,75 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project Qt4And5Automoc
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse"
--force-new-ctest-process
- --build-options ${build_options} -DQT_REVERSE_FIND_ORDER=1
+ --build-options -DQT_REVERSE_FIND_ORDER=1
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4And5AutomocReverse")
endif()
endif()
- if(CMake_TEST_FindALSA)
- add_subdirectory(FindALSA)
- endif()
+ # test for Find modules, simple cases
+ foreach(_mod IN ITEMS
+ ALSA
+ Boost
+ BZip2
+ CURL
+ Cups
+ Doxygen
+ EnvModules
+ EXPAT
+ Fontconfig
+ Freetype
+ GDAL
+ GIF
+ Git
+ GLEW
+ GnuTLS
+ GSL
+ GTK2
+ Iconv
+ ICU
+ JPEG
+ JsonCpp
+ LibLZMA
+ LibRHash
+ Libinput
+ LibUV
+ LibXml2
+ LTTngUST
+ ODBC
+ OpenACC
+ OpenCL
+ OpenGL
+ OpenMP
+ OpenSSL
+ MPI
+ PNG
+ Patch
+ PostgreSQL
+ Protobuf
+ SQLite3
+ TIFF
+ Vulkan
+ X11
+ XalanC
+ XercesC
+ )
+ if(CMake_TEST_Find${_mod})
+ add_subdirectory(Find${_mod})
+ endif()
+ endforeach()
if(CMake_TEST_CUDA)
add_subdirectory(Cuda)
add_subdirectory(CudaOnly)
endif()
- if(CMake_TEST_FindBoost)
- add_subdirectory(FindBoost)
- endif()
-
- if(CMake_TEST_FindBZip2)
- add_subdirectory(FindBZip2)
- endif()
-
- if(CMake_TEST_FindCURL)
- add_subdirectory(FindCURL)
- endif()
-
- if(CMake_TEST_FindCups)
- add_subdirectory(FindCups)
- endif()
-
- if(CMake_TEST_FindDoxygen)
- add_subdirectory(FindDoxygen)
- endif()
-
- if(CMake_TEST_FindEnvModules)
- add_subdirectory(FindEnvModules)
- endif()
-
- if(CMake_TEST_FindEXPAT)
- add_subdirectory(FindEXPAT)
- endif()
-
- if(CMake_TEST_FindFontconfig)
- add_subdirectory(FindFontconfig)
- endif()
-
- if(CMake_TEST_FindFreetype)
- add_subdirectory(FindFreetype)
- endif()
-
- if(CMake_TEST_FindGDAL)
- add_subdirectory(FindGDAL)
- endif()
-
- if(CMake_TEST_FindGIF)
- add_subdirectory(FindGIF)
- endif()
-
- if(CMake_TEST_FindGit)
- add_subdirectory(FindGit)
- endif()
-
- if(CMake_TEST_FindGLEW)
- add_subdirectory(FindGLEW)
- endif()
-
- if(CMake_TEST_FindGSL)
- add_subdirectory(FindGSL)
- endif()
-
if(CMake_TEST_FindGTest)
add_subdirectory(FindGTest)
add_subdirectory(GoogleTest)
endif()
- if(CMake_TEST_FindGTK2)
- add_subdirectory(FindGTK2)
- endif()
-
- if(CMake_TEST_FindIconv)
- add_subdirectory(FindIconv)
- endif()
-
- if(CMake_TEST_FindICU)
- add_subdirectory(FindICU)
- endif()
-
- if(CMake_TEST_FindJPEG)
- add_subdirectory(FindJPEG)
- endif()
-
- if(CMake_TEST_FindJsonCpp)
- add_subdirectory(FindJsonCpp)
- endif()
-
- if(CMake_TEST_FindLibLZMA)
- add_subdirectory(FindLibLZMA)
- endif()
-
- if(CMake_TEST_FindLibRHash)
- add_subdirectory(FindLibRHash)
- endif()
-
- if(CMake_TEST_FindLibinput)
- add_subdirectory(FindLibinput)
- endif()
-
- if(CMake_TEST_FindLibUV)
- add_subdirectory(FindLibUV)
- endif()
-
- if(CMake_TEST_FindLibXml2)
- add_subdirectory(FindLibXml2)
- endif()
-
- if(CMake_TEST_FindLTTngUST)
- add_subdirectory(FindLTTngUST)
- endif()
-
- if(CMake_TEST_FindODBC)
- add_subdirectory(FindODBC)
- endif()
-
- if(CMake_TEST_FindOpenCL)
- add_subdirectory(FindOpenCL)
- endif()
-
- if(CMake_TEST_FindOpenGL)
- add_subdirectory(FindOpenGL)
- endif()
-
- if(CMake_TEST_FindOpenMP)
- add_subdirectory(FindOpenMP)
- endif()
-
- if(CMake_TEST_FindOpenSSL)
- add_subdirectory(FindOpenSSL)
- endif()
-
- if(CMake_TEST_FindMPI)
- add_subdirectory(FindMPI)
- endif()
-
- if(CMake_TEST_FindPNG)
- add_subdirectory(FindPNG)
- endif()
-
- if(CMake_TEST_FindPatch)
- add_subdirectory(FindPatch)
- endif()
-
- if(CMake_TEST_FindPostgreSQL)
- add_subdirectory(FindPostgreSQL)
- endif()
-
- if(CMake_TEST_FindProtobuf)
- add_subdirectory(FindProtobuf)
- endif()
-
- if(CMake_TEST_FindSQLite3)
- add_subdirectory(FindSQLite3)
- endif()
-
- if(CMake_TEST_FindTIFF)
- add_subdirectory(FindTIFF)
- endif()
-
- if(CMake_TEST_FindVulkan)
- add_subdirectory(FindVulkan)
- endif()
-
- if(CMake_TEST_FindX11)
- add_subdirectory(FindX11)
- endif()
-
- if(CMake_TEST_FindXalanC)
- add_subdirectory(FindXalanC)
- endif()
-
- if(CMake_TEST_FindXercesC)
- add_subdirectory(FindXercesC)
- endif()
-
if(CMake_TEST_FindPython OR CMake_TEST_FindPython_NumPy)
add_subdirectory(FindPython)
endif()
@@ -1591,16 +1455,16 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
# CMake_TEST_FindMatlab_ROOT_DIR: indicates an optional root directory for Matlab, allows to select a version.
# CMake_TEST_FindMatlab_MCR: indicates the MCR is installed
# CMake_TEST_FindMatlab_MCR_ROOT_DIR: indicates an optional root directory for the MCR, required on Linux
- if(CMake_TEST_FindMatlab OR (NOT "${CMake_TEST_FindMatlab_ROOT_DIR}" STREQUAL "") OR
- CMake_TEST_FindMatlab_MCR OR (NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL ""))
+ if(CMake_TEST_FindMatlab OR CMake_TEST_FindMatlab_ROOT_DIR OR
+ CMake_TEST_FindMatlab_MCR OR CMake_TEST_FindMatlab_MCR_ROOT_DIR)
set(FindMatlab_additional_test_options )
- if(CMake_TEST_FindMatlab_MCR OR NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL "")
+ if(CMake_TEST_FindMatlab_MCR OR CMake_TEST_FindMatlab_MCR_ROOT_DIR)
set(FindMatlab_additional_test_options -DIS_MCR=TRUE)
endif()
- if(NOT "${CMake_TEST_FindMatlab_ROOT_DIR}" STREQUAL "")
+ if(CMake_TEST_FindMatlab_ROOT_DIR)
set(FindMatlab_additional_test_options ${FindMatlab_additional_test_options} "-DMatlab_ROOT_DIR=${CMake_TEST_FindMatlab_ROOT_DIR}")
endif()
- if(NOT "${CMake_TEST_FindMatlab_MCR_ROOT_DIR}" STREQUAL "")
+ if(CMake_TEST_FindMatlab_MCR_ROOT_DIR)
set(FindMatlab_additional_test_options ${FindMatlab_additional_test_options} "-DMCR_ROOT:FILEPATH=${CMake_TEST_FindMatlab_MCR_ROOT_DIR}")
endif()
set(FindMatlab.basic_checks_BUILD_OPTIONS ${FindMatlab_additional_test_options})
@@ -1623,7 +1487,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project ExternalProjectTest
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProject"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject")
@@ -1639,7 +1502,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project ExternalProjectSubdir
--force-new-ctest-process
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSubdir")
@@ -1651,7 +1513,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project ExternalProjectSourceSubdir
--force-new-ctest-process
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdir")
@@ -1663,7 +1524,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project ExternalProjectSourceSubdirNotCMake
--force-new-ctest-process
- --build-options ${build_options}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectSourceSubdirNotCMake")
@@ -1675,7 +1535,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project ExternalProjectLocalTest
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectLocal")
@@ -1691,7 +1550,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project ExternalProjectUpdateTest
--build-exe-dir "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProjectUpdate")
@@ -1729,17 +1587,17 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endif()
add_test(${tutorial_test_name} ${CMAKE_CTEST_COMMAND}
--build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/${step_name}"
+ "${CMake_SOURCE_DIR}/Help/guide/tutorial/${step_name}"
${tutorial_build_dir}_Build
${build_generator_args}
--build-project Tutorial
- --build-options ${build_options} ${tutorial_build_options}
+ --build-options ${tutorial_build_options}
--test-command Tutorial 25.0)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/${tutorial_build_dir}_Build")
endfunction()
if(NOT CMake_TEST_EXTERNAL_CMAKE)
- foreach(STP RANGE 1 11)
+ foreach(STP RANGE 2 11)
add_tutorial_test(Step${STP} TRUE)
endforeach()
add_tutorial_test(Complete TRUE)
@@ -1755,7 +1613,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/Testing"
${build_generator_args}
--build-project Testing
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
)
set_tests_properties(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
@@ -1768,7 +1625,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Wrapping
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --build-options ${build_options}
--test-command wrapping
)
add_test(qtwrapping ${CMAKE_CTEST_COMMAND}
@@ -1778,7 +1634,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Wrapping
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
- --build-options ${build_options}
--test-command qtwrapping
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping")
@@ -1790,7 +1645,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest
- --build-options ${build_options}
--test-command TestDriverTest test1
)
@@ -1801,7 +1655,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest
- --build-options ${build_options}
--test-command TestDriverTest test2
)
@@ -1812,7 +1665,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin"
--build-project TestDriverTest
- --build-options ${build_options}
--test-command TestDriverTest subdir/test3
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver")
@@ -1824,7 +1676,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Dependency/Exec"
${build_generator_args}
--build-project Dependency
- --build-options ${build_options}
--test-command exec
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency")
@@ -1854,8 +1705,8 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable"
--build-project Jump
${build_generator_args}
- --build-options ${build_options}
- -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
+ --build-options
+ -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib
--test-command jumpExecutable
)
@@ -1867,7 +1718,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable"
--build-project Jump
${build_generator_args}
- --build-options ${build_options}
--test-command jumpExecutable
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump")
@@ -1879,7 +1729,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project Plugin
--build-two-config
- --build-options ${build_options}
--test-command bin/example)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin")
@@ -1895,7 +1744,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/MacRuntimePath"
${build_generator_args}
--build-project MacRuntimePath
- --build-options ${build_options}
+ --build-options
-DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
)
endif()
@@ -1913,7 +1762,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/LinkLineOrder"
${build_generator_args}
--build-project LinkLineOrder
- --build-options ${build_options}
--test-command Exec1
)
@@ -1923,7 +1771,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/LinkLineOrder"
${build_generator_args}
--build-project LinkLineOrder
- --build-options ${build_options}
--test-command Exec2
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder")
@@ -1943,7 +1790,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/LinkStatic"
${build_generator_args}
--build-project LinkStatic
- --build-options ${build_options}
+ --build-options
-DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a
--test-command LinkStatic
)
@@ -1958,7 +1805,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources"
${build_generator_args}
--build-project SUBDIR
- --build-options ${build_options}
--test-command test
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere"
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj"
@@ -1974,7 +1820,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
${build_generator_args}
--build-project SUBDIR
- --build-options ${build_options}
--test-command test
"${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
"${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj"
@@ -1987,7 +1832,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-exe-dir "${CMake_BINARY_DIR}/Tests/SubDir/Executable"
${build_generator_args}
--build-project SUBDIR
- --build-options ${build_options}
--test-command test
"${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere"
"${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o"
@@ -1995,9 +1839,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
endif ()
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir")
- if(MSVC)
- ADD_TEST_MACRO(ForceInclude foo)
+ if(MSVC OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_SIMULATE_ID STREQUAL "MSVC"))
ADD_TEST_MACRO(PDBDirectoryAndName myexe)
+ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang" OR NOT "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
+ ADD_TEST_MACRO(ForceInclude foo)
+ endif()
if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
ADD_TEST_MACRO(PrecompiledHeader foo)
endif()
@@ -2023,7 +1869,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project MakeClean
--build-exe-dir "${CMake_BINARY_DIR}/MakeClean"
- --build-options ${build_options}
--test-command check_clean
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean")
@@ -2132,7 +1977,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project mfc_driver
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND}
-C \${CTEST_CONFIGURATION_TYPE} -VV)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC")
@@ -2162,7 +2006,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project VSExternalInclude
- --build-options ${build_options}
--test-command VSExternalInclude)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude")
@@ -2173,7 +2016,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project VSMidl
- --build-options ${build_options}
--test-command VSMidl)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl")
@@ -2237,6 +2079,9 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-config $<CONFIGURATION>
--build-options -DCMAKE_SYSTEM_NAME=${systemName}
-DCMAKE_SYSTEM_VERSION=${systemVersion}
+ --test-command
+ ${CMAKE_CMAKE_COMMAND} -DAPP_PACKAGE_DIR="${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}"
+ -P "${CMake_SOURCE_DIR}/Tests/VSWinStorePhone/VerifyAppPackage.cmake"
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSWinStorePhone/${name}")
endmacro()
@@ -2287,11 +2132,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
macro(add_test_VSWinCE name generator systemName systemVersion generatorPlatform)
# TODO: Fix the tutorial to make it work in cross compile
# currently the MakeTable is build for target and can not be used on the host
- # This happens in part 5 so we build only part 1-4 of the tutorial
- foreach(STP RANGE 1 4)
+ # This happens in part 5 so we build only through part 4 of the tutorial.
+ foreach(STP RANGE 2 4)
add_test(NAME "TutorialStep${STP}.${name}" COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
- "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}"
+ "${CMake_SOURCE_DIR}/Help/guide/tutorial/Step${STP}"
"${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}_${name}"
--build-generator "${generator}"
--build-project Tutorial
@@ -2460,7 +2305,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project BundleTest
--build-target install
# --build-target package
- --build-options ${build_options}
+ --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${BundleTestInstallDir}"
"-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}"
--test-command
@@ -2475,7 +2320,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project CFBundleTest
--build-config $<CONFIGURATION>
- --build-options ${build_options}
--test-command
${CMAKE_CMAKE_COMMAND} -DCTEST_CONFIGURATION_TYPE=$<CONFIGURATION>
-Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest
@@ -2483,7 +2327,8 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
-P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest")
- ADD_TEST_MACRO(ObjC++ ObjC++)
+ add_subdirectory(ObjC)
+ add_subdirectory(ObjCXX)
endif ()
endif ()
@@ -2496,7 +2341,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project BundleGeneratorTest
--build-target package
- --build-options ${build_options}
+ --build-options
"-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest")
@@ -2509,7 +2354,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-noclean
--build-project WarnUnusedUnusedViaSet
- --build-options ${build_options}
+ --build-options
"--warn-unused-vars")
set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES
PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'")
@@ -2524,7 +2369,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-noclean
--build-project WarnUnusedUnusedViaUnset
- --build-options ${build_options}
+ --build-options
"--warn-unused-vars")
set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Warning \\(dev\\) at CMakeLists.txt:7 \\(set\\):")
@@ -2538,7 +2383,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused"
${build_generator_args}
--build-project WarnUnusedCliUnused
- --build-options ${build_options}
+ --build-options
"-DUNUSED_CLI_VARIABLE=Unused")
set_tests_properties(WarnUnusedCliUnused PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE")
@@ -2551,7 +2396,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-noclean
--build-project WarnUnusedCliUsed
- --build-options ${build_options}
+ --build-options
"-DUSED_VARIABLE=Usage proven")
set_tests_properties(WarnUnusedCliUsed PROPERTIES
PASS_REGULAR_EXPRESSION "Usage proven")
@@ -2566,7 +2411,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-noclean
--build-project WarnUninitialized
- --build-options ${build_options}
+ --build-options
"--warn-uninitialized")
set_tests_properties(WarnUninitialized PROPERTIES
PASS_REGULAR_EXPRESSION "uninitialized variable 'USED_VARIABLE'")
@@ -2581,7 +2426,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-project TestsWorkingDirectoryProj
--build-exe-dir "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory"
--force-new-ctest-process
- --build-options ${build_options}
--test-command ${CMAKE_CTEST_COMMAND} -V -C \${CTEST_CONFIGURATION_TYPE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory")
@@ -2778,16 +2622,18 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
PASS_REGULAR_EXPRESSION "Could not find executable"
FAIL_REGULAR_EXPRESSION "SegFault")
- configure_file(
- "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in"
- "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake"
- @ONLY ESCAPE_QUOTES)
- add_test(CTestTestUpload ${CMAKE_CTEST_COMMAND}
- -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V
- --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log"
- )
- set_tests_properties(CTestTestUpload PROPERTIES
- PASS_REGULAR_EXPRESSION "Upload\\.xml")
+ if(NOT CMake_TEST_NO_NETWORK)
+ configure_file(
+ "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in"
+ "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ add_test(CTestTestUpload ${CMAKE_CTEST_COMMAND}
+ -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V
+ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log"
+ )
+ set_tests_properties(CTestTestUpload PROPERTIES
+ PASS_REGULAR_EXPRESSION "Upload\\.xml")
+ endif()
configure_file(
"${CMake_SOURCE_DIR}/Tests/CTestCoverageCollectGCOV/test.cmake.in"
@@ -3379,7 +3225,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project testf
--build-two-config
- --build-options ${build_options}
--test-command testf)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran")
@@ -3390,7 +3235,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/FortranModules"
${build_generator_args}
--build-project FortranModules
- --build-options ${build_options}
+ --build-options
-DCMake_TEST_NESTED_MAKE_PROGRAM:FILEPATH=${CMake_TEST_EXPLICIT_MAKE_PROGRAM}
-DCMake_TEST_Fortran_SUBMODULES:BOOL=${CMake_TEST_Fortran_SUBMODULES}
${CMake_TEST_FortranModules_BUILD_OPTIONS}
@@ -3413,7 +3258,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
${build_generator_args}
--build-project FortranC
--build-two-config
- --build-options ${build_options}
--test-command CMakeFiles/FortranCInterface/FortranCInterface)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC")
endif()
@@ -3433,86 +3277,45 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
if(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink
file(READ "${JNI_H}" JNI_FILE)
if("${JNI_FILE}" MATCHES "JDK1_2")
- add_test(Java.Jar ${CMAKE_CTEST_COMMAND}
+ add_test(NAME Java.Jar COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/Java"
"${CMake_BINARY_DIR}/Tests/JavaJar"
${build_generator_args}
--build-project hello
- --build-target hello
- --build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJar/"
- --build-options ${build_options}
- --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld)
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIG>)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJar")
- add_test(Java.JarSourceList ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Java"
- "${CMake_BINARY_DIR}/Tests/JavaJarSourceList"
- ${build_generator_args}
- --build-project hello
- --build-target hello2
- --build-two-config
- --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceList/"
- --build-options ${build_options}
- --test-command ${JAVA_RUNTIME} -classpath hello2.jar HelloWorld)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceList")
- add_test(Java.JarSourceListAndOutput ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Java"
- "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput"
- ${build_generator_args}
- --build-project hello
- --build-target hello3
- --build-two-config
- --build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput/hello3"
- --build-options ${build_options}
- --test-command ${JAVA_RUNTIME} -classpath hello3.jar HelloWorld)
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJarSourceListAndOutput")
# For next tests, java tool must have same architecture as toolchain
math(EXPR _object_mode "${CMAKE_SIZEOF_VOID_P} * 8")
execute_process(
- COMMAND "${Java_JAVA_EXECUTABLE}" -d${_object_mode} -version
- OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE _result
+ COMMAND "${Java_JAVA_EXECUTABLE}" -version
+ OUTPUT_VARIABLE _version ERROR_VARIABLE _version RESULT_VARIABLE _result
)
- if(_result EQUAL 0)
+ if(_result EQUAL 0 AND _version MATCHES "${_object_mode}-Bit")
## next test is valid only if Java version is less than 1.10
if ("${Java_VERSION}" VERSION_LESS 1.10)
- if(_isMultiConfig)
- set (JAVAH_LIBRARY_PATH ${CMake_BINARY_DIR}/Tests/JavaJavah/$<CONFIGURATION>)
- else()
- set (JAVAH_LIBRARY_PATH ${CMake_BINARY_DIR}/Tests/JavaJavah)
- endif()
add_test(NAME Java.Javah COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/JavaJavah"
"${CMake_BINARY_DIR}/Tests/JavaJavah"
${build_generator_args}
--build-project helloJavah
- --build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaJavah/"
- --build-options ${build_options}
- --test-command ${JAVA_RUNTIME} -Djava.library.path=${JAVAH_LIBRARY_PATH} -classpath hello3.jar HelloWorld2)
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIG>)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaJavah")
endif()
## next test is valid only if Java is, at least, version 1.8
if (NOT "${Java_VERSION}" VERSION_LESS 1.8)
- if(_isMultiConfig)
- set (JAVANATIVEHEADERS_LIBRARY_PATH ${CMake_BINARY_DIR}/Tests/JavaNativeHeaders/$<CONFIGURATION>)
- else()
- set (JAVANATIVEHEADERS_LIBRARY_PATH ${CMake_BINARY_DIR}/Tests/JavaNativeHeaders)
- endif()
add_test(NAME Java.NativeHeaders COMMAND ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/JavaNativeHeaders"
"${CMake_BINARY_DIR}/Tests/JavaNativeHeaders"
${build_generator_args}
--build-project helloJavaNativeHeaders
- --build-two-config
--build-run-dir "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders/"
- --build-options ${build_options}
- --test-command ${JAVA_RUNTIME} -Djava.library.path=${JAVANATIVEHEADERS_LIBRARY_PATH} -classpath hello4.jar HelloWorld3)
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIG>)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/JavaNativeHeaders")
endif()
endif()
@@ -3533,9 +3336,9 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc"
${build_generator_args}
--build-project SimpleC
- --build-options ${build_options}
- "-DCMAKE_SYSTEM_NAME=Generic"
- "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
+ --build-options
+ "-DCMAKE_SYSTEM_NAME=Generic"
+ "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
endif()
@@ -3551,11 +3354,11 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win"
${build_generator_args}
--build-project Simple
- --build-options ${build_options}
- "-DCMAKE_SYSTEM_NAME=Windows"
- "-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}"
- "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}"
- "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}"
+ --build-options
+ "-DCMAKE_SYSTEM_NAME=Windows"
+ "-DCMAKE_C_COMPILER=${MINGW_CC_LINUX2WIN_EXECUTABLE}"
+ "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}"
+ "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}"
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
endif()
@@ -3641,7 +3444,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project IncludeDirectories
- --build-options ${build_options}
--test-command IncludeDirectories)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories")
@@ -3655,8 +3457,7 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
"${CMake_BINARY_DIR}/Tests/IncludeDirectoriesCPATH"
--build-two-config
${build_generator_args}
- --build-project IncludeDirectoriesCPATH
- --build-options ${build_options})
+ --build-project IncludeDirectoriesCPATH)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectoriesCPATH")
set_tests_properties(IncludeDirectoriesCPATH
PROPERTIES
@@ -3670,7 +3471,6 @@ ${CMake_SOURCE_DIR}/Utilities/Release/push.bash --dir dev -- '${CMake_BUILD_NIGH
--build-two-config
${build_generator_args}
--build-project InterfaceLinkLibraries
- --build-options ${build_options}
--test-command InterfaceLinkLibraries)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/InterfaceLinkLibraries")
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index 1aeab8b39..03babd263 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -30,6 +30,17 @@ add_CMakeOnly_test(CheckStructHasMember)
add_CMakeOnly_test(CompilerIdC)
add_CMakeOnly_test(CompilerIdCXX)
+
+if(CMAKE_OBJC_COMPILER)
+ add_CMakeOnly_test(CompilerIdOBJC)
+ add_CMakeOnly_test(CheckOBJCCompilerFlag)
+endif()
+
+if(CMAKE_OBJCXX_COMPILER)
+ add_CMakeOnly_test(CompilerIdOBJCXX)
+ add_CMakeOnly_test(CheckOBJCXXCompilerFlag)
+endif()
+
if(CMAKE_Fortran_COMPILER)
add_CMakeOnly_test(CompilerIdFortran)
endif()
@@ -84,5 +95,5 @@ function(add_major_test module)
endfunction()
add_major_test(PythonLibs VERSIONS 2 3 VERSION_VAR PYTHONLIBS_VERSION_STRING)
-add_major_test(PythonInterp NOLANG VERSIONS 2 3 VERSION_VAR PYTHON_VERSION_STRING)
+add_major_test(PythonInterp NOLANG VERSIONS 3 VERSION_VAR PYTHON_VERSION_STRING)
add_major_test(Qt VERSIONS 3 4 VERSION_VAR QT_VERSION_STRING)
diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
index f058c19fb..2028a135c 100644
--- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt
@@ -49,6 +49,15 @@ else ()
message(STATUS "errno found in <cerrno>")
endif ()
+check_cxx_symbol_exists("std::fopen" "cstdio" CSE_RESULT_FOPEN)
+if (NOT CSE_RESULT_FOPEN)
+ if(NOT ("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 13.10))
+ message(SEND_ERROR "CheckCXXSymbolExists did not find std::fopen in <cstdio>")
+ endif()
+else()
+ message(STATUS "std::fopen found in <cstdio>")
+endif()
+
if (CMAKE_COMPILER_IS_GNUCXX)
string(APPEND CMAKE_CXX_FLAGS " -O3")
unset(CSE_RESULT_O3 CACHE)
@@ -60,3 +69,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)
message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3")
endif ()
endif ()
+
+check_cxx_symbol_exists("std::non_existent_function_for_symbol_test<int*>" "algorithm" CSE_RESULT_NON_SYMBOL)
+if (CSE_RESULT_NON_SYMBOL)
+ message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol.")
+endif()
diff --git a/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt b/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt
index ca4becb77..90aa921f5 100644
--- a/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt
+++ b/Tests/CMakeOnly/CheckLanguage/CMakeLists.txt
@@ -5,10 +5,20 @@ include(CheckLanguage)
set(langs )
set(expect_C 1)
set(expect_CXX 1)
+
+if(APPLE)
+ set(expect_OBJC 1)
+ set(expect_OBJCXX 1)
+endif()
unset(expect_Fortran)
set(expect_NoSuchLanguage 0)
-foreach(lang C CXX Fortran CUDA NoSuchLanguage)
+set(LANGUAGES C CXX Fortran CUDA NoSuchLanguage)
+if(APPLE)
+ list(APPEND LANGUAGES OBJC OBJCXX)
+endif()
+
+foreach(lang ${LANGUAGES})
check_language(${lang})
if(NOT DEFINED CMAKE_${lang}_COMPILER)
message(FATAL_ERROR "check_language(${lang}) did not set result")
diff --git a/Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt b/Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt
new file mode 100644
index 000000000..a9a96eebb
--- /dev/null
+++ b/Tests/CMakeOnly/CheckOBJCCompilerFlag/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 2.8.12)
+
+project(CheckOBJCCompilerFlag)
+
+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)
+
+if(NOT HAS_COMPILER_FLAG)
+ message(SEND_ERROR "Test fail: HAS_COMPILER_FLAG: ${COMPILER_FLAG}")
+endif
diff --git a/Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt b/Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt
new file mode 100644
index 000000000..f83b738dc
--- /dev/null
+++ b/Tests/CMakeOnly/CheckOBJCXXCompilerFlag/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 2.8.12)
+
+project(CheckOBJCXXCompilerFlag)
+
+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)
+
+if(NOT HAS_COMPILER_FLAG)
+ message(SEND_ERROR "Test fail: HAS_COMPILER_FLAG: ${COMPILER_FLAG}")
+endif()
diff --git a/Tests/CMakeOnly/CompilerIdOBJC/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdOBJC/CMakeLists.txt
new file mode 100644
index 000000000..8f1378706
--- /dev/null
+++ b/Tests/CMakeOnly/CompilerIdOBJC/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(CompilerIdOBJC OBJC)
+
+foreach(v
+ CMAKE_OBJC_COMPILER
+ CMAKE_OBJC_COMPILER_ID
+ CMAKE_OBJC_COMPILER_VERSION
+ )
+ if(${v})
+ message(STATUS "${v}=[${${v}}]")
+ else()
+ message(SEND_ERROR "${v} not set!")
+ endif()
+endforeach()
diff --git a/Tests/CMakeOnly/CompilerIdOBJCXX/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdOBJCXX/CMakeLists.txt
new file mode 100644
index 000000000..8f41db050
--- /dev/null
+++ b/Tests/CMakeOnly/CompilerIdOBJCXX/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(CompilerIdOBJCXX OBJCXX)
+
+foreach(v
+ CMAKE_OBJCXX_COMPILER
+ CMAKE_OBJCXX_COMPILER_ID
+ CMAKE_OBJCXX_COMPILER_VERSION
+ )
+ if(${v})
+ message(STATUS "${v}=[${${v}}]")
+ else()
+ message(SEND_ERROR "${v} not set!")
+ endif()
+endforeach()
diff --git a/Tests/CMakeServerLib/testServerBuffering.cpp b/Tests/CMakeServerLib/testServerBuffering.cpp
index 7330eadf7..6f2294067 100644
--- a/Tests/CMakeServerLib/testServerBuffering.cpp
+++ b/Tests/CMakeServerLib/testServerBuffering.cpp
@@ -1,9 +1,11 @@
-#include "cmConnection.h"
-#include "cmServerConnection.h"
#include <iostream>
+#include <memory>
#include <string>
#include <vector>
+#include "cmConnection.h"
+#include "cmServerConnection.h"
+
void print_error(const std::vector<std::string>& input,
const std::vector<std::string>& output)
{
diff --git a/Tests/CMakeTests/ELFTest.cmake.in b/Tests/CMakeTests/ELFTest.cmake.in
index 463577889..85c2360d3 100644
--- a/Tests/CMakeTests/ELFTest.cmake.in
+++ b/Tests/CMakeTests/ELFTest.cmake.in
@@ -25,13 +25,38 @@ foreach(f ${files})
# Change the RPATH.
file(RPATH_CHANGE FILE "${f}"
OLD_RPATH "/sample/rpath"
- NEW_RPATH "/rpath/sample")
+ NEW_RPATH "/path1:/path2")
set(rpath)
- file(STRINGS "${f}" rpath REGEX "/rpath/sample" LIMIT_COUNT 1)
+ file(STRINGS "${f}" rpath REGEX "/path1:/path2" LIMIT_COUNT 1)
if(NOT rpath)
message(FATAL_ERROR "RPATH not changed in ${f}")
endif()
+ # Change the RPATH without compiler defined rpath removed
+ file(RPATH_CHANGE FILE "${f}"
+ OLD_RPATH "/path2"
+ NEW_RPATH "/path3")
+ set(rpath)
+ file(STRINGS "${f}" rpath REGEX "/path1:/path3" LIMIT_COUNT 1)
+ if(NOT rpath)
+ message(FATAL_ERROR "RPATH not updated in ${f}")
+ endif()
+
+ # Change the RPATH with compiler defined rpath removed
+ file(RPATH_CHANGE FILE "${f}"
+ OLD_RPATH "/path3"
+ NEW_RPATH "/rpath/sample"
+ INSTALL_REMOVE_ENVIRONMENT_RPATH)
+ set(rpath)
+ file(STRINGS "${f}" rpath REGEX "/rpath/sample" LIMIT_COUNT 1)
+ if(NOT rpath)
+ message(FATAL_ERROR "RPATH not updated in ${f}")
+ endif()
+ file(STRINGS "${f}" rpath REGEX "/path1" LIMIT_COUNT 1)
+ if(rpath)
+ message(FATAL_ERROR "RPATH not removed in ${f}")
+ endif()
+
# Remove the RPATH.
file(RPATH_REMOVE FILE "${f}")
set(rpath)
diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt
index 3037f13cb..20615fea1 100644
--- a/Tests/COnly/CMakeLists.txt
+++ b/Tests/COnly/CMakeLists.txt
@@ -13,11 +13,5 @@ if(MSVC_VERSION AND NOT CMAKE_C_COMPILER_ID STREQUAL Clang OR "x${CMAKE_C_COMPIL
endif()
string(ASCII 35 32 67 77 97 107 101 ASCII_STRING)
message(STATUS "String: ${ASCII_STRING}")
-get_source_file_property(LANG conly.c LANGUAGE)
-if("${LANG}" STREQUAL "C")
- message("Language is C")
-else()
- message(FATAL_ERROR "Bad language for file conly.c")
-endif()
add_library(testCModule MODULE testCModule.c)
diff --git a/Tests/COnly/conly.c b/Tests/COnly/conly.c
index 7bd8e8e15..2ae8a1acc 100644
--- a/Tests/COnly/conly.c
+++ b/Tests/COnly/conly.c
@@ -1,10 +1,9 @@
-#include "foo.h"
+#include <stdio.h>
+#include "foo.h"
#include "libc1.h"
#include "libc2.h"
-#include <stdio.h>
-
int main()
{
int class = 0;
diff --git a/Tests/CPackComponents/mylib.cpp b/Tests/CPackComponents/mylib.cpp
index 8ddac198c..8d6307164 100644
--- a/Tests/CPackComponents/mylib.cpp
+++ b/Tests/CPackComponents/mylib.cpp
@@ -1,4 +1,5 @@
#include "mylib.h"
+
#include "stdio.h"
void mylib_function()
diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt
index 9d4b5e9df..bc5b6a947 100644
--- a/Tests/CPackComponentsDEB/CMakeLists.txt
+++ b/Tests/CPackComponentsDEB/CMakeLists.txt
@@ -4,8 +4,8 @@
# application (mylibapp). We create a binary installer (a CPack Generator)
# which supports CPack components.
-cmake_minimum_required(VERSION 2.8.3.20101130 FATAL_ERROR)
-project(CPackComponentsDEB)
+cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
+project(CPackComponentsDEB VERSION 1.0.3)
# Use GNUInstallDirs in order to enforce lib64 if needed
include(GNUInstallDirs)
@@ -44,10 +44,6 @@ set(CPACK_PACKAGE_NAME "MyLib")
set(CPACK_PACKAGE_CONTACT "None")
set(CPACK_PACKAGE_VENDOR "CMake.org")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MyLib - CPack Component Installation Example")
-set(CPACK_PACKAGE_VERSION "1.0.2")
-set(CPACK_PACKAGE_VERSION_MAJOR "1")
-set(CPACK_PACKAGE_VERSION_MINOR "0")
-set(CPACK_PACKAGE_VERSION_PATCH "2")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CPack Component Example")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/license.txt)
diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-description1.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-description1.cmake.in
index 74d816cf6..67b108bef 100644
--- a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-description1.cmake.in
+++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-description1.cmake.in
@@ -15,8 +15,9 @@ set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
# overriding previous descriptions
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "main description")
-set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION "applications_description")
-set(CPACK_COMPONENT_HEADERS_DESCRIPTION "headers_description")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "main description") # This become a summary line (the first one) of all descriptions
+set(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION "applications_description")
+set(CPACK_COMPONENT_HEADERS_DESCRIPTION "headers_description")
# libraries does not have any description and should inherit from CPACK_PACKAGE_DESCRIPTION_SUMMARY
+# plus content of the `CPACK_PACKAGE_DESCRIPTION_FILE`.
unset(CPACK_COMPONENT_LIBRARIES_DESCRIPTION)
diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-description2.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-description2.cmake.in
index cda79bc02..d87732558 100644
--- a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-description2.cmake.in
+++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-description2.cmake.in
@@ -15,12 +15,12 @@ set(CPACK_COMPONENTS_IGNORE_GROUPS 1)
#set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)
# overriding previous descriptions
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "main description 2")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "main description 2")
-# Components do not have any description
+# Components do not have any description.
+# So, content of `CPACK_PACKAGE_DESCRIPTION_FILE` gonna used
+# after summary line.
unset(CPACK_COMPONENT_APPLICATIONS_DESCRIPTION)
unset(CPACK_COMPONENT_HEADERS_DESCRIPTION)
-unset(CPACK_COMPONENT_LIBRARIES_DESCRIPTION)
-
-set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "library description")
+set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "library description")
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
index 73fd0abe2..beccc4691 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend1.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -36,7 +36,6 @@ endif()
# dpkg-deb checks for the dependencies of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -54,32 +53,23 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
- if(NOT "${dpkg_depends}" STREQUAL "depend-application")
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n")
+ if(dpkg_package_name STREQUAL "mylib-applications")
+ if(NOT dpkg_depends STREQUAL "depend-application")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-application'\n")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
- if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.2), depend-headers")
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.2), depend-headers'\n")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
- if(NOT "${dpkg_depends}" STREQUAL "depend-default")
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_depends STREQUAL "depend-default")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
endif()
else()
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
+ message(SEND_ERROR "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
endif()
endforeach()
-
-
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
- message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
- endif()
else()
message("dpkg-deb executable not found - skipping dpkg-deb test")
endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
index 81dbbc515..88f3248d9 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-depend2.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
set(config_verbose -V)
@@ -36,7 +36,6 @@ endif()
# dpkg-deb checks for the summary of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -54,13 +53,11 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}', dependencies='${dpkg_depends}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
+ if(dpkg_package_name STREQUAL "mylib-applications")
find_program(DPKG_SHLIBDEP_EXECUTABLE dpkg-shlibdeps)
if(DPKG_SHLIBDEP_EXECUTABLE)
- string(FIND "${dpkg_depends}" "lib" index_libwhatever)
- if(NOT index_libwhatever GREATER "-1")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does not contain any 'lib'\n")
+ if(NOT dpkg_depends MATCHES "lib")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does not contain any 'lib'\n")
endif()
else()
message("dpkg-shlibdeps executable not found - skipping dpkg-shlibdeps test")
@@ -69,29 +66,20 @@ if(DPKGDEB_EXECUTABLE)
# should not contain the default
string(FIND "${dpkg_depends}" "depend-default" index_default)
if(index_default GREATER "0")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' does contains 'depend-default'\n")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
- if(NOT "${dpkg_depends}" STREQUAL "mylib-libraries (= 1.0.2), depend-headers")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.2), depend-headers'\n")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_depends STREQUAL "mylib-libraries (= 1.0.3), depend-headers")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'mylib-libraries (= 1.0.3), depend-headers'\n")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
- if(NOT "${dpkg_depends}" STREQUAL "depend-default")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_depends STREQUAL "depend-default")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect dependencies for package ${dpkg_package_name}: '${dpkg_depends}' != 'depend-default'\n")
endif()
else()
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
+ message(SEND_ERROR "dpkg-deb: ${_f}: component name not found: ${dpkg_package_name}\n")
endif()
-
endforeach()
-
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
- message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
- endif()
else()
message("dpkg-deb executable not found - skipping dpkg-deb test")
endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
index ad52f56b7..86a74b2dc 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description1.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -48,26 +48,26 @@ if(DPKGDEB_EXECUTABLE)
DPKGDEB_OUTPUT "${dpkg_output}"
METAENTRY "Package:")
- dpkgdeb_return_specific_metaentry(dpkg_description
- DPKGDEB_OUTPUT "${dpkg_output}"
- METAENTRY "Description:")
+ get_package_description("${dpkg_output}" dpkg_description)
message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
- if(NOT "${dpkg_description}" STREQUAL "applications_description")
+ if(dpkg_package_name STREQUAL "mylib-applications")
+ set(expected_description "main description\n applications_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} != applications_description")
+ "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: `${dpkg_description}` != `${expected_description}`")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
- if(NOT "${dpkg_description}" STREQUAL "headers_description")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
+ set(expected_description "main description\n headers_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} != headers_description")
+ "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}" STREQUAL "main description")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ if(NOT dpkg_description MATCHES "main description\n.*")
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}` =~ `main description.*`")
endif()
else()
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
@@ -77,7 +77,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
index af27c5183..d53c73d63 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-description2.cmake
@@ -7,7 +7,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -48,26 +48,20 @@ if(DPKGDEB_EXECUTABLE)
DPKGDEB_OUTPUT "${dpkg_output}"
METAENTRY "Package:")
- dpkgdeb_return_specific_metaentry(dpkg_description
- DPKGDEB_OUTPUT "${dpkg_output}"
- METAENTRY "Description:")
+ get_package_description("${dpkg_output}" dpkg_description)
message(STATUS "package='${dpkg_package_name}', description='${dpkg_description}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
- if(NOT "${dpkg_description}" STREQUAL "main description 2")
- set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != applications_description")
- endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
- if(NOT "${dpkg_description}" STREQUAL "main description 2")
+ if(dpkg_package_name STREQUAL "mylib-applications" OR dpkg_package_name STREQUAL "mylib-headers")
+ if(NOT dpkg_description MATCHES "main description 2\n.*")
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
- "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: ${dpkg_description} != headers_description")
+ "dpkg-deb: ${_f}: Incorrect description for package ${dpkg_package_name}: `${dpkg_description}` =~ `main description 2`")
endif()
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
- if(NOT "${dpkg_description}" STREQUAL "library description")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
+ set(expected_description "main description 2\n library 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}
@@ -77,7 +71,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
index ec75d618a..7cfbb1655 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-lintian-dpkgdeb-checks.cmake
@@ -5,7 +5,7 @@ endif()
include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# TODO: currently debian doesn't produce lower cased names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -44,7 +44,7 @@ if(LINTIAN_EXECUTABLE)
string(APPEND lintian_output_errors_all "${lintian_output_errors}")
endforeach()
- if(NOT "${lintian_output_errors_all}" STREQUAL "")
+ if(NOT lintian_output_errors_all STREQUAL "")
message(FATAL_ERROR "Lintian checks failed:\n${lintian_output_errors_all}")
endif()
else()
@@ -64,13 +64,13 @@ if(DPKGDEB_EXECUTABLE)
DPKGDEB_OUTPUT "${dpkg_output}"
METAENTRY "Maintainer:")
- if(NOT "${dpkgentry}" STREQUAL "None")
+ if(NOT dpkgentry STREQUAL "None")
set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
"dpkg-deb: ${_f}: Incorrect value for Maintainer: ${dpkgentry} != None\n")
endif()
endforeach()
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
index e57488cbb..6eff3dbff 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-shlibdeps1.cmake
@@ -9,7 +9,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# requirements
# debian now produces lower case names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
@@ -39,7 +39,7 @@ endif()
# dpkg-deb checks for the summary of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all)
+ set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -53,11 +53,11 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${dpkg_package_name}'")
- if("${dpkg_package_name}" STREQUAL "mylib-applications")
+ if(dpkg_package_name STREQUAL "mylib-applications")
# pass
- elseif("${dpkg_package_name}" STREQUAL "mylib-headers")
+ elseif(dpkg_package_name STREQUAL "mylib-headers")
# pass
- elseif("${dpkg_package_name}" STREQUAL "mylib-libraries")
+ elseif(dpkg_package_name STREQUAL "mylib-libraries")
# pass
else()
set(dpkgdeb_output_errors_all ${dpkgdeb_output_errors_all}
@@ -67,7 +67,7 @@ if(DPKGDEB_EXECUTABLE)
endforeach()
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
+ if(NOT dpkgdeb_output_errors_all STREQUAL "")
message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
endif()
else()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
index 5ee057a3d..3454dca89 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-components-source.cmake
@@ -6,7 +6,7 @@ include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# expected results
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib-*_1.0.3_*.deb")
set(expected_count 3)
set(config_verbose -V)
@@ -36,7 +36,6 @@ endif()
# dpkg-deb checks for the summary of the packages
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
# extracts the metadata from the package
@@ -54,22 +53,16 @@ if(DPKGDEB_EXECUTABLE)
message(STATUS "package='${_f}', source='${dpkg_package_source}'")
- if(NOT ("${dpkg_package_name}" STREQUAL "mylib-applications"))
- if(NOT ("${dpkg_package_source}" STREQUAL "test-source"))
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n")
+ if(NOT dpkg_package_name STREQUAL "mylib-applications")
+ if(NOT dpkg_package_source STREQUAL "test-source")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-source'\n")
endif()
else()
- if(NOT ("${dpkg_package_source}" STREQUAL "test-other-source"))
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n")
+ if(NOT dpkg_package_source STREQUAL "test-other-source")
+ message(SEND_ERROR "dpkg-deb: ${_f}: Incorrect source for package '${dpkg_package_name}': '${dpkg_package_source}' instead of 'test-other-source'\n")
endif()
endif()
endforeach()
-
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
- message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
- endif()
else()
message("dpkg-deb executable not found - skipping dpkg-deb test")
endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
index 8c0bc4bd1..764fe9df4 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult-compression.cmake
@@ -5,7 +5,7 @@ endif()
include(${CPackComponentsDEB_SOURCE_DIR}/RunCPackVerifyResult.cmake)
# TODO: currently debian doesn't produce lower cased names
-set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.2_*.deb")
+set(expected_file_mask "${CPackComponentsDEB_BINARY_DIR}/mylib_1.0.3_*.deb")
set(expected_count 1)
set(actual_output)
@@ -33,22 +33,16 @@ endif()
# dpkg-deb checks
find_program(DPKGDEB_EXECUTABLE dpkg-deb)
if(DPKGDEB_EXECUTABLE)
- set(dpkgdeb_output_errors_all "")
foreach(_f IN LISTS actual_output)
run_dpkgdeb(dpkg_output
FILENAME "${_f}"
)
# message(FATAL_ERROR "output = '${dpkg_output}'")
- if("${dpkg_output}" STREQUAL "")
- set(dpkgdeb_output_errors_all "${dpkgdeb_output_errors_all}"
- "dpkg-deb: ${_f}: empty content returned by dpkg-deb")
+ if(dpkg_output STREQUAL "")
+ message(SEND_ERROR "dpkg-deb: ${_f}: empty content returned by dpkg-deb")
endif()
endforeach()
-
- if(NOT "${dpkgdeb_output_errors_all}" STREQUAL "")
- message(FATAL_ERROR "dpkg-deb checks failed:\n${dpkgdeb_output_errors_all}")
- endif()
else()
message("dpkg-deb executable not found - skipping dpkg-deb test")
endif()
diff --git a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
index 2f9e2fc92..b172da2cd 100644
--- a/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
+++ b/Tests/CPackComponentsDEB/RunCPackVerifyResult.cmake
@@ -119,13 +119,13 @@ function(lintian_check_specific_errors output_errors)
# regex to avoid
foreach(_s IN LISTS lintian_check_specific_errors_deb_ERROR_REGEX_STRINGS)
- if("${_s}" STREQUAL "")
+ if(_s STREQUAL "")
continue()
endif()
string(REGEX MATCHALL "${_s}" "_TMP_CHECK_ERROR" "${lintian_output}")
- if(NOT "${_TMP_CHECK_ERROR}" STREQUAL "")
+ if(NOT _TMP_CHECK_ERROR STREQUAL "")
string(APPEND ERROR_ACC "\nlintian: ${_f}: output contains an undesirable regex:\n\t${_TMP_CHECK_ERROR}")
endif()
endforeach()
@@ -167,7 +167,7 @@ function(run_dpkgdeb dpkg_deb_output)
ERROR_VARIABLE DPKGDEB_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE )
- if(NOT ("${DPKGDEB_RESULT}" EQUAL "0"))
+ if(NOT DPKGDEB_RESULT EQUAL "0")
message(FATAL_ERROR "Error '${DPKGDEB_RESULT}' returned by dpkg-deb: '${DPKGDEB_ERROR}'")
endif()
@@ -200,4 +200,29 @@ function(dpkgdeb_return_specific_metaentry output)
endif()
endfunction()
+function(get_package_description DPKG_OUTPUT RESULT_VAR)
+ string(UUID uuid NAMESPACE 00000000-0000-0000-0000-000000000000 TYPE SHA1)
+ string(REPLACE ";" "${uuid}" DPKG_OUTPUT "${DPKG_OUTPUT}")
+ string(REPLACE "\n" ";" DPKG_OUTPUT "${DPKG_OUTPUT}")
+
+ unset(_actual_description)
+ set(_parse_description FALSE)
+ foreach(_line IN LISTS DPKG_OUTPUT)
+ if(_line MATCHES " Description:.*")
+ set(_parse_description TRUE)
+ string(REPLACE " Description: " "" _line "${_line}")
+ list(APPEND _actual_description "${_line}")
+ elseif(_parse_description)
+ if(_line MATCHES " [A-Z][A-Za-z\-]+: .*")
+ set(_parse_description FALSE)
+ else()
+ list(APPEND _actual_description "${_line}")
+ endif()
+ endif()
+ endforeach()
+ list(JOIN _actual_description "\n" _actual_description)
+
+ set(${RESULT_VAR} "${_actual_description}" PARENT_SCOPE)
+endfunction()
+
cmake_policy(POP)
diff --git a/Tests/CPackComponentsDEB/mylib.cpp b/Tests/CPackComponentsDEB/mylib.cpp
index 8ddac198c..8d6307164 100644
--- a/Tests/CPackComponentsDEB/mylib.cpp
+++ b/Tests/CPackComponentsDEB/mylib.cpp
@@ -1,4 +1,5 @@
#include "mylib.h"
+
#include "stdio.h"
void mylib_function()
diff --git a/Tests/CPackComponentsForAll/mylib.cpp b/Tests/CPackComponentsForAll/mylib.cpp
index 8ddac198c..8d6307164 100644
--- a/Tests/CPackComponentsForAll/mylib.cpp
+++ b/Tests/CPackComponentsForAll/mylib.cpp
@@ -1,4 +1,5 @@
#include "mylib.h"
+
#include "stdio.h"
void mylib_function()
diff --git a/Tests/CPackWiXGenerator/mylib.cpp b/Tests/CPackWiXGenerator/mylib.cpp
index 8ddac198c..8d6307164 100644
--- a/Tests/CPackWiXGenerator/mylib.cpp
+++ b/Tests/CPackWiXGenerator/mylib.cpp
@@ -1,4 +1,5 @@
#include "mylib.h"
+
#include "stdio.h"
void mylib_function()
diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt
index 060fb4940..ef9198d3b 100644
--- a/Tests/CompileFeatures/CMakeLists.txt
+++ b/Tests/CompileFeatures/CMakeLists.txt
@@ -130,6 +130,12 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
+ if (CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC"
+ AND CMAKE_CXX_SIMULATE_VERSION VERSION_LESS 19.10)
+ list(REMOVE_ITEM CXX_non_features
+ cxx_relaxed_constexpr
+ )
+ endif()
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0)
if (CMAKE_CXX_COMIPLER_VERSION VERSION_EQUAL 15.0)
list(REMOVE_ITEM CXX_non_features
diff --git a/Tests/CompileFeatures/default_dialect.cpp b/Tests/CompileFeatures/default_dialect.cpp
index 3ee60a65e..e6b3ff631 100644
--- a/Tests/CompileFeatures/default_dialect.cpp
+++ b/Tests/CompileFeatures/default_dialect.cpp
@@ -2,7 +2,17 @@
template <long l>
struct Outputter;
-#if defined(_MSC_VER) && defined(_MSVC_LANG)
+#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) && _MSVC_LANG < 201403L
+# if defined(__INTEL_CXX11_MODE__)
+# if defined(__cpp_aggregate_nsdmi)
+# define CXX_STD 201402L
+# else
+# define CXX_STD 201103L
+# endif
+# else
+# define CXX_STD 199711L
+# endif
+#elif defined(_MSC_VER) && defined(_MSVC_LANG)
# define CXX_STD _MSVC_LANG
#else
# define CXX_STD __cplusplus
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 9ddf00538..49e97d585 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -1,20 +1,22 @@
-#include "Aout.h"
-#include "ExtraSources/file1.h"
#include "cmTestConfigure.h"
#include "cmTestConfigureEscape.h"
#include "cmTestGeneratedHeader.h"
#include "cmVersion.h"
+
+#include "Aout.h"
+#include "ExtraSources/file1.h"
#include "file2.h"
#include "sharedFile.h"
extern "C" {
#include "testConly.h"
}
#include <iostream>
-#include <string.h>
#include <string>
#include <vector>
#include <stdio.h>
+#include <string.h>
+
#include <sys/stat.h>
#if !defined(S_ISDIR)
# define S_ISDIR(mode) ((mode)&_S_IFDIR)
diff --git a/Tests/Complex/Library/testConly.c b/Tests/Complex/Library/testConly.c
index a7d20b0b5..eb933a26f 100644
--- a/Tests/Complex/Library/testConly.c
+++ b/Tests/Complex/Library/testConly.c
@@ -1,4 +1,5 @@
#include "testConly.h"
+
#include <stdio.h>
int CsharedFunction()
diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx
index 5b5089960..54c18f4ab 100644
--- a/Tests/ComplexOneConfig/Executable/complex.cxx
+++ b/Tests/ComplexOneConfig/Executable/complex.cxx
@@ -1,20 +1,22 @@
-#include "Aout.h"
-#include "ExtraSources/file1.h"
#include "cmTestConfigure.h"
#include "cmTestConfigureEscape.h"
#include "cmTestGeneratedHeader.h"
#include "cmVersion.h"
+
+#include "Aout.h"
+#include "ExtraSources/file1.h"
#include "file2.h"
#include "sharedFile.h"
extern "C" {
#include "testConly.h"
}
#include <iostream>
-#include <string.h>
#include <string>
#include <vector>
#include <stdio.h>
+#include <string.h>
+
#include <sys/stat.h>
#if !defined(S_ISDIR)
# define S_ISDIR(mode) ((mode)&_S_IFDIR)
diff --git a/Tests/ComplexOneConfig/Library/testConly.c b/Tests/ComplexOneConfig/Library/testConly.c
index a7d20b0b5..eb933a26f 100644
--- a/Tests/ComplexOneConfig/Library/testConly.c
+++ b/Tests/ComplexOneConfig/Library/testConly.c
@@ -1,4 +1,5 @@
#include "testConly.h"
+
#include <stdio.h>
int CsharedFunction()
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index 748aad887..f5dd2765c 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -1,17 +1,21 @@
-
cmake_minimum_required(VERSION 3.0)
-
-project(ConfigSources)
+project(ConfigSources CXX)
add_library(iface INTERFACE)
-set_property(TARGET iface PROPERTY INTERFACE_SOURCES
+target_sources(iface INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/iface_src.cpp"
"$<$<CONFIG:Debug>:${CMAKE_CURRENT_SOURCE_DIR}/iface_debug_src.cpp>"
- "$<$<CONFIG:Release>:${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist.cpp>"
-)
+ "$<$<NOT:$<CONFIG:Debug>>:${CMAKE_CURRENT_SOURCE_DIR}/iface_other_src.cpp>"
+ "$<$<CONFIG:NotAConfig>:${CMAKE_CURRENT_SOURCE_DIR}/does_not_exist.cpp>"
+ )
+target_compile_definitions(iface INTERFACE
+ "$<$<CONFIG:Debug>:CFG_DEBUG>"
+ "$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
+ )
add_executable(ConfigSources
- $<$<CONFIG:Debug>:main.cpp>
- $<$<CONFIG:Release>:does_not_exist.cpp>
-)
+ $<$<CONFIG:Debug>:main_debug.cpp>
+ $<$<NOT:$<CONFIG:Debug>>:main_other.cpp>
+ $<$<CONFIG:NotAConfig>:does_not_exist.cpp>
+ )
target_link_libraries(ConfigSources iface)
diff --git a/Tests/ConfigSources/iface.h b/Tests/ConfigSources/iface.h
new file mode 100644
index 000000000..810456cbc
--- /dev/null
+++ b/Tests/ConfigSources/iface.h
@@ -0,0 +1,10 @@
+
+int iface_src();
+
+#ifdef CFG_DEBUG
+int iface_debug();
+#endif
+
+#ifdef CFG_OTHER
+int iface_other();
+#endif
diff --git a/Tests/ConfigSources/iface_debug.h b/Tests/ConfigSources/iface_debug.h
deleted file mode 100644
index a23d7374b..000000000
--- a/Tests/ConfigSources/iface_debug.h
+++ /dev/null
@@ -1,4 +0,0 @@
-
-int iface_src();
-
-int iface_debug();
diff --git a/Tests/ConfigSources/iface_debug_src.cpp b/Tests/ConfigSources/iface_debug_src.cpp
index 63b22fcd1..010059f1f 100644
--- a/Tests/ConfigSources/iface_debug_src.cpp
+++ b/Tests/ConfigSources/iface_debug_src.cpp
@@ -1,5 +1,11 @@
+#ifndef CFG_DEBUG
+# error "This source should only be compiled in a Debug configuration."
+#endif
+#ifdef CFG_OTHER
+# error "This source should not be compiled in a non-Debug configuration."
+#endif
-#include "iface_debug.h"
+#include "iface.h"
int iface_debug()
{
diff --git a/Tests/ConfigSources/iface_other_src.cpp b/Tests/ConfigSources/iface_other_src.cpp
new file mode 100644
index 000000000..8ffdfbb72
--- /dev/null
+++ b/Tests/ConfigSources/iface_other_src.cpp
@@ -0,0 +1,13 @@
+#ifndef CFG_OTHER
+# error "This source should only be compiled in a non-Debug configuration."
+#endif
+#ifdef CFG_DEBUG
+# error "This source should not be compiled in a Debug configuration."
+#endif
+
+#include "iface.h"
+
+int iface_other()
+{
+ return 0;
+}
diff --git a/Tests/ConfigSources/main.cpp b/Tests/ConfigSources/main.cpp
deleted file mode 100644
index 71af72f70..000000000
--- a/Tests/ConfigSources/main.cpp
+++ /dev/null
@@ -1,7 +0,0 @@
-
-#include "iface_debug.h"
-
-int main(int argc, char** argv)
-{
- return iface_src() + iface_debug();
-}
diff --git a/Tests/ConfigSources/main_debug.cpp b/Tests/ConfigSources/main_debug.cpp
new file mode 100644
index 000000000..9b1e68a26
--- /dev/null
+++ b/Tests/ConfigSources/main_debug.cpp
@@ -0,0 +1,13 @@
+#ifndef CFG_DEBUG
+# error "This source should only be compiled in a Debug configuration."
+#endif
+#ifdef CFG_OTHER
+# error "This source should not be compiled in a non-Debug configuration."
+#endif
+
+#include "iface.h"
+
+int main(int argc, char** argv)
+{
+ return iface_src() + iface_debug();
+}
diff --git a/Tests/ConfigSources/main_other.cpp b/Tests/ConfigSources/main_other.cpp
new file mode 100644
index 000000000..3184a19d2
--- /dev/null
+++ b/Tests/ConfigSources/main_other.cpp
@@ -0,0 +1,13 @@
+#ifndef CFG_OTHER
+# error "This source should only be compiled in a non-Debug configuration."
+#endif
+#ifdef CFG_DEBUG
+# error "This source should not be compiled in a Debug configuration."
+#endif
+
+#include "iface.h"
+
+int main(int argc, char** argv)
+{
+ return iface_src() + iface_other();
+}
diff --git a/Tests/Cuda/CMakeLists.txt b/Tests/Cuda/CMakeLists.txt
index 44c60052f..a30071fd3 100644
--- a/Tests/Cuda/CMakeLists.txt
+++ b/Tests/Cuda/CMakeLists.txt
@@ -4,7 +4,6 @@ ADD_TEST_MACRO(Cuda.ConsumeCompileFeatures CudaConsumeCompileFeatures)
ADD_TEST_MACRO(Cuda.ObjectLibrary CudaObjectLibrary)
ADD_TEST_MACRO(Cuda.MixedStandardLevels MixedStandardLevels)
ADD_TEST_MACRO(Cuda.NotEnabled CudaNotEnabled)
-ADD_TEST_MACRO(Cuda.SeparableCompCXXOnly SeparableCompCXXOnly)
ADD_TEST_MACRO(Cuda.ToolkitInclude CudaToolkitInclude)
ADD_TEST_MACRO(Cuda.ProperDeviceLibraries ProperDeviceLibraries)
ADD_TEST_MACRO(Cuda.ProperLinkFlags ProperLinkFlags)
diff --git a/Tests/Cuda/Complex/dynamic.cu b/Tests/Cuda/Complex/dynamic.cu
index c3d8affa8..9da8853ee 100644
--- a/Tests/Cuda/Complex/dynamic.cu
+++ b/Tests/Cuda/Complex/dynamic.cu
@@ -1,8 +1,9 @@
-#include <cuda.h>
#include <iostream>
#include <string>
+#include <cuda.h>
+
#ifdef _WIN32
# define EXPORT __declspec(dllexport)
#else
diff --git a/Tests/Cuda/ObjectLibrary/Conflicts/static.cu b/Tests/Cuda/ObjectLibrary/Conflicts/static.cu
index 586e8c62b..30aa121b7 100644
--- a/Tests/Cuda/ObjectLibrary/Conflicts/static.cu
+++ b/Tests/Cuda/ObjectLibrary/Conflicts/static.cu
@@ -1,7 +1,8 @@
+#include <iostream>
+
#include <cuda.h>
#include <cuda_runtime.h>
-#include <iostream>
int __host__ cu2_sq_func(int x)
{
diff --git a/Tests/Cuda/ObjectLibrary/static.cu b/Tests/Cuda/ObjectLibrary/static.cu
index 37bb8391e..530a114a5 100644
--- a/Tests/Cuda/ObjectLibrary/static.cu
+++ b/Tests/Cuda/ObjectLibrary/static.cu
@@ -1,7 +1,8 @@
+#include <iostream>
+
#include <cuda.h>
#include <cuda_runtime.h>
-#include <iostream>
int __host__ cu1_sq_func(int x)
{
diff --git a/Tests/Cuda/ProperDeviceLibraries/main.cu b/Tests/Cuda/ProperDeviceLibraries/main.cu
index 8ceb0ccb4..397804cf9 100644
--- a/Tests/Cuda/ProperDeviceLibraries/main.cu
+++ b/Tests/Cuda/ProperDeviceLibraries/main.cu
@@ -1,7 +1,8 @@
+#include <iostream>
+
#include <cublas_v2.h>
#include <cuda_runtime.h>
-#include <iostream>
#if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)
diff --git a/Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt b/Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt
deleted file mode 100644
index 97670e392..000000000
--- a/Tests/Cuda/SeparableCompCXXOnly/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-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
deleted file mode 100644
index 813524614..000000000
--- a/Tests/Cuda/SeparableCompCXXOnly/main.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-
-int main(int, char const* [])
-{
- return 0;
-}
diff --git a/Tests/Cuda/WithC/cuda.cu b/Tests/Cuda/WithC/cuda.cu
index 06bd7b975..d1be2d481 100644
--- a/Tests/Cuda/WithC/cuda.cu
+++ b/Tests/Cuda/WithC/cuda.cu
@@ -1,7 +1,7 @@
-#include <cuda.h>
-
#include <iostream>
+#include <cuda.h>
+
extern "C" int use_cuda(void)
{
int nDevices = 0;
diff --git a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
index 619008902..6e3697fe5 100644
--- a/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
+++ b/Tests/CudaOnly/DontResolveDeviceSymbols/CMakeLists.txt
@@ -27,12 +27,12 @@ endif()
string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CUDA_STANDARD 11)
+set(CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
add_library(CUDANoDeviceResolve SHARED file1.cu)
set_target_properties(CUDANoDeviceResolve
PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
- CUDA_RESOLVE_DEVICE_SYMBOLS OFF
POSITION_INDEPENDENT_CODE ON)
if(MSVC)
target_link_options(CUDANoDeviceResolve PRIVATE "/FORCE:UNRESOLVED")
diff --git a/Tests/CudaOnly/GPUDebugFlag/main.cu b/Tests/CudaOnly/GPUDebugFlag/main.cu
index 1f3fc129f..ced378912 100644
--- a/Tests/CudaOnly/GPUDebugFlag/main.cu
+++ b/Tests/CudaOnly/GPUDebugFlag/main.cu
@@ -1,6 +1,7 @@
+#include <iostream>
+
#include <cuda.h>
#include <cuda_runtime.h>
-#include <iostream>
static __global__ void debug_kernel(bool* has_debug)
{
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
index 796e13382..64845c5ce 100644
--- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt
@@ -16,21 +16,29 @@ else()
endif()
#Goal for this example:
-# Build a static library that defines multiple methods and kernels that
-# use each other.
-# Resolve the device symbols into that static library
-# Verify that we can't use those device symbols from anything that links
+# 1. Build two static libraries that defines multiple methods and kernels
+# 2. Resolve the device symbols into the second static library, therefore
+# confirming that the first static library is on the device link line
+# 3. Verify that we can't use those device symbols from anything that links
# to the static library
-string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=[compute_30] -gencode arch=compute_50,code=\\\"compute_50\\\"")
+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(CUDAResolveDeviceLib STATIC file1.cu file2.cu)
+add_library(CUDAResolveDeviceDepsA STATIC file1.cu)
+add_library(CUDAResolveDeviceDepsB STATIC file2.cu)
+set_target_properties(CUDAResolveDeviceDepsA CUDAResolveDeviceDepsB
+ PROPERTIES
+ CUDA_SEPARABLE_COMPILATION ON
+ POSITION_INDEPENDENT_CODE ON)
+
+add_library(CUDAResolveDeviceLib STATIC file2_launch.cu)
set_target_properties(CUDAResolveDeviceLib
PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
CUDA_RESOLVE_DEVICE_SYMBOLS ON
POSITION_INDEPENDENT_CODE ON)
+target_link_libraries(CUDAResolveDeviceLib PRIVATE CUDAResolveDeviceDepsA CUDAResolveDeviceDepsB)
if(dump_command)
add_custom_command(TARGET CUDAResolveDeviceLib POST_BUILD
@@ -45,7 +53,8 @@ endif()
add_executable(CudaOnlyResolveDeviceSymbols main.cu)
set_target_properties(CudaOnlyResolveDeviceSymbols
PROPERTIES
- CUDA_SEPARABLE_COMPILATION ON)
+ CUDA_SEPARABLE_COMPILATION OFF
+ CUDA_RESOLVE_DEVICE_SYMBOLS OFF)
target_link_libraries(CudaOnlyResolveDeviceSymbols PRIVATE CUDAResolveDeviceLib)
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/file1.h b/Tests/CudaOnly/ResolveDeviceSymbols/file1.h
index ff1945c0a..b33bcaef3 100644
--- a/Tests/CudaOnly/ResolveDeviceSymbols/file1.h
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/file1.h
@@ -1,7 +1,10 @@
#pragma once
+
struct result_type
{
int input;
int sum;
};
+
+result_type __device__ file1_func(int x);
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/file2.cu b/Tests/CudaOnly/ResolveDeviceSymbols/file2.cu
index 278fd6cce..0e5e7aa49 100644
--- a/Tests/CudaOnly/ResolveDeviceSymbols/file2.cu
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/file2.cu
@@ -1,25 +1,9 @@
#include "file2.h"
-result_type __device__ file1_func(int x);
-
result_type_dynamic __device__ file2_func(int x)
{
const result_type r = file1_func(x);
const result_type_dynamic rd{ r.input, r.sum, true };
return rd;
}
-
-static __global__ void file2_kernel(result_type_dynamic& r, int x)
-{
- // call static_func which is a method that is defined in the
- // static library that is always out of date
- r = file2_func(x);
-}
-
-int file2_launch_kernel(int x)
-{
- result_type_dynamic r;
- file2_kernel<<<1, 1>>>(r, x);
- return r.sum;
-}
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/file2.h b/Tests/CudaOnly/ResolveDeviceSymbols/file2.h
index d2dbaa4de..c6e287510 100644
--- a/Tests/CudaOnly/ResolveDeviceSymbols/file2.h
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/file2.h
@@ -8,3 +8,5 @@ struct result_type_dynamic
int sum;
bool from_static;
};
+
+result_type_dynamic __device__ file2_func(int x);
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/file2_launch.cu b/Tests/CudaOnly/ResolveDeviceSymbols/file2_launch.cu
new file mode 100644
index 000000000..4e8da1371
--- /dev/null
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/file2_launch.cu
@@ -0,0 +1,18 @@
+
+#include "file2.h"
+
+static __global__ void file2_kernel(result_type_dynamic& r, int x)
+{
+ // call static_func which is a method that is defined in the
+ // static library that is always out of date
+ r = file2_func(x);
+}
+
+static __global__ void file2_kernel(result_type_dynamic& r, int x);
+
+int file2_launch_kernel(int x)
+{
+ result_type_dynamic r;
+ file2_kernel<<<1, 1>>>(r, x);
+ return r.sum;
+}
diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/main.cu b/Tests/CudaOnly/ResolveDeviceSymbols/main.cu
index d464f964e..ea842cc16 100644
--- a/Tests/CudaOnly/ResolveDeviceSymbols/main.cu
+++ b/Tests/CudaOnly/ResolveDeviceSymbols/main.cu
@@ -1,26 +1,10 @@
#include <iostream>
-#include "file1.h"
#include "file2.h"
int file2_launch_kernel(int x);
-result_type_dynamic __device__ file2_func(int x);
-static __global__ void main_kernel(result_type_dynamic& r, int x)
-{
- // call function that was not device linked to us, this will cause
- // a runtime failure of "invalid device function"
- r = file2_func(x);
-}
-
-int main_launch_kernel(int x)
-{
- result_type_dynamic r;
- main_kernel<<<1, 1>>>(r, x);
- return r.sum;
-}
-
int choose_cuda_device()
{
int nDevices = 0;
@@ -62,12 +46,10 @@ int main(int argc, char** argv)
return 0;
}
- main_launch_kernel(1);
+ file2_launch_kernel(1);
cudaError_t err = cudaGetLastError();
- if (err == cudaSuccess) {
- // This kernel launch should fail as the file2_func was device linked
- // into the static library and is not usable by the executable
- std::cerr << "main_launch_kernel: kernel launch should have failed"
+ if (err != cudaSuccess) {
+ std::cerr << "file2_launch_kernel: kernel launch should have passed"
<< std::endl;
return 1;
}
diff --git a/Tests/CudaOnly/WithDefs/main.notcu b/Tests/CudaOnly/WithDefs/main.notcu
index 68a296b2c..a5f4ed652 100644
--- a/Tests/CudaOnly/WithDefs/main.notcu
+++ b/Tests/CudaOnly/WithDefs/main.notcu
@@ -1,7 +1,7 @@
-#include <cuda.h>
-#include <cuda_runtime.h>
#include <iostream>
+#include <cuda.h>
+#include <cuda_runtime.h>
#include <inc_cuda.h>
#ifndef INC_CUDA
# error "INC_CUDA not defined!"
diff --git a/Tests/CustomCommandByproducts/CMakeLists.txt b/Tests/CustomCommandByproducts/CMakeLists.txt
index d0bf6487e..08c897c2d 100644
--- a/Tests/CustomCommandByproducts/CMakeLists.txt
+++ b/Tests/CustomCommandByproducts/CMakeLists.txt
@@ -14,20 +14,21 @@ add_custom_command(
# Generate a byproduct in a rule that runs in a dependency of the consumer.
add_custom_command(
- OUTPUT timestamp2.txt
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/../CustomCommandByproducts/timestamp2.txt
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/byproduct2.c.in byproduct2.c
- BYPRODUCTS byproduct2.c
+ BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../CustomCommandByproducts/byproduct2.c
COMMAND ${CMAKE_COMMAND} -E touch timestamp2.txt
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/byproduct2.c.in
)
-add_custom_target(Producer2 DEPENDS timestamp2.txt)
+add_custom_target(Producer2 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/timestamp2.txt)
# Generate a byproduct in a custom target.
add_custom_target(Producer3_4
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/byproduct3.c.in byproduct3.c
- BYPRODUCTS byproduct3.c
+ BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../CustomCommandByproducts/byproduct3.c
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/byproduct3.c.in
)
# Generate a byproduct in a custom target POST_BUILD command.
@@ -35,33 +36,37 @@ add_custom_command(
TARGET Producer3_4 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/byproduct4.c.in byproduct4.c
- BYPRODUCTS byproduct4.c
+ BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/../CustomCommandByproducts/byproduct4.c
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/byproduct4.c.in
)
-add_executable(ProducerExe ProducerExe.c)
+add_executable(ProducerExe5_6_7 ProducerExe.c)
# Generate a byproduct in an executable POST_BUILD command.
add_custom_command(
- TARGET ProducerExe POST_BUILD
+ TARGET ProducerExe5_6_7 POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/byproduct5.c.in byproduct5.c
BYPRODUCTS byproduct5.c
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/byproduct5.c.in
)
# Generate a byproduct in an executable PRE_LINK command.
add_custom_command(
- TARGET ProducerExe PRE_LINK
+ TARGET ProducerExe5_6_7 PRE_LINK
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/byproduct6.c.in byproduct6.c
BYPRODUCTS byproduct6.c
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/byproduct6.c.in
)
# Generate a byproduct in an executable PRE_BUILD command.
add_custom_command(
- TARGET ProducerExe PRE_BUILD
+ TARGET ProducerExe5_6_7 PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/byproduct7.c.in byproduct7.c
BYPRODUCTS byproduct7.c
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/byproduct7.c.in
)
# Generate a byproduct in a custom command that consumes other byproducts.
@@ -80,6 +85,25 @@ add_custom_command(OUTPUT timestamp8.txt
${CMAKE_CURRENT_SOURCE_DIR}/byproduct8.c.in
)
+add_executable(ProducerExe9 ProducerExe.c)
+
+# Generate a byproduct in a custom target which depends on a byproduct of a
+# POST_BUILD command (test if dependency of custom target Producer9 to
+# ProducerExe9 is added).
+add_custom_command(
+ TARGET ProducerExe9 POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ ${CMAKE_CURRENT_SOURCE_DIR}/byproduct9.c.in byproduct9a.c
+ BYPRODUCTS byproduct9a.c
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/byproduct9.c.in
+ )
+add_custom_target(Producer9
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ byproduct9a.c byproduct9.c
+ BYPRODUCTS byproduct9.c
+ DEPENDS byproduct9a.c
+ )
+
# Generate the library file of an imported target as a byproduct
# of an external project.
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
@@ -136,10 +160,13 @@ add_executable(CustomCommandByproducts
byproduct6.c
byproduct7.c
byproduct8.c timestamp8.txt
+ byproduct9.c
)
+
+# Dependencies to byproducts of custom commands other than build events are not
+# yet traced (see issue #19005).
add_dependencies(CustomCommandByproducts Producer2)
-add_dependencies(CustomCommandByproducts Producer3_4)
-add_dependencies(CustomCommandByproducts ProducerExe)
+
target_link_libraries(CustomCommandByproducts ExternalLibrary)
if(CMAKE_GENERATOR STREQUAL "Ninja")
diff --git a/Tests/CustomCommandByproducts/CustomCommandByproducts.c b/Tests/CustomCommandByproducts/CustomCommandByproducts.c
index 02ad7ea0b..0658d0518 100644
--- a/Tests/CustomCommandByproducts/CustomCommandByproducts.c
+++ b/Tests/CustomCommandByproducts/CustomCommandByproducts.c
@@ -6,10 +6,11 @@ extern int byproduct5(void);
extern int byproduct6(void);
extern int byproduct7(void);
extern int byproduct8(void);
+extern int byproduct9(void);
extern int ExternalLibrary(void);
int main(void)
{
return (byproduct1() + byproduct2() + byproduct3() + byproduct4() +
byproduct5() + byproduct6() + byproduct7() + byproduct8() +
- ExternalLibrary() + 0);
+ byproduct9() + ExternalLibrary() + 0);
}
diff --git a/Tests/CustomCommandByproducts/byproduct9.c.in b/Tests/CustomCommandByproducts/byproduct9.c.in
new file mode 100644
index 000000000..11eed2c4c
--- /dev/null
+++ b/Tests/CustomCommandByproducts/byproduct9.c.in
@@ -0,0 +1 @@
+int byproduct9(void) { return 0; }
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index c6b7dbc95..9d8a24852 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -313,6 +313,8 @@ install(FILES
)
cmake_policy(POP)
+cmake_policy(PUSH)
+cmake_policy(SET CMP0041 NEW)
add_library(testSharedLibDepends SHARED testSharedLibDepends.cpp)
set_property(TARGET testSharedLibDepends APPEND PROPERTY
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}"
@@ -329,9 +331,10 @@ install(FILES
DESTINATION include/testSharedLibDepends
)
set_property(TARGET testSharedLibDepends APPEND PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/testSharedLibDepends>"
+ INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/$<1:include>/testSharedLibDepends>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}>"
)
+cmake_policy(POP)
# LINK_PRIVATE because the LINK_INTERFACE_LIBRARIES is specified above.
target_link_libraries(testSharedLibDepends LINK_PRIVATE testSharedLibRequired)
@@ -642,3 +645,8 @@ if(CMAKE_GENERATOR MATCHES "Make|Ninja")
EXPORT RequiredExp DESTINATION lib)
export(TARGETS testLinkDepends 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)
+add_library(CXX INTERFACE)
diff --git a/Tests/ExportImport/Export/Interface/CMakeLists.txt b/Tests/ExportImport/Export/Interface/CMakeLists.txt
index 22a4ef600..43b721778 100644
--- a/Tests/ExportImport/Export/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Export/Interface/CMakeLists.txt
@@ -6,6 +6,12 @@ set_property(TARGET headeronly PROPERTY INTERFACE_INCLUDE_DIRECTORIES
)
set_property(TARGET headeronly PROPERTY INTERFACE_COMPILE_DEFINITIONS "HEADERONLY_DEFINE")
+add_library(pch_iface INTERFACE)
+target_precompile_headers(pch_iface INTERFACE
+ "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pch/pch.h>"
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/pch/pch.h>"
+ )
+
include(GenerateExportHeader)
add_library(sharedlib SHARED sharedlib.cpp)
generate_export_header(sharedlib)
@@ -45,7 +51,7 @@ set_property(TARGET cmakeonly PROPERTY custom_property CustomPropertyValue)
set_property(TARGET cmakeonly PROPERTY EXPORT_PROPERTIES custom_property)
install(TARGETS headeronly sharediface use_auto_type use_c_restrict source_target
- cmakeonly
+ pch_iface cmakeonly
EXPORT expInterface
)
install(TARGETS sharedlib
@@ -61,6 +67,10 @@ install(FILES
DESTINATION include/headeronly
)
install(FILES
+ pch/pch.h
+ DESTINATION include/pch
+)
+install(FILES
sharedlib/sharedlib.h
"${CMAKE_CURRENT_BINARY_DIR}/sharedlib_export.h"
DESTINATION include/sharedlib
diff --git a/Tests/ExportImport/Export/Interface/pch/pch.h b/Tests/ExportImport/Export/Interface/pch/pch.h
new file mode 100644
index 000000000..bc507270c
--- /dev/null
+++ b/Tests/ExportImport/Export/Interface/pch/pch.h
@@ -0,0 +1 @@
+#define PCH_PCH_H_INCLUDED
diff --git a/Tests/ExportImport/Export/testSharedLibDepends.h b/Tests/ExportImport/Export/testSharedLibDepends.h
index e84fb5454..73dafae63 100644
--- a/Tests/ExportImport/Export/testSharedLibDepends.h
+++ b/Tests/ExportImport/Export/testSharedLibDepends.h
@@ -2,10 +2,9 @@
#ifndef TESTSHAREDLIBDEPENDS_H
#define TESTSHAREDLIBDEPENDS_H
-#include "testsharedlibdepends_export.h"
-
#include "renamed.h"
#include "testSharedLibRequired.h"
+#include "testsharedlibdepends_export.h"
struct TESTSHAREDLIBDEPENDS_EXPORT TestSharedLibDepends
{
diff --git a/Tests/ExportImport/Export/testSharedLibRequiredUser2.h b/Tests/ExportImport/Export/testSharedLibRequiredUser2.h
index a13294028..e1c8a05bd 100644
--- a/Tests/ExportImport/Export/testSharedLibRequiredUser2.h
+++ b/Tests/ExportImport/Export/testSharedLibRequiredUser2.h
@@ -2,9 +2,8 @@
#ifndef TESTSHAREDLIBREQUIREDUSER2_H
#define TESTSHAREDLIBREQUIREDUSER2_H
-#include "testsharedlibrequireduser2_export.h"
-
#include "testSharedLibRequired.h"
+#include "testsharedlibrequireduser2_export.h"
struct TESTSHAREDLIBREQUIREDUSER2_EXPORT TestSharedLibRequiredUser2
{
diff --git a/Tests/ExportImport/Import/A/deps_iface.c b/Tests/ExportImport/Import/A/deps_iface.c
index e2d973c2f..afb1af01f 100644
--- a/Tests/ExportImport/Import/A/deps_iface.c
+++ b/Tests/ExportImport/Import/A/deps_iface.c
@@ -1,9 +1,4 @@
-#include "testLibIncludeRequired1.h"
-#include "testLibIncludeRequired2.h"
-#include "testLibIncludeRequired6.h"
-#include "testLibIncludeRequired7.h"
-
#include "installIncludesTest.h"
#include "installIncludesTest2.h"
#include "installIncludesTest3.h"
@@ -12,6 +7,10 @@
#include "installIncludesTest6.h"
#include "installIncludesTest7.h"
#include "installIncludesTest8.h"
+#include "testLibIncludeRequired1.h"
+#include "testLibIncludeRequired2.h"
+#include "testLibIncludeRequired6.h"
+#include "testLibIncludeRequired7.h"
#ifndef testLibRequired_IFACE_DEFINE
# error Expected testLibRequired_IFACE_DEFINE
diff --git a/Tests/ExportImport/Import/Interface/CMakeLists.txt b/Tests/ExportImport/Import/Interface/CMakeLists.txt
index a07a5b3c4..ef666b1a7 100644
--- a/Tests/ExportImport/Import/Interface/CMakeLists.txt
+++ b/Tests/ExportImport/Import/Interface/CMakeLists.txt
@@ -98,6 +98,17 @@ set_property(TARGET exp::sharediface APPEND PROPERTY INTERFACE_LINK_LIBRARIES de
add_executable(interfacetest_exp interfacetest.cpp)
target_link_libraries(interfacetest_exp exp::sharediface)
+if(NOT CMAKE_OSX_ARCHITECTURES MATCHES "[;$]" OR CMAKE_GENERATOR STREQUAL "Xcode")
+ add_executable(pch_iface_test_bld pch_iface_test.cpp)
+ target_link_libraries(pch_iface_test_bld bld::pch_iface)
+ add_executable(pch_iface_test_exp pch_iface_test.cpp)
+ target_link_libraries(pch_iface_test_exp exp::pch_iface)
+ if(CMAKE_CXX_COMPILE_OPTIONS_USE_PCH)
+ target_compile_definitions(pch_iface_test_bld PRIVATE EXPECT_PCH)
+ target_compile_definitions(pch_iface_test_exp PRIVATE EXPECT_PCH)
+ endif()
+endif()
+
do_try_compile(exp)
foreach(ns exp bld)
diff --git a/Tests/ExportImport/Import/Interface/pch_iface_test.cpp b/Tests/ExportImport/Import/Interface/pch_iface_test.cpp
new file mode 100644
index 000000000..a18bbde23
--- /dev/null
+++ b/Tests/ExportImport/Import/Interface/pch_iface_test.cpp
@@ -0,0 +1,16 @@
+#ifdef EXPECT_PCH
+// Verify that pch/pch.h was included via '-include ...' or equivalent.
+# ifndef PCH_PCH_H_INCLUDED
+# error "Expected PCH_PCH_H_INCLUDED."
+# endif
+#elif defined(__PGIC__) || defined(__ibmxl__) || defined(_CRAYC)
+// No PCH expected but these compilers define macros below.
+#elif defined(__GNUC__) || defined(__clang__) || defined(_INTEL_COMPILER) || \
+ defined(_MSC_VER)
+# error "Expected EXPECT_PCH for this compiler."
+#endif
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 5adcbd9e2..093391e3f 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -421,7 +421,7 @@ if(do_git_tests)
set(local_git_repo "../../LocalRepositories/GIT-with-submodules")
- set(proj TS1-GIT-no-GIT_SUBMODULES)
+ set(proj TS1-GIT-all-GIT_SUBMODULES)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
CMAKE_GENERATOR "${CMAKE_GENERATOR}"
@@ -435,7 +435,8 @@ if(do_git_tests)
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
- set(proj TS1-GIT-empty-GIT_SUBMODULES)
+ set(proj TS1-GIT-all-GIT_SUBMODULES-via-CMP0097-OLD)
+ cmake_policy(SET CMP0097 OLD)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
GIT_SUBMODULES ""
@@ -450,6 +451,22 @@ if(do_git_tests)
)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+ set(proj TS1-GIT-no-GIT_SUBMODULES)
+ cmake_policy(SET CMP0097 NEW)
+ ExternalProject_Add(${proj}
+ GIT_REPOSITORY "${local_git_repo}"
+ GIT_SUBMODULES ""
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ -DWITH_m1:BOOL=OFF
+ -DWITH_m2:BOOL=OFF
+ BUILD_COMMAND ""
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalGITRepository"
+ "SetupLocalGITRepositoryWithSubmodules"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
+
set(proj TS1-GIT-some-GIT_SUBMODULES)
ExternalProject_Add(${proj}
GIT_REPOSITORY "${local_git_repo}"
diff --git a/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx b/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx
index 458ed63a1..a44aba020 100644
--- a/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx
+++ b/Tests/ExternalProjectLocal/Step5/MathFunctions/mysqrt.cxx
@@ -1,12 +1,13 @@
+#include <stdio.h>
+
#include "MathFunctions.h"
#include "TutorialConfig.h"
-#include <stdio.h>
// include the generated table
-#include "Table.h"
-
#include <math.h>
+#include "Table.h"
+
// a hack square root calculation using simple operations
double mysqrt(double x)
{
diff --git a/Tests/ExternalProjectLocal/Step5/tutorial.cxx b/Tests/ExternalProjectLocal/Step5/tutorial.cxx
index 37f6ac456..8d077b29c 100644
--- a/Tests/ExternalProjectLocal/Step5/tutorial.cxx
+++ b/Tests/ExternalProjectLocal/Step5/tutorial.cxx
@@ -1,9 +1,10 @@
// A simple program that computes the square root of a number
-#include "TutorialConfig.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
+#include "TutorialConfig.h"
+
#ifdef USE_MYMATH
# include "MathFunctions.h"
#endif
diff --git a/Tests/FindDoxygen/CMakeLists.txt b/Tests/FindDoxygen/CMakeLists.txt
index 7ce98d59b..41e6255eb 100644
--- a/Tests/FindDoxygen/CMakeLists.txt
+++ b/Tests/FindDoxygen/CMakeLists.txt
@@ -28,6 +28,16 @@ add_test(NAME FindDoxygen.AllTarget COMMAND
--test-command ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
)
+add_test(NAME FindDoxygen.StampFile COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindDoxygen/StampFile"
+ "${CMake_BINARY_DIR}/Tests/FindDoxygen/StampFile"
+ --build-target allDocTargets
+ ${build_generator_args}
+ --build-options ${build_options}
+)
+
if(CMake_TEST_FindDoxygen_Dot)
add_test(NAME FindDoxygen.DotComponentTest COMMAND
${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
diff --git a/Tests/FindDoxygen/StampFile/CMakeLists.txt b/Tests/FindDoxygen/StampFile/CMakeLists.txt
new file mode 100644
index 000000000..2d0654058
--- /dev/null
+++ b/Tests/FindDoxygen/StampFile/CMakeLists.txt
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 3.8)
+project(TestFindDoxygen VERSION 1.0 LANGUAGES NONE)
+
+find_package(Doxygen REQUIRED)
+
+doxygen_add_docs(docsWithoutFilesWithStamp USE_STAMP_FILE)
+if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsWithoutFilesWithStamp")
+ message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithoutFilesWithStamp")
+endif()
+if(NOT TARGET docsWithoutFilesWithStamp)
+ message(FATAL_ERROR "Target docsWithoutFilesWithStamp not created")
+endif()
+
+doxygen_add_docs(docsWithFilesWithStamp main.cpp main2.cpp USE_STAMP_FILE)
+if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsWithFilesWithStamp")
+ message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithFilesWithStamp")
+endif()
+if(NOT TARGET docsWithFilesWithStamp)
+ message(FATAL_ERROR "Target docsWithFilesWithStamp not created")
+endif()
+
+
+add_custom_target(allDocTargets)
+add_dependencies(allDocTargets docsWithoutFilesWithStamp docsWithFilesWithStamp)
diff --git a/Tests/FindDoxygen/StampFile/main.cpp b/Tests/FindDoxygen/StampFile/main.cpp
new file mode 100644
index 000000000..925f0afe0
--- /dev/null
+++ b/Tests/FindDoxygen/StampFile/main.cpp
@@ -0,0 +1,4 @@
+/**
+ * \file
+ * \brief One C++ file w/ sample Doxygen comment just to produce any docs...
+ */
diff --git a/Tests/FindDoxygen/StampFile/main2.cpp b/Tests/FindDoxygen/StampFile/main2.cpp
new file mode 100644
index 000000000..925f0afe0
--- /dev/null
+++ b/Tests/FindDoxygen/StampFile/main2.cpp
@@ -0,0 +1,4 @@
+/**
+ * \file
+ * \brief One C++ file w/ sample Doxygen comment just to produce any docs...
+ */
diff --git a/Tests/FindEnvModules/EnvModules.cmake b/Tests/FindEnvModules/EnvModules.cmake
index 0c81bf21d..21b0042b4 100644
--- a/Tests/FindEnvModules/EnvModules.cmake
+++ b/Tests/FindEnvModules/EnvModules.cmake
@@ -18,18 +18,16 @@ if(avail_mods)
message("module list")
env_module_list(loaded_mods)
+ set(mod0_found FALSE)
foreach(mod IN LISTS loaded_mods)
message(" ${mod}")
+ if(NOT mod0_found AND mod MATCHES "^${mod0}")
+ set(mod0_found ${mod})
+ endif()
endforeach()
- list(LENGTH loaded_mods num_loaded_mods)
- message("Number of modules loaded: ${num_loaded_mods}")
- if(NOT num_loaded_mods EQUAL 1)
- message(FATAL_ERROR "Exactly 1 module should be loaded. Found ${num_loaded_mods}")
- endif()
-
- list(GET loaded_mods 0 mod0_actual)
- if(NOT (mod0_actual MATCHES "^${mod0}"))
- message(FATAL_ERROR "Loaded module does not match ${mod0}. Actual: ${mod0_actual}")
+ if(NOT mod0_found)
+ message(FATAL_ERROR "Requested module ${mod0} not found in loaded modules")
endif()
+ message("module ${mod0} found loaded as ${mod0_found}")
endif()
diff --git a/Tests/FindGIF/Test/main.c b/Tests/FindGIF/Test/main.c
index 4ed72ec1b..656a99c04 100644
--- a/Tests/FindGIF/Test/main.c
+++ b/Tests/FindGIF/Test/main.c
@@ -1,9 +1,8 @@
#include <assert.h>
+#include <gif_lib.h>
#include <stdio.h>
#include <string.h>
-#include <gif_lib.h>
-
// GIFLIB before version 5 didn't know this macro
#ifndef GIFLIB_MAJOR
# define GIFLIB_MAJOR 4
diff --git a/Tests/FindGSL/rng/main.cc b/Tests/FindGSL/rng/main.cc
index af131255a..050caacc7 100644
--- a/Tests/FindGSL/rng/main.cc
+++ b/Tests/FindGSL/rng/main.cc
@@ -1,6 +1,7 @@
-#include "gsl/gsl_rng.h"
#include <math.h>
+#include "gsl/gsl_rng.h"
+
int main()
{
// return code
diff --git a/Tests/FindGTK2/cairomm/main.cpp b/Tests/FindGTK2/cairomm/main.cpp
index 44326012b..48e5e3930 100644
--- a/Tests/FindGTK2/cairomm/main.cpp
+++ b/Tests/FindGTK2/cairomm/main.cpp
@@ -8,13 +8,13 @@
# define _USE_MATH_DEFINES
#endif
-#include <cairomm/context.h>
-#include <cairomm/surface.h>
-#include <cairommconfig.h>
+#include <cmath>
#include <iostream>
#include <string>
-#include <cmath>
+#include <cairomm/context.h>
+#include <cairomm/surface.h>
+#include <cairommconfig.h>
int main()
{
diff --git a/Tests/FindGTK2/gtkmm/helloworld.cpp b/Tests/FindGTK2/gtkmm/helloworld.cpp
index 5f4e0aece..45c942227 100644
--- a/Tests/FindGTK2/gtkmm/helloworld.cpp
+++ b/Tests/FindGTK2/gtkmm/helloworld.cpp
@@ -1,4 +1,5 @@
#include "helloworld.h"
+
#include <iostream>
HelloWorld::HelloWorld()
diff --git a/Tests/FindGTK2/gtkmm/main.cpp b/Tests/FindGTK2/gtkmm/main.cpp
index 1637da28e..29e23fd80 100644
--- a/Tests/FindGTK2/gtkmm/main.cpp
+++ b/Tests/FindGTK2/gtkmm/main.cpp
@@ -1,6 +1,7 @@
-#include "helloworld.h"
#include <gtkmm.h>
+#include "helloworld.h"
+
int main(int argc, char* argv[])
{
Gtk::Main kit(argc, argv);
diff --git a/Tests/FindGTK2/sigc++/main.cpp b/Tests/FindGTK2/sigc++/main.cpp
index e56b91037..4dae4f433 100644
--- a/Tests/FindGTK2/sigc++/main.cpp
+++ b/Tests/FindGTK2/sigc++/main.cpp
@@ -1,6 +1,7 @@
// Taken from https://developer.gnome.org/libsigc++-tutorial/stable/ch02.html
#include <iostream>
+
#include <sigc++/sigc++.h>
class AlienDetector
diff --git a/Tests/FindGnuTLS/CMakeLists.txt b/Tests/FindGnuTLS/CMakeLists.txt
new file mode 100644
index 000000000..059ac7b0f
--- /dev/null
+++ b/Tests/FindGnuTLS/CMakeLists.txt
@@ -0,0 +1,10 @@
+add_test(NAME FindGnuTLS.Test COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindGnuTLS/Test"
+ "${CMake_BINARY_DIR}/Tests/FindGnuTLS/Test"
+ ${build_generator_args}
+ --build-project TestFindGnuTLS
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindGnuTLS/Test/CMakeLists.txt b/Tests/FindGnuTLS/Test/CMakeLists.txt
new file mode 100644
index 000000000..c5a9819b2
--- /dev/null
+++ b/Tests/FindGnuTLS/Test/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.4)
+project(TestFindGnuTLS C)
+include(CTest)
+
+find_package(GnuTLS REQUIRED)
+
+add_definitions(-DCMAKE_EXPECTED_GNUTLS_VERSION="${GNUTLS_VERSION}")
+
+add_executable(test_tgt main.c)
+target_link_libraries(test_tgt GnuTLS::GnuTLS)
+add_test(NAME test_tgt COMMAND test_tgt)
+
+add_executable(test_var main.c)
+target_include_directories(test_var PRIVATE ${GNUTLS_INCLUDE_DIRS})
+target_link_libraries(test_var PRIVATE ${GNUTLS_LIBRARIES})
+target_compile_definitions(test_var PRIVATE ${GNUTLS_DEFINITIONS})
+add_test(NAME test_var COMMAND test_var)
diff --git a/Tests/FindGnuTLS/Test/main.c b/Tests/FindGnuTLS/Test/main.c
new file mode 100644
index 000000000..110535856
--- /dev/null
+++ b/Tests/FindGnuTLS/Test/main.c
@@ -0,0 +1,21 @@
+#include <assert.h>
+#include <gnutls/gnutls.h>
+#include <stdio.h>
+#include <string.h>
+
+int main()
+{
+ // test the linker
+ gnutls_session_t session;
+ if (gnutls_init(&session, GNUTLS_CLIENT)) {
+ gnutls_deinit(session);
+ }
+
+ // check the version
+ char gnutls_version_string[16];
+ snprintf(gnutls_version_string, 16, "%i.%i.%i", GNUTLS_VERSION_MAJOR,
+ GNUTLS_VERSION_MINOR, GNUTLS_VERSION_PATCH);
+ assert(strcmp(gnutls_version_string, CMAKE_EXPECTED_GNUTLS_VERSION) == 0);
+
+ return 0;
+}
diff --git a/Tests/FindICU/Test/main.cpp b/Tests/FindICU/Test/main.cpp
index 64cc5d375..606e94ef8 100644
--- a/Tests/FindICU/Test/main.cpp
+++ b/Tests/FindICU/Test/main.cpp
@@ -1,10 +1,9 @@
-#include <unicode/uclean.h>
-#include <unicode/ustring.h>
-#include <unicode/utypes.h>
-
#include <unicode/ucal.h>
+#include <unicode/uclean.h>
#include <unicode/ucnv.h>
#include <unicode/udat.h>
+#include <unicode/ustring.h>
+#include <unicode/utypes.h>
int main()
{
diff --git a/Tests/FindJPEG/Test/main.c b/Tests/FindJPEG/Test/main.c
index 0e23eff5f..5a67faaee 100644
--- a/Tests/FindJPEG/Test/main.c
+++ b/Tests/FindJPEG/Test/main.c
@@ -1,7 +1,8 @@
#include <assert.h>
+// clang-format off
#include <stdio.h>
-
#include <jpeglib.h>
+// clang-format on
int main()
{
diff --git a/Tests/FindMatlab/basic_checks/CMakeLists.txt b/Tests/FindMatlab/basic_checks/CMakeLists.txt
index c5be1ea25..c0c752a0d 100644
--- a/Tests/FindMatlab/basic_checks/CMakeLists.txt
+++ b/Tests/FindMatlab/basic_checks/CMakeLists.txt
@@ -71,3 +71,15 @@ if(RUN_UNIT_TESTS)
)
set_tests_properties(${PROJECT_NAME}_matlabtest-4 PROPERTIES WILL_FAIL TRUE)
endif()
+
+
+# checking correct flags passed
+# EXCLUDE_FROM_ALL appears after a multiargs (like SRC)
+matlab_add_mex(
+ # target name
+ NAME cmake_matlab_test_exclude_from_all
+ # output name
+ OUTPUT_NAME cmake_matlab_mex_dummy
+ SRC ${CMAKE_CURRENT_SOURCE_DIR}/../matlab_wrapper_failure.cpp
+ EXCLUDE_FROM_ALL
+ )
diff --git a/Tests/FindMatlab/matlab_wrapper_failure.cpp b/Tests/FindMatlab/matlab_wrapper_failure.cpp
new file mode 100644
index 000000000..3fe437b90
--- /dev/null
+++ b/Tests/FindMatlab/matlab_wrapper_failure.cpp
@@ -0,0 +1,13 @@
+// This should not link, as the mex function is missing.
+// This is mostly for checking we are passing the right arguments to the
+// add_library
+
+#include <algorithm>
+
+#include "mex.h"
+
+void mexFunctionXX(const int nlhs, mxArray* plhs[], const int nrhs,
+ const mxArray* prhs[])
+{
+ mexErrMsgTxt("Should not be running");
+}
diff --git a/Tests/FindOpenACC/CMakeLists.txt b/Tests/FindOpenACC/CMakeLists.txt
new file mode 100644
index 000000000..ef7de65a2
--- /dev/null
+++ b/Tests/FindOpenACC/CMakeLists.txt
@@ -0,0 +1,20 @@
+
+set(langs C CXX)
+if(NOT CMAKE_GENERATOR STREQUAL "Ninja")
+ list(APPEND langs Fortran)
+endif()
+
+foreach(lang IN LISTS langs)
+ if(CMAKE_${lang}_COMPILER)
+ add_test(NAME FindOpenACC.Test${lang} COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindOpenACC/${lang}Test"
+ "${CMake_BINARY_DIR}/Tests/FindOpenACC/${lang}Test"
+ ${build_generator_args}
+ --build-project TestFindOpenACC
+ --build-options ${build_options}
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+ endif()
+endforeach()
diff --git a/Tests/FindOpenACC/CTest/CMakeLists.txt b/Tests/FindOpenACC/CTest/CMakeLists.txt
new file mode 100644
index 000000000..c8d0968a6
--- /dev/null
+++ b/Tests/FindOpenACC/CTest/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.14)
+project(VerifyFindOpenAcc C)
+
+set(CMAKE_C_STANDARD 11)
+
+find_package(OpenACC REQUIRED)
+
+add_executable(UsesOpenACC main.c)
+target_link_libraries(UsesOpenACC PRIVATE OpenACC::OpenACC_C)
+
+add_executable(UsesOpenACCVars main.c)
+target_link_options(UsesOpenACCVars PRIVATE ${OpenACC_C_OPTIONS})
+target_compile_options(UsesOpenACCVars PRIVATE ${OpenACC_C_OPTIONS})
diff --git a/Tests/FindOpenACC/CTest/main.c b/Tests/FindOpenACC/CTest/main.c
new file mode 100644
index 000000000..53b6cae15
--- /dev/null
+++ b/Tests/FindOpenACC/CTest/main.c
@@ -0,0 +1,44 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+void vecaddgpu(float* r, float* a, float* b, int n)
+{
+#pragma acc kernels loop present(r, a, b)
+ for (int i = 0; i < n; ++i)
+ r[i] = a[i] + b[i];
+}
+
+int main()
+{
+ int n = 100000; /* vector length */
+ float* a; /* input vector 1 */
+ float* b; /* input vector 2 */
+ float* r; /* output vector */
+ float* e; /* expected output values */
+ int i, errs;
+
+ a = (float*)malloc(n * sizeof(float));
+ b = (float*)malloc(n * sizeof(float));
+ r = (float*)malloc(n * sizeof(float));
+ e = (float*)malloc(n * sizeof(float));
+ for (i = 0; i < n; ++i) {
+ a[i] = (float)(i + 1);
+ b[i] = (float)(1000 * i);
+ }
+/* compute on the GPU */
+#pragma acc data copyin(a [0:n], b [0:n]) copyout(r [0:n])
+ {
+ vecaddgpu(r, a, b, n);
+ }
+ /* compute on the host to compare */
+ for (i = 0; i < n; ++i)
+ e[i] = a[i] + b[i];
+ /* compare results */
+ errs = 0;
+ for (i = 0; i < n; ++i) {
+ if (r[i] != e[i]) {
+ ++errs;
+ }
+ }
+ return errs;
+}
diff --git a/Tests/FindOpenACC/CXXTest/CMakeLists.txt b/Tests/FindOpenACC/CXXTest/CMakeLists.txt
new file mode 100644
index 000000000..a6caf7b35
--- /dev/null
+++ b/Tests/FindOpenACC/CXXTest/CMakeLists.txt
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.14)
+project(VerifyFindOpenAcc CXX)
+
+set(CMAKE_CXX_STANDARD 11)
+
+find_package(OpenACC REQUIRED)
+
+add_executable(UsesOpenACC main.cxx)
+target_link_libraries(UsesOpenACC PRIVATE OpenACC::OpenACC_CXX)
+
+add_executable(UsesOpenACCVars main.cxx)
+target_link_options(UsesOpenACCVars PRIVATE ${OpenACC_CXX_OPTIONS})
+target_compile_options(UsesOpenACCVars PRIVATE ${OpenACC_CXX_OPTIONS})
diff --git a/Tests/FindOpenACC/CXXTest/main.cxx b/Tests/FindOpenACC/CXXTest/main.cxx
new file mode 100644
index 000000000..7369045c0
--- /dev/null
+++ b/Tests/FindOpenACC/CXXTest/main.cxx
@@ -0,0 +1,43 @@
+
+#include <vector>
+
+void vecaddgpu(float* r, float* a, float* b, std::size_t n)
+{
+#pragma acc kernels loop present(r, a, b)
+ for (std::size_t i = 0; i < n; ++i)
+ r[i] = a[i] + b[i];
+}
+
+int main(int, char* [])
+{
+ const std::size_t n = 100000; /* vector length */
+ std::vector<float> a(n); /* input vector 1 */
+ std::vector<float> b(n); /* input vector 2 */
+ std::vector<float> r(n); /* output vector */
+ std::vector<float> e(n); /* expected output values */
+
+ for (std::size_t i = 0; i < n; ++i) {
+ a[i] = static_cast<float>(i + 1);
+ b[i] = static_cast<float>(1000 * i);
+ }
+
+ /* compute on the GPU */
+ auto a_ptr = a.data();
+ auto b_ptr = b.data();
+ auto r_ptr = r.data();
+#pragma acc data copyin(a_ptr [0:n], b_ptr [0:n]) copyout(r_ptr [0:n])
+ {
+ vecaddgpu(r_ptr, a_ptr, b_ptr, n);
+ }
+ /* compute on the host to compare */
+ for (std::size_t i = 0; i < n; ++i)
+ e[i] = a[i] + b[i];
+ /* compare results */
+ int errs = 0;
+ for (std::size_t i = 0; i < n; ++i) {
+ if (r[i] != e[i]) {
+ ++errs;
+ }
+ }
+ return errs;
+}
diff --git a/Tests/FindOpenACC/FortranTest/CMakeLists.txt b/Tests/FindOpenACC/FortranTest/CMakeLists.txt
new file mode 100644
index 000000000..12e3503d1
--- /dev/null
+++ b/Tests/FindOpenACC/FortranTest/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required(VERSION 3.14)
+project(VerifyFindOpenAcc Fortran)
+
+find_package(OpenACC REQUIRED)
+
+add_executable(UsesOpenACC main.f90)
+target_link_libraries(UsesOpenACC PRIVATE OpenACC::OpenACC_Fortran)
+
+add_executable(UsesOpenACCVars main.f90)
+target_link_options(UsesOpenACCVars PRIVATE ${OpenACC_Fortran_OPTIONS})
+target_compile_options(UsesOpenACCVars PRIVATE ${OpenACC_Fortran_OPTIONS})
diff --git a/Tests/FindOpenACC/FortranTest/main.f90 b/Tests/FindOpenACC/FortranTest/main.f90
new file mode 100644
index 000000000..2ff1ba029
--- /dev/null
+++ b/Tests/FindOpenACC/FortranTest/main.f90
@@ -0,0 +1,9 @@
+program t
+integer(4) a(10000)
+a = [ (1+i,i=1,10000) ]
+!$acc kernels
+do i = 1, 10000
+ if (a(i)/3000*3000.eq.a(i)) print *," located ",i,a(i),i.gt.5000,a(i)/5.0
+end do
+!$acc end kernels
+end
diff --git a/Tests/FindOpenMP/Test/CMakeLists.txt b/Tests/FindOpenMP/Test/CMakeLists.txt
index 2692947ad..ebdb6b8f9 100644
--- a/Tests/FindOpenMP/Test/CMakeLists.txt
+++ b/Tests/FindOpenMP/Test/CMakeLists.txt
@@ -42,6 +42,7 @@ foreach(c C CXX Fortran)
separate_arguments(_OpenMP_${c}_OPTIONS NATIVE_COMMAND "${OpenMP_${c}_FLAGS}")
target_compile_options(test_var_${c} PRIVATE "${_OpenMP_${c}_OPTIONS}")
target_link_libraries(test_var_${c} PRIVATE "${OpenMP_${c}_FLAGS}")
+ target_include_directories(test_var_${c} PRIVATE ${OpenMP_${c}_INCLUDE_DIRS})
set_property(TARGET test_var_${c} PROPERTY LINKER_LANGUAGE ${c})
add_test(NAME test_var_${c} COMMAND test_var_${c})
diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt
index 1b9c973b1..7217f43b6 100644
--- a/Tests/FindPackageTest/CMakeLists.txt
+++ b/Tests/FindPackageTest/CMakeLists.txt
@@ -391,16 +391,44 @@ try_compile(EXPORTER_COMPILED
message(STATUS "Searching for export(PACKAGE) test project")
set(CMakeTestExportPackage_DIR "" CACHE FILEPATH
"Wipe out find results for testing." FORCE)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=TRUE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY TRUE)
+find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=FALSE")
+set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY FALSE)
find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
-message(STATUS "Searching for export(PACKAGE) test project with CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE")
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=TRUE and CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=TRUE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY TRUE)
set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY TRUE)
+set(CMakeTestExportPackage_DIR FALSE)
+find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED)
+if(NOT CMakeTestExportPackage_FOUND)
+ message(SEND_ERROR "CMakeTestExportPackage should be FOUND!")
+endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
+unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
+
+message(STATUS "Searching for export(PACKAGE) with CMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE and CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=FALSE")
+set(CMAKE_FIND_USE_PACKAGE_REGISTRY FALSE)
+set(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY FALSE)
set(CMakeTestExportPackage_DIR "" CACHE FILEPATH
"Wipe out find results for testing." FORCE)
-find_package(CMakeTestExportPackage 1.${version} EXACT QUIET)
+find_package(CMakeTestExportPackage 1.${version} EXACT QUIET)
if(CMakeTestExportPackage_FOUND)
- message(SEND_ERROR "CMakeTestExportPackage should not be FOUND!")
+ message(SEND_ERROR "CMakeTestExportPackage should be not FOUND!")
endif()
+unset(CMAKE_FIND_USE_PACKAGE_REGISTRY)
unset(CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY)
message(STATUS "Remove export(PACKAGE) test project")
diff --git a/Tests/FindProtobuf/Test/CMakeLists.txt b/Tests/FindProtobuf/Test/CMakeLists.txt
index bc89190b3..fc6b37e95 100644
--- a/Tests/FindProtobuf/Test/CMakeLists.txt
+++ b/Tests/FindProtobuf/Test/CMakeLists.txt
@@ -29,6 +29,7 @@ add_test(NAME test_tgt_protoc COMMAND test_tgt_protoc)
add_executable(test_var_protoc main-protoc.cxx)
target_include_directories(test_var_protoc PRIVATE ${Protobuf_INCLUDE_DIRS})
target_link_libraries(test_var_protoc PRIVATE ${Protobuf_PROTOC_LIBRARIES})
+target_compile_features(test_var_protoc PRIVATE cxx_std_11)
add_test(NAME test_var_protoc COMMAND test_var_protoc)
add_test(NAME test_tgt_protoc_version COMMAND protobuf::protoc --version)
@@ -37,14 +38,17 @@ set(Protobuf_IMPORT_DIRS ${Protobuf_INCLUDE_DIRS})
PROTOBUF_GENERATE_CPP(PROTO_SRC PROTO_HEADER msgs/example.proto)
PROTOBUF_GENERATE_CPP(DESC_PROTO_SRC DESC_PROTO_HEADER DESCRIPTORS DESC_PROTO_DESC msgs/example_desc.proto)
add_library(msgs ${PROTO_SRC} ${PROTO_HEADER})
+target_compile_features(msgs PRIVATE cxx_std_11)
add_executable(test_generate main-generate.cxx ${PROTO_SRC})
target_include_directories(test_generate PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(test_generate msgs ${Protobuf_LIBRARIES})
+target_compile_features(test_generate PRIVATE cxx_std_11)
add_test(NAME test_generate COMMAND test_generate)
add_executable(test_desc main-desc.cxx ${DESC_PROTO_SRC})
target_compile_features(test_desc PRIVATE cxx_std_11)
target_include_directories(test_desc PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(test_desc msgs ${Protobuf_LIBRARIES})
+target_compile_features(test_desc PRIVATE cxx_std_11)
add_test(NAME test_desc COMMAND test_desc ${DESC_PROTO_DESC})
diff --git a/Tests/FindProtobuf/Test/main-desc.cxx b/Tests/FindProtobuf/Test/main-desc.cxx
index a26e562d5..dc768ab99 100644
--- a/Tests/FindProtobuf/Test/main-desc.cxx
+++ b/Tests/FindProtobuf/Test/main-desc.cxx
@@ -1,11 +1,12 @@
#include <fstream>
-#include <google/protobuf/descriptor.h>
#include <google/protobuf/descriptor.pb.h>
-#include <google/protobuf/dynamic_message.h>
-#include <google/protobuf/text_format.h>
#include <iostream>
#include <string>
+#include <google/protobuf/descriptor.h>
+#include <google/protobuf/dynamic_message.h>
+#include <google/protobuf/text_format.h>
+
int main(int argc, char* argv[])
{
std::ifstream fs;
diff --git a/Tests/FindPython/CMakeLists.txt b/Tests/FindPython/CMakeLists.txt
index 4be2f22b6..868cfe0e1 100644
--- a/Tests/FindPython/CMakeLists.txt
+++ b/Tests/FindPython/CMakeLists.txt
@@ -121,6 +121,19 @@ if(CMake_TEST_FindPython)
--test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
)
+ add_test(NAME FindPython.RequiredArtifacts COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts
+ --build-options ${build_options} "-Dbuild_generator_args=${build_generator_args}"
+ "-DCMake_SOURCE_DIR=${CMake_SOURCE_DIR}"
+ "-DCMake_BINARY_DIR=${CMake_BINARY_DIR}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
endif()
if(CMake_TEST_FindPython_NumPy)
diff --git a/Tests/FindPython/FindPythonScript.cmake b/Tests/FindPython/FindPythonScript.cmake
index 94500920e..bc7e0d195 100644
--- a/Tests/FindPython/FindPythonScript.cmake
+++ b/Tests/FindPython/FindPythonScript.cmake
@@ -1 +1,9 @@
-find_package(${PYTHON_PACKAGE_NAME} REQUIRED QUIET)
+
+if (PYTHON_MUST_NOT_BE_FOUND)
+ find_package(${PYTHON_PACKAGE_NAME} QUIET)
+ if (${PYTHON_PACKAGE_NAME}_FOUND)
+ message(FATAL_ERROR "${PYTHON_PACKAGE_NAME}: unexpectedly founded.")
+ endif()
+else()
+ find_package(${PYTHON_PACKAGE_NAME} REQUIRED QUIET)
+endif()
diff --git a/Tests/FindPython/NumPy/arraytest.c b/Tests/FindPython/NumPy/arraytest.c
index db259e55a..51db7bc34 100644
--- a/Tests/FindPython/NumPy/arraytest.c
+++ b/Tests/FindPython/NumPy/arraytest.c
@@ -1,10 +1,10 @@
#include "Python.h"
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
-#include "numpy/arrayobject.h"
-
#include <math.h>
+#include "numpy/arrayobject.h"
+
static PyObject* vecsq(PyObject* self, PyObject* args);
static PyMethodDef arraytestMethods[] = { { "vecsq", vecsq, METH_VARARGS },
diff --git a/Tests/FindPython/Python2/CMakeLists.txt b/Tests/FindPython/Python2/CMakeLists.txt
index 274745a6e..cf77ca240 100644
--- a/Tests/FindPython/Python2/CMakeLists.txt
+++ b/Tests/FindPython/Python2/CMakeLists.txt
@@ -34,4 +34,5 @@ add_test (NAME python2_spam2
add_test(NAME findpython2_script
COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python2
+ -DPython2_FIND_STRATEGY=${Python2_FIND_STRATEGY}
-P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
diff --git a/Tests/FindPython/Python3/CMakeLists.txt b/Tests/FindPython/Python3/CMakeLists.txt
index b21a15bc8..6691a48a2 100644
--- a/Tests/FindPython/Python3/CMakeLists.txt
+++ b/Tests/FindPython/Python3/CMakeLists.txt
@@ -34,4 +34,57 @@ add_test (NAME python3_spam3
add_test(NAME findpython3_script
COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3
+ -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY}
+ -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
+
+
+## Try a new search specifying only expected ABI
+# retrieve ABI of python interpreter
+execute_process (COMMAND "${Python3_EXECUTABLE}" -c
+ "import sys; sys.stdout.write(sys.abiflags)"
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE abi
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+if (result)
+ # assume ABI is not supported
+ set (abi "")
+endif()
+
+# define FIND_ABI variable
+if (abi MATCHES "d")
+ set (Python3_VALID_ABI "ON")
+else()
+ set (Python3_VALID_ABI "OFF")
+endif()
+if (abi MATCHES "m")
+ list (APPEND Python3_VALID_ABI "ON")
+else()
+ list (APPEND Python3_VALID_ABI "OFF")
+endif()
+if (abi MATCHES "u")
+ list (APPEND Python3_VALID_ABI "ON")
+else()
+ list (APPEND Python3_VALID_ABI "OFF")
+endif()
+# build an invalid pattern for ABI
+set (Python3_INVALID_ABI)
+foreach (abi IN LISTS Python3_VALID_ABI)
+ if (abi)
+ list (APPEND Python3_INVALID_ABI "OFF")
+ else()
+ list (APPEND Python3_INVALID_ABI "ON")
+ endif()
+endforeach()
+
+add_test(NAME python3_find_valid_abi
+ COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3
+ -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY}
+ "-DPython3_FIND_ABI=${Python3_VALID_ABI}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
+add_test(NAME python3_find_invalid_abi
+ COMMAND "${CMAKE_COMMAND}" -DPYTHON_PACKAGE_NAME=Python3
+ -DPYTHON_MUST_NOT_BE_FOUND=ON
+ -DPython3_FIND_STRATEGY=${Python3_FIND_STRATEGY}
+ "-DPython3_FIND_ABI=${Python3_INVALID_ABI}"
-P "${CMAKE_CURRENT_LIST_DIR}/../FindPythonScript.cmake")
diff --git a/Tests/FindPython/RequiredArtifacts/CMakeLists.txt b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt
new file mode 100644
index 000000000..39e8ea562
--- /dev/null
+++ b/Tests/FindPython/RequiredArtifacts/CMakeLists.txt
@@ -0,0 +1,110 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestRequiredArtifacts LANGUAGES C)
+
+include(CTest)
+
+find_package(Python2 REQUIRED COMPONENTS Interpreter Development)
+if (NOT Python2_FOUND)
+ message (FATAL_ERROR "Fail to found Python 2")
+endif()
+find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
+if (NOT Python3_FOUND)
+ message (FATAL_ERROR "Fail to found Python 3")
+endif()
+
+
+add_test(NAME FindPython.RequiredArtifacts.Interpreter.VALID COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Interpreter.VALID"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts.Check
+ --build-options -DPYTHON_IS_FOUND=TRUE -DCHECK_INTERPRETER=ON
+ "-DPython3_EXECUTABLE=${Python3_EXECUTABLE}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+add_test(NAME FindPython.RequiredArtifacts.Interpreter.INVALID COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Interpreter.INVALID"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts.Check
+ --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INTERPRETER=ON
+ "-DPython3_EXECUTABLE=${Python3_EXECUTABLE}-bad${CMAKE_EXECUTABLE_SUFFIX}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+add_test(NAME FindPython.RequiredArtifacts.Library.VALID COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Library.VALID"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts.Check
+ --build-options -DPYTHON_IS_FOUND=TRUE -DCHECK_LIBRARY=ON
+ "-DPython3_LIBRARY=${Python3_LIBRARY_RELEASE}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+add_test(NAME FindPython.RequiredArtifacts.Library.INVALID COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Library.INVALID"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts.Check
+ --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_LIBRARY=ON
+ "-DPython3_LIBRARY=${Python2_LIBRARY_RELEASE}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+add_test(NAME FindPython.RequiredArtifacts.Include.VALID COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Include.VALID"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts.Check
+ --build-options -DPYTHON_IS_FOUND=TRUE -DCHECK_INCLUDE=ON
+ "-DPython3_INCLUDE_DIR=${Python3_INCLUDE_DIRS}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+add_test(NAME FindPython.RequiredArtifacts.Include.INVALID COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Include.INVALID"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts.Check
+ --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INCLUDE=ON
+ "-DPython3_INCLUDE_DIR=${Python2_INCLUDE_DIRS}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+add_test(NAME FindPython.RequiredArtifacts.Interpreter-Library.INVALID COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Interpreter-Library.INVALID"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts.Check
+ --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_INTERPRETER=ON -DCHECK_LIBRARY=ON
+ "-DPython3_EXECUTABLE=${Python3_EXECUTABLE}"
+ "-DPython3_LIBRARY=${Python2_LIBRARY_RELEASE}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
+
+add_test(NAME FindPython.RequiredArtifacts.Library-Include.INVALID COMMAND
+ ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/FindPython/RequiredArtifacts/Check"
+ "${CMake_BINARY_DIR}/Tests/FindPython/RequiredArtifacts/Library-Include.INVALID"
+ ${build_generator_args}
+ --build-project TestRequiredArtifacts.Check
+ --build-options -DPYTHON_IS_FOUND=FALSE -DCHECK_LIBRARY=ON -DCHECK_INCLUDE=ON
+ "-DPython3_LIBRARY=${Python3_LIBRARY_RELEASE}"
+ "-DPython3_INCLUDE_DIR=${Python2_INCLUDE_DIRS}"
+ --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION>
+ )
diff --git a/Tests/FindPython/RequiredArtifacts/Check/CMakeLists.txt b/Tests/FindPython/RequiredArtifacts/Check/CMakeLists.txt
new file mode 100644
index 000000000..b859ac57f
--- /dev/null
+++ b/Tests/FindPython/RequiredArtifacts/Check/CMakeLists.txt
@@ -0,0 +1,41 @@
+cmake_minimum_required(VERSION 3.1)
+
+project(TestRequiredArtifacts.Check LANGUAGES C)
+
+set (components)
+if (CHECK_INTERPRETER)
+ set (required_interpreter "${Python3_EXECUTABLE}")
+ list (APPEND components Interpreter)
+endif()
+if (CHECK_LIBRARY OR CHECK_INCLUDE)
+ list (APPEND components Development)
+ if (CHECK_LIBRARY)
+ set (required_library "${Python3_LIBRARY}")
+ endif()
+ if (CHECK_INCLUDE)
+ set (required_include "${Python3_INCLUDE_DIR}")
+ endif()
+endif()
+
+find_package (Python3 COMPONENTS ${components})
+
+
+if (PYTHON_IS_FOUND AND NOT Python3_FOUND)
+ message (FATAL_ERROR "Python3 unexpectedly not found")
+endif()
+if (NOT PYTHON_IS_FOUND AND Python3_FOUND)
+ message (FATAL_ERROR "Python3 unexpectedly found")
+endif()
+
+
+if (CHECK_INTERPRETER AND NOT Python3_EXECUTABLE STREQUAL required_interpreter)
+ message (FATAL_ERROR "Fail to use input variable Python3_EXECUTABLE")
+endif()
+
+if (CHECK_LIBRARY AND NOT Python3_LIBRARY_RELEASE STREQUAL required_library)
+ message (FATAL_ERROR "Fail to use input variable Python3_LIBRARY")
+endif()
+
+if (CHECK_INCLUDE AND NOT Python3_INCLUDE_DIRS STREQUAL required_include)
+ message (FATAL_ERROR "Fail to use input variable Python3_INCLUDE_DIR")
+endif()
diff --git a/Tests/FindSQLite3/Test/main.c b/Tests/FindSQLite3/Test/main.c
index aeb494063..fb17c672a 100644
--- a/Tests/FindSQLite3/Test/main.c
+++ b/Tests/FindSQLite3/Test/main.c
@@ -1,6 +1,5 @@
-#include <string.h>
-
#include <sqlite3.h>
+#include <string.h>
int main()
{
diff --git a/Tests/FindX11/Test/main.c b/Tests/FindX11/Test/main.c
index 044bfa278..c8144e09c 100644
--- a/Tests/FindX11/Test/main.c
+++ b/Tests/FindX11/Test/main.c
@@ -167,12 +167,12 @@ static Bool test_Xkb(void)
#endif
#ifdef HAVE_X11_xkbfile
+// clang-format off
# include <stdio.h>
-
# include <X11/XKBlib.h>
# include <X11/extensions/XKBfile.h>
-
# include <stdlib.h>
+// clang-format on
static void test_xkbfile(void)
{
@@ -184,7 +184,6 @@ static void test_xkbfile(void)
#ifdef HAVE_X11_Xmu
# include <X11/Xmu/Xmu.h>
-
# include <stdlib.h>
static Bool test_Xmu(void)
diff --git a/Tests/FortranModules/Library/a.f90 b/Tests/FortranModules/Library/a.f90
index 3031c0723..c180cc068 100644
--- a/Tests/FortranModules/Library/a.f90
+++ b/Tests/FortranModules/Library/a.f90
@@ -1,3 +1,6 @@
MODULE libraryModuleA
USE libraryModuleB
+CONTAINS
+ SUBROUTINE libA
+ END SUBROUTINE
END MODULE
diff --git a/Tests/FortranModules/Library/b.f90 b/Tests/FortranModules/Library/b.f90
index ae1edcb20..f550996a1 100644
--- a/Tests/FortranModules/Library/b.f90
+++ b/Tests/FortranModules/Library/b.f90
@@ -1,2 +1,5 @@
MODULE libraryModuleB
+CONTAINS
+ SUBROUTINE libB
+ END SUBROUTINE
END MODULE
diff --git a/Tests/FortranModules/Subdir/subdir.f90 b/Tests/FortranModules/Subdir/subdir.f90
index 68955f6b5..5288b065b 100644
--- a/Tests/FortranModules/Subdir/subdir.f90
+++ b/Tests/FortranModules/Subdir/subdir.f90
@@ -1,2 +1,5 @@
MODULE subdirModuleA
+CONTAINS
+ SUBROUTINE subdirLibA
+ END SUBROUTINE
END MODULE
diff --git a/Tests/FortranOnly/CMakeLists.txt b/Tests/FortranOnly/CMakeLists.txt
index 45372ddb9..de887faa4 100644
--- a/Tests/FortranOnly/CMakeLists.txt
+++ b/Tests/FortranOnly/CMakeLists.txt
@@ -112,3 +112,11 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM)
)
endif()
endif()
+
+# Test that with Intel Fortran we always compile with preprocessor
+# defines even if splitting the preprocessing and compilation steps.
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel")
+ add_executable(IntelIfDef IntelIfDef.f)
+ set_property(TARGET IntelIfDef PROPERTY Fortran_FORMAT FIXED)
+ target_compile_definitions(IntelIfDef PRIVATE SOME_DEF)
+endif()
diff --git a/Tests/FortranOnly/IntelIfDef.f b/Tests/FortranOnly/IntelIfDef.f
new file mode 100644
index 000000000..d7a73d149
--- /dev/null
+++ b/Tests/FortranOnly/IntelIfDef.f
@@ -0,0 +1,3 @@
+ INCLUDE 'IntelIfDef.inc'
+ PROGRAM IntelIfDef
+ END
diff --git a/Tests/FortranOnly/IntelIfDef.inc b/Tests/FortranOnly/IntelIfDef.inc
new file mode 100644
index 000000000..52edafa78
--- /dev/null
+++ b/Tests/FortranOnly/IntelIfDef.inc
@@ -0,0 +1,3 @@
+CDEC$ IF .NOT. DEFINED(SOME_DEF)
+CDEC$ INCLUDE 'SOME_DEF not defined'
+CDEC$ END IF
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 3ff2b8595..9d5134203 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -86,7 +86,7 @@ add_custom_target(check-part1 ALL
-Dtest_colons_4=$<1:C:\\CMake>
-Dtest_colons_5=$<1:C:/CMake>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part1.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 4)"
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 1 of 5)"
VERBATIM
)
@@ -157,7 +157,7 @@ add_custom_target(check-part2 ALL
-Dtest_arbitrary_content_comma_9=$<1:a,,b,,>
-Dtest_arbitrary_content_comma_10=$<1:,,a,,b,,>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part2.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 4)"
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 2 of 5)"
VERBATIM
)
@@ -251,7 +251,7 @@ add_custom_target(check-part3 ALL
-Dequal22=$<EQUAL:10,-012>
-Dequal23=$<EQUAL:-10,-012>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part3.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 4)"
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 3 of 5)"
VERBATIM
)
@@ -277,7 +277,27 @@ add_custom_target(check-part4 ALL
-DWIN32=${WIN32}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-P ${CMAKE_CURRENT_SOURCE_DIR}/check-part4.cmake
- COMMAND ${CMAKE_COMMAND} -E echo "check done (part 4 of 4)"
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 4 of 5)"
+ VERBATIM
+ )
+
+add_custom_target(check-part5 ALL
+ COMMAND ${CMAKE_COMMAND} -E echo "check done (part 5 of 5)"
+ DEPENDS check-part5.stamp
+ VERBATIM
+ )
+
+add_custom_command(
+ OUTPUT check-part5.stamp
+ DEPENDS $<FILTER:file.foo.bar,EXCLUDE,\\.foo\\.bar$>
+ COMMAND ${CMAKE_COMMAND} -E sleep 0
+ VERBATIM
+ )
+set_property(SOURCE check-part5.stamp PROPERTY SYMBOLIC 1)
+
+add_custom_command(
+ OUTPUT file.foo.bar
+ COMMAND ${CMAKE_COMMAND} -P check-part5.cmake
VERBATIM
)
diff --git a/Tests/GeneratorExpression/check-part5.cmake b/Tests/GeneratorExpression/check-part5.cmake
new file mode 100644
index 000000000..77d138713
--- /dev/null
+++ b/Tests/GeneratorExpression/check-part5.cmake
@@ -0,0 +1 @@
+message(SEND_ERROR "$<FILTER:file.foo.bar,EXCLUDE,\\.foo\\.bar$> genex in DEPENDS argument of 'add_custom_command()' is not empty")
diff --git a/Tests/GoogleTest/Test/main1.cxx b/Tests/GoogleTest/Test/main1.cxx
index 03d604b91..c353d9146 100644
--- a/Tests/GoogleTest/Test/main1.cxx
+++ b/Tests/GoogleTest/Test/main1.cxx
@@ -1,7 +1,7 @@
-#include <gtest/gtest.h>
-
#include <string>
+#include <gtest/gtest.h>
+
namespace {
bool shouldFail = false;
}
diff --git a/Tests/IPO/CMakeLists.txt b/Tests/IPO/CMakeLists.txt
deleted file mode 100644
index 6dabf86bb..000000000
--- a/Tests/IPO/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-cmake_minimum_required (VERSION 2.8)
-project(IPO NONE)
-
-set_property(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION 1)
-
-add_subdirectory(../COnly COnly)
-add_subdirectory(../CxxOnly CxxOnly)
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp b/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp
index be18ebf52..a13f08fdc 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/consumer.cpp
@@ -1,7 +1,6 @@
-#include "upstream.h"
-
#include "config_iface.h"
+#include "upstream.h"
int consumer()
{
diff --git a/Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h b/Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h
index 5b3c7db73..3e1894138 100644
--- a/Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h
+++ b/Tests/InterfaceLibrary/libsdir/sharedlib/sharedlib.h
@@ -2,9 +2,8 @@
#ifndef SHAREDLIB_H
#define SHAREDLIB_H
-#include "sharedlib_export.h"
-
#include "shareddependlib.h"
+#include "sharedlib_export.h"
struct SHAREDLIB_EXPORT SharedLibObject
{
diff --git a/Tests/Java/CMakeLists.txt b/Tests/Java/CMakeLists.txt
index 0b8269bb7..aea4282e7 100644
--- a/Tests/Java/CMakeLists.txt
+++ b/Tests/Java/CMakeLists.txt
@@ -3,6 +3,8 @@ project(hello Java)
cmake_minimum_required (VERSION 2.6)
set(CMAKE_VERBOSE_MAKEFILE 1)
+include(CTest)
+
find_package(Java COMPONENTS Development)
include (UseJava)
@@ -14,3 +16,10 @@ add_jar(hello2 @${CMAKE_CURRENT_BINARY_DIR}/java_fileslist)
# use listing file to specify sources and specify output directory (issue #17316)
add_jar(hello3 @${CMAKE_CURRENT_BINARY_DIR}/java_fileslist OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/hello3")
+
+add_test (NAME Java.Jar
+ COMMAND "${Java_JAVA_EXECUTABLE}" -classpath hello.jar HelloWorld)
+add_test (NAME Java.JarSourceList
+ COMMAND "${Java_JAVA_EXECUTABLE}" -classpath hello2.jar HelloWorld)
+add_test (NAME Java.JarSourceListAndOutput
+ COMMAND "${Java_JAVA_EXECUTABLE}" -classpath "${CMAKE_CURRENT_BINARY_DIR}/hello3/hello3.jar" HelloWorld)
diff --git a/Tests/JavaJavah/B.cpp b/Tests/JavaJavah/B.cpp
index 491107efb..86d8aa869 100644
--- a/Tests/JavaJavah/B.cpp
+++ b/Tests/JavaJavah/B.cpp
@@ -1,9 +1,9 @@
+#include "B.h"
+
#include <jni.h>
#include <stdio.h>
-#include "B.h"
-
JNIEXPORT void JNICALL Java_B_printName(JNIEnv*, jobject)
{
printf("B\n");
diff --git a/Tests/JavaJavah/C.cpp b/Tests/JavaJavah/C.cpp
index 0a3178f95..569eab54a 100644
--- a/Tests/JavaJavah/C.cpp
+++ b/Tests/JavaJavah/C.cpp
@@ -1,9 +1,9 @@
+#include "C.h"
+
#include <jni.h>
#include <stdio.h>
-#include "C.h"
-
JNIEXPORT void JNICALL Java_C_printName(JNIEnv*, jobject)
{
printf("C\n");
diff --git a/Tests/JavaJavah/CMakeLists.txt b/Tests/JavaJavah/CMakeLists.txt
index 071bf20d6..77c292a32 100644
--- a/Tests/JavaJavah/CMakeLists.txt
+++ b/Tests/JavaJavah/CMakeLists.txt
@@ -3,6 +3,8 @@ project(helloJavah Java CXX)
cmake_minimum_required (VERSION 2.6)
set(CMAKE_VERBOSE_MAKEFILE 1)
+include(CTest)
+
find_package(Java COMPONENTS Development)
include (UseJava)
@@ -21,3 +23,6 @@ add_dependencies(B B_javah)
target_include_directories(B PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH2})
+
+add_test (NAME Java.Javah
+ COMMAND "${Java_JAVA_EXECUTABLE}" -Djava.library.path=$<TARGET_FILE_DIR:B> -classpath hello3.jar HelloWorld2)
diff --git a/Tests/JavaNativeHeaders/CMakeLists.txt b/Tests/JavaNativeHeaders/CMakeLists.txt
index 7dc267942..2023d25f9 100644
--- a/Tests/JavaNativeHeaders/CMakeLists.txt
+++ b/Tests/JavaNativeHeaders/CMakeLists.txt
@@ -3,6 +3,8 @@ project(helloJavaNativeHeaders Java CXX)
cmake_minimum_required (VERSION 2.6)
set(CMAKE_VERBOSE_MAKEFILE 1)
+include (CTest)
+
find_package(Java COMPONENTS Development)
include (UseJava)
@@ -16,3 +18,7 @@ add_jar(hello4 HelloWorld3.java)
add_library(D SHARED D.cpp E.cpp)
target_link_libraries (D PRIVATE D1-native E1-native)
+
+
+add_test (NAME Java.NativeHeaders
+ COMMAND "${Java_JAVA_EXECUTABLE}" -Djava.library.path=$<TARGET_FILE_DIR:D> -classpath hello4.jar HelloWorld3)
diff --git a/Tests/JavaNativeHeaders/D.cpp b/Tests/JavaNativeHeaders/D.cpp
index 2a90a080c..018386c23 100644
--- a/Tests/JavaNativeHeaders/D.cpp
+++ b/Tests/JavaNativeHeaders/D.cpp
@@ -1,9 +1,9 @@
+#include "D.h"
+
#include <jni.h>
#include <stdio.h>
-#include "D.h"
-
JNIEXPORT void JNICALL Java_D_printName(JNIEnv*, jobject)
{
printf("D\n");
diff --git a/Tests/JavaNativeHeaders/E.cpp b/Tests/JavaNativeHeaders/E.cpp
index fb98946db..3a8e0acff 100644
--- a/Tests/JavaNativeHeaders/E.cpp
+++ b/Tests/JavaNativeHeaders/E.cpp
@@ -1,9 +1,9 @@
+#include "E.h"
+
#include <jni.h>
#include <stdio.h>
-#include "E.h"
-
JNIEXPORT void JNICALL Java_E_printName(JNIEnv*, jobject)
{
printf("E\n");
diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
index 3558f894b..99f0de925 100644
--- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
@@ -1,8 +1,9 @@
-#include "cmCPluginAPI.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "cmCPluginAPI.h"
+
typedef struct
{
char* LibraryName;
diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
index 3558f894b..99f0de925 100644
--- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
+++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c
@@ -1,8 +1,9 @@
-#include "cmCPluginAPI.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include "cmCPluginAPI.h"
+
typedef struct
{
char* LibraryName;
diff --git a/Tests/MFC/mfc1/ChildFrm.cpp b/Tests/MFC/mfc1/ChildFrm.cpp
index a415229d7..0422d2a9c 100644
--- a/Tests/MFC/mfc1/ChildFrm.cpp
+++ b/Tests/MFC/mfc1/ChildFrm.cpp
@@ -1,11 +1,13 @@
// ChildFrm.cpp : implementation of the CChildFrame class
//
+// clang-format off
#include "stdafx.h"
#include "mfc1.h"
#include "ChildFrm.h"
+// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
diff --git a/Tests/MFC/mfc1/MainFrm.cpp b/Tests/MFC/mfc1/MainFrm.cpp
index 6bd2b3d9a..7f82e267f 100644
--- a/Tests/MFC/mfc1/MainFrm.cpp
+++ b/Tests/MFC/mfc1/MainFrm.cpp
@@ -1,11 +1,13 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
+// clang-format off
#include "stdafx.h"
#include "mfc1.h"
#include "MainFrm.h"
+// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
diff --git a/Tests/MFC/mfc1/mfc1.cpp b/Tests/MFC/mfc1/mfc1.cpp
index 892a89d27..87406b641 100644
--- a/Tests/MFC/mfc1/mfc1.cpp
+++ b/Tests/MFC/mfc1/mfc1.cpp
@@ -1,6 +1,7 @@
// mfc1.cpp : Defines the class behaviors for the application.
//
+// clang-format off
#include "stdafx.h"
#include "MainFrm.h"
@@ -9,6 +10,7 @@
#include "ChildFrm.h"
#include "mfc1Doc.h"
#include "mfc1View.h"
+// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
diff --git a/Tests/MFC/mfc1/mfc1Doc.cpp b/Tests/MFC/mfc1/mfc1Doc.cpp
index e69b61c71..ef8b6afd2 100644
--- a/Tests/MFC/mfc1/mfc1Doc.cpp
+++ b/Tests/MFC/mfc1/mfc1Doc.cpp
@@ -1,11 +1,13 @@
// mfc1Doc.cpp : implementation of the Cmfc1Doc class
//
+// clang-format off
#include "stdafx.h"
#include "mfc1.h"
#include "mfc1Doc.h"
+// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
diff --git a/Tests/MFC/mfc1/mfc1View.cpp b/Tests/MFC/mfc1/mfc1View.cpp
index 3de55cf6e..55dcb8e42 100644
--- a/Tests/MFC/mfc1/mfc1View.cpp
+++ b/Tests/MFC/mfc1/mfc1View.cpp
@@ -1,12 +1,14 @@
// mfc1View.cpp : implementation of the Cmfc1View class
//
+// clang-format off
#include "stdafx.h"
#include "mfc1.h"
#include "mfc1Doc.h"
#include "mfc1View.h"
+// clang-format on
#ifdef _DEBUG
# define new DEBUG_NEW
diff --git a/Tests/MFC/mfc1/stdafx.h b/Tests/MFC/mfc1/stdafx.h
index 2680f2632..b36908593 100644
--- a/Tests/MFC/mfc1/stdafx.h
+++ b/Tests/MFC/mfc1/stdafx.h
@@ -61,11 +61,10 @@
// messages
#define _AFX_ALL_WARNINGS
-#include <afxdisp.h> // MFC Automation classes
-#include <afxext.h> // MFC extensions
-#include <afxwin.h> // MFC core and standard components
-
+#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
+#include <afxext.h> // MFC extensions
+#include <afxwin.h> // MFC core and standard components
#ifndef _AFX_NO_AFXCMN_SUPPORT
# include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
diff --git a/Tests/MacRuntimePath/A/framework.cpp b/Tests/MacRuntimePath/A/framework.cpp
index abda195ed..b5a95d89d 100644
--- a/Tests/MacRuntimePath/A/framework.cpp
+++ b/Tests/MacRuntimePath/A/framework.cpp
@@ -1,5 +1,6 @@
#include "framework.h"
+
#include "stdio.h"
void framework()
diff --git a/Tests/MacRuntimePath/A/framework2.cpp b/Tests/MacRuntimePath/A/framework2.cpp
index d3c2c458d..0a1beecab 100644
--- a/Tests/MacRuntimePath/A/framework2.cpp
+++ b/Tests/MacRuntimePath/A/framework2.cpp
@@ -1,5 +1,6 @@
#include "framework2.h"
+
#include "stdio.h"
void framework2()
diff --git a/Tests/MacRuntimePath/A/shared.cpp b/Tests/MacRuntimePath/A/shared.cpp
index e5e7dc5ae..13791c269 100644
--- a/Tests/MacRuntimePath/A/shared.cpp
+++ b/Tests/MacRuntimePath/A/shared.cpp
@@ -1,5 +1,6 @@
#include "shared.h"
+
#include "stdio.h"
void shared()
diff --git a/Tests/MathTest/CMakeLists.txt b/Tests/MathTest/CMakeLists.txt
index 5403d297c..396f633c6 100644
--- a/Tests/MathTest/CMakeLists.txt
+++ b/Tests/MathTest/CMakeLists.txt
@@ -16,6 +16,8 @@ set(expressions
"1000 -12*5"
"1000 +12*-5"
"1000 -12*-5"
+ "~~1"
+ "1000 & ~0"
)
set(FILE_EXPRESSIONS "extern void test_expression(int x, int y, const char * text);\n")
diff --git a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
index 4a41a988d..c5cd03e06 100644
--- a/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
+++ b/Tests/Module/CheckIPOSupported-C/CMakeLists.txt
@@ -13,8 +13,18 @@ elseif(CMake_TEST_IPO_WORKS_C)
endif()
add_library(foo foo.c)
+if(NOT CYGWIN AND (NOT WIN32 OR "x${CMAKE_C_COMPILER_ID}" STREQUAL "xClang"))
+ add_library(bar SHARED bar.c)
+ if(WIN32)
+ # Bindexplib for clang supports LTO objects
+ set_target_properties(bar PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
+ endif()
+else()
+ # TODO: bindexplib doesn't support exporting IPO symbols with other compilers on Windows
+ add_library(bar STATIC bar.c)
+endif()
add_executable(CheckIPOSupported-C main.c)
-target_link_libraries(CheckIPOSupported-C PUBLIC foo)
+target_link_libraries(CheckIPOSupported-C PUBLIC foo bar)
enable_testing()
add_test(NAME CheckIPOSupported-C COMMAND CheckIPOSupported-C)
diff --git a/Tests/Module/CheckIPOSupported-C/bar.c b/Tests/Module/CheckIPOSupported-C/bar.c
new file mode 100644
index 000000000..680f21302
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-C/bar.c
@@ -0,0 +1,4 @@
+int bar()
+{
+ return 0x42;
+}
diff --git a/Tests/Module/CheckIPOSupported-C/main.c b/Tests/Module/CheckIPOSupported-C/main.c
index 99204abce..28ab26f64 100644
--- a/Tests/Module/CheckIPOSupported-C/main.c
+++ b/Tests/Module/CheckIPOSupported-C/main.c
@@ -1,8 +1,9 @@
int foo();
+int bar();
int main()
{
- if (foo() == 0) {
+ if (foo() != bar()) {
return 1;
}
return 0;
diff --git a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
index 1bb2b8496..237bf1d6d 100644
--- a/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
+++ b/Tests/Module/CheckIPOSupported-CXX/CMakeLists.txt
@@ -12,9 +12,20 @@ elseif(CMake_TEST_IPO_WORKS_CXX)
message(FATAL_ERROR "IPO expected to work, but the check failed:\n ${ipo_output}")
endif()
-add_library(foo foo.cpp)
+
+add_library(foo STATIC foo.cpp)
+if(NOT CYGWIN AND (NOT WIN32 OR "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"))
+ add_library(bar SHARED bar.cpp)
+ if(WIN32)
+ # Bindexplib for clang supports LTO objects
+ set_target_properties(bar PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
+ endif()
+else()
+ # TODO: bindexplib doesn't support exporting IPO symbols with other compilers on Windows
+ add_library(bar STATIC bar.cpp)
+endif()
add_executable(CheckIPOSupported-CXX main.cpp)
-target_link_libraries(CheckIPOSupported-CXX PUBLIC foo)
+target_link_libraries(CheckIPOSupported-CXX PUBLIC foo bar)
enable_testing()
add_test(NAME CheckIPOSupported-CXX COMMAND CheckIPOSupported-CXX)
diff --git a/Tests/Module/CheckIPOSupported-CXX/bar.cpp b/Tests/Module/CheckIPOSupported-CXX/bar.cpp
new file mode 100644
index 000000000..680f21302
--- /dev/null
+++ b/Tests/Module/CheckIPOSupported-CXX/bar.cpp
@@ -0,0 +1,4 @@
+int bar()
+{
+ return 0x42;
+}
diff --git a/Tests/Module/CheckIPOSupported-CXX/main.cpp b/Tests/Module/CheckIPOSupported-CXX/main.cpp
index 99204abce..28ab26f64 100644
--- a/Tests/Module/CheckIPOSupported-CXX/main.cpp
+++ b/Tests/Module/CheckIPOSupported-CXX/main.cpp
@@ -1,8 +1,9 @@
int foo();
+int bar();
int main()
{
- if (foo() == 0) {
+ if (foo() != bar()) {
return 1;
}
return 0;
diff --git a/Tests/NewlineArgs/cxxonly.cxx b/Tests/NewlineArgs/cxxonly.cxx
index 9e6f91820..33b26dc29 100644
--- a/Tests/NewlineArgs/cxxonly.cxx
+++ b/Tests/NewlineArgs/cxxonly.cxx
@@ -1,8 +1,8 @@
+#include <stdio.h>
+
#include "libcxx1.h"
#include "libcxx2.h"
-#include <stdio.h>
-
int main()
{
if (LibCxx1Class::Method() != 2.0) {
diff --git a/Tests/ObjC++/CMakeLists.txt b/Tests/ObjC++/CMakeLists.txt
deleted file mode 100644
index 8b1563ed8..000000000
--- a/Tests/ObjC++/CMakeLists.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# a simple objc++ test case that uses Cocoa framework
-project (ObjC++)
-
-add_executable (ObjC++ objc++.mm)
-target_link_libraries(ObjC++ "-framework Cocoa")
-
diff --git a/Tests/ObjC/CMakeLists.txt b/Tests/ObjC/CMakeLists.txt
new file mode 100644
index 000000000..ce3033c03
--- /dev/null
+++ b/Tests/ObjC/CMakeLists.txt
@@ -0,0 +1,4 @@
+ADD_TEST_MACRO(ObjC.simple-build-test simple-build-test)
+ADD_TEST_MACRO(ObjC.c-file-extension-test c-file-extension-test)
+ADD_TEST_MACRO(ObjC.cxx-file-extension-test cxx-file-extension-test)
+ADD_TEST_MACRO(ObjC.objc-file-extension-test objc-file-extension-test)
diff --git a/Tests/ObjC/c-file-extension-test/CMakeLists.txt b/Tests/ObjC/c-file-extension-test/CMakeLists.txt
new file mode 100644
index 000000000..e09144820
--- /dev/null
+++ b/Tests/ObjC/c-file-extension-test/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(c-file-extension-test C)
+
+add_executable(c-file-extension-test main.m)
diff --git a/Tests/ObjC/c-file-extension-test/main.m b/Tests/ObjC/c-file-extension-test/main.m
new file mode 100644
index 000000000..1c159a9af
--- /dev/null
+++ b/Tests/ObjC/c-file-extension-test/main.m
@@ -0,0 +1,8 @@
+#ifndef __OBJC__
+# error "Compiler cannot compile Objective-C"
+#endif
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/ObjC/cxx-file-extension-test/CMakeLists.txt b/Tests/ObjC/cxx-file-extension-test/CMakeLists.txt
new file mode 100644
index 000000000..eb065e46d
--- /dev/null
+++ b/Tests/ObjC/cxx-file-extension-test/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(cxx-file-extension-test)
+
+string(APPEND CMAKE_CXX_FLAGS " -std=c++11")
+set(CMAKE_CXX_STANDARD 14)
+
+add_executable(cxx-file-extension-test main.m)
diff --git a/Tests/ObjC/cxx-file-extension-test/main.m b/Tests/ObjC/cxx-file-extension-test/main.m
new file mode 100644
index 000000000..1c159a9af
--- /dev/null
+++ b/Tests/ObjC/cxx-file-extension-test/main.m
@@ -0,0 +1,8 @@
+#ifndef __OBJC__
+# error "Compiler cannot compile Objective-C"
+#endif
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/ObjC/objc-file-extension-test/CMakeLists.txt b/Tests/ObjC/objc-file-extension-test/CMakeLists.txt
new file mode 100644
index 000000000..27e88be68
--- /dev/null
+++ b/Tests/ObjC/objc-file-extension-test/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(objc-file-extension-test OBJC CXX)
+
+add_executable(objc-file-extension-test main.m)
+target_link_libraries(objc-file-extension-test "-framework Foundation")
diff --git a/Tests/ObjC/objc-file-extension-test/main.m b/Tests/ObjC/objc-file-extension-test/main.m
new file mode 100644
index 000000000..2ec391704
--- /dev/null
+++ b/Tests/ObjC/objc-file-extension-test/main.m
@@ -0,0 +1,12 @@
+#ifndef __OBJC__
+# error "Compiler is not an Objective-C compiler."
+#endif
+
+#import <Foundation/Foundation.h>
+
+int main()
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [pool release];
+ return 0;
+}
diff --git a/Tests/ObjC/simple-build-test/CMakeLists.txt b/Tests/ObjC/simple-build-test/CMakeLists.txt
new file mode 100644
index 000000000..5ab46acd7
--- /dev/null
+++ b/Tests/ObjC/simple-build-test/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required(VERSION 3.15)
+
+set(CMAKE_MACOSX_RPATH OFF)
+
+project(simple-build-test OBJC)
+
+add_library(foo SHARED foo.m)
+target_link_libraries(foo "-framework Foundation")
+
+add_executable(simple-build-test main.m)
+target_link_libraries(simple-build-test "-framework Foundation" foo)
diff --git a/Tests/ObjC/simple-build-test/foo.h b/Tests/ObjC/simple-build-test/foo.h
new file mode 100644
index 000000000..b3fb084c1
--- /dev/null
+++ b/Tests/ObjC/simple-build-test/foo.h
@@ -0,0 +1,9 @@
+#import <Foundation/Foundation.h>
+
+@interface Foo : NSObject {
+ NSNumber* age;
+}
+
+@property (nonatomic, retain) NSNumber* age;
+
+@end
diff --git a/Tests/ObjC/simple-build-test/foo.m b/Tests/ObjC/simple-build-test/foo.m
new file mode 100644
index 000000000..2d452a8e5
--- /dev/null
+++ b/Tests/ObjC/simple-build-test/foo.m
@@ -0,0 +1,7 @@
+#import "foo.h"
+
+@implementation Foo
+
+@synthesize age;
+
+@end
diff --git a/Tests/ObjC/simple-build-test/main.m b/Tests/ObjC/simple-build-test/main.m
new file mode 100644
index 000000000..970d5548e
--- /dev/null
+++ b/Tests/ObjC/simple-build-test/main.m
@@ -0,0 +1,12 @@
+#import <Foundation/Foundation.h>
+#import "foo.h"
+
+int main(int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ Foo *theFoo = [[Foo alloc] init];
+ theFoo.age = [NSNumber numberWithInt:argc];
+ NSLog(@"%d\n",[theFoo.age intValue]);
+ [pool release];
+ return 0;
+}
diff --git a/Tests/ObjCXX/CMakeLists.txt b/Tests/ObjCXX/CMakeLists.txt
new file mode 100644
index 000000000..a2a907a67
--- /dev/null
+++ b/Tests/ObjCXX/CMakeLists.txt
@@ -0,0 +1,4 @@
+ADD_TEST_MACRO(ObjCXX.ObjC++ ObjC++)
+ADD_TEST_MACRO(ObjCXX.simple-build-test simple-build-test)
+ADD_TEST_MACRO(ObjCXX.cxx-file-extension-test cxx-file-extension-test)
+ADD_TEST_MACRO(ObjCXX.objcxx-file-extension-test objcxx-file-extension-test)
diff --git a/Tests/ObjCXX/ObjC++/CMakeLists.txt b/Tests/ObjCXX/ObjC++/CMakeLists.txt
new file mode 100644
index 000000000..5ba5db2ed
--- /dev/null
+++ b/Tests/ObjCXX/ObjC++/CMakeLists.txt
@@ -0,0 +1,5 @@
+# a simple objc++ test case that uses Cocoa framework
+project (ObjC++)
+
+add_executable (ObjC++ objc++.mm)
+target_link_libraries(ObjC++ "-framework Cocoa")
diff --git a/Tests/ObjC++/objc++.mm b/Tests/ObjCXX/ObjC++/objc++.mm
index 258ebaa52..258ebaa52 100644
--- a/Tests/ObjC++/objc++.mm
+++ b/Tests/ObjCXX/ObjC++/objc++.mm
diff --git a/Tests/ObjCXX/cxx-file-extension-test/CMakeLists.txt b/Tests/ObjCXX/cxx-file-extension-test/CMakeLists.txt
new file mode 100644
index 000000000..0b33875d9
--- /dev/null
+++ b/Tests/ObjCXX/cxx-file-extension-test/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(cxx-file-extension-test CXX)
+
+add_executable(cxx-file-extension-test main.mm)
diff --git a/Tests/ObjCXX/cxx-file-extension-test/main.mm b/Tests/ObjCXX/cxx-file-extension-test/main.mm
new file mode 100644
index 000000000..1c159a9af
--- /dev/null
+++ b/Tests/ObjCXX/cxx-file-extension-test/main.mm
@@ -0,0 +1,8 @@
+#ifndef __OBJC__
+# error "Compiler cannot compile Objective-C"
+#endif
+
+int main()
+{
+ return 0;
+}
diff --git a/Tests/ObjCXX/objcxx-file-extension-test/CMakeLists.txt b/Tests/ObjCXX/objcxx-file-extension-test/CMakeLists.txt
new file mode 100644
index 000000000..eda7bbaeb
--- /dev/null
+++ b/Tests/ObjCXX/objcxx-file-extension-test/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(objcxx-file-extension-test OBJCXX CXX)
+
+add_executable(objcxx-file-extension-test main.mm)
+target_link_libraries(objcxx-file-extension-test "-framework Foundation")
diff --git a/Tests/ObjCXX/objcxx-file-extension-test/main.mm b/Tests/ObjCXX/objcxx-file-extension-test/main.mm
new file mode 100644
index 000000000..d4aa1bba3
--- /dev/null
+++ b/Tests/ObjCXX/objcxx-file-extension-test/main.mm
@@ -0,0 +1,14 @@
+#ifndef __OBJC__
+# error "Compiler is not an Objective-C compiler."
+#endif
+
+#import <Foundation/Foundation.h>
+#include <iostream>
+
+int main()
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ std::cout << "Hello World" << std::endl;
+ [pool release];
+ return 0;
+}
diff --git a/Tests/ObjCXX/simple-build-test/CMakeLists.txt b/Tests/ObjCXX/simple-build-test/CMakeLists.txt
new file mode 100644
index 000000000..cf276834a
--- /dev/null
+++ b/Tests/ObjCXX/simple-build-test/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required(VERSION 3.15)
+
+set(CMAKE_MACOSX_RPATH OFF)
+
+project(simple-build-test OBJCXX)
+
+add_library(foo SHARED foo.mm)
+target_link_libraries(foo "-framework Foundation")
+
+add_executable(simple-build-test main.mm)
+target_link_libraries(simple-build-test "-framework Foundation" foo)
diff --git a/Tests/ObjCXX/simple-build-test/foo.h b/Tests/ObjCXX/simple-build-test/foo.h
new file mode 100644
index 000000000..b3fb084c1
--- /dev/null
+++ b/Tests/ObjCXX/simple-build-test/foo.h
@@ -0,0 +1,9 @@
+#import <Foundation/Foundation.h>
+
+@interface Foo : NSObject {
+ NSNumber* age;
+}
+
+@property (nonatomic, retain) NSNumber* age;
+
+@end
diff --git a/Tests/ObjCXX/simple-build-test/foo.mm b/Tests/ObjCXX/simple-build-test/foo.mm
new file mode 100644
index 000000000..2d452a8e5
--- /dev/null
+++ b/Tests/ObjCXX/simple-build-test/foo.mm
@@ -0,0 +1,7 @@
+#import "foo.h"
+
+@implementation Foo
+
+@synthesize age;
+
+@end
diff --git a/Tests/ObjCXX/simple-build-test/main.mm b/Tests/ObjCXX/simple-build-test/main.mm
new file mode 100644
index 000000000..7c85551f0
--- /dev/null
+++ b/Tests/ObjCXX/simple-build-test/main.mm
@@ -0,0 +1,14 @@
+#import <Foundation/Foundation.h>
+#import "foo.h"
+#include <iostream>
+
+int main(int argc, char **argv)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ Foo *theFoo = [[Foo alloc] init];
+ theFoo.age = [NSNumber numberWithInt:argc];
+ NSLog(@"%d\n",[theFoo.age intValue]);
+ std::cout << [theFoo.age intValue] << std::endl;
+ [pool release];
+ return 0;
+}
diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt
index 6d8d6cc00..44194ca1a 100644
--- a/Tests/PDBDirectoryAndName/CMakeLists.txt
+++ b/Tests/PDBDirectoryAndName/CMakeLists.txt
@@ -3,8 +3,8 @@ cmake_policy(SET CMP0054 NEW)
project(PDBDirectoryAndName C)
# Make sure the proper compiler is in use.
-if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
- message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel")
+if(NOT MSVC AND NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC, Clang or Intel")
endif()
# Intel 11.1 does not support /Fd but Intel 14.0 does.
diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt
index 8e8fa0759..729bba347 100644
--- a/Tests/Plugin/CMakeLists.txt
+++ b/Tests/Plugin/CMakeLists.txt
@@ -10,14 +10,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/static)
-# We need the dynamic loader support from KWSys to load the plugin in
-# the executable.
-set(KWSYS_NAMESPACE kwsys)
-set(KWSYS_HEADER_ROOT ${Plugin_BINARY_DIR}/include)
-set(KWSYS_USE_DynamicLoader 1)
-set(KWSYS_ENCODING_DEFAULT_CODEPAGE CP_UTF8)
-add_subdirectory(${Plugin_SOURCE_DIR}/../../Source/kwsys src/kwsys)
-
# Configure the location of plugins.
configure_file(${Plugin_SOURCE_DIR}/src/example_exe.h.in
${Plugin_BINARY_DIR}/include/example_exe.h @ONLY)
@@ -36,14 +28,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND
endif()
# Create an executable that exports an API for use by plugins.
-add_executable(example_exe src/example_exe.cxx)
+add_executable(example_exe src/example_exe.cxx src/DynamicLoader.cxx)
set_target_properties(example_exe PROPERTIES
ENABLE_EXPORTS 1
OUTPUT_NAME example
# Test placing exe import library in unique directory.
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/exe
)
-target_link_libraries(example_exe kwsys)
+target_link_libraries(example_exe ${CMAKE_DL_LIBS})
# Create a plugin that uses the API provided by the executable.
# This module "links" to the executable to use the symbols.
diff --git a/Tests/Plugin/include/DynamicLoader.hxx b/Tests/Plugin/include/DynamicLoader.hxx
new file mode 100644
index 000000000..20b37de16
--- /dev/null
+++ b/Tests/Plugin/include/DynamicLoader.hxx
@@ -0,0 +1,49 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.
+ See https://cmake.org/licensing#kwsys for details. */
+#ifndef DynamicLoader_hxx
+#define DynamicLoader_hxx
+
+#include <string>
+
+#if defined(__hpux)
+# include <dl.h>
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+# include <windows.h>
+#elif defined(__APPLE__)
+# include <AvailabilityMacros.h>
+# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
+# include <mach-o/dyld.h>
+# endif
+#elif defined(__BEOS__)
+# include <be/kernel/image.h>
+#endif
+
+class DynamicLoader
+{
+public:
+#if defined(__hpux)
+ typedef shl_t LibraryHandle;
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+ typedef HMODULE LibraryHandle;
+#elif defined(__APPLE__)
+# if MAC_OS_X_VERSION_MAX_ALLOWED < 1030
+ typedef NSModule LibraryHandle;
+# else
+ typedef void* LibraryHandle;
+# endif
+#elif defined(__BEOS__)
+ typedef image_id LibraryHandle;
+#else // POSIX
+ typedef void* LibraryHandle;
+#endif
+
+ typedef void (*SymbolPointer)();
+
+ static LibraryHandle OpenLibrary(const std::string&);
+
+ static int CloseLibrary(LibraryHandle);
+
+ static SymbolPointer GetSymbolAddress(LibraryHandle, const std::string&);
+};
+
+#endif
diff --git a/Tests/Plugin/src/DynamicLoader.cxx b/Tests/Plugin/src/DynamicLoader.cxx
new file mode 100644
index 000000000..d4a26372b
--- /dev/null
+++ b/Tests/Plugin/src/DynamicLoader.cxx
@@ -0,0 +1,263 @@
+/* Distributed under the OSI-approved BSD 3-Clause License.
+ See https://cmake.org/licensing#kwsys for details. */
+#if defined(_WIN32)
+# define NOMINMAX // hide min,max to not conflict with <limits>
+#endif
+
+#include <DynamicLoader.hxx>
+
+#if defined(__hpux)
+# include <dl.h>
+
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(
+ const std::string& libname)
+{
+ return shl_load(libname.c_str(), BIND_DEFERRED | DYNAMIC_PATH, 0L);
+}
+
+int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
+{
+ if (!lib) {
+ return 0;
+ }
+ return !shl_unload(lib);
+}
+
+DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
+{
+ void* addr;
+ int status;
+
+ /* TYPE_PROCEDURE Look for a function or procedure. (This used to be default)
+ * TYPE_DATA Look for a symbol in the data segment (for example,
+ * variables).
+ * TYPE_UNDEFINED Look for any symbol.
+ */
+ status = shl_findsym(&lib, sym.c_str(), TYPE_UNDEFINED, &addr);
+ void* result = (status < 0) ? (void*)0 : addr;
+
+ // Hack to cast pointer-to-data to pointer-to-function.
+ return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
+}
+
+#elif defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED < 1030)
+# include <mach-o/dyld.h>
+
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(
+ const std::string& libname)
+{
+ NSObjectFileImageReturnCode rc;
+ NSObjectFileImage image = 0;
+
+ rc = NSCreateObjectFileImageFromFile(libname.c_str(), &image);
+ // rc == NSObjectFileImageInappropriateFile when trying to load a dylib file
+ if (rc != NSObjectFileImageSuccess) {
+ return 0;
+ }
+ NSModule handle = NSLinkModule(image, libname.c_str(),
+ NSLINKMODULE_OPTION_BINDNOW |
+ NSLINKMODULE_OPTION_RETURN_ON_ERROR);
+ NSDestroyObjectFileImage(image);
+ return handle;
+}
+
+int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
+{
+ bool success = NSUnLinkModule(lib, NSUNLINKMODULE_OPTION_NONE);
+ return success;
+}
+
+DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
+{
+ void* result = 0;
+ // Need to prepend symbols with '_' on Apple-gcc compilers
+ std::string rsym = '_' + sym;
+
+ NSSymbol symbol = NSLookupSymbolInModule(lib, rsym.c_str());
+ if (symbol) {
+ result = NSAddressOfSymbol(symbol);
+ }
+
+ // Hack to cast pointer-to-data to pointer-to-function.
+ return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
+}
+
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+# include <windows.h>
+
+# include <stdio.h>
+
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(
+ const std::string& libname)
+{
+ DynamicLoader::LibraryHandle lh;
+ int length = MultiByteToWideChar(CP_UTF8, 0, libname.c_str(), -1, NULL, 0);
+ wchar_t* wchars = new wchar_t[length + 1];
+ wchars[0] = '\0';
+ MultiByteToWideChar(CP_UTF8, 0, libname.c_str(), -1, wchars, length);
+ lh = LoadLibraryW(wchars);
+ delete[] wchars;
+ return lh;
+}
+
+int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
+{
+ return (int)FreeLibrary(lib);
+}
+
+DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
+{
+ void* result;
+# if defined(__BORLANDC__) || defined(__WATCOMC__)
+ // Need to prepend symbols with '_'
+ std::string ssym = '_' + sym;
+ const char* rsym = ssym.c_str();
+# else
+ const char* rsym = sym.c_str();
+# endif
+ result = (void*)GetProcAddress(lib, rsym);
+// Hack to cast pointer-to-data to pointer-to-function.
+# ifdef __WATCOMC__
+ return *(DynamicLoader::SymbolPointer*)(&result);
+# else
+ return *reinterpret_cast<DynamicLoader::SymbolPointer*>(&result);
+# endif
+}
+
+#elif defined(__BEOS__)
+# include <be/kernel/image.h>
+# include <be/support/Errors.h>
+
+static image_id last_dynamic_err = B_OK;
+
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(
+ const std::string& libname)
+{
+ // image_id's are integers, errors are negative. Add one just in case we
+ // get a valid image_id of zero (is that even possible?).
+ image_id rc = load_add_on(libname.c_str());
+ if (rc < 0) {
+ last_dynamic_err = rc;
+ return 0;
+ }
+
+ return rc + 1;
+}
+
+int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
+{
+ if (!lib) {
+ last_dynamic_err = B_BAD_VALUE;
+ return 0;
+ } else {
+ // The function dlclose() returns 0 on success, and non-zero on error.
+ status_t rc = unload_add_on(lib - 1);
+ if (rc != B_OK) {
+ last_dynamic_err = rc;
+ return 0;
+ }
+ }
+
+ return 1;
+}
+
+DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
+{
+ // Hack to cast pointer-to-data to pointer-to-function.
+ union
+ {
+ void* pvoid;
+ DynamicLoader::SymbolPointer psym;
+ } result;
+
+ result.psym = NULL;
+
+ if (!lib) {
+ last_dynamic_err = B_BAD_VALUE;
+ } else {
+ // !!! FIXME: BeOS can do function-only lookups...does this ever
+ // !!! FIXME: actually _want_ a data symbol lookup, or was this union
+ // !!! FIXME: a leftover of dlsym()? (s/ANY/TEXT for functions only).
+ status_t rc =
+ get_image_symbol(lib - 1, sym.c_str(), B_SYMBOL_TYPE_ANY, &result.pvoid);
+ if (rc != B_OK) {
+ last_dynamic_err = rc;
+ result.psym = NULL;
+ }
+ }
+ return result.psym;
+}
+
+#elif defined(__MINT__)
+# define _GNU_SOURCE /* for program_invocation_name */
+# include <dld.h>
+# include <errno.h>
+# include <malloc.h>
+
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(
+ const std::string& libname)
+{
+ char* name = (char*)calloc(1, libname.size() + 1);
+ dld_init(program_invocation_name);
+ strncpy(name, libname.c_str(), libname.size());
+ dld_link(libname.c_str());
+ return (void*)name;
+}
+
+int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
+{
+ dld_unlink_by_file((char*)lib, 0);
+ free(lib);
+ return 0;
+}
+
+DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
+{
+ // Hack to cast pointer-to-data to pointer-to-function.
+ union
+ {
+ void* pvoid;
+ DynamicLoader::SymbolPointer psym;
+ } result;
+ result.pvoid = dld_get_symbol(sym.c_str());
+ return result.psym;
+}
+
+#else
+# include <dlfcn.h>
+
+DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(
+ const std::string& libname)
+{
+ return dlopen(libname.c_str(), RTLD_LAZY);
+}
+
+int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
+{
+ if (lib) {
+ // The function dlclose() returns 0 on success, and non-zero on error.
+ return !dlclose(lib);
+ }
+ // else
+ return 0;
+}
+
+DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
+ DynamicLoader::LibraryHandle lib, const std::string& sym)
+{
+ // Hack to cast pointer-to-data to pointer-to-function.
+ union
+ {
+ void* pvoid;
+ DynamicLoader::SymbolPointer psym;
+ } result;
+ result.pvoid = dlsym(lib, sym.c_str());
+ return result.psym;
+}
+
+#endif
diff --git a/Tests/Plugin/src/example_exe.cxx b/Tests/Plugin/src/example_exe.cxx
index 257a35ca5..bc4c727f1 100644
--- a/Tests/Plugin/src/example_exe.cxx
+++ b/Tests/Plugin/src/example_exe.cxx
@@ -1,14 +1,12 @@
-#include <kwsys/DynamicLoader.hxx>
-
-#include <example.h>
-
-#include <example_exe.h>
-
#include <iostream>
#include <string>
+#include <example.h>
+#include <example_exe.h>
#include <stdio.h>
+#include "DynamicLoader.hxx"
+
// Implement the ABI used by plugins.
extern "C" int example_exe_function()
{
@@ -24,20 +22,17 @@ extern "C" int example_exe_function()
int main()
{
- std::string libName = EXAMPLE_EXE_PLUGIN_DIR CONFIG_DIR "/";
- libName += kwsys::DynamicLoader::LibPrefix();
- libName += "example_mod_1";
- libName += kwsys::DynamicLoader::LibExtension();
- kwsys::DynamicLoader::LibraryHandle handle =
- kwsys::DynamicLoader::OpenLibrary(libName.c_str());
+ std::string const libName = EXAMPLE_EXE_PLUGIN_DIR CONFIG_DIR
+ "/" EXAMPLE_EXE_MOD_PREFIX "example_mod_1" EXAMPLE_EXE_MOD_SUFFIX;
+ DynamicLoader::LibraryHandle handle = DynamicLoader::OpenLibrary(libName);
if (!handle) {
// Leave the .c_str() on this one. It is needed on OpenWatcom.
std::cerr << "Could not open plugin \"" << libName.c_str() << "\"!"
<< std::endl;
return 1;
}
- kwsys::DynamicLoader::SymbolPointer sym =
- kwsys::DynamicLoader::GetSymbolAddress(handle, "example_mod_1_function");
+ DynamicLoader::SymbolPointer sym =
+ DynamicLoader::GetSymbolAddress(handle, "example_mod_1_function");
if (!sym) {
std::cerr << "Could not get plugin symbol \"example_mod_1_function\"!"
<< std::endl;
@@ -52,6 +47,6 @@ int main()
std::cerr << "Incorrect return value from plugin!" << std::endl;
return 1;
}
- kwsys::DynamicLoader::CloseLibrary(handle);
+ DynamicLoader::CloseLibrary(handle);
return 0;
}
diff --git a/Tests/Plugin/src/example_exe.h.in b/Tests/Plugin/src/example_exe.h.in
index 62f0d9f02..af71021a5 100644
--- a/Tests/Plugin/src/example_exe.h.in
+++ b/Tests/Plugin/src/example_exe.h.in
@@ -2,5 +2,7 @@
#define example_exe_h
#define EXAMPLE_EXE_PLUGIN_DIR "@CMAKE_LIBRARY_OUTPUT_DIRECTORY@"
+#define EXAMPLE_EXE_MOD_PREFIX "@CMAKE_SHARED_MODULE_PREFIX@"
+#define EXAMPLE_EXE_MOD_SUFFIX "@CMAKE_SHARED_MODULE_SUFFIX@"
#endif
diff --git a/Tests/Plugin/src/example_mod_1.c b/Tests/Plugin/src/example_mod_1.c
index 87b559d2f..2b740b8db 100644
--- a/Tests/Plugin/src/example_mod_1.c
+++ b/Tests/Plugin/src/example_mod_1.c
@@ -1,5 +1,4 @@
#include <example.h>
-
#include <stdio.h>
#if defined(_WIN32)
diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt
index 588af0320..bce1b3f07 100644
--- a/Tests/Preprocess/CMakeLists.txt
+++ b/Tests/Preprocess/CMakeLists.txt
@@ -29,7 +29,10 @@ if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
set(PP_VS 1)
endif()
if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND
- "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" AND
+ "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
+ set(CLANG_MSVC_WINDOWS 1)
+endif()
+if(CLANG_MSVC_WINDOWS AND
"x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xGNU")
set(CLANG_GNULIKE_WINDOWS 1)
endif()
@@ -106,7 +109,7 @@ endif()
set(EXPR_OP1 "/")
if((NOT MSVC OR PP_NMAKE) AND
NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND
- NOT CLANG_GNULIKE_WINDOWS)
+ NOT CLANG_MSVC_WINDOWS)
# MSVC cl, Intel icl: %
# When the cl compiler is invoked from the command line then % must
# be written %% (to distinguish from %ENV% syntax). However cl does
diff --git a/Tests/Qt4Targets/main.cpp b/Tests/Qt4Targets/main.cpp
index f8eacdcdc..fc7f580bd 100644
--- a/Tests/Qt4Targets/main.cpp
+++ b/Tests/Qt4Targets/main.cpp
@@ -1,8 +1,7 @@
#include <QApplication>
-#include <QWidget>
-
#include <QString>
+#include <QWidget>
#ifndef QT_CORE_LIB
# error Expected QT_CORE_LIB
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp
index e498969e9..c7c6863d5 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.cpp
@@ -1,5 +1,6 @@
#include "a_qt.hpp"
+
#include <a_mc.hpp>
namespace a_qt {
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp
index e2387ee11..fafc8a20e 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/a_qt.hpp
@@ -1,10 +1,12 @@
#ifndef A_QT_HPP
#define A_QT_HPP
-#include <QObject>
-#include <config.hpp>
#include <string>
+#include <config.hpp>
+
+#include <QObject>
+
namespace a_qt {
/// @brief A header local QObject based class
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp
index f72f6ca9f..c5adaebda 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.cpp
@@ -1,5 +1,6 @@
#include "b_qt.hpp"
+
#include <b_mc.hpp>
namespace b_qt {
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp
index d7f0311a6..b798e71ca 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/b_qt.hpp
@@ -1,10 +1,12 @@
#ifndef B_QT_HPP
#define B_QT_HPP
-#include <QObject>
-#include <config.hpp>
#include <string>
+#include <config.hpp>
+
+#include <QObject>
+
namespace b_qt {
/// @brief A header local QObject based class
diff --git a/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp b/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp
index a3425f14c..3fb6c7095 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOff/main.cpp
@@ -1,7 +1,8 @@
+#include <string>
+
#include <a_qt.hpp>
#include <b_qt.hpp>
-#include <string>
int main()
{
diff --git a/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp
index 408335bd2..55457d212 100644
--- a/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp
+++ b/Tests/QtAutogen/AutogenOriginDependsOn/testGenLib.hpp
@@ -1,9 +1,10 @@
#ifndef TEST3_HPP
#define TEST3_HPP
-#include "simpleLib.hpp"
#include <QObject>
+#include "simpleLib.hpp"
+
// This object triggers the AUTOMOC on this file
class LObject : public QObject
{
diff --git a/Tests/QtAutogen/Complex/Adir/libA.h b/Tests/QtAutogen/Complex/Adir/libA.h
index c4eb9f7dc..a8ca20907 100644
--- a/Tests/QtAutogen/Complex/Adir/libA.h
+++ b/Tests/QtAutogen/Complex/Adir/libA.h
@@ -2,10 +2,10 @@
#ifndef LIBA_H
#define LIBA_H
-#include "liba_export.h"
-
#include <QObject>
+#include "liba_export.h"
+
class LIBA_EXPORT LibA : public QObject
{
Q_OBJECT
diff --git a/Tests/QtAutogen/Complex/Bdir/libB.h b/Tests/QtAutogen/Complex/Bdir/libB.h
index e4ab788c0..38dae87cb 100644
--- a/Tests/QtAutogen/Complex/Bdir/libB.h
+++ b/Tests/QtAutogen/Complex/Bdir/libB.h
@@ -2,10 +2,10 @@
#ifndef LIBB_H
#define LIBB_H
-#include "libb_export.h"
+#include <QObject>
#include "libA.h"
-#include <QObject>
+#include "libb_export.h"
class LIBB_EXPORT LibB : public QObject
{
diff --git a/Tests/QtAutogen/Complex/abc.cpp b/Tests/QtAutogen/Complex/abc.cpp
index 2929b92ee..4c7dc52cb 100644
--- a/Tests/QtAutogen/Complex/abc.cpp
+++ b/Tests/QtAutogen/Complex/abc.cpp
@@ -1,10 +1,11 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "abc.h"
-#include "abc_p.h"
#include <stdio.h>
+#include "abc_p.h"
+
class PrintAbc : public QObject
{
Q_OBJECT
diff --git a/Tests/QtAutogen/Complex/abc_p.h b/Tests/QtAutogen/Complex/abc_p.h
index be984876c..1f6102cd0 100644
--- a/Tests/QtAutogen/Complex/abc_p.h
+++ b/Tests/QtAutogen/Complex/abc_p.h
@@ -3,10 +3,10 @@
#ifndef ABC_P_H
#define ABC_P_H
-#include <QObject>
-
#include <stdio.h>
+#include <QObject>
+
class AbcP : public QObject
{
Q_OBJECT
diff --git a/Tests/QtAutogen/Complex/calwidget.cpp b/Tests/QtAutogen/Complex/calwidget.cpp
index 8ce53f14a..f58b18247 100644
--- a/Tests/QtAutogen/Complex/calwidget.cpp
+++ b/Tests/QtAutogen/Complex/calwidget.cpp
@@ -38,6 +38,8 @@
**
****************************************************************************/
+#include "calwidget.h"
+
#include <QCalendarWidget>
#include <QCheckBox>
#include <QComboBox>
@@ -47,8 +49,6 @@
#include <QLabel>
#include <QTextCharFormat>
-#include "calwidget.h"
-
#include "ui_calwidget.h"
#ifdef UI_CALWIDGET_H
# error Definition of UI_CALWIDGET_H should be disabled by file option.
diff --git a/Tests/QtAutogen/Complex/codeeditor.cpp b/Tests/QtAutogen/Complex/codeeditor.cpp
index 0caf8a7df..bb6f405ad 100644
--- a/Tests/QtAutogen/Complex/codeeditor.cpp
+++ b/Tests/QtAutogen/Complex/codeeditor.cpp
@@ -38,10 +38,10 @@
**
****************************************************************************/
-#include <QtGui>
-
#include "codeeditor.h"
+#include <QtGui>
+
CodeEditor::CodeEditor(QWidget* parent)
: QPlainTextEdit(parent)
{
diff --git a/Tests/QtAutogen/Complex/debug_class.cpp b/Tests/QtAutogen/Complex/debug_class.cpp
index 46b09e705..3aaf79a08 100644
--- a/Tests/QtAutogen/Complex/debug_class.cpp
+++ b/Tests/QtAutogen/Complex/debug_class.cpp
@@ -1,5 +1,6 @@
#include "debug_class.h"
+
#include "ui_debug_class.h"
DebugClass::DebugClass(QWidget* parent)
diff --git a/Tests/QtAutogen/Complex/libC.h b/Tests/QtAutogen/Complex/libC.h
index 3bc2bad54..51ea48d9e 100644
--- a/Tests/QtAutogen/Complex/libC.h
+++ b/Tests/QtAutogen/Complex/libC.h
@@ -2,10 +2,10 @@
#ifndef LIBC_H
#define LIBC_H
-#include "libc_export.h"
+#include <QObject>
#include "libB.h"
-#include <QObject>
+#include "libc_export.h"
class LIBC_EXPORT LibC : public QObject
{
diff --git a/Tests/QtAutogen/Complex/main.cpp b/Tests/QtAutogen/Complex/main.cpp
index b5b6ed173..12f649f03 100644
--- a/Tests/QtAutogen/Complex/main.cpp
+++ b/Tests/QtAutogen/Complex/main.cpp
@@ -52,8 +52,9 @@
#include "xyz.h"
#include "yaf.h"
#ifdef TEST_DEBUG_CLASS
-# include "debug_class.h"
# include <iostream>
+
+# include "debug_class.h"
#endif
int main(int argv, char** args)
diff --git a/Tests/QtAutogen/Complex/second_widget.cpp b/Tests/QtAutogen/Complex/second_widget.cpp
index c575f1013..9f51a80cd 100644
--- a/Tests/QtAutogen/Complex/second_widget.cpp
+++ b/Tests/QtAutogen/Complex/second_widget.cpp
@@ -1,5 +1,6 @@
#include "second_widget.h"
+
#include "ui_second_widget.h"
SecondWidget::SecondWidget(QWidget* parent)
diff --git a/Tests/QtAutogen/Complex/yaf.cpp b/Tests/QtAutogen/Complex/yaf.cpp
index 70e26aa95..10448c1bc 100644
--- a/Tests/QtAutogen/Complex/yaf.cpp
+++ b/Tests/QtAutogen/Complex/yaf.cpp
@@ -1,10 +1,11 @@
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "yaf.h"
-#include "yaf_p.h"
#include <stdio.h>
+#include "yaf_p.h"
+
Yaf::Yaf()
{
}
diff --git a/Tests/QtAutogen/Complex/yaf_p.h b/Tests/QtAutogen/Complex/yaf_p.h
index ea5eed69c..48fdd301c 100644
--- a/Tests/QtAutogen/Complex/yaf_p.h
+++ b/Tests/QtAutogen/Complex/yaf_p.h
@@ -3,10 +3,10 @@
#ifndef YAF_P_H
#define YAF_P_H
-#include <QObject>
-
#include <stdio.h>
+#include <QObject>
+
class YafP : public QObject
{
Q_OBJECT
diff --git a/Tests/QtAutogen/LowMinimumVersion/item.cpp b/Tests/QtAutogen/LowMinimumVersion/item.cpp
index e2f19b204..511a1caa8 100644
--- a/Tests/QtAutogen/LowMinimumVersion/item.cpp
+++ b/Tests/QtAutogen/LowMinimumVersion/item.cpp
@@ -1,4 +1,5 @@
#include "item.hpp"
+
#include <ui_view.h>
class MocLocal : public QObject
diff --git a/Tests/QtAutogen/MacOsFW/test/testMacosFWLib.cpp b/Tests/QtAutogen/MacOsFW/test/testMacosFWLib.cpp
index 3476d6176..edc93764a 100644
--- a/Tests/QtAutogen/MacOsFW/test/testMacosFWLib.cpp
+++ b/Tests/QtAutogen/MacOsFW/test/testMacosFWLib.cpp
@@ -1,8 +1,9 @@
+#include "testMacosFWLib.h"
+
#include <QObject>
#include <QString>
#include "macos_fw_lib.h"
-#include "testMacosFWLib.h"
class TestMacosFWLib : public QObject
{
diff --git a/Tests/QtAutogen/MocCMP0071/Obj.cpp b/Tests/QtAutogen/MocCMP0071/Obj.cpp
index 1ae50edc9..25a291d31 100644
--- a/Tests/QtAutogen/MocCMP0071/Obj.cpp
+++ b/Tests/QtAutogen/MocCMP0071/Obj.cpp
@@ -1,4 +1,5 @@
#include "Obj.hpp"
+
#include "Obj_p.h"
ObjPrivate::ObjPrivate()
diff --git a/Tests/QtAutogen/MocInclude/CMakeLists.txt b/Tests/QtAutogen/MocInclude/CMakeLists.txt
new file mode 100644
index 000000000..04c8bafb7
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/CMakeLists.txt
@@ -0,0 +1,112 @@
+cmake_minimum_required(VERSION 3.15)
+project(MocInclude)
+get_filename_component(CS_REAL ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
+include("${CS_REAL}/../AutogenCoreTest.cmake")
+
+# Test moc include patterns
+
+set(COM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Common")
+
+macro(addCopyCommand from to)
+ add_custom_command(
+ OUTPUT ${to}
+ COMMAND ${CMAKE_COMMAND} -E copy ${from} ${to}
+ DEPENDS ${from})
+endmacro()
+
+# Create an executable
+function(makeExecutable TARGET_NAME)
+ # Utility variables
+ set(CB_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+
+ # Copy directory
+ file(REMOVE_RECURSE "${CB_DIR}/InIncludes")
+ file(COPY "${COM_DIR}/InIncludes.in" DESTINATION "${CB_DIR}")
+ file(RENAME "${CB_DIR}/InIncludes.in" "${CB_DIR}/InIncludes")
+
+ # Generate .moc file from the header externally and
+ # enabled SKIP_AUTOMOC on the source file
+ qtx_wrap_cpp(ExternDotMOC ${COM_DIR}/ExternDot.hpp OPTIONS "-p" "./")
+ addCopyCommand(${ExternDotMOC}
+ ${CB_DIR}/ExternDot.moc)
+ set_property(
+ SOURCE ${COM_DIR}/ExternDot.cpp
+ PROPERTY SKIP_AUTOMOC ON)
+
+ # Generate .moc file from the GENERATED header externally
+ # and enabled SKIP_AUTOMOC on the source file
+ addCopyCommand(${COM_DIR}/ExternDotGenerated.hpp.in
+ ${CB_DIR}/ExternDotGenerated.hpp)
+ addCopyCommand(${COM_DIR}/ExternDotGenerated.cpp.in
+ ${CB_DIR}/ExternDotGenerated.cpp)
+ qtx_wrap_cpp(ExternDotGeneratedMOC
+ ${CB_DIR}/ExternDotGenerated.hpp
+ OPTIONS "-p" "./")
+ addCopyCommand(${ExternDotGeneratedMOC}
+ ${CB_DIR}/ExternDotGenerated.moc)
+ set_property(
+ SOURCE ${CB_DIR}/ExternDotGenerated.cpp
+ PROPERTY SKIP_AUTOMOC ON)
+
+ # Generate header moc file externally with a custom name
+ # and enabled SKIP_AUTOMOC on the header
+ qtx_wrap_cpp(MixedCustomMOC
+ ${COM_DIR}/MixedCustom.hpp
+ OPTIONS "-p" "./")
+ addCopyCommand(${MixedCustomMOC}
+ ${CB_DIR}/MixedCustom_extMoc.cpp)
+ set_property(
+ SOURCE ${COM_DIR}/MixedCustom.hpp
+ PROPERTY SKIP_AUTOMOC ON)
+ # Custom target to depend on
+ add_custom_target("${TARGET_NAME}_MixedCustom"
+ DEPENDS ${CB_DIR}/MixedCustom_extMoc.cpp
+ BYPRODUCTS ${CB_DIR}/moc_MixedCustom.cpp
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${COM_DIR}/moc_MixedCustom.cpp.in
+ ${CB_DIR}/moc_MixedCustom.cpp)
+
+ add_executable(${TARGET_NAME}
+ # Test own "*.moc" and "moc_*.cpp" includes
+ ${COM_DIR}/None.cpp
+ ${COM_DIR}/OwnDot.cpp
+ ${COM_DIR}/OwnUnderscore.cpp
+ ${COM_DIR}/OwnDotUnderscore.cpp
+
+ # Test "moc_*.cpp" includes of other files
+ ${COM_DIR}/OtherUnderscore.cpp
+ ${COM_DIR}/OtherUnderscoreExtra.cpp
+ ${COM_DIR}/OtherUnderscoreSub.cpp
+ ${COM_DIR}/OtherUnderscoreSubDir/SubExtra.cpp
+
+ # Test relative ../../ path for moc includes
+ ${COM_DIR}/DualSub/Second/Second.cpp
+ ${COM_DIR}/DualSubMocked.cpp
+
+ # Test externally generated moc files
+ ${COM_DIR}/ExternDot.cpp
+ ${CB_DIR}/ExternDot.moc
+
+ # Test externally generated moc files for GENERATED source
+ ${CB_DIR}/ExternDotGenerated.cpp
+ ${CB_DIR}/ExternDotGenerated.moc
+
+ # Test externally generated moc files and SKIP_AUTOMOC enabled header
+ ${COM_DIR}/MixedSkipped.cpp
+ ${COM_DIR}/MixedCustom.hpp
+ ${COM_DIR}/MixedCustom.cpp
+
+ # Test sources in a subdirectory
+ ${CB_DIR}/InIncludes/SubOwnDot.cpp
+ ${COM_DIR}/InIncludesMoc.cpp
+ )
+ add_dependencies(${TARGET_NAME} "${TARGET_NAME}_MixedCustom")
+ target_include_directories(${TARGET_NAME} PRIVATE "${COM_DIR}")
+ target_include_directories(${TARGET_NAME} PRIVATE "${CB_DIR}")
+ target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
+ target_link_libraries(${TARGET_NAME} ${QT_LIBRARIES})
+ set_target_properties(${TARGET_NAME} PROPERTIES AUTOMOC ON)
+endfunction()
+
+add_subdirectory(Strict)
+add_subdirectory(Relaxed)
diff --git a/Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.cpp b/Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.cpp
new file mode 100644
index 000000000..453add117
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.cpp
@@ -0,0 +1,11 @@
+#include "Second.hpp"
+
+Second::Second()
+{
+}
+
+Second::~Second()
+{
+}
+
+#include "../../moc_DualSubMocked.cpp"
diff --git a/Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.hpp b/Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.hpp
new file mode 100644
index 000000000..e1f3eac16
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/DualSub/Second/Second.hpp
@@ -0,0 +1,14 @@
+#ifndef Second_HPP
+#define Second_HPP
+
+#include <QObject>
+
+class Second : public QObject
+{
+ Q_OBJECT
+public:
+ Second();
+ ~Second();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/DualSubMocked.cpp b/Tests/QtAutogen/MocInclude/Common/DualSubMocked.cpp
new file mode 100644
index 000000000..1d4658dcb
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/DualSubMocked.cpp
@@ -0,0 +1,9 @@
+#include "DualSubMocked.hpp"
+
+DualSubMocked::DualSubMocked()
+{
+}
+
+DualSubMocked::~DualSubMocked()
+{
+}
diff --git a/Tests/QtAutogen/MocInclude/Common/DualSubMocked.hpp b/Tests/QtAutogen/MocInclude/Common/DualSubMocked.hpp
new file mode 100644
index 000000000..58cb571dd
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/DualSubMocked.hpp
@@ -0,0 +1,15 @@
+#ifndef DualSubMocked_HPP
+#define DualSubMocked_HPP
+
+#include <QObject>
+
+// Header moc file is included by DualSub/Second/Second.cpp
+class DualSubMocked : public QObject
+{
+ Q_OBJECT
+public:
+ DualSubMocked();
+ ~DualSubMocked();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/ExternDot.cpp b/Tests/QtAutogen/MocInclude/Common/ExternDot.cpp
new file mode 100644
index 000000000..2495aa794
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/ExternDot.cpp
@@ -0,0 +1,11 @@
+#include "ExternDot.hpp"
+
+ExternDot::ExternDot()
+{
+}
+
+ExternDot::~ExternDot()
+{
+}
+
+#include "ExternDot.moc"
diff --git a/Tests/QtAutogen/MocInclude/Common/ExternDot.hpp b/Tests/QtAutogen/MocInclude/Common/ExternDot.hpp
new file mode 100644
index 000000000..7eaab2afb
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/ExternDot.hpp
@@ -0,0 +1,15 @@
+#ifndef ExternDot_HPP
+#define ExternDot_HPP
+
+#include <QObject>
+
+// Object source includes externally generated .moc file
+class ExternDot : public QObject
+{
+ Q_OBJECT
+public:
+ ExternDot();
+ ~ExternDot();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.cpp.in b/Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.cpp.in
new file mode 100644
index 000000000..09ce5cdba
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.cpp.in
@@ -0,0 +1,11 @@
+#include "ExternDotGenerated.hpp"
+
+ExternDotGenerated::ExternDotGenerated()
+{
+}
+
+ExternDotGenerated::~ExternDotGenerated()
+{
+}
+
+#include "ExternDotGenerated.moc"
diff --git a/Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.hpp.in b/Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.hpp.in
new file mode 100644
index 000000000..21c69be06
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/ExternDotGenerated.hpp.in
@@ -0,0 +1,15 @@
+#ifndef ExternDotGenerated_HPP
+#define ExternDotGenerated_HPP
+
+#include <QObject>
+
+// GENERATED Object source includes externally generated .moc file
+class ExternDotGenerated : public QObject
+{
+ Q_OBJECT
+public:
+ ExternDotGenerated();
+ ~ExternDotGenerated();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.cpp b/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.cpp
new file mode 100644
index 000000000..275754dbb
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.cpp
@@ -0,0 +1,44 @@
+#include "SubOwnDot.hpp"
+
+#include "SubOwnDot_p.hpp"
+
+namespace InIncludes {
+
+class SubOwnDotLocal : public QObject
+{
+ Q_OBJECT
+public:
+ SubOwnDotLocal();
+ ~SubOwnDotLocal();
+};
+
+SubOwnDotLocal::SubOwnDotLocal()
+{
+}
+
+SubOwnDotLocal::~SubOwnDotLocal()
+{
+}
+
+SubOwnDotPrivate::SubOwnDotPrivate()
+{
+}
+
+SubOwnDotPrivate::~SubOwnDotPrivate()
+{
+}
+
+SubOwnDot::SubOwnDot()
+{
+ SubOwnDotPrivate privateObj;
+ SubOwnDotLocal localObj;
+}
+
+SubOwnDot::~SubOwnDot()
+{
+}
+
+} // End of namespace
+
+// For the local QObject
+#include "SubOwnDot.moc"
diff --git a/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.hpp b/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.hpp
new file mode 100644
index 000000000..038ddfaa4
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot.hpp
@@ -0,0 +1,17 @@
+#ifndef InIncludes_SubOwnDot_HPP
+#define InIncludes_SubOwnDot_HPP
+
+#include <QObject>
+
+namespace InIncludes {
+
+class SubOwnDot : public QObject
+{
+ Q_OBJECT
+public:
+ SubOwnDot();
+ ~SubOwnDot();
+};
+}
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot_p.hpp b/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot_p.hpp
new file mode 100644
index 000000000..626a9a86c
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/InIncludes.in/SubOwnDot_p.hpp
@@ -0,0 +1,18 @@
+#ifndef InIncludes_SubOwnDot_P_HPP
+#define InIncludes_SubOwnDot_P_HPP
+
+#include <QObject>
+
+namespace InIncludes {
+
+class SubOwnDotPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ SubOwnDotPrivate();
+ ~SubOwnDotPrivate();
+};
+
+} // End of namespace
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/InIncludesMoc.cpp b/Tests/QtAutogen/MocInclude/Common/InIncludesMoc.cpp
new file mode 100644
index 000000000..88f53a445
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/InIncludesMoc.cpp
@@ -0,0 +1,4 @@
+
+// Moc a header that is not in the sources but in a directory that
+// is in the list of include directories.
+#include "InIncludes/moc_SubOwnDot.cpp"
diff --git a/Tests/QtAutogen/MocInclude/Common/MixedCustom.cpp b/Tests/QtAutogen/MocInclude/Common/MixedCustom.cpp
new file mode 100644
index 000000000..557cc62e1
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/MixedCustom.cpp
@@ -0,0 +1,32 @@
+#include "MixedCustom.hpp"
+
+class MixedCustomLocal : public QObject
+{
+ Q_OBJECT
+
+public:
+ MixedCustomLocal();
+ ~MixedCustomLocal();
+};
+
+MixedCustomLocal::MixedCustomLocal()
+{
+}
+
+MixedCustomLocal::~MixedCustomLocal()
+{
+}
+
+MixedCustom::MixedCustom()
+{
+ MixedCustomLocal local;
+}
+
+MixedCustom::~MixedCustom()
+{
+}
+
+// AUTOMOC generated source moc
+#include "MixedCustom.moc"
+// Externally generated header moc
+#include "MixedCustom_extMoc.cpp"
diff --git a/Tests/QtAutogen/MocInclude/Common/MixedCustom.hpp b/Tests/QtAutogen/MocInclude/Common/MixedCustom.hpp
new file mode 100644
index 000000000..6e8ff8865
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/MixedCustom.hpp
@@ -0,0 +1,20 @@
+#ifndef MixedCustom_HPP
+#define MixedCustom_HPP
+
+#include <QObject>
+
+// Object source includes
+// - externally generated header moc file
+// - AUTOMOC generated source .moc file
+class MixedCustom : public QObject
+{
+ Q_OBJECT
+public:
+ MixedCustom();
+ ~MixedCustom();
+};
+
+// Function forward declaration
+void moc_MixedCustom(MixedCustom const& arg);
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/MixedSkipped.cpp b/Tests/QtAutogen/MocInclude/Common/MixedSkipped.cpp
new file mode 100644
index 000000000..6919ebcf2
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/MixedSkipped.cpp
@@ -0,0 +1,40 @@
+#include "MixedSkipped.hpp"
+
+#include "MixedCustom.hpp"
+
+class MixedSkippedLocal : public QObject
+{
+ Q_OBJECT
+
+public:
+ MixedSkippedLocal();
+ ~MixedSkippedLocal();
+};
+
+MixedSkippedLocal::MixedSkippedLocal()
+{
+}
+
+MixedSkippedLocal::~MixedSkippedLocal()
+{
+}
+
+MixedSkipped::MixedSkipped()
+{
+ MixedSkippedLocal local;
+ MixedCustom externCutom;
+ // Call moc named function
+ moc_MixedCustom(externCutom);
+}
+
+MixedSkipped::~MixedSkipped()
+{
+}
+
+// Include AUTOMOC generated moc files
+#include "MixedSkipped.moc"
+#include "moc_MixedSkipped.cpp"
+
+// Include externally generated moc_ named file that is not a moc file
+// and for which the relevant header is SKIP_AUTOMOC enabled
+#include "moc_MixedCustom.cpp"
diff --git a/Tests/QtAutogen/MocInclude/Common/MixedSkipped.hpp b/Tests/QtAutogen/MocInclude/Common/MixedSkipped.hpp
new file mode 100644
index 000000000..5f6c6644f
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/MixedSkipped.hpp
@@ -0,0 +1,17 @@
+#ifndef MixedSkipped_HPP
+#define MixedSkipped_HPP
+
+#include <QObject>
+
+// Object source includes
+// - Own moc_ and .moc files.
+// - externally generated moc_ file from a SKIP_AUTOMOC enabled header
+class MixedSkipped : public QObject
+{
+ Q_OBJECT
+public:
+ MixedSkipped();
+ ~MixedSkipped();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/None.cpp b/Tests/QtAutogen/MocInclude/Common/None.cpp
new file mode 100644
index 000000000..286ddb6cc
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/None.cpp
@@ -0,0 +1,21 @@
+#include "None.hpp"
+
+#include "None_p.h"
+
+NonePrivate::NonePrivate()
+{
+}
+
+NonePrivate::~NonePrivate()
+{
+}
+
+None::None()
+ : d(new NonePrivate)
+{
+}
+
+None::~None()
+{
+ delete d;
+}
diff --git a/Tests/QtAutogen/MocInclude/Common/None.hpp b/Tests/QtAutogen/MocInclude/Common/None.hpp
new file mode 100644
index 000000000..ca0713ec4
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/None.hpp
@@ -0,0 +1,19 @@
+#ifndef None_HPP
+#define None_HPP
+
+#include <QObject>
+
+// Object source comes without any _moc/.moc includes
+class NonePrivate;
+class None : public QObject
+{
+ Q_OBJECT
+public:
+ None();
+ ~None();
+
+private:
+ NonePrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/None_p.h b/Tests/QtAutogen/MocInclude/Common/None_p.h
new file mode 100644
index 000000000..e209aebbd
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/None_p.h
@@ -0,0 +1,14 @@
+#ifndef None_P_HPP
+#define None_P_HPP
+
+#include <QObject>
+
+class NonePrivate : public QObject
+{
+ Q_OBJECT
+public:
+ NonePrivate();
+ ~NonePrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscore.cpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscore.cpp
new file mode 100644
index 000000000..df1c428a1
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscore.cpp
@@ -0,0 +1,45 @@
+#include "OtherUnderscore.hpp"
+
+#include "OtherUnderscoreExtra.hpp"
+#include "OtherUnderscore_p.hpp"
+
+class OtherUnderscoreLocal : public QObject
+{
+ Q_OBJECT
+public:
+ OtherUnderscoreLocal();
+ ~OtherUnderscoreLocal();
+};
+
+OtherUnderscoreLocal::OtherUnderscoreLocal()
+{
+}
+
+OtherUnderscoreLocal::~OtherUnderscoreLocal()
+{
+}
+
+OtherUnderscorePrivate::OtherUnderscorePrivate()
+{
+ OtherUnderscoreLocal localObj;
+ OtherUnderscoreExtra extraObj;
+}
+
+OtherUnderscorePrivate::~OtherUnderscorePrivate()
+{
+}
+
+OtherUnderscore::OtherUnderscore()
+ : d(new OtherUnderscorePrivate)
+{
+}
+
+OtherUnderscore::~OtherUnderscore()
+{
+ delete d;
+}
+
+// For OtherUnderscoreLocal
+#include "OtherUnderscore.moc"
+// - Not the own header
+#include "moc_OtherUnderscoreExtra.cpp"
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscore.hpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscore.hpp
new file mode 100644
index 000000000..a4ff603cf
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscore.hpp
@@ -0,0 +1,19 @@
+#ifndef OtherUnderscore_HPP
+#define OtherUnderscore_HPP
+
+#include <QObject>
+
+// Sources includes a moc_ includes of an extra object
+class OtherUnderscorePrivate;
+class OtherUnderscore : public QObject
+{
+ Q_OBJECT
+public:
+ OtherUnderscore();
+ ~OtherUnderscore();
+
+private:
+ OtherUnderscorePrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.cpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.cpp
new file mode 100644
index 000000000..11ebd8104
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.cpp
@@ -0,0 +1,21 @@
+#include "OtherUnderscoreExtra.hpp"
+
+#include "OtherUnderscoreExtra_p.hpp"
+
+OtherUnderscoreExtraPrivate::OtherUnderscoreExtraPrivate()
+{
+}
+
+OtherUnderscoreExtraPrivate::~OtherUnderscoreExtraPrivate()
+{
+}
+
+OtherUnderscoreExtra::OtherUnderscoreExtra()
+ : d(new OtherUnderscoreExtraPrivate)
+{
+}
+
+OtherUnderscoreExtra::~OtherUnderscoreExtra()
+{
+ delete d;
+}
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.hpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.hpp
new file mode 100644
index 000000000..5afe48cf8
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra.hpp
@@ -0,0 +1,18 @@
+#ifndef OtherUnderscoreEXTRA_HPP
+#define OtherUnderscoreEXTRA_HPP
+
+#include <QObject>
+
+class OtherUnderscoreExtraPrivate;
+class OtherUnderscoreExtra : public QObject
+{
+ Q_OBJECT
+public:
+ OtherUnderscoreExtra();
+ ~OtherUnderscoreExtra();
+
+private:
+ OtherUnderscoreExtraPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra_p.hpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra_p.hpp
new file mode 100644
index 000000000..2066ac305
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreExtra_p.hpp
@@ -0,0 +1,14 @@
+#ifndef OtherUnderscoreEXTRA_P_HPP
+#define OtherUnderscoreEXTRA_P_HPP
+
+#include <QObject>
+
+class OtherUnderscoreExtraPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ OtherUnderscoreExtraPrivate();
+ ~OtherUnderscoreExtraPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.cpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.cpp
new file mode 100644
index 000000000..712c540c3
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.cpp
@@ -0,0 +1,46 @@
+#include "OtherUnderscoreSub.hpp"
+
+#include "OtherUnderscoreSubDir/SubExtra.hpp"
+#include "OtherUnderscoreSub_p.hpp"
+
+class OtherUnderscoreSubLocal : public QObject
+{
+ Q_OBJECT
+public:
+ OtherUnderscoreSubLocal();
+ ~OtherUnderscoreSubLocal();
+};
+
+OtherUnderscoreSubLocal::OtherUnderscoreSubLocal()
+{
+}
+
+OtherUnderscoreSubLocal::~OtherUnderscoreSubLocal()
+{
+}
+
+OtherUnderscoreSubPrivate::OtherUnderscoreSubPrivate()
+{
+ OtherUnderscoreSubLocal localObj;
+ SubExtra extraObj;
+}
+
+OtherUnderscoreSubPrivate::~OtherUnderscoreSubPrivate()
+{
+}
+
+OtherUnderscoreSub::OtherUnderscoreSub()
+ : d(new OtherUnderscoreSubPrivate)
+{
+}
+
+OtherUnderscoreSub::~OtherUnderscoreSub()
+{
+ delete d;
+}
+
+// For OtherUnderscoreSubLocal
+#include "OtherUnderscoreSub.moc"
+// - Not the own header
+// - in a subdirectory
+#include "OtherUnderscoreSubDir/moc_SubExtra.cpp"
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.hpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.hpp
new file mode 100644
index 000000000..7feaa46f1
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub.hpp
@@ -0,0 +1,19 @@
+#ifndef OtherUnderscoreSub_HPP
+#define OtherUnderscoreSub_HPP
+
+#include <QObject>
+
+// Sources includes a moc_ includes of an extra object in a subdirectory
+class OtherUnderscoreSubPrivate;
+class OtherUnderscoreSub : public QObject
+{
+ Q_OBJECT
+public:
+ OtherUnderscoreSub();
+ ~OtherUnderscoreSub();
+
+private:
+ OtherUnderscoreSubPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.cpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.cpp
new file mode 100644
index 000000000..22501e44d
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.cpp
@@ -0,0 +1,21 @@
+#include "SubExtra.hpp"
+
+#include "SubExtra_p.hpp"
+
+SubExtraPrivate::SubExtraPrivate()
+{
+}
+
+SubExtraPrivate::~SubExtraPrivate()
+{
+}
+
+SubExtra::SubExtra()
+ : d(new SubExtraPrivate)
+{
+}
+
+SubExtra::~SubExtra()
+{
+ delete d;
+}
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.hpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.hpp
new file mode 100644
index 000000000..5700634a0
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra.hpp
@@ -0,0 +1,18 @@
+#ifndef SubExtra_HPP
+#define SubExtra_HPP
+
+#include <QObject>
+
+class SubExtraPrivate;
+class SubExtra : public QObject
+{
+ Q_OBJECT
+public:
+ SubExtra();
+ ~SubExtra();
+
+private:
+ SubExtraPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra_p.hpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra_p.hpp
new file mode 100644
index 000000000..5a14a2d38
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSubDir/SubExtra_p.hpp
@@ -0,0 +1,14 @@
+#ifndef SubExtra_P_HPP
+#define SubExtra_P_HPP
+
+#include <QObject>
+
+class SubExtraPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ SubExtraPrivate();
+ ~SubExtraPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub_p.hpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub_p.hpp
new file mode 100644
index 000000000..7d5999ca4
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscoreSub_p.hpp
@@ -0,0 +1,14 @@
+#ifndef OtherUnderscoreSub_P_HPP
+#define OtherUnderscoreSub_P_HPP
+
+#include <QObject>
+
+class OtherUnderscoreSubPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ OtherUnderscoreSubPrivate();
+ ~OtherUnderscoreSubPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OtherUnderscore_p.hpp b/Tests/QtAutogen/MocInclude/Common/OtherUnderscore_p.hpp
new file mode 100644
index 000000000..96906cfc2
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OtherUnderscore_p.hpp
@@ -0,0 +1,14 @@
+#ifndef OtherUnderscore_P_HPP
+#define OtherUnderscore_P_HPP
+
+#include <QObject>
+
+class OtherUnderscorePrivate : public QObject
+{
+ Q_OBJECT
+public:
+ OtherUnderscorePrivate();
+ ~OtherUnderscorePrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnDot.cpp b/Tests/QtAutogen/MocInclude/Common/OwnDot.cpp
new file mode 100644
index 000000000..b7b7d854c
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnDot.cpp
@@ -0,0 +1,40 @@
+#include "OwnDot.hpp"
+
+#include "OwnDot_p.h"
+
+class OwnDotLocal : public QObject
+{
+ Q_OBJECT
+public:
+ OwnDotLocal();
+ ~OwnDotLocal();
+};
+
+OwnDotLocal::OwnDotLocal()
+{
+}
+
+OwnDotLocal::~OwnDotLocal()
+{
+}
+
+OwnDotPrivate::OwnDotPrivate()
+{
+ OwnDotLocal localObj;
+}
+
+OwnDotPrivate::~OwnDotPrivate()
+{
+}
+
+OwnDot::OwnDot()
+ : d(new OwnDotPrivate)
+{
+}
+
+OwnDot::~OwnDot()
+{
+ delete d;
+}
+
+#include "OwnDot.moc"
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnDot.hpp b/Tests/QtAutogen/MocInclude/Common/OwnDot.hpp
new file mode 100644
index 000000000..6f49f12ba
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnDot.hpp
@@ -0,0 +1,19 @@
+#ifndef OwnDot_HPP
+#define OwnDot_HPP
+
+#include <QObject>
+
+// Object source comes with a .moc include
+class OwnDotPrivate;
+class OwnDot : public QObject
+{
+ Q_OBJECT
+public:
+ OwnDot();
+ ~OwnDot();
+
+private:
+ OwnDotPrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.cpp b/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.cpp
new file mode 100644
index 000000000..056c0db84
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.cpp
@@ -0,0 +1,41 @@
+#include "OwnDotUnderscore.hpp"
+
+#include "OwnDotUnderscore_p.h"
+
+class OwnDotUnderscoreLocal : public QObject
+{
+ Q_OBJECT
+public:
+ OwnDotUnderscoreLocal();
+ ~OwnDotUnderscoreLocal();
+};
+
+OwnDotUnderscoreLocal::OwnDotUnderscoreLocal()
+{
+}
+
+OwnDotUnderscoreLocal::~OwnDotUnderscoreLocal()
+{
+}
+
+OwnDotUnderscorePrivate::OwnDotUnderscorePrivate()
+{
+ OwnDotUnderscoreLocal localObj;
+}
+
+OwnDotUnderscorePrivate::~OwnDotUnderscorePrivate()
+{
+}
+
+OwnDotUnderscore::OwnDotUnderscore()
+ : d(new OwnDotUnderscorePrivate)
+{
+}
+
+OwnDotUnderscore::~OwnDotUnderscore()
+{
+ delete d;
+}
+
+#include "OwnDotUnderscore.moc"
+#include "moc_OwnDotUnderscore.cpp"
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.hpp b/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.hpp
new file mode 100644
index 000000000..478955c30
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore.hpp
@@ -0,0 +1,19 @@
+#ifndef LOwnDotUnderscore_HPP
+#define LOwnDotUnderscore_HPP
+
+#include <QObject>
+
+// Object source comes with a .moc and a _moc include
+class OwnDotUnderscorePrivate;
+class OwnDotUnderscore : public QObject
+{
+ Q_OBJECT
+public:
+ OwnDotUnderscore();
+ ~OwnDotUnderscore();
+
+private:
+ OwnDotUnderscorePrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore_p.h b/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore_p.h
new file mode 100644
index 000000000..6950b7f13
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnDotUnderscore_p.h
@@ -0,0 +1,14 @@
+#ifndef OwnDotUnderscore_P_HPP
+#define OwnDotUnderscore_P_HPP
+
+#include <QObject>
+
+class OwnDotUnderscorePrivate : public QObject
+{
+ Q_OBJECT
+public:
+ OwnDotUnderscorePrivate();
+ ~OwnDotUnderscorePrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnDot_p.h b/Tests/QtAutogen/MocInclude/Common/OwnDot_p.h
new file mode 100644
index 000000000..f3aff32ff
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnDot_p.h
@@ -0,0 +1,14 @@
+#ifndef OwnDot_P_HPP
+#define OwnDot_P_HPP
+
+#include <QObject>
+
+class OwnDotPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ OwnDotPrivate();
+ ~OwnDotPrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnUnderscore.cpp b/Tests/QtAutogen/MocInclude/Common/OwnUnderscore.cpp
new file mode 100644
index 000000000..cb8f12c9b
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnUnderscore.cpp
@@ -0,0 +1,23 @@
+#include "OwnUnderscore.hpp"
+
+#include "OwnUnderscore_p.h"
+
+OwnUnderscorePrivate::OwnUnderscorePrivate()
+{
+}
+
+OwnUnderscorePrivate::~OwnUnderscorePrivate()
+{
+}
+
+OwnUnderscore::OwnUnderscore()
+ : d(new OwnUnderscorePrivate)
+{
+}
+
+OwnUnderscore::~OwnUnderscore()
+{
+ delete d;
+}
+
+#include "moc_OwnUnderscore.cpp"
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnUnderscore.hpp b/Tests/QtAutogen/MocInclude/Common/OwnUnderscore.hpp
new file mode 100644
index 000000000..e6a6a6eb8
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnUnderscore.hpp
@@ -0,0 +1,19 @@
+#ifndef OwnUnderscore_HPP
+#define OwnUnderscore_HPP
+
+#include <QObject>
+
+// Object source comes with a _moc include
+class OwnUnderscorePrivate;
+class OwnUnderscore : public QObject
+{
+ Q_OBJECT
+public:
+ OwnUnderscore();
+ ~OwnUnderscore();
+
+private:
+ OwnUnderscorePrivate* const d;
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/OwnUnderscore_p.h b/Tests/QtAutogen/MocInclude/Common/OwnUnderscore_p.h
new file mode 100644
index 000000000..a3a6b0062
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/OwnUnderscore_p.h
@@ -0,0 +1,14 @@
+#ifndef OwnUnderscore_P_HPP
+#define OwnUnderscore_P_HPP
+
+#include <QObject>
+
+class OwnUnderscorePrivate : public QObject
+{
+ Q_OBJECT
+public:
+ OwnUnderscorePrivate();
+ ~OwnUnderscorePrivate();
+};
+
+#endif
diff --git a/Tests/QtAutogen/MocInclude/Common/common.cpp.in b/Tests/QtAutogen/MocInclude/Common/common.cpp.in
new file mode 100644
index 000000000..b53e93dd6
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/common.cpp.in
@@ -0,0 +1,32 @@
+#include "DualSub/Second/Second.hpp"
+#include "DualSubMocked.hpp"
+#include "ExternDot.hpp"
+#include "ExternDotGenerated.hpp"
+#include "None.hpp"
+#include "OtherUnderscore.hpp"
+#include "OtherUnderscoreSub.hpp"
+#include "OwnDot.hpp"
+#include "OwnDotUnderscore.hpp"
+#include "OwnUnderscore.hpp"
+#include "InIncludes/SubOwnDot.hpp"
+
+bool @COMMON_FUNCTION_NAME@()
+{
+ None objNone;
+ OwnUnderscore objOwnUnderscore;
+ OwnDot objOwnDot;
+ OwnDotUnderscore objOwnDotUnderscore;
+
+ OtherUnderscore objOtherUnderscore;
+ OtherUnderscoreSub objOtherUnderscoreSub;
+
+ Second second;
+ DualSubMocked dualSubMocked;
+
+ ExternDot objExternDot;
+ ExternDotGenerated objGeneratedExternDot;
+
+ InIncludes::SubOwnDot subOwnDot;
+
+ return true;
+}
diff --git a/Tests/QtAutogen/MocInclude/Common/moc_MixedCustom.cpp.in b/Tests/QtAutogen/MocInclude/Common/moc_MixedCustom.cpp.in
new file mode 100644
index 000000000..6c44793a8
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Common/moc_MixedCustom.cpp.in
@@ -0,0 +1,5 @@
+
+void moc_MixedCustom(MixedCustom const & arg)
+{
+ (void)arg;
+}
diff --git a/Tests/QtAutogen/MocInclude/EObjA.cpp b/Tests/QtAutogen/MocInclude/EObjA.cpp
deleted file mode 100644
index 7681c29b9..000000000
--- a/Tests/QtAutogen/MocInclude/EObjA.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#include "EObjA.hpp"
-#include "EObjAExtra.hpp"
-#include "EObjA_p.hpp"
-
-class EObjALocal : public QObject
-{
- Q_OBJECT
-public:
- EObjALocal();
- ~EObjALocal();
-};
-
-EObjALocal::EObjALocal()
-{
-}
-
-EObjALocal::~EObjALocal()
-{
-}
-
-EObjAPrivate::EObjAPrivate()
-{
- EObjALocal localObj;
- EObjAExtra extraObj;
-}
-
-EObjAPrivate::~EObjAPrivate()
-{
-}
-
-EObjA::EObjA()
- : d(new EObjAPrivate)
-{
-}
-
-EObjA::~EObjA()
-{
- delete d;
-}
-
-// For EObjALocal
-#include "EObjA.moc"
-// - Not the own header
-#include "moc_EObjAExtra.cpp"
diff --git a/Tests/QtAutogen/MocInclude/EObjA.hpp b/Tests/QtAutogen/MocInclude/EObjA.hpp
deleted file mode 100644
index 0939ab66d..000000000
--- a/Tests/QtAutogen/MocInclude/EObjA.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef EOBJA_HPP
-#define EOBJA_HPP
-
-#include <QObject>
-
-// Sources includes a moc_ includes of an extra object
-class EObjAPrivate;
-class EObjA : public QObject
-{
- Q_OBJECT
-public:
- EObjA();
- ~EObjA();
-
-private:
- EObjAPrivate* const d;
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/EObjAExtra.cpp b/Tests/QtAutogen/MocInclude/EObjAExtra.cpp
deleted file mode 100644
index 369ca8f77..000000000
--- a/Tests/QtAutogen/MocInclude/EObjAExtra.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "EObjAExtra.hpp"
-#include "EObjAExtra_p.hpp"
-
-EObjAExtraPrivate::EObjAExtraPrivate()
-{
-}
-
-EObjAExtraPrivate::~EObjAExtraPrivate()
-{
-}
-
-EObjAExtra::EObjAExtra()
- : d(new EObjAExtraPrivate)
-{
-}
-
-EObjAExtra::~EObjAExtra()
-{
- delete d;
-}
diff --git a/Tests/QtAutogen/MocInclude/EObjAExtra.hpp b/Tests/QtAutogen/MocInclude/EObjAExtra.hpp
deleted file mode 100644
index b10681d59..000000000
--- a/Tests/QtAutogen/MocInclude/EObjAExtra.hpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef EOBJAEXTRA_HPP
-#define EOBJAEXTRA_HPP
-
-#include <QObject>
-
-class EObjAExtraPrivate;
-class EObjAExtra : public QObject
-{
- Q_OBJECT
-public:
- EObjAExtra();
- ~EObjAExtra();
-
-private:
- EObjAExtraPrivate* const d;
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp b/Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp
deleted file mode 100644
index d8bf2844c..000000000
--- a/Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef EOBJAEXTRA_P_HPP
-#define EOBJAEXTRA_P_HPP
-
-#include <QObject>
-
-class EObjAExtraPrivate : public QObject
-{
- Q_OBJECT
-public:
- EObjAExtraPrivate();
- ~EObjAExtraPrivate();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/EObjA_p.hpp b/Tests/QtAutogen/MocInclude/EObjA_p.hpp
deleted file mode 100644
index 9ef5624ab..000000000
--- a/Tests/QtAutogen/MocInclude/EObjA_p.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef EOBJA_P_HPP
-#define EOBJA_P_HPP
-
-#include <QObject>
-
-class EObjAPrivate : public QObject
-{
- Q_OBJECT
-public:
- EObjAPrivate();
- ~EObjAPrivate();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/EObjB.cpp b/Tests/QtAutogen/MocInclude/EObjB.cpp
deleted file mode 100644
index 3068c682d..000000000
--- a/Tests/QtAutogen/MocInclude/EObjB.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "EObjB.hpp"
-#include "EObjB_p.hpp"
-#include "subExtra/EObjBExtra.hpp"
-
-class EObjBLocal : public QObject
-{
- Q_OBJECT
-public:
- EObjBLocal();
- ~EObjBLocal();
-};
-
-EObjBLocal::EObjBLocal()
-{
-}
-
-EObjBLocal::~EObjBLocal()
-{
-}
-
-EObjBPrivate::EObjBPrivate()
-{
- EObjBLocal localObj;
- EObjBExtra extraObj;
-}
-
-EObjBPrivate::~EObjBPrivate()
-{
-}
-
-EObjB::EObjB()
- : d(new EObjBPrivate)
-{
-}
-
-EObjB::~EObjB()
-{
- delete d;
-}
-
-// For EObjBLocal
-#include "EObjB.moc"
-// - Not the own header
-// - in a subdirectory
-#include "subExtra/moc_EObjBExtra.cpp"
diff --git a/Tests/QtAutogen/MocInclude/EObjB.hpp b/Tests/QtAutogen/MocInclude/EObjB.hpp
deleted file mode 100644
index 6632bdb07..000000000
--- a/Tests/QtAutogen/MocInclude/EObjB.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef EOBJB_HPP
-#define EOBJB_HPP
-
-#include <QObject>
-
-// Sources includes a moc_ includes of an extra object in a subdirectory
-class EObjBPrivate;
-class EObjB : public QObject
-{
- Q_OBJECT
-public:
- EObjB();
- ~EObjB();
-
-private:
- EObjBPrivate* const d;
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/EObjB_p.hpp b/Tests/QtAutogen/MocInclude/EObjB_p.hpp
deleted file mode 100644
index 84b1ea270..000000000
--- a/Tests/QtAutogen/MocInclude/EObjB_p.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef EOBJB_P_HPP
-#define EOBJB_P_HPP
-
-#include <QObject>
-
-class EObjBPrivate : public QObject
-{
- Q_OBJECT
-public:
- EObjBPrivate();
- ~EObjBPrivate();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/LObjA.cpp b/Tests/QtAutogen/MocInclude/LObjA.cpp
deleted file mode 100644
index 9aae9917f..000000000
--- a/Tests/QtAutogen/MocInclude/LObjA.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "LObjA.hpp"
-#include "LObjA_p.h"
-
-class LObjALocal : public QObject
-{
- Q_OBJECT
-public:
- LObjALocal();
- ~LObjALocal();
-};
-
-LObjALocal::LObjALocal()
-{
-}
-
-LObjALocal::~LObjALocal()
-{
-}
-
-LObjAPrivate::LObjAPrivate()
-{
- LObjALocal localObj;
-}
-
-LObjAPrivate::~LObjAPrivate()
-{
-}
-
-LObjA::LObjA()
- : d(new LObjAPrivate)
-{
-}
-
-LObjA::~LObjA()
-{
- delete d;
-}
-
-#include "LObjA.moc"
diff --git a/Tests/QtAutogen/MocInclude/LObjA.hpp b/Tests/QtAutogen/MocInclude/LObjA.hpp
deleted file mode 100644
index aac670c00..000000000
--- a/Tests/QtAutogen/MocInclude/LObjA.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef LOBJA_HPP
-#define LOBJA_HPP
-
-#include <QObject>
-
-// Object source comes with a .moc include
-class LObjAPrivate;
-class LObjA : public QObject
-{
- Q_OBJECT
-public:
- LObjA();
- ~LObjA();
-
-private:
- LObjAPrivate* const d;
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/LObjA_p.h b/Tests/QtAutogen/MocInclude/LObjA_p.h
deleted file mode 100644
index 97113d6d1..000000000
--- a/Tests/QtAutogen/MocInclude/LObjA_p.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef LOBJA_P_HPP
-#define LOBJA_P_HPP
-
-#include <QObject>
-
-class LObjAPrivate : public QObject
-{
- Q_OBJECT
-public:
- LObjAPrivate();
- ~LObjAPrivate();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/LObjB.cpp b/Tests/QtAutogen/MocInclude/LObjB.cpp
deleted file mode 100644
index 7485d8fca..000000000
--- a/Tests/QtAutogen/MocInclude/LObjB.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "LObjB.hpp"
-#include "LObjB_p.h"
-
-class LObjBLocal : public QObject
-{
- Q_OBJECT
-public:
- LObjBLocal();
- ~LObjBLocal();
-};
-
-LObjBLocal::LObjBLocal()
-{
-}
-
-LObjBLocal::~LObjBLocal()
-{
-}
-
-LObjBPrivate::LObjBPrivate()
-{
- LObjBLocal localObj;
-}
-
-LObjBPrivate::~LObjBPrivate()
-{
-}
-
-LObjB::LObjB()
- : d(new LObjBPrivate)
-{
-}
-
-LObjB::~LObjB()
-{
- delete d;
-}
-
-#include "LObjB.moc"
-#include "moc_LObjB.cpp"
diff --git a/Tests/QtAutogen/MocInclude/LObjB.hpp b/Tests/QtAutogen/MocInclude/LObjB.hpp
deleted file mode 100644
index eb4e58d79..000000000
--- a/Tests/QtAutogen/MocInclude/LObjB.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef LLObjB_HPP
-#define LLObjB_HPP
-
-#include <QObject>
-
-// Object source comes with a .moc and a _moc include
-class LObjBPrivate;
-class LObjB : public QObject
-{
- Q_OBJECT
-public:
- LObjB();
- ~LObjB();
-
-private:
- LObjBPrivate* const d;
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/LObjB_p.h b/Tests/QtAutogen/MocInclude/LObjB_p.h
deleted file mode 100644
index b88f40e5c..000000000
--- a/Tests/QtAutogen/MocInclude/LObjB_p.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef LOBJB_P_HPP
-#define LOBJB_P_HPP
-
-#include <QObject>
-
-class LObjBPrivate : public QObject
-{
- Q_OBJECT
-public:
- LObjBPrivate();
- ~LObjBPrivate();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/ObjA.cpp b/Tests/QtAutogen/MocInclude/ObjA.cpp
deleted file mode 100644
index 6f6b90ef1..000000000
--- a/Tests/QtAutogen/MocInclude/ObjA.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "ObjA.hpp"
-#include "ObjA_p.h"
-
-ObjAPrivate::ObjAPrivate()
-{
-}
-
-ObjAPrivate::~ObjAPrivate()
-{
-}
-
-ObjA::ObjA()
- : d(new ObjAPrivate)
-{
-}
-
-ObjA::~ObjA()
-{
- delete d;
-}
diff --git a/Tests/QtAutogen/MocInclude/ObjA.hpp b/Tests/QtAutogen/MocInclude/ObjA.hpp
deleted file mode 100644
index f16c924aa..000000000
--- a/Tests/QtAutogen/MocInclude/ObjA.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef OBJA_HPP
-#define OBJA_HPP
-
-#include <QObject>
-
-// Object source comes without any _moc/.moc includes
-class ObjAPrivate;
-class ObjA : public QObject
-{
- Q_OBJECT
-public:
- ObjA();
- ~ObjA();
-
-private:
- ObjAPrivate* const d;
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/ObjA_p.h b/Tests/QtAutogen/MocInclude/ObjA_p.h
deleted file mode 100644
index d944bc637..000000000
--- a/Tests/QtAutogen/MocInclude/ObjA_p.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef OBJA_P_HPP
-#define OBJA_P_HPP
-
-#include <QObject>
-
-class ObjAPrivate : public QObject
-{
- Q_OBJECT
-public:
- ObjAPrivate();
- ~ObjAPrivate();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/ObjB.cpp b/Tests/QtAutogen/MocInclude/ObjB.cpp
deleted file mode 100644
index a6f2509af..000000000
--- a/Tests/QtAutogen/MocInclude/ObjB.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "ObjB.hpp"
-#include "ObjB_p.h"
-
-ObjBPrivate::ObjBPrivate()
-{
-}
-
-ObjBPrivate::~ObjBPrivate()
-{
-}
-
-ObjB::ObjB()
- : d(new ObjBPrivate)
-{
-}
-
-ObjB::~ObjB()
-{
- delete d;
-}
-
-#include "moc_ObjB.cpp"
diff --git a/Tests/QtAutogen/MocInclude/ObjB.hpp b/Tests/QtAutogen/MocInclude/ObjB.hpp
deleted file mode 100644
index 2ac8d1700..000000000
--- a/Tests/QtAutogen/MocInclude/ObjB.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-#ifndef ObjB_HPP
-#define ObjB_HPP
-
-#include <QObject>
-
-// Object source comes with a _moc include
-class ObjBPrivate;
-class ObjB : public QObject
-{
- Q_OBJECT
-public:
- ObjB();
- ~ObjB();
-
-private:
- ObjBPrivate* const d;
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/ObjB_p.h b/Tests/QtAutogen/MocInclude/ObjB_p.h
deleted file mode 100644
index 61ba6042e..000000000
--- a/Tests/QtAutogen/MocInclude/ObjB_p.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef OBJB_P_HPP
-#define OBJB_P_HPP
-
-#include <QObject>
-
-class ObjBPrivate : public QObject
-{
- Q_OBJECT
-public:
- ObjBPrivate();
- ~ObjBPrivate();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/Relaxed/CMakeLists.txt b/Tests/QtAutogen/MocInclude/Relaxed/CMakeLists.txt
new file mode 100644
index 000000000..048b79cb7
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Relaxed/CMakeLists.txt
@@ -0,0 +1,17 @@
+# Enable relaxed mode
+set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
+
+# Common test
+set(COMMON_FUNCTION_NAME commonRelaxed)
+configure_file(
+ "${COM_DIR}/common.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/commonRelaxed.cpp")
+
+makeExecutable(libRelaxed)
+target_sources(libRelaxed PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/commonRelaxed.cpp"
+ RObjA.cpp
+ RObjB.cpp
+ RObjC.cpp
+ relaxed.cpp
+ )
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/RObjA.cpp b/Tests/QtAutogen/MocInclude/Relaxed/RObjA.cpp
index 2e2cf6a48..2e2cf6a48 100644
--- a/Tests/QtAutogen/MocIncludeRelaxed/RObjA.cpp
+++ b/Tests/QtAutogen/MocInclude/Relaxed/RObjA.cpp
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/RObjA.hpp b/Tests/QtAutogen/MocInclude/Relaxed/RObjA.hpp
index 597418773..597418773 100644
--- a/Tests/QtAutogen/MocIncludeRelaxed/RObjA.hpp
+++ b/Tests/QtAutogen/MocInclude/Relaxed/RObjA.hpp
diff --git a/Tests/QtAutogen/MocInclude/Relaxed/RObjB.cpp b/Tests/QtAutogen/MocInclude/Relaxed/RObjB.cpp
new file mode 100644
index 000000000..57d7daf16
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Relaxed/RObjB.cpp
@@ -0,0 +1,23 @@
+#include "RObjB.hpp"
+
+#include "RObjBExtra.hpp"
+
+RObjBExtra::RObjBExtra()
+{
+}
+
+RObjBExtra::~RObjBExtra()
+{
+}
+
+RObjB::RObjB()
+{
+ RObjBExtra extraObject;
+}
+
+RObjB::~RObjB()
+{
+}
+
+// Relaxed mode should run moc on RObjBExtra.hpp instead
+#include "RObjBExtra.moc"
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/RObjB.hpp b/Tests/QtAutogen/MocInclude/Relaxed/RObjB.hpp
index d6d0474ad..d6d0474ad 100644
--- a/Tests/QtAutogen/MocIncludeRelaxed/RObjB.hpp
+++ b/Tests/QtAutogen/MocInclude/Relaxed/RObjB.hpp
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/RObjBExtra.hpp b/Tests/QtAutogen/MocInclude/Relaxed/RObjBExtra.hpp
index 5d6be752f..5d6be752f 100644
--- a/Tests/QtAutogen/MocIncludeRelaxed/RObjBExtra.hpp
+++ b/Tests/QtAutogen/MocInclude/Relaxed/RObjBExtra.hpp
diff --git a/Tests/QtAutogen/MocInclude/Relaxed/RObjC.cpp b/Tests/QtAutogen/MocInclude/Relaxed/RObjC.cpp
new file mode 100644
index 000000000..327521666
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Relaxed/RObjC.cpp
@@ -0,0 +1,31 @@
+#include "RObjC.hpp"
+
+#include <QObject>
+
+class RObjCPrivate : public QObject
+{
+ Q_OBJECT
+public:
+ RObjCPrivate();
+ ~RObjCPrivate();
+};
+
+RObjCPrivate::RObjCPrivate()
+{
+}
+
+RObjCPrivate::~RObjCPrivate()
+{
+}
+
+RObjC::RObjC()
+{
+ RObjCPrivate privateObject;
+}
+
+RObjC::~RObjC()
+{
+}
+
+// Relaxed include should moc this source instead of the header
+#include "moc_RObjC.cpp"
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/RObjC.hpp b/Tests/QtAutogen/MocInclude/Relaxed/RObjC.hpp
index 5552ede4a..5552ede4a 100644
--- a/Tests/QtAutogen/MocIncludeRelaxed/RObjC.hpp
+++ b/Tests/QtAutogen/MocInclude/Relaxed/RObjC.hpp
diff --git a/Tests/QtAutogen/MocInclude/Relaxed/relaxed.cpp b/Tests/QtAutogen/MocInclude/Relaxed/relaxed.cpp
new file mode 100644
index 000000000..5a511b673
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Relaxed/relaxed.cpp
@@ -0,0 +1,21 @@
+// AUTOMOC relaxed mode objects
+#include "RObjA.hpp"
+#include "RObjB.hpp"
+#include "RObjC.hpp"
+
+// Forward declaration
+bool commonRelaxed();
+
+int main(int argv, char** args)
+{
+ // Common tests
+ if (!commonRelaxed()) {
+ return -1;
+ }
+
+ // Relaxed tests
+ RObjA rObjA;
+ RObjB rObjB;
+ RObjC rObjC;
+ return 0;
+}
diff --git a/Tests/QtAutogen/MocInclude/SObjA.cpp b/Tests/QtAutogen/MocInclude/SObjA.cpp
deleted file mode 100644
index 7e75bf973..000000000
--- a/Tests/QtAutogen/MocInclude/SObjA.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "SObjA.hpp"
-
-SObjA::SObjA()
-{
-}
-
-SObjA::~SObjA()
-{
-}
-
-#include "SObjA.moc"
diff --git a/Tests/QtAutogen/MocInclude/SObjA.hpp b/Tests/QtAutogen/MocInclude/SObjA.hpp
deleted file mode 100644
index 1436abc6c..000000000
--- a/Tests/QtAutogen/MocInclude/SObjA.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef SOBJA_HPP
-#define SOBJA_HPP
-
-#include <QObject>
-
-// Object source includes externally generated .moc file
-class SObjA : public QObject
-{
- Q_OBJECT
-public:
- SObjA();
- ~SObjA();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/SObjB.cpp.in b/Tests/QtAutogen/MocInclude/SObjB.cpp.in
deleted file mode 100644
index b1cc12ab2..000000000
--- a/Tests/QtAutogen/MocInclude/SObjB.cpp.in
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "SObjB.hpp"
-
-SObjB::SObjB()
-{
-}
-
-SObjB::~SObjB()
-{
-}
-
-#include "SObjB.moc"
diff --git a/Tests/QtAutogen/MocInclude/SObjB.hpp.in b/Tests/QtAutogen/MocInclude/SObjB.hpp.in
deleted file mode 100644
index 5e396aea8..000000000
--- a/Tests/QtAutogen/MocInclude/SObjB.hpp.in
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef SOBJB_HPP
-#define SOBJB_HPP
-
-#include <QObject>
-
-// Object source includes externally generated .moc file
-class SObjB : public QObject
-{
- Q_OBJECT
-public:
- SObjB();
- ~SObjB();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/SObjC.cpp b/Tests/QtAutogen/MocInclude/SObjC.cpp
deleted file mode 100644
index 1e8d397f9..000000000
--- a/Tests/QtAutogen/MocInclude/SObjC.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "SObjC.hpp"
-
-void SObjCLocalFunction();
-
-class SObjCLocal : public QObject
-{
- Q_OBJECT
-
-public:
- SObjCLocal();
- ~SObjCLocal();
-};
-
-SObjCLocal::SObjCLocal()
-{
-}
-
-SObjCLocal::~SObjCLocal()
-{
-}
-
-SObjC::SObjC()
-{
- SObjCLocal localObject;
- SObjCLocalFunction();
-}
-
-SObjC::~SObjC()
-{
-}
-
-#include "SObjC.moc"
-#include "moc_SObjC.cpp"
-// Include moc_ file for which the header is SKIP_AUTOMOC enabled
-#include "moc_SObjCExtra.cpp"
diff --git a/Tests/QtAutogen/MocInclude/SObjC.hpp b/Tests/QtAutogen/MocInclude/SObjC.hpp
deleted file mode 100644
index def0f9d96..000000000
--- a/Tests/QtAutogen/MocInclude/SObjC.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef SOBJC_HPP
-#define SOBJC_HPP
-
-#include <QObject>
-
-// Object source includes externally generated .moc file
-class SObjC : public QObject
-{
- Q_OBJECT
-public:
- SObjC();
- ~SObjC();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/SObjCExtra.cpp b/Tests/QtAutogen/MocInclude/SObjCExtra.cpp
deleted file mode 100644
index 55dd1c315..000000000
--- a/Tests/QtAutogen/MocInclude/SObjCExtra.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "SObjCExtra.hpp"
-
-class SObjCLocalExtra : public QObject
-{
- Q_OBJECT
-
-public:
- SObjCLocalExtra();
- ~SObjCLocalExtra();
-};
-
-SObjCLocalExtra::SObjCLocalExtra()
-{
-}
-
-SObjCLocalExtra::~SObjCLocalExtra()
-{
-}
-
-SObjCExtra::SObjCExtra()
-{
-}
-
-SObjCExtra::~SObjCExtra()
-{
-}
-
-// Externally generated header moc
-#include "SObjCExtra_extMoc.cpp"
-// AUTOMOC generated source moc
-#include "SObjCExtra.moc"
diff --git a/Tests/QtAutogen/MocInclude/SObjCExtra.hpp b/Tests/QtAutogen/MocInclude/SObjCExtra.hpp
deleted file mode 100644
index 08545ac29..000000000
--- a/Tests/QtAutogen/MocInclude/SObjCExtra.hpp
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef SOBJCEXTRA_HPP
-#define SOBJCEXTRA_HPP
-
-#include <QObject>
-
-// Object source includes externally generated .moc file
-class SObjCExtra : public QObject
-{
- Q_OBJECT
-public:
- SObjCExtra();
- ~SObjCExtra();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/SObjCExtra.moc.in b/Tests/QtAutogen/MocInclude/SObjCExtra.moc.in
deleted file mode 100644
index 00fc4aabe..000000000
--- a/Tests/QtAutogen/MocInclude/SObjCExtra.moc.in
+++ /dev/null
@@ -1,4 +0,0 @@
-
-void SObjCLocalFunction()
-{
-}
diff --git a/Tests/QtAutogen/MocInclude/Strict/CMakeLists.txt b/Tests/QtAutogen/MocInclude/Strict/CMakeLists.txt
new file mode 100644
index 000000000..12c503faf
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Strict/CMakeLists.txt
@@ -0,0 +1,14 @@
+# Disable relaxed mode
+set(CMAKE_AUTOMOC_RELAXED_MODE FALSE)
+
+# Common test
+set(COMMON_FUNCTION_NAME commonStrict)
+configure_file(
+ "${COM_DIR}/common.cpp.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/commonStrict.cpp")
+
+makeExecutable(libStrict)
+target_sources(libStrict PRIVATE
+ "${CMAKE_CURRENT_BINARY_DIR}/commonStrict.cpp"
+ strict.cpp
+ )
diff --git a/Tests/QtAutogen/MocInclude/Strict/strict.cpp b/Tests/QtAutogen/MocInclude/Strict/strict.cpp
new file mode 100644
index 000000000..dd24bb0d4
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/Strict/strict.cpp
@@ -0,0 +1,7 @@
+// Forward declaration
+bool commonStrict();
+
+int main(int argv, char** args)
+{
+ return commonStrict() ? 0 : -1;
+}
diff --git a/Tests/QtAutogen/MocInclude/main.cpp b/Tests/QtAutogen/MocInclude/main.cpp
new file mode 100644
index 000000000..371c5fdad
--- /dev/null
+++ b/Tests/QtAutogen/MocInclude/main.cpp
@@ -0,0 +1,9 @@
+
+// Forward declaration
+bool libStrict();
+bool libRelaxed();
+
+int main(int argv, char** args)
+{
+ return (libStrict() && libRelaxed()) ? 0 : -1;
+}
diff --git a/Tests/QtAutogen/MocInclude/shared.cmake b/Tests/QtAutogen/MocInclude/shared.cmake
deleted file mode 100644
index 2ca28414d..000000000
--- a/Tests/QtAutogen/MocInclude/shared.cmake
+++ /dev/null
@@ -1,71 +0,0 @@
-# Test moc include patterns
-include_directories("../MocInclude")
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-
-# Generate .moc file externally and enabled SKIP_AUTOMOC on the file
-qtx_generate_moc(
- ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjA.hpp
- ${CMAKE_CURRENT_BINARY_DIR}/SObjA.moc)
-set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjA.cpp PROPERTY SKIP_AUTOMOC ON)
-
-# Generate .moc file externally from generated source file
-# and enabled SKIP_AUTOMOC on the source file
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp
- COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjB.hpp.in
- ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp)
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp
- COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjB.cpp.in
- ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp)
-qtx_generate_moc(
- ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp
- ${CMAKE_CURRENT_BINARY_DIR}/SObjB.moc)
-set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp PROPERTY SKIP_AUTOMOC ON)
-
-# Generate moc file externally and enabled SKIP_AUTOMOC on the header
-qtx_generate_moc(
- ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjCExtra.hpp
- ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp)
-set_property(
- SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjCExtra.hpp
- PROPERTY SKIP_AUTOMOC ON)
-# Custom target to depend on
-set(SOBJC_MOC ${CMAKE_CURRENT_BINARY_DIR}/moc_SObjCExtra.cpp)
-add_custom_target("${MOC_INCLUDE_NAME}_SOBJC"
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp
- BYPRODUCTS ${SOBJC_MOC}
- COMMAND ${CMAKE_COMMAND} -E copy
- ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjCExtra.moc.in
- ${SOBJC_MOC})
-
-# MOC_INCLUDE_NAME must be defined by the includer
-add_executable(${MOC_INCLUDE_NAME}
- # Common sources
- ../MocInclude/ObjA.cpp
- ../MocInclude/ObjB.cpp
-
- ../MocInclude/LObjA.cpp
- ../MocInclude/LObjB.cpp
-
- ../MocInclude/EObjA.cpp
- ../MocInclude/EObjAExtra.cpp
- ../MocInclude/EObjB.cpp
- ../MocInclude/subExtra/EObjBExtra.cpp
-
- ../MocInclude/SObjA.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/SObjA.moc
- ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp
- ${CMAKE_CURRENT_BINARY_DIR}/SObjB.moc
- ../MocInclude/SObjC.cpp
- ../MocInclude/SObjCExtra.hpp
- ../MocInclude/SObjCExtra.cpp
-
- ../MocInclude/subGlobal/GObj.cpp
- main.cpp
-)
-add_dependencies(${MOC_INCLUDE_NAME} "${MOC_INCLUDE_NAME}_SOBJC")
-target_link_libraries(${MOC_INCLUDE_NAME} ${QT_LIBRARIES})
-set_target_properties(${MOC_INCLUDE_NAME} PROPERTIES AUTOMOC ON)
diff --git a/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp
deleted file mode 100644
index c697866e7..000000000
--- a/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "EObjBExtra.hpp"
-#include "EObjBExtra_p.hpp"
-
-EObjBExtraPrivate::EObjBExtraPrivate()
-{
-}
-
-EObjBExtraPrivate::~EObjBExtraPrivate()
-{
-}
-
-EObjBExtra::EObjBExtra()
- : d(new EObjBExtraPrivate)
-{
-}
-
-EObjBExtra::~EObjBExtra()
-{
- delete d;
-}
diff --git a/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp
deleted file mode 100644
index 3798d7f52..000000000
--- a/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef EOBJBEXTRA_HPP
-#define EOBJBEXTRA_HPP
-
-#include <QObject>
-
-class EObjBExtraPrivate;
-class EObjBExtra : public QObject
-{
- Q_OBJECT
-public:
- EObjBExtra();
- ~EObjBExtra();
-
-private:
- EObjBExtraPrivate* const d;
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp
deleted file mode 100644
index 3231fac96..000000000
--- a/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef EOBJBEXTRA_P_HPP
-#define EOBJBEXTRA_P_HPP
-
-#include <QObject>
-
-class EObjBExtraPrivate : public QObject
-{
- Q_OBJECT
-public:
- EObjBExtraPrivate();
- ~EObjBExtraPrivate();
-};
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp b/Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp
deleted file mode 100644
index 6b92f2194..000000000
--- a/Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "GObj.hpp"
-#include "GObj_p.hpp"
-
-namespace subGlobal {
-
-class GObjLocal : public QObject
-{
- Q_OBJECT
-public:
- GObjLocal();
- ~GObjLocal();
-};
-
-GObjLocal::GObjLocal()
-{
-}
-
-GObjLocal::~GObjLocal()
-{
-}
-
-GObjPrivate::GObjPrivate()
-{
-}
-
-GObjPrivate::~GObjPrivate()
-{
-}
-
-GObj::GObj()
-{
- GObjLocal localObj;
-}
-
-GObj::~GObj()
-{
-}
-}
-
-// For the local QObject
-#include "GObj.moc"
diff --git a/Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp b/Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp
deleted file mode 100644
index 2f9ee8207..000000000
--- a/Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef GOBJ_HPP
-#define GOBJ_HPP
-
-#include <QObject>
-
-namespace subGlobal {
-
-class GObj : public QObject
-{
- Q_OBJECT
-public:
- GObj();
- ~GObj();
-};
-}
-
-#endif
diff --git a/Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp b/Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp
deleted file mode 100644
index 4a4375543..000000000
--- a/Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef GOBJ_P_HPP
-#define GOBJ_P_HPP
-
-#include <QObject>
-
-namespace subGlobal {
-
-class GObjPrivate : public QObject
-{
- Q_OBJECT
-public:
- GObjPrivate();
- ~GObjPrivate();
-};
-}
-
-#endif
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt
deleted file mode 100644
index 8b4da3453..000000000
--- a/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-project(MocIncludeRelaxed)
-include("../AutogenCoreTest.cmake")
-
-# Test moc include patterns
-set(CMAKE_AUTOMOC_RELAXED_MODE TRUE)
-
-# Shared executable
-set(MOC_INCLUDE_NAME "mocIncludeRelaxed")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/shared.cmake)
-
-# Relaxed only executable
-add_executable(mocIncludeRelaxedOnly
- RObjA.cpp
- RObjB.cpp
- RObjC.cpp
- RMain.cpp
-)
-target_link_libraries(mocIncludeRelaxedOnly ${QT_LIBRARIES})
-set_target_properties(mocIncludeRelaxedOnly PROPERTIES AUTOMOC ON)
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp b/Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp
deleted file mode 100644
index 5b2c07032..000000000
--- a/Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// Relaxed AUTOMOC objects
-#include "RObjA.hpp"
-#include "RObjB.hpp"
-#include "RObjC.hpp"
-
-int main(int argv, char** args)
-{
- RObjA rObjA;
- RObjB rObjB;
- RObjC rObjC;
- return 0;
-}
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/RObjB.cpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjB.cpp
deleted file mode 100644
index c56d10f04..000000000
--- a/Tests/QtAutogen/MocIncludeRelaxed/RObjB.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "RObjB.hpp"
-#include "RObjBExtra.hpp"
-
-RObjBExtra::RObjBExtra()
-{
-}
-
-RObjBExtra::~RObjBExtra()
-{
-}
-
-RObjB::RObjB()
-{
- RObjBExtra extraObject;
-}
-
-RObjB::~RObjB()
-{
-}
-
-// Relaxed mode should run moc on RObjBExtra.hpp instead
-#include "RObjBExtra.moc"
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/RObjC.cpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjC.cpp
deleted file mode 100644
index 4ba32f54b..000000000
--- a/Tests/QtAutogen/MocIncludeRelaxed/RObjC.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include "RObjC.hpp"
-#include <QObject>
-
-class RObjCPrivate : public QObject
-{
- Q_OBJECT
-public:
- RObjCPrivate();
- ~RObjCPrivate();
-};
-
-RObjCPrivate::RObjCPrivate()
-{
-}
-
-RObjCPrivate::~RObjCPrivate()
-{
-}
-
-RObjC::RObjC()
-{
- RObjCPrivate privateObject;
-}
-
-RObjC::~RObjC()
-{
-}
-
-// Relaxed include should moc this source instead of the header
-#include "moc_RObjC.cpp"
diff --git a/Tests/QtAutogen/MocIncludeRelaxed/main.cpp b/Tests/QtAutogen/MocIncludeRelaxed/main.cpp
deleted file mode 100644
index 5a3148dda..000000000
--- a/Tests/QtAutogen/MocIncludeRelaxed/main.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "EObjA.hpp"
-#include "EObjB.hpp"
-#include "LObjA.hpp"
-#include "LObjB.hpp"
-#include "ObjA.hpp"
-#include "ObjB.hpp"
-#include "SObjA.hpp"
-#include "SObjB.hpp"
-#include "subGlobal/GObj.hpp"
-
-int main(int argv, char** args)
-{
- subGlobal::GObj gObj;
- ObjA objA;
- ObjB objB;
- LObjA lObjA;
- LObjB lObjB;
- EObjA eObjA;
- EObjB eObjB;
- SObjA sObjA;
- SObjB sObjB;
- return 0;
-}
-
-// Header in global subdirectory
-#include "subGlobal/moc_GObj.cpp"
diff --git a/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt b/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt
deleted file mode 100644
index d0aaebf37..000000000
--- a/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-cmake_minimum_required(VERSION 3.10)
-project(MocIncludeStrict)
-include("../AutogenCoreTest.cmake")
-
-# Test moc include patterns
-set(CMAKE_AUTOMOC_RELAXED_MODE FALSE)
-
-# Shared executable
-set(MOC_INCLUDE_NAME "mocIncludeStrict")
-include(${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/shared.cmake)
diff --git a/Tests/QtAutogen/MocIncludeStrict/main.cpp b/Tests/QtAutogen/MocIncludeStrict/main.cpp
deleted file mode 100644
index 5a3148dda..000000000
--- a/Tests/QtAutogen/MocIncludeStrict/main.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "EObjA.hpp"
-#include "EObjB.hpp"
-#include "LObjA.hpp"
-#include "LObjB.hpp"
-#include "ObjA.hpp"
-#include "ObjB.hpp"
-#include "SObjA.hpp"
-#include "SObjB.hpp"
-#include "subGlobal/GObj.hpp"
-
-int main(int argv, char** args)
-{
- subGlobal::GObj gObj;
- ObjA objA;
- ObjB objB;
- LObjA lObjA;
- LObjB lObjB;
- EObjA eObjA;
- EObjB eObjB;
- SObjA sObjA;
- SObjB sObjB;
- return 0;
-}
-
-// Header in global subdirectory
-#include "subGlobal/moc_GObj.cpp"
diff --git a/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt b/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
new file mode 100644
index 000000000..1627b394f
--- /dev/null
+++ b/Tests/QtAutogen/MocIncludeSymlink/CMakeLists.txt
@@ -0,0 +1,80 @@
+cmake_minimum_required(VERSION 3.15)
+project(MocIncludeSymlink)
+include("../AutogenCoreTest.cmake")
+
+#
+# Tests if MocInclude can be build when
+# - The source directory is a symbolic link
+# - The build directory is a symbolic link
+#
+
+# -- Utility variables
+set(CS_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+set(CB_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+
+# Absolute MocInclude path
+get_filename_component(MocIncludePath "../MocInclude" ABSOLUTE)
+message("MocIncludePath: ${MocIncludePath}")
+
+# Use nested subdirectories to ensure relatives paths are correct as well
+set(BUILD_DIR_NORMAL "${CB_DIR}/Build/Normal")
+set(BUILD_DIR_LINKED "${CB_DIR}/Build/Linked")
+
+set(SL_SOURCE_DIR "${CB_DIR}/SL_Source")
+set(SL_BUILD_DIR "${CB_DIR}/SL_Build")
+
+# -- Utility macros
+function(makeSymLink origin link)
+ message("Creating symbolic link\n Link: ${link}\n To: ${origin}")
+ file(CREATE_LINK ${origin} ${link} RESULT res SYMBOLIC)
+ if(NOT (${res} STREQUAL "0"))
+ message("Symlink creation failed.\n Link: ${link}\n To: ${origin}\n Result: ${res}")
+ endif()
+endfunction()
+
+# -- Make source directory symlink
+makeSymLink(${MocIncludePath} ${SL_SOURCE_DIR} linkResult)
+if(NOT EXISTS ${SL_SOURCE_DIR})
+ message("Directory symlink can't be created. Skipping test.")
+ return()
+endif()
+
+# -- Make normal build directory
+file(REMOVE_RECURSE ${BUILD_DIR_NORMAL})
+file(MAKE_DIRECTORY ${BUILD_DIR_NORMAL})
+
+# -- Make linked build directory and symlink
+file(REMOVE_RECURSE ${BUILD_DIR_LINKED})
+file(MAKE_DIRECTORY ${BUILD_DIR_LINKED})
+makeSymLink(${BUILD_DIR_LINKED} ${SL_BUILD_DIR} linkResult)
+if(NOT EXISTS ${SL_BUILD_DIR})
+ message("Directory symlink can't be created. Skipping test.")
+ return()
+endif()
+
+
+# -- Building
+macro(buildMocInclude sourceDir binaryDir)
+ message("Building MocInclude\n - source dir: ${sourceDir}\n - binary dir: ${binaryDir}\n")
+ try_compile(result
+ "${binaryDir}"
+ "${sourceDir}"
+ MocInclude
+ CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+ "-DCMAKE_AUTOGEN_VERBOSE=${CMAKE_AUTOGEN_VERBOSE}"
+ "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
+ OUTPUT_VARIABLE output
+ )
+ if (result)
+ message(STATUS "--- Build success. ---")
+ else()
+ message(STATUS "\n### Building MocInclude failed. ###\n\n--- Output ---\n${output}")
+ message(FATAL_ERROR "--- Building MocInclude failed. End of output. ---")
+ endif()
+endmacro()
+
+message("\nTry building with\n - symbolic link source dir\n - non symbolic build dir\n")
+buildMocInclude(${SL_SOURCE_DIR} ${BUILD_DIR_NORMAL})
+
+message("\nTry building with\n - symbolic link source dir\n - symbolic link build dir\n")
+buildMocInclude(${SL_SOURCE_DIR} ${SL_BUILD_DIR})
diff --git a/Tests/QtAutogen/MocOnly/main.cpp b/Tests/QtAutogen/MocOnly/main.cpp
index b83b8063b..ec8da214e 100644
--- a/Tests/QtAutogen/MocOnly/main.cpp
+++ b/Tests/QtAutogen/MocOnly/main.cpp
@@ -1,8 +1,9 @@
+#include <iostream>
+
#include "IncA.hpp"
#include "IncB.hpp"
#include "StyleA.hpp"
#include "StyleB.hpp"
-#include <iostream>
int main(int argv, char** args)
{
diff --git a/Tests/QtAutogen/MocOsMacros/TestClass.cpp b/Tests/QtAutogen/MocOsMacros/TestClass.cpp
index 13f8fd93a..babc08b12 100644
--- a/Tests/QtAutogen/MocOsMacros/TestClass.cpp
+++ b/Tests/QtAutogen/MocOsMacros/TestClass.cpp
@@ -1,4 +1,5 @@
#include "TestClass.hpp"
+
#include <iostream>
void TestClass::open()
diff --git a/Tests/QtAutogen/MocOsMacros/main.cpp b/Tests/QtAutogen/MocOsMacros/main.cpp
index f8eec3cbc..c427345be 100644
--- a/Tests/QtAutogen/MocOsMacros/main.cpp
+++ b/Tests/QtAutogen/MocOsMacros/main.cpp
@@ -1,6 +1,7 @@
-#include "TestClass.hpp"
#include <QtGlobal>
+#include "TestClass.hpp"
+
int main()
{
TestClass a;
diff --git a/Tests/QtAutogen/ObjectLibrary/a/classa.cpp b/Tests/QtAutogen/ObjectLibrary/a/classa.cpp
index 4f08fda84..a548652dd 100644
--- a/Tests/QtAutogen/ObjectLibrary/a/classa.cpp
+++ b/Tests/QtAutogen/ObjectLibrary/a/classa.cpp
@@ -1,4 +1,5 @@
#include "classa.h"
+
#include <QDebug>
void ClassA::slotDoSomething()
diff --git a/Tests/QtAutogen/ObjectLibrary/b/classb.cpp b/Tests/QtAutogen/ObjectLibrary/b/classb.cpp
index 26e09261c..e5cc2e77e 100644
--- a/Tests/QtAutogen/ObjectLibrary/b/classb.cpp
+++ b/Tests/QtAutogen/ObjectLibrary/b/classb.cpp
@@ -1,4 +1,5 @@
#include "classb.h"
+
#include <QDebug>
void ClassB::slotDoSomething()
diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp
index 35158a4b0..e1fdf0bbd 100644
--- a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp
+++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp
@@ -1,9 +1,10 @@
#ifndef STYLEA_HPP
#define STYLEA_HPP
-#include "UtilityMacros.hpp"
#include <QStylePlugin>
+#include "UtilityMacros.hpp"
+
class StyleA : public QStylePlugin
{
Q_OBJECT
diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp
index 15b79c598..7550d0c3b 100644
--- a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp
+++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp
@@ -1,9 +1,10 @@
#ifndef STYLEB_HPP
#define STYLEB_HPP
-#include "UtilityMacros.hpp"
#include <QStylePlugin>
+#include "UtilityMacros.hpp"
+
class StyleB : public QStylePlugin
{
Q_OBJECT
diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp
index b0a41150b..ec71becda 100644
--- a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp
+++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp
@@ -1,9 +1,10 @@
#ifndef STYLEC_HPP
#define STYLEC_HPP
-#include "UtilityMacros.hpp"
#include <QStylePlugin>
+#include "UtilityMacros.hpp"
+
class StyleC : public QStylePlugin
{
Q_OBJECT
diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp
index 9696aaa26..3c093b914 100644
--- a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp
+++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp
@@ -1,9 +1,10 @@
#ifndef STYLED_HPP
#define STYLED_HPP
-#include "UtilityMacros.hpp"
#include <QStylePlugin>
+#include "UtilityMacros.hpp"
+
class StyleD : public QStylePlugin
{
Q_OBJECT
diff --git a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp
index f9734db4d..5f10fb4a0 100644
--- a/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp
+++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp
@@ -1,9 +1,10 @@
#ifndef STYLEE_INCLUDE_HPP
#define STYLEE_INCLUDE_HPP
-#include "UtilityMacros.hpp"
#include <QStylePlugin>
+#include "UtilityMacros.hpp"
+
class StyleE : public QStylePlugin
{
Q_OBJECT
diff --git a/Tests/QtAutogen/SameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt
index 0a80d5eee..1919cc739 100644
--- a/Tests/QtAutogen/SameName/CMakeLists.txt
+++ b/Tests/QtAutogen/SameName/CMakeLists.txt
@@ -18,9 +18,11 @@ add_executable(sameName
ccc/data.qrc
item.cpp
object.h
+ object.hh
object.h++
object.hpp
object.hxx
+ object_upper_ext.H
data.qrc
main.cpp
)
diff --git a/Tests/QtAutogen/SameName/main.cpp b/Tests/QtAutogen/SameName/main.cpp
index 92f15cd5f..725f4cd7b 100644
--- a/Tests/QtAutogen/SameName/main.cpp
+++ b/Tests/QtAutogen/SameName/main.cpp
@@ -6,8 +6,10 @@
#include "item.hpp"
#include "object.h"
#include "object.h++"
+#include "object.hh"
#include "object.hpp"
#include "object.hxx"
+#include "object_upper_ext.H"
int main(int argv, char** args)
{
@@ -20,8 +22,10 @@ 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;
+ ::Object_Upper_Ext_H obj_upper_ext_h;
return 0;
}
diff --git a/Tests/QtAutogen/SameName/object.hh b/Tests/QtAutogen/SameName/object.hh
new file mode 100644
index 000000000..3e16f8332
--- /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/SameName/object_upper_ext.H b/Tests/QtAutogen/SameName/object_upper_ext.H
new file mode 100644
index 000000000..3266087d4
--- /dev/null
+++ b/Tests/QtAutogen/SameName/object_upper_ext.H
@@ -0,0 +1,13 @@
+#ifndef OBJECT_UPPER_EXT_H
+#define OBJECT_UPPER_EXT_H
+
+#include <QObject>
+
+class Object_Upper_Ext_H : public QObject
+{
+ Q_OBJECT
+ Q_SLOT
+ void go(){};
+};
+
+#endif
diff --git a/Tests/QtAutogen/StaticLibraryCycle/a.cpp b/Tests/QtAutogen/StaticLibraryCycle/a.cpp
index faa52e610..8dd1803f1 100644
--- a/Tests/QtAutogen/StaticLibraryCycle/a.cpp
+++ b/Tests/QtAutogen/StaticLibraryCycle/a.cpp
@@ -1,4 +1,5 @@
#include "a.h"
+
#include "b.h"
bool A::recursed = false;
diff --git a/Tests/QtAutogen/StaticLibraryCycle/b.cpp b/Tests/QtAutogen/StaticLibraryCycle/b.cpp
index a807d89cf..dee26177a 100644
--- a/Tests/QtAutogen/StaticLibraryCycle/b.cpp
+++ b/Tests/QtAutogen/StaticLibraryCycle/b.cpp
@@ -1,4 +1,5 @@
#include "b.h"
+
#include "c.h"
B::B()
diff --git a/Tests/QtAutogen/StaticLibraryCycle/c.cpp b/Tests/QtAutogen/StaticLibraryCycle/c.cpp
index 7d427c234..2871f62f6 100644
--- a/Tests/QtAutogen/StaticLibraryCycle/c.cpp
+++ b/Tests/QtAutogen/StaticLibraryCycle/c.cpp
@@ -1,4 +1,5 @@
#include "c.h"
+
#include "a.h"
C::C()
diff --git a/Tests/QtAutogen/Tests.cmake b/Tests/QtAutogen/Tests.cmake
index 6771828e6..2b001d452 100644
--- a/Tests/QtAutogen/Tests.cmake
+++ b/Tests/QtAutogen/Tests.cmake
@@ -32,8 +32,8 @@ ADD_AUTOGEN_TEST(UicSkipSource)
if(QT_TEST_ALLOW_QT_MACROS)
ADD_AUTOGEN_TEST(MocCMP0071)
- ADD_AUTOGEN_TEST(MocIncludeRelaxed mocIncludeRelaxed)
- ADD_AUTOGEN_TEST(MocIncludeStrict mocIncludeStrict)
+ ADD_AUTOGEN_TEST(MocInclude)
+ ADD_AUTOGEN_TEST(MocIncludeSymlink)
ADD_AUTOGEN_TEST(MocSkipSource)
endif()
diff --git a/Tests/QtAutogen/UicInterface/libwidget.h b/Tests/QtAutogen/UicInterface/libwidget.h
index a7ad14f62..532ff1db1 100644
--- a/Tests/QtAutogen/UicInterface/libwidget.h
+++ b/Tests/QtAutogen/UicInterface/libwidget.h
@@ -2,9 +2,10 @@
#ifndef LIBWIDGET_H
#define LIBWIDGET_H
-#include <QWidget>
#include <memory>
+#include <QWidget>
+
#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
# include <klocalizedstring.h>
#endif
diff --git a/Tests/QtAutogen/UicInterface/mywidget.h b/Tests/QtAutogen/UicInterface/mywidget.h
index 1d31ce7a7..320d433ba 100644
--- a/Tests/QtAutogen/UicInterface/mywidget.h
+++ b/Tests/QtAutogen/UicInterface/mywidget.h
@@ -2,9 +2,10 @@
#ifndef MYWIDGET_H
#define MYWIDGET_H
-#include <QWidget>
#include <memory>
+#include <QWidget>
+
#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0)
# include <klocalizedstring.h>
#endif
diff --git a/Tests/QtAutogen/UicSkipSource/skipUicGen.cpp b/Tests/QtAutogen/UicSkipSource/skipUicGen.cpp
index d2a55a6f1..ab3c454c7 100644
--- a/Tests/QtAutogen/UicSkipSource/skipUicGen.cpp
+++ b/Tests/QtAutogen/UicSkipSource/skipUicGen.cpp
@@ -1,5 +1,6 @@
#include "skipUicGen.hpp"
+
#include "ui_uigen2.h"
void skipGen()
diff --git a/Tests/QtAutogen/UicSkipSource/skipUicNoGen1.cpp b/Tests/QtAutogen/UicSkipSource/skipUicNoGen1.cpp
index f591a42ba..d648d94e7 100644
--- a/Tests/QtAutogen/UicSkipSource/skipUicNoGen1.cpp
+++ b/Tests/QtAutogen/UicSkipSource/skipUicNoGen1.cpp
@@ -1,5 +1,6 @@
#include "skipUicNoGen1.hpp"
+
#include "ui_nogen2.h"
void skipNoGen1()
diff --git a/Tests/QtAutogen/UicSkipSource/skipUicNoGen2.cpp b/Tests/QtAutogen/UicSkipSource/skipUicNoGen2.cpp
index 8c1c3241c..aca58a463 100644
--- a/Tests/QtAutogen/UicSkipSource/skipUicNoGen2.cpp
+++ b/Tests/QtAutogen/UicSkipSource/skipUicNoGen2.cpp
@@ -1,5 +1,6 @@
#include "skipUicNoGen2.hpp"
+
#include "ui_nogen2.h"
void skipNoGen2()
diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake
index aaa7c8919..d96ab8648 100644
--- a/Tests/RunCMake/Android/common.cmake
+++ b/Tests/RunCMake/Android/common.cmake
@@ -6,8 +6,6 @@ if(NOT ANDROID)
endif()
foreach(f
- "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}"
- "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}g++${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
"${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ar${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
"${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}ld${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}"
)
@@ -51,23 +49,26 @@ elseif(CMAKE_ANDROID_STANDALONE_TOOLCHAIN)
endif()
endif()
-execute_process(
- COMMAND "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}" -dumpmachine
- OUTPUT_VARIABLE _out OUTPUT_STRIP_TRAILING_WHITESPACE
- ERROR_VARIABLE _err
- RESULT_VARIABLE _res
- )
-if(NOT _res EQUAL 0)
- message(SEND_ERROR "Failed to run 'gcc -dumpmachine':\n ${_res}")
-endif()
-string(REPLACE "--" "-" _out_check "${_out}")
-if(NOT _out_check STREQUAL "${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}"
- AND NOT (_out STREQUAL "arm--linux-android" AND CMAKE_C_ANDROID_TOOLCHAIN_MACHINE STREQUAL "arm-linux-androideabi"))
- message(SEND_ERROR "'gcc -dumpmachine' produced:\n"
- " ${_out}\n"
- "which does not match CMAKE_C_ANDROID_TOOLCHAIN_MACHINE:\n"
- " ${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}"
+set(gcc ${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX})
+if(EXISTS "${gcc}")
+ execute_process(
+ COMMAND "${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}gcc${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}" -dumpmachine
+ OUTPUT_VARIABLE _out OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_VARIABLE _err
+ RESULT_VARIABLE _res
)
+ if(NOT _res EQUAL 0)
+ message(SEND_ERROR "Failed to run 'gcc -dumpmachine':\n ${_res}")
+ endif()
+ string(REPLACE "--" "-" _out_check "${_out}")
+ if(NOT _out_check STREQUAL "${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}"
+ AND NOT (_out STREQUAL "arm--linux-android" AND CMAKE_C_ANDROID_TOOLCHAIN_MACHINE STREQUAL "arm-linux-androideabi"))
+ message(SEND_ERROR "'gcc -dumpmachine' produced:\n"
+ " ${_out}\n"
+ "which does not match CMAKE_C_ANDROID_TOOLCHAIN_MACHINE:\n"
+ " ${CMAKE_C_ANDROID_TOOLCHAIN_MACHINE}"
+ )
+ endif()
endif()
if(CMAKE_ANDROID_STL_TYPE STREQUAL "none")
diff --git a/Tests/RunCMake/Android/ndk-arm64-v8a-stdout.txt b/Tests/RunCMake/Android/ndk-arm64-v8a-stdout.txt
index 8d0bdc293..a228ccc0a 100644
--- a/Tests/RunCMake/Android/ndk-arm64-v8a-stdout.txt
+++ b/Tests/RunCMake/Android/ndk-arm64-v8a-stdout.txt
@@ -1,2 +1,2 @@
-- Android: Targeting API '[0-9]+' with architecture 'arm64', ABI 'arm64-v8a', and processor 'aarch64'
--- Android: Selected (Clang toolchain '[^']+' with )?GCC toolchain '[^']+'
+-- Android: Selected (unified Clang toolchain|(Clang toolchain '[^']+' with )?GCC toolchain '[^']+')
diff --git a/Tests/RunCMake/Android/ndk-armeabi-arm-stdout.txt b/Tests/RunCMake/Android/ndk-armeabi-arm-stdout.txt
index 3741da3c4..72ec00ebc 100644
--- a/Tests/RunCMake/Android/ndk-armeabi-arm-stdout.txt
+++ b/Tests/RunCMake/Android/ndk-armeabi-arm-stdout.txt
@@ -1,3 +1,3 @@
-- Android: Targeting API '[0-9]+' with architecture 'arm', ABI 'armeabi', and processor 'armv5te'
--- Android: Selected (Clang toolchain '[^']+' with )?GCC toolchain '[^']+'
+-- Android: Selected (unified Clang toolchain|(Clang toolchain '[^']+' with )?GCC toolchain '[^']+')
.*-- CMAKE_ANDROID_ARM_MODE=1
diff --git a/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stdout.txt b/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stdout.txt
index ac2bfd5a9..8bd87fa27 100644
--- a/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stdout.txt
+++ b/Tests/RunCMake/Android/ndk-armeabi-v7a-neon-stdout.txt
@@ -1,3 +1,3 @@
-- Android: Targeting API '[0-9]+' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
--- Android: Selected (Clang toolchain '[^']+' with )?GCC toolchain '[^']+'
+-- Android: Selected (unified Clang toolchain|(Clang toolchain '[^']+' with )?GCC toolchain '[^']+')
.*-- CMAKE_ANDROID_ARM_NEON=1
diff --git a/Tests/RunCMake/Android/ndk-armeabi-v7a-stdout.txt b/Tests/RunCMake/Android/ndk-armeabi-v7a-stdout.txt
index 0edb4f7be..554548ed8 100644
--- a/Tests/RunCMake/Android/ndk-armeabi-v7a-stdout.txt
+++ b/Tests/RunCMake/Android/ndk-armeabi-v7a-stdout.txt
@@ -1,3 +1,3 @@
-- Android: Targeting API '[0-9]+' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
--- Android: Selected (Clang toolchain '[^']+' with )?GCC toolchain '[^']+'
+-- Android: Selected (unified Clang toolchain|(Clang toolchain '[^']+' with )?GCC toolchain '[^']+')
.*-- CMAKE_ANDROID_ARM_NEON=0
diff --git a/Tests/RunCMake/Android/ndk-badver-stderr.txt b/Tests/RunCMake/Android/ndk-badver-stderr.txt
index df2c5e622..ce6bc4e63 100644
--- a/Tests/RunCMake/Android/ndk-badver-stderr.txt
+++ b/Tests/RunCMake/Android/ndk-badver-stderr.txt
@@ -1,11 +1,12 @@
^CMake Error at .*/Modules/Platform/Android/Determine-Compiler-NDK.cmake:[0-9]+ \(message\):
- Android: The CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION value 'badver' is not one
+ Android: The CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION value 'badver' is not(
+ supported by this NDK. It must be 'clang' or not set at all\.| one
of the allowed forms:
<major>.<minor> = GCC of specified version
clang<major>.<minor> = Clang of specified version
clang = Clang of most recent available version
-
+)
Call Stack \(most recent call first\):
.*
ndk-badver.cmake:1 \(enable_language\)
diff --git a/Tests/RunCMake/Android/ndk-badvernum-stderr.txt b/Tests/RunCMake/Android/ndk-badvernum-stderr.txt
index adacaf160..aec91d95e 100644
--- a/Tests/RunCMake/Android/ndk-badvernum-stderr.txt
+++ b/Tests/RunCMake/Android/ndk-badvernum-stderr.txt
@@ -1,4 +1,6 @@
-^CMake Error at .*/Modules/Platform/Android/Determine-Compiler-NDK.cmake:[0-9]+ \(message\):
+^CMake Error at .*/Modules/Platform/Android/Determine-Compiler-NDK.cmake:[0-9]+ \(message\):(
+ Android: The CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION value '1.0' is not
+ supported by this NDK. It must be 'clang' or not set at all.|
Android: No toolchain for ABI 'armeabi(-v7a)?' found in the NDK:
.*
@@ -6,7 +8,7 @@
of the version specified by CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION:
1\.0
-
+)
Call Stack \(most recent call first\):
.*
ndk-badvernum.cmake:1 \(enable_language\)
diff --git a/Tests/RunCMake/Android/ndk-mips-stdout.txt b/Tests/RunCMake/Android/ndk-mips-stdout.txt
index c74468362..8ce544dcc 100644
--- a/Tests/RunCMake/Android/ndk-mips-stdout.txt
+++ b/Tests/RunCMake/Android/ndk-mips-stdout.txt
@@ -1,2 +1,2 @@
-- Android: Targeting API '[0-9]+' with architecture 'mips', ABI 'mips', and processor 'mips'
--- Android: Selected (Clang toolchain '[^']+' with )?GCC toolchain '[^']+'
+-- Android: Selected (unified Clang toolchain|(Clang toolchain '[^']+' with )?GCC toolchain '[^']+')
diff --git a/Tests/RunCMake/Android/ndk-mips64-stdout.txt b/Tests/RunCMake/Android/ndk-mips64-stdout.txt
index 839ddfd1c..1d7edea60 100644
--- a/Tests/RunCMake/Android/ndk-mips64-stdout.txt
+++ b/Tests/RunCMake/Android/ndk-mips64-stdout.txt
@@ -1,2 +1,2 @@
-- Android: Targeting API '[0-9]+' with architecture 'mips64', ABI 'mips64', and processor 'mips64'
--- Android: Selected (Clang toolchain '[^']+' with )?GCC toolchain '[^']+'
+-- Android: Selected (unified Clang toolchain|(Clang toolchain '[^']+' with )?GCC toolchain '[^']+')
diff --git a/Tests/RunCMake/Android/ndk-x86-stdout.txt b/Tests/RunCMake/Android/ndk-x86-stdout.txt
index 2dbb2f05e..8d710fe91 100644
--- a/Tests/RunCMake/Android/ndk-x86-stdout.txt
+++ b/Tests/RunCMake/Android/ndk-x86-stdout.txt
@@ -1,2 +1,2 @@
-- Android: Targeting API '[0-9]+' with architecture 'x86', ABI 'x86', and processor 'i686'
--- Android: Selected (Clang toolchain '[^']+' with )?GCC toolchain '[^']+'
+-- Android: Selected (unified Clang toolchain|(Clang toolchain '[^']+' with )?GCC toolchain '[^']+')
diff --git a/Tests/RunCMake/Android/ndk-x86_64-stdout.txt b/Tests/RunCMake/Android/ndk-x86_64-stdout.txt
index a7ae91d09..695a088bd 100644
--- a/Tests/RunCMake/Android/ndk-x86_64-stdout.txt
+++ b/Tests/RunCMake/Android/ndk-x86_64-stdout.txt
@@ -1,2 +1,2 @@
-- Android: Targeting API '[0-9]+' with architecture 'x86_64', ABI 'x86_64', and processor 'x86_64'
--- Android: Selected (Clang toolchain '[^']+' with )?GCC toolchain '[^']+'
+-- Android: Selected (unified Clang toolchain|(Clang toolchain '[^']+' with )?GCC toolchain '[^']+')
diff --git a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake
index 27a609dcb..6c9be4bb1 100644
--- a/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake
+++ b/Tests/RunCMake/AutoExportDll/RunCMakeTest.cmake
@@ -7,9 +7,13 @@ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
run_cmake(AutoExport)
unset(RunCMake_TEST_OPTIONS)
# don't run this test on Watcom or Borland make as it is not supported
-if("${RunCMake_GENERATOR}" MATCHES "Watcom WMake|Borland Makefiles")
+if(RunCMake_GENERATOR MATCHES "Watcom WMake|Borland Makefiles")
return()
endif()
+if(RunCMake_GENERATOR MATCHES "Ninja|Visual Studio" AND
+ CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ set(EXPORTS TRUE)
+endif()
# we build debug so the say.exe will be found in Debug/say.exe for
# Visual Studio generators
if(RunCMake_GENERATOR_IS_MULTI_CONFIG)
@@ -18,9 +22,36 @@ endif()
# build AutoExport
run_cmake_command(AutoExportBuild ${CMAKE_COMMAND} --build
${RunCMake_TEST_BINARY_DIR} --config Debug --clean-first)
+# save the current timestamp of exports.def
+if(EXPORTS)
+ set(EXPORTS_DEF "${RunCMake_TEST_BINARY_DIR}/say.dir/${INTDIR}exports.def")
+ if(NOT EXISTS "${EXPORTS_DEF}")
+ set(EXPORTS_DEF
+ "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/say.dir/${INTDIR}exports.def")
+ endif()
+ file(TIMESTAMP "${EXPORTS_DEF}" timestamp)
+ if(NOT timestamp)
+ message(SEND_ERROR "Could not get timestamp for \"${EXPORTS_DEF}\"")
+ endif()
+endif()
# run the executable that uses symbols from the dll
if(WIN32)
set(EXE_EXT ".exe")
endif()
run_cmake_command(AutoExportRun
- ${RunCMake_BINARY_DIR}/AutoExport-build/bin/${INTDIR}say${EXE_EXT})
+ ${RunCMake_TEST_BINARY_DIR}/bin/${INTDIR}say${EXE_EXT})
+# build AutoExport again without modification
+run_cmake_command(AutoExportBuildAgain ${CMAKE_COMMAND} --build
+ ${RunCMake_TEST_BINARY_DIR} --config Debug)
+# compare timestamps of exports.def to make sure it has not been updated
+if(EXPORTS)
+ file(TIMESTAMP "${EXPORTS_DEF}" timestamp_after)
+ if(NOT timestamp_after)
+ message(SEND_ERROR "Could not get timestamp for \"${EXPORTS_DEF}\"")
+ endif()
+ if (timestamp_after STREQUAL timestamp)
+ message(STATUS "AutoExportTimeStamp - PASSED")
+ else()
+ message(SEND_ERROR "\"${EXPORTS_DEF}\" has been updated.")
+ endif()
+endif()
diff --git a/Tests/RunCMake/AutoExportDll/hello.cxx b/Tests/RunCMake/AutoExportDll/hello.cxx
index 533fd3e72..74e7a4e94 100644
--- a/Tests/RunCMake/AutoExportDll/hello.cxx
+++ b/Tests/RunCMake/AutoExportDll/hello.cxx
@@ -1,4 +1,5 @@
#include "hello.h"
+
#include <stdio.h>
int Hello::Data = 0;
void Hello::real()
diff --git a/Tests/RunCMake/AutoExportDll/say.cxx b/Tests/RunCMake/AutoExportDll/say.cxx
index c8bfcc7bd..654b5e03d 100644
--- a/Tests/RunCMake/AutoExportDll/say.cxx
+++ b/Tests/RunCMake/AutoExportDll/say.cxx
@@ -1,5 +1,6 @@
-#include "hello.h"
#include <stdio.h>
+
+#include "hello.h"
#ifdef _MSC_VER
# include "windows.h"
#else
diff --git a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
index 254a4ec02..e86b50eb1 100644
--- a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake
@@ -1,8 +1,11 @@
include(RunCMake)
run_cmake(OLDBad1)
-run_cmake(OLDBad2)
-run_cmake(NEWBad)
+if(NOT CMAKE_SYSTEM_NAME STREQUAL "AIX")
+ # Tests with ENABLE_EXPORTS ON. For AIX we do not use the flags at all.
+ run_cmake(OLDBad2)
+ run_cmake(NEWBad)
+endif()
run_cmake(NEWGood)
run_cmake(WARN-OFF)
run_cmake(WARN-ON)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 69f816215..6b2f117a8 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -120,7 +120,7 @@ add_RunCMake_test(CMP0081)
# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode
# generators ignore. The policy will have no effect on those generators.
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode")
- add_RunCMake_test(CMP0065)
+ add_RunCMake_test(CMP0065 -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
endif()
if(CMAKE_GENERATOR MATCHES "Make")
add_RunCMake_test(Make -DMAKE_IS_GNU=${MAKE_IS_GNU})
@@ -167,7 +167,7 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Unix Makefiles|Ninja")
add_RunCMake_test(CompilerChange)
endif()
add_RunCMake_test(CompilerNotFound)
-add_RunCMake_test(Configure)
+add_RunCMake_test(Configure -DMSVC_IDE=${MSVC_IDE})
add_RunCMake_test(DisallowedCommands)
add_RunCMake_test(ExternalData)
add_RunCMake_test(FeatureSummary)
@@ -201,6 +201,7 @@ if(MSVC)
endif()
add_RunCMake_test(ObjectLibrary)
add_RunCMake_test(ParseImplicitIncludeInfo)
+add_RunCMake_test(ParseImplicitLinkInfo)
if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
add_RunCMake_test(RuntimePath)
endif()
@@ -248,7 +249,8 @@ add_RunCMake_test(export)
add_RunCMake_test(cmake_minimum_required)
add_RunCMake_test(cmake_parse_arguments)
add_RunCMake_test(continue)
-add_RunCMake_test(ctest_build)
+add_executable(color_warning color_warning.c)
+add_RunCMake_test(ctest_build -DCOLOR_WARNING=$<TARGET_FILE:color_warning>)
add_RunCMake_test(ctest_cmake_error)
add_RunCMake_test(ctest_configure)
if(COVERAGE_COMMAND)
@@ -311,6 +313,8 @@ function(add_RunCMake_test_try_compile)
CMAKE_CXX_COMPILER_VERSION
CMAKE_CXX_STANDARD_DEFAULT
CMake_TEST_CUDA
+ CMAKE_OBJC_STANDARD_DEFAULT
+ CMAKE_OBJCXX_STANDARD_DEFAULT
)
if(DEFINED ${var})
list(APPEND try_compile_ARGS -D${var}=${${var}})
@@ -333,6 +337,44 @@ add_RunCMake_test(no_install_prefix)
add_RunCMake_test(configure_file)
add_RunCMake_test(CTestTimeoutAfterMatch)
+# ctresalloc links against CMakeLib and CTestLib, which means it can't be built
+# if CMake_TEST_EXTERNAL_CMAKE is activated (the compiler might be different.)
+# So, it has to be provided in the original build tree.
+if(CMake_TEST_EXTERNAL_CMAKE)
+ set(no_package_root_path)
+ if(NOT CMAKE_VERSION VERSION_LESS 3.12)
+ set(no_package_root_path NO_PACKAGE_ROOT_PATH)
+ endif()
+ find_program(ctresalloc ctresalloc PATHS ${CMake_TEST_EXTERNAL_CMAKE}
+ NO_DEFAULT_PATH
+ ${no_package_root_path}
+ NO_CMAKE_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_SYSTEM_PATH
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+ if(ctresalloc)
+ add_executable(ctresalloc IMPORTED)
+ set_property(TARGET ctresalloc PROPERTY IMPORTED_LOCATION ${ctresalloc})
+ endif()
+else()
+ add_executable(ctresalloc CTestResourceAllocation/ctresalloc.cxx)
+ target_link_libraries(ctresalloc CTestLib)
+ target_include_directories(ctresalloc PRIVATE
+ ${CMake_BINARY_DIR}/Source
+ ${CMake_SOURCE_DIR}/Source
+ ${CMake_SOURCE_DIR}/Source/CTest
+ )
+ set_property(TARGET ctresalloc PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMake_BIN_DIR})
+endif()
+
+if(TARGET ctresalloc)
+ add_RunCMake_test(CTestResourceAllocation -DCTRESALLOC_COMMAND=$<TARGET_FILE:ctresalloc>)
+else()
+ message(WARNING "Could not find or build ctresalloc")
+endif()
+
find_package(Qt4 QUIET)
find_package(Qt5Core QUIET)
if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0)
@@ -408,7 +450,12 @@ else()
set(NO_NAMELINK 0)
endif()
-add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN})
+add_RunCMake_test(install -DNO_NAMELINK=${NO_NAMELINK} -DCYGWIN=${CYGWIN} -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN=${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN}
+ -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME}
+ -DCMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG=${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}
+ -DCMAKE_EXECUTABLE_FORMAT=${CMAKE_EXECUTABLE_FORMAT})
+
add_RunCMake_test(CPackCommandLine)
add_RunCMake_test(CPackConfig)
add_RunCMake_test(CPackInstallProperties)
@@ -427,8 +474,8 @@ if(UNIX)
add_RunCMake_test(CPackSymlinks)
endif()
-set(IfacePaths_INCLUDE_DIRECTORIES_ARGS -DTEST_PROP=INCLUDE_DIRECTORIES)
-add_RunCMake_test(IfacePaths_INCLUDE_DIRECTORIES TEST_DIR IfacePaths)
+set(IfacePaths_INCDIRS_ARGS -DTEST_PROP=INCLUDE_DIRECTORIES)
+add_RunCMake_test(IfacePaths_INCDIRS TEST_DIR IfacePaths)
set(IfacePaths_SOURCES_ARGS -DTEST_PROP=SOURCES)
add_RunCMake_test(IfacePaths_SOURCES TEST_DIR IfacePaths)
@@ -503,6 +550,7 @@ set(cpack_tests
DEB.TIMESTAMPS
DEB.MD5SUMS
DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY
+ DEB.DEB_DESCRIPTION
RPM.CUSTOM_BINARY_SPEC_FILE
RPM.CUSTOM_NAMES
@@ -536,7 +584,7 @@ set(cpack_tests
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
-add_RunCMake_test(AutoExportDll)
+add_RunCMake_test(AutoExportDll -DCMAKE_CXX_COMPILER_ID=${CMAKE_CXX_COMPILER_ID})
add_RunCMake_test(AndroidMK)
@@ -565,3 +613,8 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|9[0-9])")
add_RunCMake_test(CSharpCustomCommand)
add_RunCMake_test(CSharpReferenceImport)
endif()
+
+add_RunCMake_test("CTestCommandExpandLists")
+
+add_RunCMake_test(PrecompileHeaders)
+add_RunCMake_test("UnityBuild")
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 37df57cd0..b154c79a0 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -33,6 +33,13 @@ run_cpack_test(TIMESTAMPS "DEB.TIMESTAMPS;TGZ" false "COMPONENT")
unset(ENVIRONMENT)
run_cpack_test(USER_FILELIST "RPM.USER_FILELIST" false "MONOLITHIC")
run_cpack_test(MD5SUMS "DEB.MD5SUMS" false "MONOLITHIC;COMPONENT")
-run_cpack_test(CPACK_INSTALL_SCRIPT "ZIP" false "MONOLITHIC")
+run_cpack_test_subtests(CPACK_INSTALL_SCRIPTS "singular;plural;both" "ZIP" false "MONOLITHIC")
run_cpack_test(DEB_PACKAGE_VERSION_BACK_COMPATIBILITY "DEB.DEB_PACKAGE_VERSION_BACK_COMPATIBILITY" false "MONOLITHIC;COMPONENT")
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"
+ "DEB.DEB_DESCRIPTION"
+ false
+ "MONOLITHIC;COMPONENT"
+)
diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake
deleted file mode 100644
index e3fe0ca47..000000000
--- a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/test.cmake
+++ /dev/null
@@ -1,11 +0,0 @@
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/abc.txt" "test content")
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/user-script.cmake"
- "file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/foo\"
- TYPE FILE FILES \"${CMAKE_CURRENT_BINARY_DIR}/abc.txt\")")
-set(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/user-script.cmake")
-
-function(run_after_include_cpack)
- file(READ "${CPACK_OUTPUT_CONFIG_FILE}" conf_file_)
- string(REGEX REPLACE "SET\\(CPACK_INSTALL_CMAKE_PROJECTS [^)]*\\)" "" conf_file_ "${conf_file_}")
- file(WRITE "${CPACK_OUTPUT_CONFIG_FILE}" "${conf_file_}")
-endfunction()
diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/ExpectedFiles.cmake
index 02a78215b..02a78215b 100644
--- a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPT/ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/ExpectedFiles.cmake
diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt
new file mode 100644
index 000000000..666030e29
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/both-stderr.txt
@@ -0,0 +1 @@
+CPack Warning: Both CPACK_INSTALL_SCRIPTS and CPACK_INSTALL_SCRIPT are set, the latter will be ignored.
diff --git a/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake
new file mode 100644
index 000000000..249d2e6bb
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/CPACK_INSTALL_SCRIPTS/test.cmake
@@ -0,0 +1,26 @@
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/abc.txt" "test content")
+set(user_script_ "${CMAKE_CURRENT_BINARY_DIR}/user-script.cmake")
+file(WRITE "${user_script_}"
+ "file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/foo\"
+ TYPE FILE FILES \"${CMAKE_CURRENT_BINARY_DIR}/abc.txt\")")
+
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "both")
+ set(CPACK_INSTALL_SCRIPT "${user_script_}")
+ set(CPACK_INSTALL_SCRIPTS "${CPACK_INSTALL_SCRIPT}")
+
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "singular")
+ set(CPACK_INSTALL_SCRIPT "${user_script_}")
+
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "plural")
+ set(CPACK_INSTALL_SCRIPTS "${user_script_}")
+
+else()
+ message(FATAL_ERROR "Unexpected subtest name: ${RunCMake_SUBTEST_SUFFIX}")
+
+endif()
+
+function(run_after_include_cpack)
+ file(READ "${CPACK_OUTPUT_CONFIG_FILE}" conf_file_)
+ string(REGEX REPLACE "SET\\(CPACK_INSTALL_CMAKE_PROJECTS [^)]*\\)" "" conf_file_ "${conf_file_}")
+ file(WRITE "${CPACK_OUTPUT_CONFIG_FILE}" "${conf_file_}")
+endfunction()
diff --git a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/ExpectedFiles.cmake b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/ExpectedFiles.cmake
new file mode 100644
index 000000000..39f18a3d6
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/ExpectedFiles.cmake
@@ -0,0 +1,16 @@
+set(EXPECTED_FILES_COUNT_MONOLITHIC "1")
+set(EXPECTED_FILES_COUNT_COMPONENT "2")
+set(EXPECTED_FILES_COUNT "${EXPECTED_FILES_COUNT_${PACKAGING_TYPE}}")
+
+if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(EXPECTED_FILE_1 "deb_description-0.1.1-*-satu.deb")
+ set(EXPECTED_FILE_2 "deb_description-0.1.1-*-dua.deb")
+ set(EXPECTED_FILE_CONTENT_1_LIST "/satu;/satu/CMakeLists.txt")
+ set(EXPECTED_FILE_CONTENT_2_LIST "/dua;/dua/CMakeLists.txt")
+
+elseif(PACKAGING_TYPE STREQUAL "MONOLITHIC")
+ set(EXPECTED_FILE_CONTENT_1_LIST "/dua;/dua/CMakeLists.txt;/satu;/satu/CMakeLists.txt")
+
+endif()
+
+# kate: indent-width 2;
diff --git a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
new file mode 100644
index 000000000..e9ac13ab1
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/VerifyResult.cmake
@@ -0,0 +1,65 @@
+function(checkPackageDescription FILE EXPECTED_DESCRIPTION)
+ getPackageInfo("${FILE}" "_file_info")
+ string(UUID uuid NAMESPACE 00000000-0000-0000-0000-000000000000 TYPE SHA1)
+ string(REPLACE ";" "${uuid}" _file_info "${_file_info}")
+ string(REPLACE ";" "${uuid}" EXPECTED_DESCRIPTION "${EXPECTED_DESCRIPTION}")
+ string(REPLACE "\n" ";" _file_info "${_file_info}")
+
+ set(_actual_description)
+ set(_parse_description FALSE)
+ foreach(_line IN LISTS _file_info)
+ if(_line MATCHES " Description:.*")
+ set(_parse_description TRUE)
+ list(APPEND _actual_description "${_line}")
+ elseif(_parse_description)
+ if(_line MATCHES " [A-Z][A-Za-z\-]+: .*")
+ set(_parse_description FALSE)
+ else()
+ list(APPEND _actual_description "${_line}")
+ endif()
+ endif()
+ endforeach()
+ list(JOIN _actual_description "\n" _actual_description)
+
+ if(NOT _actual_description STREQUAL EXPECTED_DESCRIPTION)
+ set(_error "---[BEGIN Expected description]---\n${EXPECTED_DESCRIPTION}---[END Expected description]---\n")
+ string(APPEND _error "---[BEGIN Actual description]---\n${_actual_description}---[END Actual description]---\n")
+ string(REPLACE "${uuid}" ";" _error "${_error}")
+ message(FATAL_ERROR "${_error}")
+ endif()
+endfunction()
+
+# ALERT The output of `dpkg -I *.deb` indented by one space
+set(_expected_description [[ Description: This is the summary line
+ This is the Debian package multiline description.
+ .
+ It must be formatted properly! Otherwise, the result `*.deb`
+ package become broken and cant be installed!
+ .
+ It may contains `;` characters (even like this `;;;;`). Example:
+ .
+ - one;
+ - two;
+ - three;
+ .
+ ... and they are properly handled by the automatic description formatter!
+ .
+ See also: https://www.debian.org/doc/debian-policy/ch-controlfields.html#description]])
+
+# ATTENTION The code in `cmCPackGenerator.cxx` to read `CPACK_PACKAGE_DESCRIPTION_FILE`
+# has a BUG: it appends the `\n` character to every line of the
+# input, even if there was no EOL (e.g. at the last line of the file).
+# That is WHY for this sub-test the one more pre-formatted "empty"
+# line required!
+# NOTE For component based installers content of the file gonna read by
+# `CPackDeb` module and the `file(READ...)` command so no the mentioned
+# workaround required!
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_PACKAGE_DESCRIPTION_FILE" AND PACKAGING_TYPE STREQUAL "MONOLITHIC")
+ string(APPEND _expected_description "\n ." )
+endif()
+
+foreach(_file_no RANGE 1 ${EXPECTED_FILES_COUNT})
+ checkPackageDescription("${FOUND_FILE_${_file_no}}" "${_expected_description}")
+endforeach()
+
+# kate: indent-width 2;
diff --git a/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake
new file mode 100644
index 000000000..ce3f65129
--- /dev/null
+++ b/Tests/RunCMake/CPack/tests/DEB_DESCRIPTION/test.cmake
@@ -0,0 +1,45 @@
+install(FILES CMakeLists.txt DESTINATION satu COMPONENT satu)
+install(FILES CMakeLists.txt DESTINATION dua COMPONENT dua)
+
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "This is the summary line")
+set(_description [[This is the Debian package multiline description.
+
+It must be formatted properly! Otherwise, the result `*.deb`
+package become broken and cant be installed!
+
+It may contains `;` characters (even like this `;;;;`). Example:
+
+ - one;
+ - two;
+ - three;
+
+... and they are properly handled by the automatic description formatter!
+
+See also: https://www.debian.org/doc/debian-policy/ch-controlfields.html#description]])
+
+if(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_DEBIAN_PACKAGE_DESCRIPTION")
+ if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(CPACK_DEBIAN_SATU_DESCRIPTION "${_description}")
+ set(CPACK_DEBIAN_DUA_DESCRIPTION "${_description}")
+ else()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${_description}")
+ endif()
+
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_PACKAGE_DESCRIPTION")
+ # NOTE Documented fallback variable
+ if(PACKAGING_TYPE STREQUAL "COMPONENT")
+ set(CPACK_COMPONENT_SATU_DESCRIPTION "${_description}")
+ set(CPACK_COMPONENT_DUA_DESCRIPTION "${_description}")
+ else()
+ set(CPACK_PACKAGE_DESCRIPTION "${_description}")
+ endif()
+
+elseif(RunCMake_SUBTEST_SUFFIX STREQUAL "CPACK_PACKAGE_DESCRIPTION_FILE")
+ # NOTE Getting the description from the file
+ set(_file "${CMAKE_CURRENT_BINARY_DIR}/description.txt")
+ file(WRITE "${_file}" "${_description}")
+ set(CPACK_PACKAGE_DESCRIPTION_FILE "${_file}")
+
+endif()
+
+# kate: indent-width 2;
diff --git a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake
index b4bdb61b6..c47b40e70 100644
--- a/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake
+++ b/Tests/RunCMake/CPack/tests/PER_COMPONENT_FIELDS/VerifyResult.cmake
@@ -8,6 +8,9 @@ endfunction()
if(GENERATOR_TYPE STREQUAL "DEB")
set(name_ "Package")
set(group_ "Section")
+ # NOTE For a Debian package the first line of the `Description`
+ # field is generated by CMake and gonna be ignored
+ set(ignore_rest_cond_ ".*\n")
elseif(GENERATOR_TYPE STREQUAL "RPM")
set(name_ "Name")
set(group_ "Group")
@@ -33,6 +36,6 @@ if(GENERATOR_TYPE STREQUAL "RPM")
endif()
# check package description
-checkPackageInfo_("description" "${FOUND_FILE_1}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_1")
-checkPackageInfo_("description" "${FOUND_FILE_2}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_2")
-checkPackageInfo_("description" "${FOUND_FILE_3}" ".*Description${whitespaces_}:${whitespaces_}Description for pkg_3")
+checkPackageInfo_("description" "${FOUND_FILE_1}" ".*Description${whitespaces_}:${ignore_rest_cond_}${whitespaces_}Description for pkg_1")
+checkPackageInfo_("description" "${FOUND_FILE_2}" ".*Description${whitespaces_}:${ignore_rest_cond_}${whitespaces_}Description for pkg_2")
+checkPackageInfo_("description" "${FOUND_FILE_3}" ".*Description${whitespaces_}:${ignore_rest_cond_}${whitespaces_}Description for pkg_3")
diff --git a/Tests/RunCMake/CPackCommandLine/CMakeLists.txt b/Tests/RunCMake/CPackCommandLine/CMakeLists.txt
new file mode 100644
index 000000000..2632ffa91
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/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/CPackCommandLine/MultiConfig-check-stdout.txt b/Tests/RunCMake/CPackCommandLine/MultiConfig-check-stdout.txt
new file mode 100644
index 000000000..f2ae844da
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/MultiConfig-check-stdout.txt
@@ -0,0 +1,4 @@
+MultiConfig-0\.1\.1-[^/
+]*/lib/(lib|)foo_dbg\.(a|lib)
+MultiConfig-0\.1\.1-[^/
+]*/lib/(lib|)foo_rel\.(a|lib)
diff --git a/Tests/RunCMake/CPackCommandLine/MultiConfig-package-stdout.txt b/Tests/RunCMake/CPackCommandLine/MultiConfig-package-stdout.txt
new file mode 100644
index 000000000..4fb8181de
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/MultiConfig-package-stdout.txt
@@ -0,0 +1,8 @@
+^CPack: Create package using ZIP
+CPack: Install projects
+CPack: - Install project: MultiConfig \[Debug\]
+CPack: - Install project: MultiConfig \[Release\]
+CPack: Create package
+CPack: - package: [^
+]*/Tests/RunCMake/CPackCommandLine/MultiConfig-build/MultiConfig-0.1.1-[^
+]*.zip generated.$
diff --git a/Tests/RunCMake/CPackCommandLine/MultiConfig.cmake b/Tests/RunCMake/CPackCommandLine/MultiConfig.cmake
new file mode 100644
index 000000000..71fd189ff
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/MultiConfig.cmake
@@ -0,0 +1,9 @@
+enable_language(C)
+
+include(CPack)
+
+add_library(foo foo.c)
+set_property(TARGET foo PROPERTY DEBUG_POSTFIX _dbg)
+set_property(TARGET foo PROPERTY RELEASE_POSTFIX _rel)
+
+install(TARGETS foo)
diff --git a/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake
index 991146c8e..53f4e4f93 100644
--- a/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPackCommandLine/RunCMakeTest.cmake
@@ -8,3 +8,26 @@ set(CPACK_PACKAGE_VERSION "1")
set(RunCMake_TEST_NO_CLEAN 1)
run_cmake_command(NotAGenerator ${CMAKE_CPACK_COMMAND} -G NotAGenerator)
unset(RunCMake_TEST_NO_CLEAN)
+
+function(run_MultiConfig)
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/MultiConfig-build")
+ run_cmake(MultiConfig)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(MultiConfig-build-dbg ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(MultiConfig-build-rel ${CMAKE_COMMAND} --build . --config Release)
+ run_cmake_command(MultiConfig-package ${CMAKE_CPACK_COMMAND} -G ZIP -C "Debug\;Release")
+ set(zip_glob "${RunCMake_TEST_BINARY_DIR}/MultiConfig-0.1.1-*.zip")
+ file(GLOB zips "${zip_glob}")
+ set(zip_found 0)
+ foreach(zip IN LISTS zips)
+ set(zip_found 1)
+ run_cmake_command(MultiConfig-check ${CMAKE_COMMAND} -E tar tf "${zip}")
+ endforeach()
+ if(NOT zip_found)
+ message(SEND_ERROR "No package file found at\n ${zip_glob}")
+ endif()
+endfunction()
+
+if(RunCMake_GENERATOR MATCHES "Visual Studio|Xcode")
+ run_MultiConfig()
+endif()
diff --git a/Tests/RunCMake/CPackCommandLine/foo.c b/Tests/RunCMake/CPackCommandLine/foo.c
new file mode 100644
index 000000000..c83d85699
--- /dev/null
+++ b/Tests/RunCMake/CPackCommandLine/foo.c
@@ -0,0 +1,4 @@
+int foo(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt b/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt
new file mode 100644
index 000000000..3e470a29c
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.14)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt.in b/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt.in
new file mode 100644
index 000000000..7d56c903b
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/CMakeLists.txt.in
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.14)
+project(@CASE_NAME@ NONE)
+include("@RunCMake_SOURCE_DIR@/@CASE_NAME@.cmake")
diff --git a/Tests/RunCMake/CTestCommandExpandLists/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandExpandLists/RunCMakeTest.cmake
new file mode 100644
index 000000000..7c3779e15
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/RunCMakeTest.cmake
@@ -0,0 +1,5 @@
+include(RunCTest)
+
+run_ctest(expandGeneratorExpressionResult)
+run_ctest(expandEmptyCommand)
+run_cmake(multipleExpandOptions)
diff --git a/Tests/RunCMake/CTestCommandExpandLists/compare_options.cmake b/Tests/RunCMake/CTestCommandExpandLists/compare_options.cmake
new file mode 100644
index 000000000..a32e579e2
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/compare_options.cmake
@@ -0,0 +1,14 @@
+set(range 1 2 3 4 5 6 7 8 9 10)
+set(aargs "")
+set(bargs "")
+foreach(n IN LISTS range)
+ set(aval "${A${n}ARG}")
+ set(bval "${B${n}ARG}")
+ if(aval OR bval)
+ list(APPEND aargs "\"${aval}\"")
+ list(APPEND bargs "\"${bval}\"")
+ endif()
+endforeach()
+if(NOT "${aargs}" STREQUAL "${bargs}")
+ message(FATAL_ERROR "COMPARE_OPTIONS: \n\t${aargs} != \n\t${bargs}")
+endif()
diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-result.txt b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stderr.txt b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stderr.txt
new file mode 100644
index 000000000..c656b4c7f
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stderr.txt
@@ -0,0 +1 @@
+Unable to find executable:
diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stdout.txt
new file mode 100644
index 000000000..075258010
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-stdout.txt
@@ -0,0 +1,13 @@
+Test project .*/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand-build
+.* +Start 1: CommandExpandEmptyList
+Could not find executable +
+Looked in the following places:
+.*
+1/1 Test #1: CommandExpandEmptyList +\.+\*\*\*Not Run +[0-9.]+ sec
++
+0% tests passed, 1 tests failed out of 1
++
+Total Test time \(real\) = +[0-9.]+ sec
++
+The following tests FAILED:
+.* +1 - CommandExpandEmptyList \(Not Run\)$
diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand.cmake b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand.cmake
new file mode 100644
index 000000000..b75828e38
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/expandEmptyCommand.cmake
@@ -0,0 +1,10 @@
+include(CTest)
+
+set(argv /bin/true)
+list(POP_BACK argv)
+
+add_test(
+ NAME CommandExpandEmptyList
+ COMMAND "$<JOIN:${argv},;>"
+ COMMAND_EXPAND_LISTS
+)
diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-result.txt b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-result.txt
new file mode 100644
index 000000000..573541ac9
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-stdout.txt
new file mode 100644
index 000000000..2f2159295
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-stdout.txt
@@ -0,0 +1,7 @@
+Test project .*/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult-build
+.* +Start 1: CommandExpandList
+1/1 Test #1: CommandExpandList +\.+ +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/CTestCommandExpandLists/expandGeneratorExpressionResult.cmake b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult.cmake
new file mode 100644
index 000000000..20608ae17
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/expandGeneratorExpressionResult.cmake
@@ -0,0 +1,19 @@
+include(CTest)
+
+
+set(cmp_args "1ARG=COMMAND_EXPAND_LISTS" "2ARG=test" "3ARG=outfile"
+ "4ARG=content")
+set(AARGS "")
+foreach(arg IN LISTS cmp_args)
+ list(APPEND AARGS "-DA${arg}")
+endforeach()
+
+
+
+add_test(
+ NAME CommandExpandList
+ COMMAND ${CMAKE_COMMAND} ${AARGS} -V
+ "-DB$<JOIN:${cmp_args},;-DB>"
+ "-P" "${CMAKE_CURRENT_LIST_DIR}/compare_options.cmake"
+ COMMAND_EXPAND_LISTS
+)
diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-result.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stderr.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stderr.txt
new file mode 100644
index 000000000..e48513fa7
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stderr.txt
@@ -0,0 +1,2 @@
+CMake Error at multipleExpandOptions\.cmake:3 \(add_test\):
+ +add_test may be given at most one COMMAND_EXPAND_LISTS\.
diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt
new file mode 100644
index 000000000..55bb89445
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-stdout.txt
@@ -0,0 +1,2 @@
+-- Configuring incomplete, errors occurred!
+See also ".*/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions-build/CMakeFiles/CMakeOutput\.log".
diff --git a/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions.cmake b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions.cmake
new file mode 100644
index 000000000..dcf2dc434
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/multipleExpandOptions.cmake
@@ -0,0 +1,8 @@
+include(CTest)
+
+add_test(
+ NAME MultipleExpandOptions
+ COMMAND /bin/true
+ COMMAND_EXPAND_LISTS
+ COMMAND_EXPAND_LISTS
+)
diff --git a/Tests/RunCMake/CTestCommandExpandLists/test.cmake.in b/Tests/RunCMake/CTestCommandExpandLists/test.cmake.in
new file mode 100644
index 000000000..d9a8ccb08
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandExpandLists/test.cmake.in
@@ -0,0 +1,15 @@
+cmake_minimum_required(VERSION 3.14)
+
+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()
+ctest_build()
+ctest_test()
diff --git a/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake b/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake
new file mode 100644
index 000000000..1097788ec
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/FailRegexFound-check.cmake
@@ -0,0 +1,13 @@
+set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log")
+if(EXISTS "${last_test_log}")
+ file(READ "${last_test_log}" last_test_log_content)
+ string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}")
+ if(NOT last_test_log_content MATCHES "
+Test Pass Reason:
+Error regular expression found in output. Regex=[[]test1]")
+ string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}")
+ set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake b/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake
new file mode 100644
index 000000000..bde60d12c
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/RequiredRegexFound-check.cmake
@@ -0,0 +1,13 @@
+set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log")
+if(EXISTS "${last_test_log}")
+ file(READ "${last_test_log}" last_test_log_content)
+ string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}")
+ if(NOT last_test_log_content MATCHES "
+Test Pass Reason:
+Required regular expression found. Regex=[[]test1]")
+ string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}")
+ set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake b/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake
new file mode 100644
index 000000000..6d420f39d
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/RequiredRegexNotFound-check.cmake
@@ -0,0 +1,16 @@
+set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log")
+if(EXISTS "${last_test_log}")
+ file(READ "${last_test_log}" last_test_log_content)
+ string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}")
+ if(NOT last_test_log_content MATCHES "
+Test Pass Reason:
+Required regular expression not found. Regex=[[]foo
+toast1
+bar
+]")
+ string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}")
+ set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
index b7f9a37ac..6b23162db 100644
--- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake
@@ -78,6 +78,62 @@ endfunction()
run_LabelCount()
+function(run_RequiredRegexFoundTest)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RequiredRegexFound)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION \"foo;test1;bar\")
+")
+
+ run_cmake_command(RequiredRegexFound ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+run_RequiredRegexFoundTest()
+
+function(run_RequiredRegexNotFoundTest)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RequiredRegexNotFound)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION \"foo;toast1;bar\" WILL_FAIL True)
+")
+
+ run_cmake_command(RequiredRegexNotFound ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+run_RequiredRegexNotFoundTest()
+
+function(run_FailRegexFoundTest)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/FailRegexFound)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+set_tests_properties(test1 PROPERTIES FAIL_REGULAR_EXPRESSION \"foo;test1;bar\" WILL_FAIL True)
+")
+
+ run_cmake_command(FailRegexFound ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+run_FailRegexFoundTest()
+
+function(run_SkipRegexFoundTest)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SkipRegexFound)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
+add_test(test1 \"${CMAKE_COMMAND}\" -E echo \"test1\")
+set_tests_properties(test1 PROPERTIES SKIP_REGULAR_EXPRESSION \"test1\")
+")
+
+ run_cmake_command(SkipRegexFound ${CMAKE_CTEST_COMMAND} -V)
+endfunction()
+run_SkipRegexFoundTest()
+
function(run_SerialFailed)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SerialFailed)
set(RunCMake_TEST_NO_CLEAN 1)
@@ -202,6 +258,7 @@ function(run_ShowOnly)
add_test(ShowOnly \"${CMAKE_COMMAND}\" -E echo)
set_tests_properties(ShowOnly PROPERTIES
WILL_FAIL true
+ RESOURCE_GROUPS \"2,threads:2,gpus:4;gpus:2,threads:4\"
REQUIRED_FILES RequiredFileDoesNotExist
_BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\"
)
diff --git a/Tests/RunCMake/CTestCommandLine/SkipRegexFound-check.cmake b/Tests/RunCMake/CTestCommandLine/SkipRegexFound-check.cmake
new file mode 100644
index 000000000..1a2dfa353
--- /dev/null
+++ b/Tests/RunCMake/CTestCommandLine/SkipRegexFound-check.cmake
@@ -0,0 +1,13 @@
+set(last_test_log "${RunCMake_TEST_BINARY_DIR}/Testing/Temporary/LastTest.log")
+if(EXISTS "${last_test_log}")
+ file(READ "${last_test_log}" last_test_log_content)
+ string(REGEX REPLACE "\n+$" "" last_test_log_content "${last_test_log_content}")
+ if(NOT last_test_log_content MATCHES "
+Test Pass Reason:
+Skip regular expression found in output. Regex=[[]test1]")
+ string(REPLACE "\n" "\n " last_test_log_content " ${last_test_log_content}")
+ set(RunCMake_TEST_FAILED "LastTest.log does not have expected content:\n${last_test_log_content}")
+ endif()
+else()
+ set(RunCMake_TEST_FAILED "LastTest.log missing:\n ${last_test_log}")
+endif()
diff --git a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
index 3ad576813..b81865008 100644
--- a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
+++ b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py
@@ -80,6 +80,62 @@ def check_willfail_property(p):
assert p["name"] == "WILL_FAIL"
assert p["value"] == True
+def check_resource_groups_property(p):
+ assert is_dict(p)
+ assert sorted(p.keys()) == ["name", "value"]
+ assert is_string(p["name"])
+ assert is_list(p["value"])
+ assert p["name"] == "RESOURCE_GROUPS"
+ assert len(p["value"]) == 3
+
+ assert is_dict(p["value"][0])
+ assert sorted(p["value"][0].keys()) == ["requirements"]
+ assert is_list(p["value"][0]["requirements"])
+ assert len(p["value"][0]["requirements"]) == 2
+ assert is_dict(p["value"][0]["requirements"][0])
+ assert sorted(p["value"][0]["requirements"][0].keys()) == \
+ [".type", "slots"]
+ assert is_string(p["value"][0]["requirements"][0][".type"])
+ assert p["value"][0]["requirements"][0][".type"] == "threads"
+ assert is_int(p["value"][0]["requirements"][0]["slots"])
+ assert p["value"][0]["requirements"][0]["slots"] == 2
+ assert is_string(p["value"][0]["requirements"][1][".type"])
+ assert p["value"][0]["requirements"][1][".type"] == "gpus"
+ assert is_int(p["value"][0]["requirements"][1]["slots"])
+ assert p["value"][0]["requirements"][1]["slots"] == 4
+
+ assert is_dict(p["value"][1])
+ assert sorted(p["value"][1].keys()) == ["requirements"]
+ assert is_list(p["value"][1]["requirements"])
+ assert len(p["value"][1]["requirements"]) == 2
+ assert is_dict(p["value"][1]["requirements"][0])
+ assert sorted(p["value"][1]["requirements"][0].keys()) == \
+ [".type", "slots"]
+ assert is_string(p["value"][1]["requirements"][0][".type"])
+ assert p["value"][1]["requirements"][0][".type"] == "threads"
+ assert is_int(p["value"][1]["requirements"][0]["slots"])
+ assert p["value"][1]["requirements"][0]["slots"] == 2
+ assert is_string(p["value"][1]["requirements"][1][".type"])
+ assert p["value"][1]["requirements"][1][".type"] == "gpus"
+ assert is_int(p["value"][1]["requirements"][1]["slots"])
+ assert p["value"][1]["requirements"][1]["slots"] == 4
+
+ assert is_dict(p["value"][2])
+ assert sorted(p["value"][2].keys()) == ["requirements"]
+ assert is_list(p["value"][2]["requirements"])
+ assert len(p["value"][2]["requirements"]) == 2
+ assert is_dict(p["value"][2]["requirements"][0])
+ assert sorted(p["value"][2]["requirements"][0].keys()) == \
+ [".type", "slots"]
+ assert is_string(p["value"][2]["requirements"][0][".type"])
+ assert p["value"][2]["requirements"][0][".type"] == "gpus"
+ assert is_int(p["value"][2]["requirements"][0]["slots"])
+ assert p["value"][2]["requirements"][0]["slots"] == 2
+ assert is_string(p["value"][2]["requirements"][1][".type"])
+ assert p["value"][2]["requirements"][1][".type"] == "threads"
+ assert is_int(p["value"][2]["requirements"][1]["slots"])
+ assert p["value"][2]["requirements"][1]["slots"] == 4
+
def check_workingdir_property(p):
assert is_dict(p)
assert sorted(p.keys()) == ["name", "value"]
@@ -90,10 +146,11 @@ def check_workingdir_property(p):
def check_properties(p):
assert is_list(p)
- assert len(p) == 3
- check_reqfiles_property(p[0])
- check_willfail_property(p[1])
- check_workingdir_property(p[2])
+ assert len(p) == 4
+ check_resource_groups_property(p[0])
+ check_reqfiles_property(p[1])
+ check_willfail_property(p[2])
+ check_workingdir_property(p[3])
def check_tests(t):
assert is_list(t)
diff --git a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc b/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
deleted file mode 100644
index 3b6cb1db9..000000000
--- a/Tests/RunCMake/CTestCommandLine/show_only_json_check.pyc
+++ /dev/null
Binary files differ
diff --git a/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in b/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in
new file mode 100644
index 000000000..998442116
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/CMakeLists.txt.in
@@ -0,0 +1,9 @@
+cmake_minimum_required(VERSION 3.15)
+set(CASE_NAME "@CASE_NAME@")
+if(CASE_NAME MATCHES "^(.*)-ctest-s")
+ set(projname "${CMAKE_MATCH_1}")
+ project(${projname} NONE)
+ include(CTest)
+ include("@RunCMake_SOURCE_DIR@/ResourceCommon.cmake")
+ include("@RunCMake_SOURCE_DIR@/${projname}.cmake")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
new file mode 100644
index 000000000..7d632999d
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ResourceCommon.cmake
@@ -0,0 +1,23 @@
+function(setup_resource_tests)
+ if(CTEST_RESOURCE_ALLOC_ENABLED)
+ add_test(NAME ResourceSetup COMMAND "${CMAKE_COMMAND}" -E remove -f "${CMAKE_BINARY_DIR}/ctresalloc.log")
+ endif()
+endfunction()
+
+function(add_resource_test name sleep_time proc)
+ if(CTEST_RESOURCE_ALLOC_ENABLED)
+ add_test(NAME "${name}" COMMAND "${CTRESALLOC_COMMAND}" write "${CMAKE_BINARY_DIR}/ctresalloc.log" "${name}" "${sleep_time}" "${proc}")
+ set_property(TEST "${name}" PROPERTY DEPENDS ResourceSetup)
+ else()
+ add_test(NAME "${name}" COMMAND "${CTRESALLOC_COMMAND}" write "${CMAKE_BINARY_DIR}/ctresalloc.log" "${name}" "${sleep_time}")
+ endif()
+ set_property(TEST "${name}" PROPERTY RESOURCE_GROUPS "${proc}")
+ list(APPEND RESOURCE_TESTS "${name}")
+ set(RESOURCE_TESTS "${RESOURCE_TESTS}" PARENT_SCOPE)
+endfunction()
+
+function(cleanup_resource_tests)
+ if(CTEST_RESOURCE_ALLOC_ENABLED)
+ file(WRITE "${CMAKE_BINARY_DIR}/restests.txt" "${RESOURCE_TESTS}")
+ endif()
+endfunction()
diff --git a/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
new file mode 100644
index 000000000..858478647
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/RunCMakeTest.cmake
@@ -0,0 +1,169 @@
+include(RunCMake)
+include(RunCTest)
+
+###############################################################################
+# Test ctresalloc itself - we want to make sure it's not just rubber-stamping
+# the test results
+###############################################################################
+
+function(ctresalloc_verify_log expected_contents)
+ if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ string(APPEND RunCMake_TEST_FAILED "Log file was not written\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ return()
+ endif()
+ file(READ "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log" actual_contents)
+ if(NOT actual_contents STREQUAL expected_contents)
+ string(APPEND RunCMake_TEST_FAILED "Actual log did not match expected log\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+function(run_ctresalloc_write_proc name proc)
+ file(REMOVE "${RunCMake_BINARY_DIR}/${name}-build/ctresalloc.log")
+ run_ctresalloc_write_proc_nodel("${name}" "${proc}" "${ARGN}")
+endfunction()
+
+function(run_ctresalloc_write_proc_nodel name proc)
+ string(REPLACE ";" "\\;" proc "${proc}")
+ run_cmake_command(${name} "${CMAKE_COMMAND}" -E env "${ARGN}" "${CTRESALLOC_COMMAND}" write "${RunCMake_BINARY_DIR}/${name}-build/ctresalloc.log" "${name}" 0 "${proc}")
+endfunction()
+
+function(run_ctresalloc_write_noproc name)
+ run_cmake_command(${name} "${CMAKE_COMMAND}" -E env "${ARGN}" "${CTRESALLOC_COMMAND}" write "${RunCMake_BINARY_DIR}/${name}-build/ctresalloc.log" "${name}" 0)
+endfunction()
+
+function(run_ctresalloc_verify name tests)
+ string(REPLACE ";" "\\;" tests "${tests}")
+ run_cmake_command(${name} "${CTRESALLOC_COMMAND}" verify "${RunCMake_SOURCE_DIR}/${name}.log" "${CMAKE_CURRENT_LIST_DIR}/resspec.json" "${tests}")
+endfunction()
+
+unset(ENV{CTEST_RESOURCE_GROUP_COUNT})
+set(RunCMake_TEST_NO_CLEAN 1)
+file(REMOVE_RECURSE "${RunCMake_BINARY_DIR}/ctresalloc-write-proc-good1-build")
+file(MAKE_DIRECTORY "${RunCMake_BINARY_DIR}/ctresalloc-write-proc-good1-build")
+file(WRITE "${RunCMake_BINARY_DIR}/ctresalloc-write-proc-good1-build/ctresalloc.log"
+[[begin test1
+alloc widgets 0 1
+dealloc widgets 0 1
+end test1
+]])
+run_ctresalloc_write_proc_nodel(ctresalloc-write-proc-good1 "1,widgets:2,transmogrifiers:1;2,widgets:1,widgets:2"
+ CTEST_RESOURCE_GROUP_COUNT=3
+ CTEST_RESOURCE_GROUP_0=widgets,transmogrifiers
+ CTEST_RESOURCE_GROUP_0_WIDGETS=id:0,slots:2
+ CTEST_RESOURCE_GROUP_0_TRANSMOGRIFIERS=id:calvin,slots:1
+ CTEST_RESOURCE_GROUP_1=widgets
+ "CTEST_RESOURCE_GROUP_1_WIDGETS=id:0,slots:1\\;id:2,slots:2"
+ CTEST_RESOURCE_GROUP_2=widgets
+ "CTEST_RESOURCE_GROUP_2_WIDGETS=id:0,slots:1\\;id:2,slots:2"
+ )
+set(RunCMake_TEST_NO_CLEAN 0)
+run_ctresalloc_write_proc(ctresalloc-write-proc-good2 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=id:3,slots:8
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-nocount "widgets:8")
+run_ctresalloc_write_proc(ctresalloc-write-proc-badcount "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=2
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-nores "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badres "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets,transmogrifiers
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-nowidgets "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets1 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets2 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ "CTEST_RESOURCE_GROUP_0_WIDGETS=id:3,slots:8\\;id:0,slots:1"
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets3 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=id:3,slots:7
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets4 "widgets:8"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=invalid
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets5 "widgets:2,widgets:2"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ "CTEST_RESOURCE_GROUP_0_WIDGETS=id:0,slots:2\\;id:0,slots:1"
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets6 "widgets:2"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ "CTEST_RESOURCE_GROUP_0_WIDGETS=id:0,slots:2\\;id:0,slots:1"
+ )
+run_ctresalloc_write_proc(ctresalloc-write-proc-badwidgets7 "widgets:2,widgets:2"
+ CTEST_RESOURCE_GROUP_COUNT=1
+ CTEST_RESOURCE_GROUP_0=widgets
+ CTEST_RESOURCE_GROUP_0_WIDGETS=id:0,slots:2
+ )
+
+run_ctresalloc_write_noproc(ctresalloc-write-noproc-good1)
+run_ctresalloc_write_noproc(ctresalloc-write-noproc-count
+ CTEST_RESOURCE_GROUP_COUNT=1
+ )
+
+run_ctresalloc_verify(ctresalloc-verify-good1 "test1;test2")
+run_ctresalloc_verify(ctresalloc-verify-good2 "")
+run_ctresalloc_verify(ctresalloc-verify-nolog "")
+run_ctresalloc_verify(ctresalloc-verify-nores "")
+run_ctresalloc_verify(ctresalloc-verify-noid "")
+run_ctresalloc_verify(ctresalloc-verify-notenough "")
+run_ctresalloc_verify(ctresalloc-verify-baddealloc "")
+run_ctresalloc_verify(ctresalloc-verify-leak "")
+run_ctresalloc_verify(ctresalloc-verify-badtest1 "")
+run_ctresalloc_verify(ctresalloc-verify-badtest2 "test1")
+run_ctresalloc_verify(ctresalloc-verify-badtest3 "test1")
+run_ctresalloc_verify(ctresalloc-verify-badtest4 "test1")
+run_ctresalloc_verify(ctresalloc-verify-badtest5 "test1")
+run_ctresalloc_verify(ctresalloc-verify-nobegin "test1")
+run_ctresalloc_verify(ctresalloc-verify-noend "test1")
+
+###############################################################################
+# Now test the resource allocation feature of CTest
+###############################################################################
+
+function(run_ctest_resource name parallel random)
+ run_ctest("${name}-ctest-s-res" "-DCTEST_RESOURCE_ALLOC_ENABLED=1" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+ run_ctest("${name}-ctest-s-nores" "-DCTEST_RESOURCE_ALLOC_ENABLED=0" "-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}" "-DCTEST_PARALLEL=${parallel}" "-DCTEST_RANDOM=${random}")
+endfunction()
+
+function(verify_ctest_resources)
+ file(READ "${RunCMake_TEST_BINARY_DIR}/restests.txt" restests)
+ execute_process(COMMAND "${CTRESALLOC_COMMAND}" verify "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log" "${CMAKE_CURRENT_LIST_DIR}/resspec.json" "${restests}"
+ OUTPUT_VARIABLE output ERROR_QUIET RESULT_VARIABLE result)
+ if(result)
+ string(APPEND RunCMake_TEST_FAILED "${output}")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+run_ctest_resource(lotsoftests 10 1)
+run_ctest_resource(checkfree1 2 0)
+run_ctest_resource(checkfree2 1 0)
+run_ctest_resource(notenough1 1 0)
+run_ctest_resource(notenough2 1 0)
+run_ctest_resource(notenough3 1 0)
+run_ctest_resource(combine 1 0)
+run_ctest_resource(ensure_parallel 2 0)
+
+set(ENV{CTEST_RESOURCE_GROUP_COUNT} 2)
+run_ctest_resource(process_count 1 0)
+unset(ENV{CTEST_RESOURCE_GROUP_COUNT})
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-check.cmake
new file mode 100644
index 000000000..ceda72ea8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree1-ctest-s-res-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree1.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree1.cmake
new file mode 100644
index 000000000..45cbf2099
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree1.cmake
@@ -0,0 +1,7 @@
+setup_resource_tests()
+
+add_resource_test(Test1 1 "widgets:8")
+add_resource_test(Test2 1 "fluxcapacitors:50;fluxcapacitors:50,widgets:8")
+add_resource_test(Test3 1 "fluxcapacitors:121")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree2-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree2-ctest-s-res-check.cmake
new file mode 100644
index 000000000..ceda72ea8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree2-ctest-s-res-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/checkfree2.cmake b/Tests/RunCMake/CTestResourceAllocation/checkfree2.cmake
new file mode 100644
index 000000000..03b737cea
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/checkfree2.cmake
@@ -0,0 +1,8 @@
+setup_resource_tests()
+
+# This test is an attack on the resource scheduling algorithm. It has been
+# carefully crafted to fool the algorithm into thinking there aren't sufficient
+# resources for it.
+add_resource_test(Test1 1 "widgets:2;4,widgets:4")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/combine.cmake b/Tests/RunCMake/CTestResourceAllocation/combine.cmake
new file mode 100644
index 000000000..ed5b25109
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/combine.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 0 "widgets:8,widgets:4")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc.log
new file mode 100644
index 000000000..abd6badc8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-baddealloc.log
@@ -0,0 +1,2 @@
+alloc widgets 0 1
+dealloc widgets 0 2
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1.log
new file mode 100644
index 000000000..605104b1a
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest1.log
@@ -0,0 +1 @@
+begin test1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2.log
new file mode 100644
index 000000000..1ff1b0d71
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest2.log
@@ -0,0 +1,2 @@
+begin test1
+begin test1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3.log
new file mode 100644
index 000000000..1925e6a3d
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest3.log
@@ -0,0 +1,3 @@
+begin test1
+end test1
+begin test1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4.log
new file mode 100644
index 000000000..3fe7da169
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest4.log
@@ -0,0 +1,3 @@
+begin test1
+end test1
+end test1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5.log
new file mode 100644
index 000000000..3a2e7e3bf
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-badtest5.log
@@ -0,0 +1 @@
+end test1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good1.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good1.log
new file mode 100644
index 000000000..2cca0c39c
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good1.log
@@ -0,0 +1,14 @@
+begin test1
+alloc widgets 3 4
+alloc widgets 4 1
+alloc transmogrifiers calvin 2
+alloc fluxcapacitors outatime 121
+begin test2
+alloc widgets 3 4
+dealloc widgets 3 4
+dealloc widgets 4 1
+dealloc transmogrifiers calvin 2
+dealloc fluxcapacitors outatime 121
+end test1
+dealloc widgets 3 4
+end test2
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good2.log
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-good2.log
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak.log
new file mode 100644
index 000000000..b900d86d1
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-leak.log
@@ -0,0 +1 @@
+alloc widgets 0 1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin.log
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nobegin.log
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend.log
new file mode 100644
index 000000000..605104b1a
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noend.log
@@ -0,0 +1 @@
+begin test1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid.log
new file mode 100644
index 000000000..c71897525
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-noid.log
@@ -0,0 +1,2 @@
+alloc fluxcapacitors train 1
+dealloc fluxcapacitors train 1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nolog-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nolog-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nolog-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores.log
new file mode 100644
index 000000000..a18202b0a
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-nores.log
@@ -0,0 +1,2 @@
+alloc gpus 0 1
+dealloc gpus 0 1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough.log b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough.log
new file mode 100644
index 000000000..ac78d5ad3
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-verify-notenough.log
@@ -0,0 +1,2 @@
+alloc widgets 0 8
+dealloc widgets 0 8
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-noproc-count-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-noproc-count-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-noproc-count-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badcount-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badcount-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badcount-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badres-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badres-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badres-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets1-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets2-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets3-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets3-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets4-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets4-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets5-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets5-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets6-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets6-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets7-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets7-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-badwidgets7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good1-check.cmake b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good1-check.cmake
new file mode 100644
index 000000000..40144c89b
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good1-check.cmake
@@ -0,0 +1,20 @@
+ctresalloc_verify_log(
+[[begin test1
+alloc widgets 0 1
+dealloc widgets 0 1
+end test1
+begin ctresalloc-write-proc-good1
+alloc transmogrifiers calvin 1
+alloc widgets 0 2
+alloc widgets 0 1
+alloc widgets 2 2
+alloc widgets 0 1
+alloc widgets 2 2
+dealloc transmogrifiers calvin 1
+dealloc widgets 0 2
+dealloc widgets 0 1
+dealloc widgets 2 2
+dealloc widgets 0 1
+dealloc widgets 2 2
+end ctresalloc-write-proc-good1
+]])
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good2-check.cmake b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good2-check.cmake
new file mode 100644
index 000000000..4545466fb
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-good2-check.cmake
@@ -0,0 +1,6 @@
+ctresalloc_verify_log(
+[[begin ctresalloc-write-proc-good2
+alloc widgets 3 8
+dealloc widgets 3 8
+end ctresalloc-write-proc-good2
+]])
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nocount-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nocount-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nocount-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nores-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nores-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nores-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nowidgets-result.txt b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nowidgets-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc-write-proc-nowidgets-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx b/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
new file mode 100644
index 000000000..27644af28
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ctresalloc.cxx
@@ -0,0 +1,399 @@
+#include <cassert>
+#include <chrono>
+#include <cstddef>
+#include <cstdlib>
+#include <iostream>
+#include <map>
+#include <set>
+#include <string>
+#include <thread>
+#include <utility>
+#include <vector>
+
+#include "cmsys/Encoding.hxx"
+#include "cmsys/FStream.hxx"
+
+#include "cmCTestMultiProcessHandler.h"
+#include "cmCTestResourceAllocator.h"
+#include "cmCTestResourceSpec.h"
+#include "cmCTestTestHandler.h"
+#include "cmFileLock.h"
+#include "cmFileLockResult.h"
+#include "cmStringAlgorithms.h"
+#include "cmSystemTools.h"
+
+/*
+ * This helper program is used to verify that the CTest resource allocation
+ * feature is working correctly. It consists of two stages:
+ *
+ * 1) write - This stage receives the RESOURCE_GROUPS property of the test and
+ * compares it with the values passed in the CTEST_RESOURCE_GROUP_*
+ * environment variables. If it received all of the resources it expected,
+ * then it writes this information to a log file, which will be read in
+ * the verify stage.
+ * 2) verify - This stage compares the log file with the resource spec file to
+ * make sure that no resources were over-subscribed, deallocated without
+ * being allocated, or allocated without being deallocated.
+ */
+
+static int usage(const char* argv0)
+{
+ std::cout << "Usage: " << argv0 << " (write|verify) <args...>" << std::endl;
+ return 1;
+}
+
+static int usageWrite(const char* argv0)
+{
+ std::cout << "Usage: " << argv0
+ << " write <log-file> <test-name> <sleep-time-secs>"
+ " [<resource-groups-property>]"
+ << std::endl;
+ return 1;
+}
+
+static int usageVerify(const char* argv0)
+{
+ std::cout << "Usage: " << argv0
+ << " verify <log-file> <resource-spec-file> [<test-names>]"
+ << std::endl;
+ return 1;
+}
+
+static int doWrite(int argc, char const* const* argv)
+{
+ if (argc < 5 || argc > 6) {
+ return usageWrite(argv[0]);
+ }
+ std::string logFile = argv[2];
+ std::string testName = argv[3];
+ unsigned int sleepTime = std::atoi(argv[4]);
+ std::vector<std::map<
+ std::string, std::vector<cmCTestMultiProcessHandler::ResourceAllocation>>>
+ resources;
+ if (argc == 6) {
+ // Parse RESOURCE_GROUPS property
+ std::string resourceGroupsProperty = argv[5];
+ std::vector<
+ std::vector<cmCTestTestHandler::cmCTestTestResourceRequirement>>
+ resourceGroups;
+ bool result = cmCTestTestHandler::ParseResourceGroupsProperty(
+ resourceGroupsProperty, resourceGroups);
+ (void)result;
+ assert(result);
+
+ // Verify group count
+ const char* resourceGroupCountEnv =
+ cmSystemTools::GetEnv("CTEST_RESOURCE_GROUP_COUNT");
+ if (!resourceGroupCountEnv) {
+ std::cout << "CTEST_RESOURCE_GROUP_COUNT should be defined" << std::endl;
+ return 1;
+ }
+ int resourceGroupCount = std::atoi(resourceGroupCountEnv);
+ if (resourceGroups.size() != std::size_t(resourceGroupCount)) {
+ std::cout
+ << "CTEST_RESOURCE_GROUP_COUNT does not match expected resource groups"
+ << std::endl
+ << "Expected: " << resourceGroups.size() << std::endl
+ << "Actual: " << resourceGroupCount << std::endl;
+ return 1;
+ }
+
+ if (!cmSystemTools::Touch(logFile + ".lock", true)) {
+ std::cout << "Could not create lock file" << std::endl;
+ return 1;
+ }
+ cmFileLock lock;
+ auto lockResult =
+ lock.Lock(logFile + ".lock", static_cast<unsigned long>(-1));
+ if (!lockResult.IsOk()) {
+ std::cout << "Could not lock file" << std::endl;
+ return 1;
+ }
+ std::size_t i = 0;
+ cmsys::ofstream fout(logFile.c_str(), std::ios::app);
+ fout << "begin " << testName << std::endl;
+ for (auto& resourceGroup : resourceGroups) {
+ try {
+ // Build and verify set of expected resources
+ std::set<std::string> expectedResources;
+ for (auto const& it : resourceGroup) {
+ expectedResources.insert(it.ResourceType);
+ }
+
+ std::string prefix = "CTEST_RESOURCE_GROUP_";
+ prefix += std::to_string(i);
+ const char* actualResourcesCStr = cmSystemTools::GetEnv(prefix);
+ if (!actualResourcesCStr) {
+ std::cout << prefix << " should be defined" << std::endl;
+ return 1;
+ }
+
+ auto actualResourcesVec =
+ cmSystemTools::SplitString(actualResourcesCStr, ',');
+ std::set<std::string> actualResources;
+ for (auto const& r : actualResourcesVec) {
+ if (!r.empty()) {
+ actualResources.insert(r);
+ }
+ }
+
+ if (actualResources != expectedResources) {
+ std::cout << prefix << " did not list expected resources"
+ << std::endl;
+ return 1;
+ }
+
+ // Verify that we got what we asked for and write it to the log
+ prefix += '_';
+ std::map<std::string,
+ std::vector<cmCTestMultiProcessHandler::ResourceAllocation>>
+ resEntry;
+ for (auto const& type : actualResources) {
+ auto it = resourceGroup.begin();
+
+ std::string varName = prefix;
+ varName += cmSystemTools::UpperCase(type);
+ const char* varVal = cmSystemTools::GetEnv(varName);
+ if (!varVal) {
+ std::cout << varName << " should be defined" << std::endl;
+ return 1;
+ }
+
+ auto received = cmSystemTools::SplitString(varVal, ';');
+ for (auto const& r : received) {
+ while (it->ResourceType != type || it->UnitsNeeded == 0) {
+ ++it;
+ if (it == resourceGroup.end()) {
+ std::cout << varName << " did not list expected resources"
+ << std::endl;
+ return 1;
+ }
+ }
+ auto split = cmSystemTools::SplitString(r, ',');
+ if (split.size() != 2) {
+ std::cout << varName << " was ill-formed" << std::endl;
+ return 1;
+ }
+ if (!cmHasLiteralPrefix(split[0], "id:")) {
+ std::cout << varName << " was ill-formed" << std::endl;
+ return 1;
+ }
+ auto id = split[0].substr(3);
+ if (!cmHasLiteralPrefix(split[1], "slots:")) {
+ std::cout << varName << " was ill-formed" << std::endl;
+ return 1;
+ }
+ auto slots = split[1].substr(6);
+ unsigned int amount = std::atoi(slots.c_str());
+ if (amount != static_cast<unsigned int>(it->SlotsNeeded)) {
+ std::cout << varName << " did not list expected resources"
+ << std::endl;
+ return 1;
+ }
+ --it->UnitsNeeded;
+
+ fout << "alloc " << type << " " << id << " " << amount
+ << std::endl;
+ resEntry[type].push_back({ id, amount });
+ }
+
+ bool ended = false;
+ while (it->ResourceType != type || it->UnitsNeeded == 0) {
+ ++it;
+ if (it == resourceGroup.end()) {
+ ended = true;
+ break;
+ }
+ }
+
+ if (!ended) {
+ std::cout << varName << " did not list expected resources"
+ << std::endl;
+ return 1;
+ }
+ }
+ resources.push_back(resEntry);
+
+ ++i;
+ } catch (...) {
+ std::cout << "Unknown error while processing resources" << std::endl;
+ return 1;
+ }
+ }
+
+ auto unlockResult = lock.Release();
+ if (!unlockResult.IsOk()) {
+ std::cout << "Could not unlock file" << std::endl;
+ return 1;
+ }
+ } else {
+ if (cmSystemTools::GetEnv("CTEST_RESOURCE_GROUP_COUNT")) {
+ std::cout << "CTEST_RESOURCE_GROUP_COUNT should not be defined"
+ << std::endl;
+ return 1;
+ }
+ }
+
+ std::this_thread::sleep_for(std::chrono::seconds(sleepTime));
+
+ if (argc == 6) {
+ if (!cmSystemTools::Touch(logFile + ".lock", true)) {
+ std::cout << "Could not create lock file" << std::endl;
+ return 1;
+ }
+ cmFileLock lock;
+ auto lockResult =
+ lock.Lock(logFile + ".lock", static_cast<unsigned long>(-1));
+ if (!lockResult.IsOk()) {
+ std::cout << "Could not lock file" << std::endl;
+ return 1;
+ }
+ cmsys::ofstream fout(logFile.c_str(), std::ios::app);
+ for (auto const& group : resources) {
+ for (auto const& it : group) {
+ for (auto const& it2 : it.second) {
+ fout << "dealloc " << it.first << " " << it2.Id << " " << it2.Slots
+ << std::endl;
+ }
+ }
+ }
+
+ fout << "end " << testName << std::endl;
+
+ auto unlockResult = lock.Release();
+ if (!unlockResult.IsOk()) {
+ std::cout << "Could not unlock file" << std::endl;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+static int doVerify(int argc, char const* const* argv)
+{
+ if (argc < 4 || argc > 5) {
+ return usageVerify(argv[0]);
+ }
+ std::string logFile = argv[2];
+ std::string resFile = argv[3];
+ std::string testNames;
+ if (argc == 5) {
+ testNames = argv[4];
+ }
+ auto testNameList = cmExpandedList(testNames, false);
+ std::set<std::string> testNameSet(testNameList.begin(), testNameList.end());
+
+ cmCTestResourceSpec spec;
+ if (!spec.ReadFromJSONFile(resFile)) {
+ std::cout << "Could not read resource spec " << resFile << std::endl;
+ return 1;
+ }
+
+ cmCTestResourceAllocator allocator;
+ allocator.InitializeFromResourceSpec(spec);
+
+ cmsys::ifstream fin(logFile.c_str(), std::ios::in);
+ if (!fin) {
+ std::cout << "Could not open log file " << logFile << std::endl;
+ return 1;
+ }
+
+ std::string command;
+ std::string resourceName;
+ std::string resourceId;
+ std::string testName;
+ unsigned int amount;
+ std::set<std::string> inProgressTests;
+ std::set<std::string> completedTests;
+ try {
+ while (fin >> command) {
+ if (command == "begin") {
+ if (!(fin >> testName)) {
+ std::cout << "Could not read begin line" << std::endl;
+ return 1;
+ }
+ if (!testNameSet.count(testName) || inProgressTests.count(testName) ||
+ completedTests.count(testName)) {
+ std::cout << "Could not begin test" << std::endl;
+ return 1;
+ }
+ inProgressTests.insert(testName);
+ } else if (command == "alloc") {
+ if (!(fin >> resourceName) || !(fin >> resourceId) ||
+ !(fin >> amount)) {
+ std::cout << "Could not read alloc line" << std::endl;
+ return 1;
+ }
+ if (!allocator.AllocateResource(resourceName, resourceId, amount)) {
+ std::cout << "Could not allocate resources" << std::endl;
+ return 1;
+ }
+ } else if (command == "dealloc") {
+ if (!(fin >> resourceName) || !(fin >> resourceId) ||
+ !(fin >> amount)) {
+ std::cout << "Could not read dealloc line" << std::endl;
+ return 1;
+ }
+ if (!allocator.DeallocateResource(resourceName, resourceId, amount)) {
+ std::cout << "Could not deallocate resources" << std::endl;
+ return 1;
+ }
+ } else if (command == "end") {
+ if (!(fin >> testName)) {
+ std::cout << "Could not read end line" << std::endl;
+ return 1;
+ }
+ if (!inProgressTests.erase(testName)) {
+ std::cout << "Could not end test" << std::endl;
+ return 1;
+ }
+ if (!completedTests.insert(testName).second) {
+ std::cout << "Could not end test" << std::endl;
+ return 1;
+ }
+ }
+ }
+ } catch (...) {
+ std::cout << "Unknown error while reading log file" << std::endl;
+ return 1;
+ }
+
+ auto const& avail = allocator.GetResources();
+ for (auto const& it : avail) {
+ for (auto const& it2 : it.second) {
+ if (it2.second.Locked != 0) {
+ std::cout << "Resource was not unlocked" << std::endl;
+ return 1;
+ }
+ }
+ }
+
+ if (completedTests != testNameSet) {
+ std::cout << "Tests were not ended" << std::endl;
+ return 1;
+ }
+
+ return 0;
+}
+
+int main(int argc, char const* const* argv)
+{
+ cmsys::Encoding::CommandLineArguments args =
+ cmsys::Encoding::CommandLineArguments::Main(argc, argv);
+ argc = args.argc();
+ argv = args.argv();
+
+ if (argc < 2) {
+ return usage(argv[0]);
+ }
+
+ std::string argv1 = argv[1];
+ if (argv1 == "write") {
+ return doWrite(argc, argv);
+ }
+ if (argv1 == "verify") {
+ return doVerify(argc, argv);
+ }
+ return usage(argv[0]);
+}
diff --git a/Tests/RunCMake/CTestResourceAllocation/ensure_parallel-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/ensure_parallel-ctest-s-res-check.cmake
new file mode 100644
index 000000000..d842a76f4
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ensure_parallel-ctest-s-res-check.cmake
@@ -0,0 +1,16 @@
+verify_ctest_resources()
+
+set(expected_contents [[
+begin Test1
+alloc transmogrifiers calvin 2
+begin Test2
+alloc transmogrifiers hobbes 2
+dealloc transmogrifiers calvin 2
+end Test1
+dealloc transmogrifiers hobbes 2
+end Test2
+]])
+file(READ "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log" actual_contents)
+if(NOT actual_contents STREQUAL expected_contents)
+ string(APPEND RunCMake_TEST_FAILED "ctresalloc.log contents did not match expected\n")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/ensure_parallel.cmake b/Tests/RunCMake/CTestResourceAllocation/ensure_parallel.cmake
new file mode 100644
index 000000000..562d05acb
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/ensure_parallel.cmake
@@ -0,0 +1,11 @@
+setup_resource_tests()
+
+add_resource_test(Test1 4 "transmogrifiers:2")
+
+# Mitigate possible race conditions to ensure that the events are logged in the
+# exact order we want
+add_test(NAME Test2Sleep COMMAND "${CMAKE_COMMAND}" -E sleep 2)
+add_resource_test(Test2 4 "transmogrifiers:2")
+set_property(TEST Test2 APPEND PROPERTY DEPENDS Test2Sleep)
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/lotsoftests-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/lotsoftests-ctest-s-res-check.cmake
new file mode 100644
index 000000000..ceda72ea8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/lotsoftests-ctest-s-res-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/lotsoftests.cmake b/Tests/RunCMake/CTestResourceAllocation/lotsoftests.cmake
new file mode 100644
index 000000000..4c0a7a554
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/lotsoftests.cmake
@@ -0,0 +1,16 @@
+setup_resource_tests()
+
+add_resource_test(Test1 2 "widgets:8;2,widgets:2")
+add_resource_test(Test2 5 "fluxcapacitors:40")
+add_resource_test(Test3 1 "10,widgets:1,fluxcapacitors:2")
+add_resource_test(Test4 4 "fluxcapacitors:121")
+
+foreach(i RANGE 5 50)
+ add_resource_test(Test${i} 1 "2,widgets:1")
+endforeach()
+
+foreach(i RANGE 51 100)
+ add_resource_test(Test${i} 1 "2,transmogrifiers:2")
+endforeach()
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-check.cmake
new file mode 100644
index 000000000..321e9a2f8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt
new file mode 100644
index 000000000..41df5afad
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res-stderr.txt
@@ -0,0 +1,4 @@
+^Insufficient resources
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough1-ctest-s-res/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake
new file mode 100644
index 000000000..f820c378c
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough1.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 0 "fluxcapacitors:200")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-check.cmake
new file mode 100644
index 000000000..321e9a2f8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt
new file mode 100644
index 000000000..6c2f554e5
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res-stderr.txt
@@ -0,0 +1,4 @@
+^Insufficient resources
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough2-ctest-s-res/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake
new file mode 100644
index 000000000..5b8177636
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough2.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 0 "terminators:2")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-check.cmake
new file mode 100644
index 000000000..321e9a2f8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-check.cmake
@@ -0,0 +1,3 @@
+if(EXISTS "${RunCMake_TEST_BINARY_DIR}/ctresalloc.log")
+ set(RunCMake_TEST_FAILED "ctresalloc.log should not exist")
+endif()
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-result.txt b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt
new file mode 100644
index 000000000..82dfdefcf
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res-stderr.txt
@@ -0,0 +1,4 @@
+^Insufficient resources
+CMake Error at [^
+]*/Tests/RunCMake/CTestResourceAllocation/notenough3-ctest-s-res/test\.cmake:[0-9]+ \(message\):
+ Tests did not pass$
diff --git a/Tests/RunCMake/CTestResourceAllocation/notenough3.cmake b/Tests/RunCMake/CTestResourceAllocation/notenough3.cmake
new file mode 100644
index 000000000..ddf3a9cd5
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/notenough3.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 0 "widgets:12")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake b/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake
new file mode 100644
index 000000000..ceda72ea8
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/process_count-ctest-s-res-check.cmake
@@ -0,0 +1 @@
+verify_ctest_resources()
diff --git a/Tests/RunCMake/CTestResourceAllocation/process_count.cmake b/Tests/RunCMake/CTestResourceAllocation/process_count.cmake
new file mode 100644
index 000000000..1457f8976
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/process_count.cmake
@@ -0,0 +1,5 @@
+setup_resource_tests()
+
+add_resource_test(Test1 1 "widgets:1")
+
+cleanup_resource_tests()
diff --git a/Tests/RunCMake/CTestResourceAllocation/resspec.json b/Tests/RunCMake/CTestResourceAllocation/resspec.json
new file mode 100644
index 000000000..48321ec77
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/resspec.json
@@ -0,0 +1,59 @@
+{
+ "version": {
+ "major": 1,
+ "minor": 0
+ },
+ "local": [
+ {
+ "widgets": [
+ {
+ "id": "0",
+ "slots": 4
+ },
+ {
+ "id": "1",
+ "slots": 2
+ },
+ {
+ "id": "2",
+ "slots": 4
+ },
+ {
+ "id": "3",
+ "slots": 8
+ },
+ {
+ "id": "4",
+ "slots": 1
+ },
+ {
+ "id": "5",
+ "slots": 1
+ },
+ {
+ "id": "6",
+ "slots": 1
+ },
+ {
+ "id": "7"
+ }
+ ],
+ "transmogrifiers": [
+ {
+ "id": "calvin",
+ "slots": 2
+ },
+ {
+ "id": "hobbes",
+ "slots": 2
+ }
+ ],
+ "fluxcapacitors": [
+ {
+ "id": "outatime",
+ "slots": 121
+ }
+ ]
+ }
+ ]
+}
diff --git a/Tests/RunCMake/CTestResourceAllocation/test.cmake.in b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in
new file mode 100644
index 000000000..4b426f161
--- /dev/null
+++ b/Tests/RunCMake/CTestResourceAllocation/test.cmake.in
@@ -0,0 +1,23 @@
+set(CTEST_SITE "test-site")
+set(CTEST_BUILD_NAME "test-build-name")
+set(CTEST_SOURCE_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@")
+set(CTEST_BINARY_DIRECTORY "@RunCMake_BINARY_DIR@/@CASE_NAME@-build")
+set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
+set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
+set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+
+ctest_start(Experimental QUIET)
+ctest_configure(OPTIONS
+ "-DCTEST_RESOURCE_ALLOC_ENABLED=${CTEST_RESOURCE_ALLOC_ENABLED};-DCTRESALLOC_COMMAND=${CTRESALLOC_COMMAND}"
+ )
+ctest_build()
+
+if(CTEST_RESOURCE_ALLOC_ENABLED)
+ set(resspec RESOURCE_SPEC_FILE "@RunCMake_SOURCE_DIR@/resspec.json")
+endif()
+ctest_test(${resspec} RETURN_VALUE retval PARALLEL_LEVEL ${CTEST_PARALLEL} SCHEDULE_RANDOM ${CTEST_RANDOM})
+if(retval)
+ message(FATAL_ERROR "Tests did not pass")
+endif()
diff --git a/Tests/RunCMake/CommandLine/C-no-file-stderr.txt b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt
index 2a4ee6451..b65a3498e 100644
--- a/Tests/RunCMake/CommandLine/C-no-file-stderr.txt
+++ b/Tests/RunCMake/CommandLine/C-no-file-stderr.txt
@@ -1,3 +1,3 @@
-^CMake Error: Error processing file: nosuchcachefile.txt
+^CMake Error: Error processing file: .*/Tests/RunCMake/CommandLine/C-no-file-build/nosuchcachefile.txt
CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/C-no-file-build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.$
diff --git a/Tests/RunCMake/CommandLine/C_basic-stderr.txt b/Tests/RunCMake/CommandLine/C_basic-stderr.txt
new file mode 100644
index 000000000..62d0cd5fe
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic-stderr.txt
@@ -0,0 +1,4 @@
+initial-cache.txt: CMAKE_SOURCE_DIR: .*/Tests/RunCMake/CommandLine
+initial-cache.txt: CMAKE_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic-build
+CMakeLists.txt: INITIAL_SOURCE_DIR: .*/Tests/RunCMake/CommandLine
+CMakeLists.txt: INITIAL_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic-build
diff --git a/Tests/RunCMake/CommandLine/C_basic-stdout.txt b/Tests/RunCMake/CommandLine/C_basic-stdout.txt
new file mode 100644
index 000000000..74a938e91
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic-stdout.txt
@@ -0,0 +1 @@
+loading initial cache file ../C_basic_initial-cache.txt
diff --git a/Tests/RunCMake/CommandLine/C_basic.cmake b/Tests/RunCMake/CommandLine/C_basic.cmake
new file mode 100644
index 000000000..1a565935b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic.cmake
@@ -0,0 +1,2 @@
+message("CMakeLists.txt: INITIAL_SOURCE_DIR: ${INITIAL_SOURCE_DIR}")
+message("CMakeLists.txt: INITIAL_BINARY_DIR: ${INITIAL_BINARY_DIR}")
diff --git a/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt b/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt
new file mode 100644
index 000000000..f382a017b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic_fullpath-stderr.txt
@@ -0,0 +1,4 @@
+initial-cache.txt: CMAKE_SOURCE_DIR: .*/Tests/RunCMake/CommandLine
+initial-cache.txt: CMAKE_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic_fullpath-build
+CMakeLists.txt: INITIAL_SOURCE_DIR: .*/Tests/RunCMake/CommandLine
+CMakeLists.txt: INITIAL_BINARY_DIR: .*/Tests/RunCMake/CommandLine/C_basic_fullpath-build
diff --git a/Tests/RunCMake/CommandLine/C_basic_fullpath-stdout.txt b/Tests/RunCMake/CommandLine/C_basic_fullpath-stdout.txt
new file mode 100644
index 000000000..32724f59f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic_fullpath-stdout.txt
@@ -0,0 +1 @@
+loading initial cache file .*/Tests/RunCMake/CommandLine/C_basic_initial-cache.txt
diff --git a/Tests/RunCMake/CommandLine/C_basic_fullpath.cmake b/Tests/RunCMake/CommandLine/C_basic_fullpath.cmake
new file mode 100644
index 000000000..1a565935b
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic_fullpath.cmake
@@ -0,0 +1,2 @@
+message("CMakeLists.txt: INITIAL_SOURCE_DIR: ${INITIAL_SOURCE_DIR}")
+message("CMakeLists.txt: INITIAL_BINARY_DIR: ${INITIAL_BINARY_DIR}")
diff --git a/Tests/RunCMake/CommandLine/C_basic_initial-cache.txt b/Tests/RunCMake/CommandLine/C_basic_initial-cache.txt
new file mode 100644
index 000000000..e7a8ac95f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_basic_initial-cache.txt
@@ -0,0 +1,5 @@
+set(INITIAL_SOURCE_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "defined in initial.cmake")
+set(INITIAL_BINARY_DIR "${CMAKE_BINARY_DIR}" CACHE PATH "defined in initial.cmake")
+
+message("initial-cache.txt: CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
+message("initial-cache.txt: CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
diff --git a/Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt b/Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt
new file mode 100644
index 000000000..4720a6f68
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_buildsrcdir-stderr.txt
@@ -0,0 +1,8 @@
+initial-cache.txt: CMAKE_SOURCE_DIR: .*/C_buildsrcdir/src
+initial-cache.txt: CMAKE_BINARY_DIR: .*/ExplicitDirs-build/DummyBuildDir
+PreLoad.cmake: CMAKE_SOURCE_DIR: .*/C_buildsrcdir/src
+PreLoad.cmake: CMAKE_BINARY_DIR: .*/ExplicitDirs-build/DummyBuildDir
+CMakeLists.txt: INITIAL_SOURCE_DIR: .*/C_buildsrcdir/src
+CMakeLists.txt: INITIAL_BINARY_DIR: .*/ExplicitDirs-build/DummyBuildDir
+CMakeLists.txt: PRELOAD_SOURCE_DIR: .*/C_buildsrcdir/src
+CMakeLists.txt: PRELOAD_BINARY_DIR: .*/ExplicitDirs-build/DummyBuildDir
diff --git a/Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt b/Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt
new file mode 100644
index 000000000..862cfeb14
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_buildsrcdir-stdout.txt
@@ -0,0 +1,2 @@
+loading initial cache file .*initial-cache.txt
+.*
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-empty.output b/Tests/RunCMake/CommandLine/C_buildsrcdir.cmake
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-empty.output
+++ b/Tests/RunCMake/CommandLine/C_buildsrcdir.cmake
diff --git a/Tests/RunCMake/CommandLine/C_buildsrcdir/initial-cache.txt b/Tests/RunCMake/CommandLine/C_buildsrcdir/initial-cache.txt
new file mode 100644
index 000000000..adc125ba2
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_buildsrcdir/initial-cache.txt
@@ -0,0 +1,6 @@
+# Used to verify that the values match what is passed via -S and -B, and are retained in cache.
+set(INITIAL_SOURCE_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "defined in initial.cmake")
+set(INITIAL_BINARY_DIR "${CMAKE_BINARY_DIR}" CACHE PATH "defined in initial.cmake")
+
+message("initial-cache.txt: CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
+message("initial-cache.txt: CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
diff --git a/Tests/RunCMake/CommandLine/C_buildsrcdir/src/CMakeLists.txt b/Tests/RunCMake/CommandLine/C_buildsrcdir/src/CMakeLists.txt
new file mode 100644
index 000000000..4893fe711
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_buildsrcdir/src/CMakeLists.txt
@@ -0,0 +1,6 @@
+project(C_buildsrcdir)
+
+message("CMakeLists.txt: INITIAL_SOURCE_DIR: ${INITIAL_SOURCE_DIR}")
+message("CMakeLists.txt: INITIAL_BINARY_DIR: ${INITIAL_BINARY_DIR}")
+message("CMakeLists.txt: PRELOAD_SOURCE_DIR: ${PRELOAD_SOURCE_DIR}")
+message("CMakeLists.txt: PRELOAD_BINARY_DIR: ${PRELOAD_BINARY_DIR}")
diff --git a/Tests/RunCMake/CommandLine/C_buildsrcdir/src/PreLoad.cmake b/Tests/RunCMake/CommandLine/C_buildsrcdir/src/PreLoad.cmake
new file mode 100644
index 000000000..519921928
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/C_buildsrcdir/src/PreLoad.cmake
@@ -0,0 +1,6 @@
+# Used to verify that the values match what is passed via -S and -B, and are retained in cache.
+message("PreLoad.cmake: CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}")
+message("PreLoad.cmake: CMAKE_BINARY_DIR: ${CMAKE_BINARY_DIR}")
+
+set(PRELOAD_BINARY_DIR "${CMAKE_BINARY_DIR}" CACHE PATH "value of cmake_binary_dir during preload")
+set(PRELOAD_SOURCE_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "value of cmake_source_dir during preload")
diff --git a/Tests/RunCMake/CommandLine/Cno-file-stderr.txt b/Tests/RunCMake/CommandLine/Cno-file-stderr.txt
index 67a20324c..416686cd5 100644
--- a/Tests/RunCMake/CommandLine/Cno-file-stderr.txt
+++ b/Tests/RunCMake/CommandLine/Cno-file-stderr.txt
@@ -1,3 +1,3 @@
-^CMake Error: Error processing file: nosuchcachefile.txt
+^CMake Error: Error processing file: .*/Tests/RunCMake/CommandLine/Cno-file-build/nosuchcachefile.txt
CMake Error: The source directory ".*/Tests/RunCMake/CommandLine/Cno-file-build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.$
diff --git a/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt b/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_false-extraargs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_false-result.txt b/Tests/RunCMake/CommandLine/E_false-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_false-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-check.cmake b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-check.cmake
new file mode 100644
index 000000000..f70312c46
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-check.cmake
@@ -0,0 +1,6 @@
+if(EXISTS ${out}/link_dir)
+ set(RunCMake_TEST_FAILED "did not remove ${out}/link_dir")
+endif()
+if(NOT EXISTS ${out}/dir)
+ set(RunCMake_TEST_FAILED "should not have removed ${out}/dir")
+endif()
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-empty.output b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-stderr.txt
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-empty.output
+++ b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-dir-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-check.cmake b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-check.cmake
new file mode 100644
index 000000000..23d7c6d85
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-check.cmake
@@ -0,0 +1,6 @@
+if(NOT EXISTS ${outfile})
+ set(RunCMake_TEST_FAILED "removed non-directory ${outfile}")
+endif()
+if(NOT EXISTS ${out}/link_file_for_test.txt)
+ set(RunCMake_TEST_FAILED "removed non-directory symlink ${out}/link_file_for_test.txt")
+endif()
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-stderr.txt
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.output
+++ b/Tests/RunCMake/CommandLine/E_remove_directory-symlink-file-stderr.txt
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index c9d3a4ddd..b608d334a 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -26,6 +26,10 @@ run_cmake_command(E_echo_append ${CMAKE_COMMAND} -E echo_append)
run_cmake_command(E_rename-no-arg ${CMAKE_COMMAND} -E rename)
run_cmake_command(E_server-arg ${CMAKE_COMMAND} -E server --extra-arg)
run_cmake_command(E_server-pipe ${CMAKE_COMMAND} -E server --pipe=)
+run_cmake_command(E_true ${CMAKE_COMMAND} -E true)
+run_cmake_command(E_true-extraargs ${CMAKE_COMMAND} -E true ignored)
+run_cmake_command(E_false ${CMAKE_COMMAND} -E false)
+run_cmake_command(E_false-extraargs ${CMAKE_COMMAND} -E false ignored)
run_cmake_command(E_touch_nocreate-no-arg ${CMAKE_COMMAND} -E touch_nocreate)
run_cmake_command(E_touch-nonexistent-dir ${CMAKE_COMMAND} -E touch "${RunCMake_BINARY_DIR}/touch-nonexistent-dir/foo")
@@ -106,6 +110,14 @@ project(ExplicitDirsMissing LANGUAGES NONE)
file(REMOVE_RECURSE "${binary_dir}")
run_cmake_with_options(B-S -B${binary_dir} -S${source_dir})
+ message("copied to ${RunCMake_TEST_BINARY_DIR}/initial-cache.txt")
+ file(COPY ${RunCMake_SOURCE_DIR}/C_buildsrcdir/initial-cache.txt DESTINATION ${RunCMake_TEST_BINARY_DIR})
+
+ # CMAKE_BINARY_DIR should be determined by -B if specified, and CMAKE_SOURCE_DIR determined by -S if specified.
+ # Path to initial-cache.txt is relative to the $PWD, which is normally set to ${RunCMake_TEST_BINARY_DIR}.
+ run_cmake_with_options(C_buildsrcdir -B DummyBuildDir -S ${RunCMake_SOURCE_DIR}/C_buildsrcdir/src -C initial-cache.txt)
+ # Test that full path works, too.
+ run_cmake_with_options(C_buildsrcdir -B DummyBuildDir -S ${RunCMake_SOURCE_DIR}/C_buildsrcdir/src -C ${RunCMake_TEST_BINARY_DIR}/initial-cache.txt)
endfunction()
run_ExplicitDirs()
@@ -344,6 +356,17 @@ run_cmake_command(E_make_directory-two-directories-and-file
${CMAKE_COMMAND} -E make_directory ${out}/d1 ${out}/d2 ${outfile})
run_cmake_command(E_remove_directory-two-directories-and-file
${CMAKE_COMMAND} -E remove_directory ${out}/d1 ${out}/d2 ${outfile})
+
+if(UNIX)
+ file(MAKE_DIRECTORY ${out}/dir)
+ file(CREATE_LINK ${out}/dir ${out}/link_dir SYMBOLIC)
+ file(CREATE_LINK ${outfile} ${out}/link_file_for_test.txt SYMBOLIC)
+ run_cmake_command(E_remove_directory-symlink-dir
+ ${CMAKE_COMMAND} -E remove_directory ${out}/link_dir)
+ run_cmake_command(E_remove_directory-symlink-file
+ ${CMAKE_COMMAND} -E remove_directory ${out}/link_file_for_test.txt)
+endif()
+
unset(out)
unset(outfile)
@@ -387,6 +410,14 @@ run_cmake_command(E_sleep-one-tenth ${CMAKE_COMMAND} -E sleep 0.1)
run_cmake_command(P_directory ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR})
run_cmake_command(P_working-dir ${CMAKE_COMMAND} -DEXPECTED_WORKING_DIR=${RunCMake_BINARY_DIR}/P_working-dir-build -P ${RunCMake_SOURCE_DIR}/P_working-dir.cmake)
+# Documented to return the same result as above even if -S and -B are set to something else.
+# Tests the values of CMAKE_BINARY_DIR CMAKE_CURRENT_BINARY_DIR CMAKE_SOURCE_DIR CMAKE_CURRENT_SOURCE_DIR.
+run_cmake_command(P_working-dir ${CMAKE_COMMAND} -DEXPECTED_WORKING_DIR=${RunCMake_BINARY_DIR}/P_working-dir-build -P ${RunCMake_SOURCE_DIR}/P_working-dir.cmake -S something_else -B something_else_1)
+
+# Place an initial cache where C_basic will find it when passed the relative path "..".
+file(COPY ${RunCMake_SOURCE_DIR}/C_basic_initial-cache.txt DESTINATION ${RunCMake_BINARY_DIR})
+run_cmake_with_options(C_basic -C ../C_basic_initial-cache.txt)
+run_cmake_with_options(C_basic_fullpath -C ${RunCMake_BINARY_DIR}/C_basic_initial-cache.txt)
set(RunCMake_TEST_OPTIONS
"-DFOO=-DBAR:BOOL=BAZ")
@@ -480,6 +511,14 @@ set(RunCMake_TEST_OPTIONS --trace-expand --warn-uninitialized)
run_cmake(trace-expand-warn-uninitialized)
unset(RunCMake_TEST_OPTIONS)
+set(RunCMake_TEST_OPTIONS --trace-redirect=${RunCMake_BINARY_DIR}/redirected.trace)
+run_cmake(trace-redirect)
+unset(RunCMake_TEST_OPTIONS)
+
+set(RunCMake_TEST_OPTIONS --trace-redirect=/no/such/file.txt)
+run_cmake(trace-redirect-nofile)
+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/trace-redirect-check.cmake b/Tests/RunCMake/CommandLine/trace-redirect-check.cmake
new file mode 100644
index 000000000..1ee0e0de6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-redirect-check.cmake
@@ -0,0 +1,13 @@
+file(READ ${RunCMake_SOURCE_DIR}/trace-stderr.txt expected_content)
+string(REGEX REPLACE "\n+$" "" expected_content "${expected_content}")
+
+file(READ ${RunCMake_BINARY_DIR}/redirected.trace actual_content)
+string(REGEX REPLACE "\r\n" "\n" actual_content "${actual_content}")
+string(REGEX REPLACE "\n+$" "" actual_content "${actual_content}")
+if(NOT "${actual_content}" MATCHES "${expected_content}")
+ set(RunCMake_TEST_FAILED
+ "Trace file content does not match that expected."
+ "Expected to match:\n${expected_content}\n"
+ "Actual content:\n${actual_content}\n"
+ )
+endif()
diff --git a/Tests/RunCMake/CommandLine/trace-redirect-nofile-result.txt b/Tests/RunCMake/CommandLine/trace-redirect-nofile-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-redirect-nofile-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/trace-redirect-nofile-stderr.txt b/Tests/RunCMake/CommandLine/trace-redirect-nofile-stderr.txt
new file mode 100644
index 000000000..edb0c8e6f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-redirect-nofile-stderr.txt
@@ -0,0 +1 @@
+^CMake Error: Error opening trace file /no/such/file.txt: .+$
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output b/Tests/RunCMake/CommandLine/trace-redirect-nofile.cmake
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.output
+++ b/Tests/RunCMake/CommandLine/trace-redirect-nofile.cmake
diff --git a/Tests/RunCMake/CommandLine/trace-redirect-stdout.txt b/Tests/RunCMake/CommandLine/trace-redirect-stdout.txt
new file mode 100644
index 000000000..775f2b5f0
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-redirect-stdout.txt
@@ -0,0 +1 @@
+^.*Trace will be written to .+redirected.trace.*$
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output b/Tests/RunCMake/CommandLine/trace-redirect.cmake
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.output
+++ b/Tests/RunCMake/CommandLine/trace-redirect.cmake
diff --git a/Tests/RunCMake/Configure/RerunCMake-build3-result.txt b/Tests/RunCMake/Configure/RerunCMake-build3-result.txt
new file mode 100644
index 000000000..d197c913c
--- /dev/null
+++ b/Tests/RunCMake/Configure/RerunCMake-build3-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/Configure/RerunCMake-build3-stdout.txt b/Tests/RunCMake/Configure/RerunCMake-build3-stdout.txt
new file mode 100644
index 000000000..dde2ea67a
--- /dev/null
+++ b/Tests/RunCMake/Configure/RerunCMake-build3-stdout.txt
@@ -0,0 +1 @@
+Rerun error 3
diff --git a/Tests/RunCMake/Configure/RerunCMake-build4-result.txt b/Tests/RunCMake/Configure/RerunCMake-build4-result.txt
new file mode 100644
index 000000000..d197c913c
--- /dev/null
+++ b/Tests/RunCMake/Configure/RerunCMake-build4-result.txt
@@ -0,0 +1 @@
+[^0]
diff --git a/Tests/RunCMake/Configure/RerunCMake-build4-stdout.txt b/Tests/RunCMake/Configure/RerunCMake-build4-stdout.txt
new file mode 100644
index 000000000..b8727e169
--- /dev/null
+++ b/Tests/RunCMake/Configure/RerunCMake-build4-stdout.txt
@@ -0,0 +1 @@
+Rerun error 4
diff --git a/Tests/RunCMake/Configure/RerunCMake.cmake b/Tests/RunCMake/Configure/RerunCMake.cmake
index 5a561bf45..c0b079819 100644
--- a/Tests/RunCMake/Configure/RerunCMake.cmake
+++ b/Tests/RunCMake/Configure/RerunCMake.cmake
@@ -9,3 +9,9 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${depend})
file(READ ${depend} content)
file(WRITE ${output} "${content}")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS RerunCMake.txt)
+
+set(error ${CMAKE_CURRENT_BINARY_DIR}/CustomCMakeError.txt)
+if(EXISTS ${error})
+ file(READ ${error} content)
+ message(FATAL_ERROR "Rerun error ${content}")
+endif()
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
index 4a135befd..76d843c6e 100644
--- a/Tests/RunCMake/Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -14,6 +14,7 @@ set(input "${RunCMake_TEST_BINARY_DIR}/CustomCMakeInput.txt")
set(stamp "${RunCMake_TEST_BINARY_DIR}/CustomCMakeStamp.txt")
set(depend "${RunCMake_TEST_BINARY_DIR}/CustomCMakeDepend.txt")
set(output "${RunCMake_TEST_BINARY_DIR}/CustomCMakeOutput.txt")
+set(error "${RunCMake_TEST_BINARY_DIR}/CustomCMakeError.txt")
file(WRITE "${input}" "1")
file(WRITE "${depend}" "1")
run_cmake(RerunCMake)
@@ -22,6 +23,22 @@ file(WRITE "${input}" "2")
run_cmake_command(RerunCMake-build1 ${CMAKE_COMMAND} --build .)
file(WRITE "${depend}" "2")
run_cmake_command(RerunCMake-build2 ${CMAKE_COMMAND} --build .)
+execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
+file(WRITE "${depend}" "3")
+file(WRITE "${error}" "3")
+set(RunCMake_TEST_OUTPUT_MERGE 1)
+run_cmake_command(RerunCMake-build3 ${CMAKE_COMMAND} --build .)
+if(MSVC_IDE)
+ # Make sure that for Visual Studio the error occurs from within the build
+ # system.
+ file(REMOVE "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/generate.stamp.list")
+ file(WRITE "${error}" "4")
+ # With Visual Studio the error must be on stdout, otherwise the error was not
+ # emitted by ZERO_CHECK.
+ set(RunCMake_TEST_OUTPUT_MERGE 0)
+ run_cmake_command(RerunCMake-build4 ${CMAKE_COMMAND} --build .)
+endif()
+unset(RunCMake_TEST_OUTPUT_MERGE)
unset(RunCMake_TEST_BINARY_DIR)
unset(RunCMake_TEST_NO_CLEAN)
diff --git a/Tests/RunCMake/FPHSA/CustomMessageConfig.cmake b/Tests/RunCMake/FPHSA/CustomMessageConfig.cmake
new file mode 100644
index 000000000..e25db1a0a
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/CustomMessageConfig.cmake
@@ -0,0 +1 @@
+# pseudo config module
diff --git a/Tests/RunCMake/FPHSA/CustomMessageConfigVersion.cmake b/Tests/RunCMake/FPHSA/CustomMessageConfigVersion.cmake
new file mode 100644
index 000000000..b7c9e1866
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/CustomMessageConfigVersion.cmake
@@ -0,0 +1,4 @@
+# pseudo find_module
+
+set (PACKAGE_VERSION 2)
+set (PACKAGE_VERSION_UNSUITABLE TRUE)
diff --git a/Tests/RunCMake/FPHSA/FindCustomMessage.cmake b/Tests/RunCMake/FPHSA/FindCustomMessage.cmake
new file mode 100644
index 000000000..4d67db86d
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/FindCustomMessage.cmake
@@ -0,0 +1,17 @@
+# pseudo find_module
+
+if (REASON_FAILURE_MESSAGE)
+ list (PREPEND REASON_FAILURE_MESSAGE "REASON_FAILURE_MESSAGE")
+endif()
+
+include(FindPackageHandleStandardArgs)
+
+if (CONFIG_MODE)
+ find_package (CustomMessage QUIET CONFIG HINTS "${CMAKE_MODULE_PATH}")
+ find_package_handle_standard_args(CustomMessage CONFIG_MODE
+ ${REASON_FAILURE_MESSAGE})
+else()
+ find_package_handle_standard_args(CustomMessage REQUIRED_VARS FOOBAR
+ VERSION_VAR CustomMessage_VERSION
+ ${REASON_FAILURE_MESSAGE})
+endif()
diff --git a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
index dd73cd487..f3e6c3e74 100644
--- a/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FPHSA/RunCMakeTest.cmake
@@ -39,3 +39,10 @@ unset(RunCMake_DEFAULT_stderr)
# check if searching for a version 0 works
list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DPseudo_VERSION=0")
run_cmake(exact_0_matching)
+
+# check custom error message
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DCustomMessage_VERSION=1.2.3.4")
+run_cmake(custom_message_1)
+set(RunCMake_TEST_OPTIONS "-DCMAKE_MODULE_PATH=${CMAKE_CURRENT_LIST_DIR}" "-DCONFIG_MODE=TRUE")
+run_cmake(custom_message_2)
+run_cmake(custom_message_3)
diff --git a/Tests/RunCMake/FPHSA/custom_message_1-result.txt b/Tests/RunCMake/FPHSA/custom_message_1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/custom_message_1-stderr.txt b/Tests/RunCMake/FPHSA/custom_message_1-stderr.txt
new file mode 100644
index 000000000..992fe39ea
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_1-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .+/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ Could NOT find CustomMessage \(missing: FOOBAR\) \(found suitable version
+ "1\.2\.3\.4", minimum required is "1\.2"\)
+
+ Reason given by package: Reason Failure
+
+Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/FPHSA/custom_message_1.cmake b/Tests/RunCMake/FPHSA/custom_message_1.cmake
new file mode 100644
index 000000000..330de501d
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_1.cmake
@@ -0,0 +1,4 @@
+
+set (REASON_FAILURE_MESSAGE "Reason Failure")
+
+find_package(CustomMessage 1.2 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/custom_message_2-result.txt b/Tests/RunCMake/FPHSA/custom_message_2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/custom_message_2-stderr.txt b/Tests/RunCMake/FPHSA/custom_message_2-stderr.txt
new file mode 100644
index 000000000..494075242
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_2-stderr.txt
@@ -0,0 +1,8 @@
+^CMake Error at .+/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ Could NOT find CustomMessage \(Required is at least version "1\.2"\), checked
+ the following files:
+
+ .+/Tests/RunCMake/FPHSA/CustomMessageConfig.cmake \(version 2\)
+ Reason given by package: Not Found Message
+
+Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/FPHSA/custom_message_2.cmake b/Tests/RunCMake/FPHSA/custom_message_2.cmake
new file mode 100644
index 000000000..a3f2d969b
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_2.cmake
@@ -0,0 +1,5 @@
+
+unset (REASON_FAILURE_MESSAGE)
+set (CustomMessage_NOT_FOUND_MESSAGE "Not Found Message")
+
+find_package(CustomMessage 1.2 REQUIRED)
diff --git a/Tests/RunCMake/FPHSA/custom_message_3-result.txt b/Tests/RunCMake/FPHSA/custom_message_3-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/FPHSA/custom_message_3-stderr.txt b/Tests/RunCMake/FPHSA/custom_message_3-stderr.txt
new file mode 100644
index 000000000..dc55843ac
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_3-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Error at .+/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\):
+ Could NOT find CustomMessage \(Required is at least version "1\.2"\), checked
+ the following files:
+
+ .+/Tests/RunCMake/FPHSA/CustomMessageConfig.cmake \(version 2\)
+ Reason given by package: Not Found Message
+ Reason Failure
+
+Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/FPHSA/custom_message_3.cmake b/Tests/RunCMake/FPHSA/custom_message_3.cmake
new file mode 100644
index 000000000..203e012ca
--- /dev/null
+++ b/Tests/RunCMake/FPHSA/custom_message_3.cmake
@@ -0,0 +1,5 @@
+
+set (REASON_FAILURE_MESSAGE "Reason Failure")
+set (CustomMessage_NOT_FOUND_MESSAGE "Not Found Message")
+
+find_package(CustomMessage 1.2 REQUIRED)
diff --git a/Tests/RunCMake/FileAPI/check_index.pyc b/Tests/RunCMake/FileAPI/check_index.pyc
deleted file mode 100644
index 1abd6c2a9..000000000
--- a/Tests/RunCMake/FileAPI/check_index.pyc
+++ /dev/null
Binary files differ
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index 3096358dc..66c559d7f 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -232,17 +232,37 @@ def check_target(c):
assert is_string(obj["link"]["language"], expected["link"]["language"])
- # FIXME: Properly test commandFragments
if "commandFragments" in obj["link"]:
link_keys.append("commandFragments")
assert is_list(obj["link"]["commandFragments"])
for f in obj["link"]["commandFragments"]:
assert is_dict(f)
- assert sorted(f.keys()) == ["fragment", "role"]
+ assert sorted(f.keys()) == ["fragment", "role"] or sorted(f.keys()) == ["backtrace", "fragment", "role"]
assert is_string(f["fragment"])
assert is_string(f["role"])
assert f["role"] in ("flags", "libraries", "libraryPath", "frameworkPath")
+ if expected["link"]["commandFragments"] is not None:
+ def check_link_command_fragments(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["fragment", "role"]
+
+ if expected["backtrace"] is not None:
+ expected_keys.append("backtrace")
+ assert matches(actual["fragment"], expected["fragment"])
+ assert actual["role"] == expected["role"]
+ check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: matches(a["fragment"], e["fragment"]),
+ obj["link"]["commandFragments"], expected["link"]["commandFragments"],
+ check=check_link_command_fragments,
+ check_exception=lambda a, e: "Link fragment: %s" % a["fragment"],
+ missing_exception=lambda e: "Link fragment: %s" % e["fragment"],
+ extra_exception=lambda a: "Link fragment: %s" % a["fragment"],
+ allow_extra=True)
+
if expected["link"]["lto"] is not None:
link_keys.append("lto")
assert is_bool(obj["link"]["lto"], expected["link"]["lto"])
@@ -327,15 +347,33 @@ def check_target(c):
missing_exception=lambda e: "Source path: %s" % e,
extra_exception=lambda a: "Source path: %s" % obj["sources"][a]["path"])
- # FIXME: Properly test compileCommandFragments
if "compileCommandFragments" in actual:
expected_keys.append("compileCommandFragments")
assert is_list(actual["compileCommandFragments"])
for f in actual["compileCommandFragments"]:
assert is_dict(f)
- assert sorted(f.keys()) == ["fragment"]
assert is_string(f["fragment"])
+ if expected["compileCommandFragments"] is not None:
+ def check_compile_command_fragments(actual, expected):
+ assert is_dict(actual)
+ expected_keys = ["fragment"]
+
+ if expected["backtrace"] is not None:
+ expected_keys.append("backtrace")
+ assert actual["fragment"] == expected["fragment"]
+ check_backtrace(obj, actual["backtrace"], expected["backtrace"])
+
+ assert sorted(actual.keys()) == sorted(expected_keys)
+
+ check_list_match(lambda a, e: is_string(a["fragment"], e["fragment"]),
+ actual["compileCommandFragments"], expected["compileCommandFragments"],
+ check=check_compile_command_fragments,
+ check_exception=lambda a, e: "Compile fragment: %s" % a["fragment"],
+ missing_exception=lambda e: "Compile fragment: %s" % e["fragment"],
+ extra_exception=lambda a: "Compile fragment: %s" % a["fragment"],
+ allow_extra=True)
+
if expected["includes"] is not None:
expected_keys.append("includes")
@@ -931,6 +969,7 @@ def gen_check_targets(c, g, inSource):
"backtrace": None,
},
],
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -979,6 +1018,11 @@ def gen_check_targets(c, g, inSource):
"_dllExtra": False,
},
{
+ "path": "^lib/my_interface_exe\\.imp$",
+ "_aixExtra": True,
+ "_dllExtra": False,
+ },
+ {
"path": "^lib/((Debug|Release|RelWithDebInfo|MinSizeRel)/)?(lib)?my_interface_exe\\.(dll\\.a|lib)$",
"_dllExtra": True,
},
@@ -993,6 +1037,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -1059,6 +1104,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -1166,6 +1212,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -1212,6 +1259,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -1312,6 +1360,7 @@ def gen_check_targets(c, g, inSource):
"backtrace": None,
},
],
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -1362,6 +1411,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": True,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -1428,6 +1478,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -1474,6 +1525,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": True,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -1569,6 +1621,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -1676,6 +1729,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -1722,6 +1776,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -1974,6 +2029,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -2057,6 +2113,25 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": [
+ {
+ "fragment" : "TargetCompileOptions",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 17,
+ "command": "target_compile_options",
+ "hasParent": True,
+ },
+ {
+ "file" : "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ }
+ ],
},
],
"backtrace": [
@@ -2124,6 +2199,62 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "CXX",
"lto": None,
+ "commandFragments": [
+ {
+ "fragment" : "TargetLinkOptions",
+ "role" : "flags",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 18,
+ "command": "target_link_options",
+ "hasParent": True,
+ },
+ {
+ "file" : "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "fragment" : ".*TargetLinkDir\\\"?$",
+ "role" : "libraryPath",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 19,
+ "command": "target_link_directories",
+ "hasParent": True,
+ },
+ {
+ "file" : "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ {
+ "fragment" : ".*cxx_lib.*",
+ "role" : "libraries",
+ "backtrace": [
+ {
+ "file": "^cxx/CMakeLists\\.txt$",
+ "line": 6,
+ "command": "target_link_libraries",
+ "hasParent": True,
+ },
+ {
+ "file" : "^cxx/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ },
+ ],
},
"archive": None,
"dependencies": [
@@ -2200,6 +2331,7 @@ def gen_check_targets(c, g, inSource):
"backtrace": None,
},
],
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -2238,6 +2370,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "CXX",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -2292,6 +2425,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -2326,6 +2460,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "CXX",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -2397,6 +2532,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -2480,6 +2616,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -2514,6 +2651,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "CXX",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -2738,6 +2876,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -2772,6 +2911,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -2843,6 +2983,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -2877,6 +3018,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "CXX",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -3109,6 +3251,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -3216,6 +3359,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -3271,6 +3415,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -3332,6 +3477,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -3439,6 +3585,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -3494,6 +3641,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "CXX",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -3720,6 +3868,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -3754,6 +3903,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -3808,6 +3958,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -3842,6 +3993,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -3896,6 +4048,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -3930,6 +4083,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -3984,6 +4138,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -4018,6 +4173,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -4072,6 +4228,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -4106,6 +4263,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -4396,6 +4554,7 @@ def gen_check_targets(c, g, inSource):
],
"includes": None,
"defines": None,
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -4430,6 +4589,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "C",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -4678,7 +4838,20 @@ def gen_check_targets(c, g, inSource):
{
"path": "^.*/Tests/RunCMake/FileAPI/FileAPIExternalBuild$",
"isSystem": None,
- "backtrace": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 10,
+ "command": "set_property",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
},
{
"path": "^.*/Tests/RunCMake/FileAPIExternalSource$",
@@ -4702,11 +4875,37 @@ def gen_check_targets(c, g, inSource):
"defines": [
{
"define": "EMPTY_C=1",
- "backtrace": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "set_property",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
},
{
"define": "SRC_DUMMY",
- "backtrace": None,
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 9,
+ "command": "set_property",
+ "hasParent": True,
+ },
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
},
{
"define": "GENERATED_EXE=1",
@@ -4743,6 +4942,25 @@ def gen_check_targets(c, g, inSource):
],
},
],
+ "compileCommandFragments": [
+ {
+ "fragment" : "SRC_COMPILE_OPTIONS_DUMMY",
+ "backtrace": [
+ {
+ "file": "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": 13,
+ "command": "set_source_files_properties",
+ "hasParent": True,
+ },
+ {
+ "file" : "^.*/Tests/RunCMake/FileAPIExternalSource/CMakeLists\\.txt$",
+ "line": None,
+ "command": None,
+ "hasParent": False,
+ },
+ ],
+ }
+ ],
},
{
"language": "CXX",
@@ -4805,6 +5023,7 @@ def gen_check_targets(c, g, inSource):
],
},
],
+ "compileCommandFragments": None,
},
],
"backtrace": [
@@ -4839,6 +5058,7 @@ def gen_check_targets(c, g, inSource):
"link": {
"language": "CXX",
"lto": None,
+ "commandFragments": None,
},
"archive": None,
"dependencies": [
@@ -4928,6 +5148,10 @@ def gen_check_targets(c, g, inSource):
for e in expected:
e["artifacts"] = filter_list(lambda a: not a["_dllExtra"], e["artifacts"])
+ if "aix" not in sys.platform:
+ for e in expected:
+ e["artifacts"] = filter_list(lambda a: not a.get("_aixExtra", False), e["artifacts"])
+
return expected
def check_targets(c, g, inSource):
diff --git a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
index 29b61b84f..b0564f5dd 100644
--- a/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
+++ b/Tests/RunCMake/FileAPI/cxx/CMakeLists.txt
@@ -13,3 +13,7 @@ target_link_libraries(cxx_shared_exe PRIVATE cxx_shared_lib)
add_library(cxx_static_lib STATIC ../empty.cxx)
add_executable(cxx_static_exe ../empty.cxx)
target_link_libraries(cxx_static_exe PRIVATE cxx_static_lib)
+
+target_compile_options(cxx_exe PUBLIC TargetCompileOptions)
+target_link_options(cxx_exe PUBLIC TargetLinkOptions)
+target_link_directories(cxx_exe PUBLIC "${CMAKE_BINARY_DIR}/TargetLinkDir")
diff --git a/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
index f5670a727..b3ca66075 100644
--- a/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
+++ b/Tests/RunCMake/FileAPIExternalSource/CMakeLists.txt
@@ -10,3 +10,4 @@ set_property(SOURCE empty.c PROPERTY COMPILE_DEFINITIONS EMPTY_C=1 SRC_DUMMY)
set_property(SOURCE empty.c PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}")
target_include_directories(generated_exe SYSTEM PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
target_compile_definitions(generated_exe PRIVATE GENERATED_EXE=1 -DTGT_DUMMY)
+set_source_files_properties(empty.c PROPERTIES COMPILE_OPTIONS SRC_COMPILE_OPTIONS_DUMMY)
diff --git a/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
index 0a67488a8..ebd723258 100644
--- a/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
+++ b/Tests/RunCMake/FindBoost/CMakePackage-stdout.txt
@@ -1,2 +1,2 @@
-- Found Boost: [^
-]* \(found suitable version "1\.12345", minimum required is "1\.12345"\) found components: date_time
+]* \(found suitable version "1\.12345", minimum required is "1\.12345"\) found components: date_time
diff --git a/Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt b/Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt
index a781dce30..11754252e 100644
--- a/Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt
+++ b/Tests/RunCMake/FindBoost/LegacyVars-LowercaseTargetPrefix-stdout.txt
@@ -1,5 +1,5 @@
-- Found Boost: [^
-]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time python37 mpi_python2 *
+]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time python37 mpi_python2 *
-- Boost_FOUND: TRUE
-- Boost_INCLUDE_DIRS: [^
]*/Tests/RunCMake/FindBoost/CMakePackage[^/]*/include
diff --git a/Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt b/Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt
index a4e9c6af1..101d60ea7 100644
--- a/Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt
+++ b/Tests/RunCMake/FindBoost/LegacyVars-TargetsDefined-stdout.txt
@@ -1,5 +1,5 @@
-- Found Boost: [^
-]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time python37 mpi_python2 *
+]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time python37 mpi_python2 *
-- Boost_FOUND: TRUE
-- Boost_INCLUDE_DIRS: [^
]*/Tests/RunCMake/FindBoost/CMakePackage[^/]*/include
diff --git a/Tests/RunCMake/FindBoost/MissingTarget-stdout.txt b/Tests/RunCMake/FindBoost/MissingTarget-stdout.txt
index 8e9d684c8..9853c01df 100644
--- a/Tests/RunCMake/FindBoost/MissingTarget-stdout.txt
+++ b/Tests/RunCMake/FindBoost/MissingTarget-stdout.txt
@@ -1,5 +1,5 @@
-- Found Boost: [^
-]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time *
+]* \(found suitable version "1\.70\.42", minimum required is "1\.70"\) found components: date_time *
-- Boost_FOUND: TRUE
-- Boost_INCLUDE_DIRS: [^
]*/Tests/RunCMake/FindBoost/CMakePackage_MissingTarget/include
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake
new file mode 100644
index 000000000..fc3a7664b
--- /dev/null
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_GET_MATCHING_MODULE_NAME.cmake
@@ -0,0 +1,28 @@
+# Prepare environment to reuse bletch.pc
+file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/pc-bletch/lib/pkgconfig" PC_PATH)
+if(UNIX)
+ string(REPLACE "\\ " " " PC_PATH "${PC_PATH}")
+endif()
+set(ENV{PKG_CONFIG_PATH} "${PC_PATH}")
+
+find_package(PkgConfig REQUIRED)
+pkg_search_module(FOO REQUIRED foo bletch bar)
+
+if(NOT FOO_MODULE_NAME STREQUAL "bletch")
+ message(FATAL_ERROR "Wrong value for FOO_MODULE_NAME. Expected: bletch, got: ${FOO_MODULE_NAME}")
+endif()
+
+pkg_get_variable(FOO_JACKPOT ${FOO_MODULE_NAME} jackpot)
+
+if(NOT FOO_JACKPOT STREQUAL "bletch-lives")
+ message(FATAL_ERROR "Wrong value for FOO_JACKPOT. Expected: bletch-lives, got: ${FOO_JACKPOT}")
+endif()
+
+unset(FOO_MODULE_NAME)
+
+# verify variable get's also set on subsequent run
+pkg_search_module(FOO REQUIRED foo bletch bar)
+
+if(NOT FOO_MODULE_NAME STREQUAL "bletch")
+ message(FATAL_ERROR "Wrong value for FOO_MODULE_NAME on second run. Expected: bletch, got: ${FOO_MODULE_NAME}")
+endif()
diff --git a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
index e82b05fd8..62bb5de77 100644
--- a/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
+++ b/Tests/RunCMake/FindPkgConfig/FindPkgConfig_IMPORTED_TARGET.cmake
@@ -39,7 +39,7 @@ foreach(i 1 2)
"Name: CMakeInternalFakePackage${i}
Description: Dummy package (${i}) for FindPkgConfig IMPORTED_TARGET test
Version: 1.2.3
-Libs: -l${pname}
+Libs: -l${pname} -l${pname}-doesnotexist
")
endforeach()
@@ -47,27 +47,6 @@ endforeach()
# the import target find_library() calls handle the NO...PATH options correctly
set(ENV{PKG_CONFIG_PATH} ${fakePkgDir}/lib/pkgconfig)
-# Confirm correct behavior of NO_CMAKE_PATH, ensuring we only find the library
-# for the imported target if we have both set CMAKE_PREFIX_PATH and have not
-# given the NO_CMAKE_PATH option
-unset(CMAKE_PREFIX_PATH)
-unset(ENV{CMAKE_PREFIX_PATH})
-pkg_check_modules(FakePackage1 QUIET IMPORTED_TARGET cmakeinternalfakepackage1)
-if (TARGET PkgConfig::FakePackage1)
- message(FATAL_ERROR "Have import target for fake package 1 with no path prefix")
-endif()
-
-set(CMAKE_PREFIX_PATH ${fakePkgDir})
-pkg_check_modules(FakePackage1 QUIET IMPORTED_TARGET NO_CMAKE_PATH cmakeinternalfakepackage1)
-if (TARGET PkgConfig::FakePackage1)
- message(FATAL_ERROR "Have import target for fake package 1 with ignored cmake path")
-endif()
-
-pkg_check_modules(FakePackage1 REQUIRED QUIET IMPORTED_TARGET cmakeinternalfakepackage1)
-if (NOT TARGET PkgConfig::FakePackage1)
- message(FATAL_ERROR "No import target for fake package 1 with prefix path")
-endif()
-
# find targets in subdir and check their visibility
add_subdirectory(target_subdir)
if (TARGET PkgConfig::FakePackage1_dir)
@@ -82,31 +61,35 @@ endif()
# combination
unset(CMAKE_PREFIX_PATH)
unset(ENV{CMAKE_PREFIX_PATH})
-pkg_check_modules(FakePackage2 QUIET IMPORTED_TARGET cmakeinternalfakepackage2)
-if (TARGET PkgConfig::FakePackage2)
- message(FATAL_ERROR "Have import target for fake package 2 with no path prefix")
-endif()
-
set(ENV{CMAKE_PREFIX_PATH} ${fakePkgDir})
-pkg_check_modules(FakePackage2 QUIET IMPORTED_TARGET NO_CMAKE_ENVIRONMENT_PATH cmakeinternalfakepackage2)
-if (TARGET PkgConfig::FakePackage2)
- message(FATAL_ERROR "Have import target for fake package 2 with ignored cmake path")
-endif()
pkg_check_modules(FakePackage2 REQUIRED QUIET IMPORTED_TARGET cmakeinternalfakepackage2)
if (NOT TARGET PkgConfig::FakePackage2)
message(FATAL_ERROR "No import target for fake package 2 with prefix path")
endif()
+# check that 2 library entries exist
+list(LENGTH FakePackage2_LINK_LIBRARIES fp2_nlibs)
+if (NOT fp2_nlibs EQUAL 2)
+ message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has ${fp2_nlibs} entries but should have exactly 2")
+endif()
+
# check that the full library path is also returned
-if (NOT FakePackage2_LINK_LIBRARIES STREQUAL "${fakePkgDir}/lib/libcmakeinternalfakepackage2.a")
+list(GET FakePackage2_LINK_LIBRARIES 0 fp2_lib0)
+if (NOT fp2_lib0 STREQUAL "${fakePkgDir}/lib/libcmakeinternalfakepackage2.a")
+ message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on first run: ${FakePackage2_LINK_LIBRARIES}")
+endif()
+
+# check that the library that couldn't be found still shows up
+list(GET FakePackage2_LINK_LIBRARIES 1 fp2_lib1)
+if (NOT fp2_lib1 STREQUAL "cmakeinternalfakepackage2-doesnotexist")
message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on first run: ${FakePackage2_LINK_LIBRARIES}")
endif()
# the information in *_LINK_LIBRARIES is not cached, so ensure is also is present on second run
unset(FakePackage2_LINK_LIBRARIES)
pkg_check_modules(FakePackage2 REQUIRED QUIET IMPORTED_TARGET cmakeinternalfakepackage2)
-if (NOT FakePackage2_LINK_LIBRARIES STREQUAL "${fakePkgDir}/lib/libcmakeinternalfakepackage2.a")
+if (NOT FakePackage2_LINK_LIBRARIES STREQUAL "${fakePkgDir}/lib/libcmakeinternalfakepackage2.a;cmakeinternalfakepackage2-doesnotexist")
message(FATAL_ERROR "FakePackage2_LINK_LIBRARIES has bad content on second run: ${FakePackage2_LINK_LIBRARIES}")
endif()
diff --git a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
index 414d9b68f..b77bb5432 100644
--- a/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/FindPkgConfig/RunCMakeTest.cmake
@@ -19,4 +19,5 @@ if (PKG_CONFIG_FOUND)
run_cmake(FindPkgConfig_cache_variables)
run_cmake(FindPkgConfig_IMPORTED_TARGET)
run_cmake(FindPkgConfig_VERSION_OPERATORS)
+ run_cmake(FindPkgConfig_GET_MATCHING_MODULE_NAME)
endif ()
diff --git a/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt b/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt
index f664db91f..4a92a455a 100644
--- a/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt
+++ b/Tests/RunCMake/Framework/FrameworkTypeSHARED-build-stdout.txt
@@ -1,3 +1,2 @@
-.*/Framework:( Mach-O universal binary with [^
-]*)? Mach-O[^
+.*/Framework( \(for architecture [^\)]+\))?:[ ]+Mach-O[^
]* dynamically linked shared library.*
diff --git a/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt b/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt
index 4b5f761af..dd64717e6 100644
--- a/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt
+++ b/Tests/RunCMake/Framework/FrameworkTypeSTATIC-build-stdout.txt
@@ -1,2 +1 @@
-/Framework: (Mach-O universal binary with [^
-]*)?current ar archive random library
+/Framework( \(for architecture [^\)]+\))?:[ ]+current ar archive random library
diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake
index c7e1319c1..965fbf431 100644
--- a/Tests/RunCMake/Framework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake
@@ -25,7 +25,7 @@ function(framework_type_test Toolchain Type UseProperty)
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${RunCMake_SOURCE_DIR}/${Toolchain}.cmake")
list(APPEND RunCMake_TEST_OPTIONS "-DFRAMEWORK_TYPE=${Type}")
- if(NOT ${UseProperty})
+ if(NOT UseProperty)
list(APPEND RunCMake_TEST_OPTIONS "-DCMAKE_FRAMEWORK=YES")
endif()
diff --git a/Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp b/Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp
index 7e3e0e43f..ba7767986 100644
--- a/Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp
+++ b/Tests/RunCMake/GenerateExportHeader/exportheader_test.cpp
@@ -1,13 +1,13 @@
-#include "libshared.h"
-
-#include "libstatic.h"
-
#include <fstream>
#include <iostream>
-#include <stdlib.h>
#include <string>
+#include <stdlib.h>
+
+#include "libshared.h"
+#include "libstatic.h"
+
void compare(const char* refName, const char* testName)
{
std::ifstream ref;
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake
index 34e500ac4..f52776e98 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX-imported-target.cmake
@@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_PREFIX static2_import_prefix)
string (APPEND GENERATE_CONTENT
"\ncheck_value (\"TARGET_FILE_PREFIX executable custom\" \"$<TARGET_FILE_PREFIX:exec2>\" \"exec2_prefix\")
-check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,exec2_import_prefix,exec2_prefix>\")
+check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms};AIX>,exec2_import_prefix,exec2_prefix>\")
check_value (\"TARGET_FILE_PREFIX shared custom\" \"$<TARGET_FILE_PREFIX:shared2>\" \"shared2_prefix\")
check_value (\"TARGET_LINKER_FILE_PREFIX shared linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:shared2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,shared2_import_prefix,shared2_prefix>\")
check_value (\"TARGET_FILE_PREFIX static custom\" \"$<TARGET_FILE_PREFIX:static2>\" \"static2_prefix\")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake
index 6bb1e44d6..bef7bbf5c 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_PREFIX.cmake
@@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_PREFIX static2_import_prefix)
string (APPEND GENERATE_CONTENT
"\ncheck_value (\"TARGET_FILE_PREFIX executable custom\" \"$<TARGET_FILE_PREFIX:exec2>\" \"exec2_prefix\")
-check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,exec2_import_prefix,exec2_prefix>\")
+check_value (\"TARGET_LINKER_FILE_PREFIX executable linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms};AIX>,exec2_import_prefix,exec2_prefix>\")
check_value (\"TARGET_FILE_PREFIX shared custom\" \"$<TARGET_FILE_PREFIX:shared2>\" \"shared2_prefix\")
check_value (\"TARGET_LINKER_FILE_PREFIX shared linker custom\" \"$<TARGET_LINKER_FILE_PREFIX:shared2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,shared2_import_prefix,shared2_prefix>\")
check_value (\"TARGET_FILE_PREFIX static custom\" \"$<TARGET_FILE_PREFIX:static2>\" \"static2_prefix\")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake
index e1b7654ce..cefeb86f1 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX-imported-target.cmake
@@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_SUFFIX static2_import_suffix)
string (APPEND GENERATE_CONTENT
"\ncheck_value (\"TARGET_FILE_SUFFIX executable custom\" \"$<TARGET_FILE_SUFFIX:exec2>\" \"exec2_suffix\")
-check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,exec2_import_suffix,exec2_suffix>\")
+check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms};AIX>,exec2_import_suffix,exec2_suffix>\")
check_value (\"TARGET_FILE_SUFFIX shared custom\" \"$<TARGET_FILE_SUFFIX:shared2>\" \"shared2_suffix\")
check_value (\"TARGET_LINKER_FILE_SUFFIX shared linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:shared2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,shared2_import_suffix,shared2_suffix>\")
check_value (\"TARGET_FILE_SUFFIX static custom\" \"$<TARGET_FILE_SUFFIX:static2>\" \"static2_suffix\")
diff --git a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake
index 78afecdaa..39e39fd5b 100644
--- a/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake
+++ b/Tests/RunCMake/GeneratorExpression/TARGET_FILE_SUFFIX.cmake
@@ -38,7 +38,7 @@ set_property (TARGET static2 PROPERTY IMPORT_SUFFIX static2_import_suffix)
string (APPEND GENERATE_CONTENT
"\ncheck_value (\"TARGET_FILE_SUFFIX executable custom\" \"$<TARGET_FILE_SUFFIX:exec2>\" \"exec2_suffix\")
-check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,exec2_import_suffix,exec2_suffix>\")
+check_value (\"TARGET_LINKER_FILE_SUFFIX executable linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:exec2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms};AIX>,exec2_import_suffix,exec2_suffix>\")
check_value (\"TARGET_FILE_SUFFIX shared custom\" \"$<TARGET_FILE_SUFFIX:shared2>\" \"shared2_suffix\")
check_value (\"TARGET_LINKER_FILE_SUFFIX shared linker custom\" \"$<TARGET_LINKER_FILE_SUFFIX:shared2>\" \"$<IF:$<IN_LIST:$<PLATFORM_ID>,${win_platforms}>,shared2_import_suffix,shared2_suffix>\")
check_value (\"TARGET_FILE_SUFFIX static custom\" \"$<TARGET_FILE_SUFFIX:static2>\" \"static2_suffix\")
diff --git a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
index ef8fd2540..ae75561b1 100644
--- a/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorToolset/RunCMakeTest.cmake
@@ -6,12 +6,14 @@ run_cmake(NoToolset)
if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[012456]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset")
run_cmake(TestToolset)
- set(RunCMake_GENERATOR_TOOLSET "Test Toolset,cuda=Test Cuda")
+ set(RunCMake_GENERATOR_TOOLSET "Test Toolset,cuda=0.0")
run_cmake(TestToolsetCudaBoth)
- set(RunCMake_GENERATOR_TOOLSET ",cuda=Test Cuda")
- run_cmake(TestToolsetCudaOnly)
- set(RunCMake_GENERATOR_TOOLSET "cuda=Test Cuda")
- run_cmake(TestToolsetCudaOnly)
+ set(RunCMake_GENERATOR_TOOLSET ",cuda=0.0")
+ run_cmake(TestToolsetCudaVersionOnly)
+ set(RunCMake_GENERATOR_TOOLSET "cuda=0.0")
+ run_cmake(TestToolsetCudaVersionOnly)
+ set(RunCMake_GENERATOR_TOOLSET "cuda=C:\\dummy\\cuda")
+ run_cmake(TestToolsetCudaPathOnly)
if("${RunCMake_GENERATOR}" MATCHES "Visual Studio 1[2456]")
set(RunCMake_GENERATOR_TOOLSET "Test Toolset,host=x64")
run_cmake(TestToolsetHostArchBoth)
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt
index 90503e2cc..f12c123a5 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaBoth-stdout.txt
@@ -1,2 +1,2 @@
-- CMAKE_VS_PLATFORM_TOOLSET='Test Toolset'
--- CMAKE_VS_PLATFORM_TOOLSET_CUDA='Test Cuda'
+-- CMAKE_VS_PLATFORM_TOOLSET_CUDA='0.0'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt
deleted file mode 100644
index 94e1e43e4..000000000
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly-stdout.txt
+++ /dev/null
@@ -1,2 +0,0 @@
--- CMAKE_VS_PLATFORM_TOOLSET='(v[0-9]+|Windows7.1SDK)'
--- CMAKE_VS_PLATFORM_TOOLSET_CUDA='Test Cuda'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly-result.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly-stderr.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly-stderr.txt
new file mode 100644
index 000000000..b17745f9a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at CMakeLists.txt:[0-9]+ \(project\):
+ Generator
+
+ Visual Studio .*
+
+ given toolset
+
+ cuda=C:\\dummy\\cuda\\
+
+ cannot detect Visual Studio integration files in path
+
+ C:/dummy/cuda/CUDAVisualStudioIntegration/extras/visual_studio_integration/MSBuildExtensions
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly.cmake
new file mode 100644
index 000000000..2fc38e5c5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaPathOnly.cmake
@@ -0,0 +1 @@
+message(FATAL_ERROR "This should not be reached!")
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaVersionOnly-stdout.txt b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaVersionOnly-stdout.txt
new file mode 100644
index 000000000..1717ff82e
--- /dev/null
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaVersionOnly-stdout.txt
@@ -0,0 +1,2 @@
+-- CMAKE_VS_PLATFORM_TOOLSET='(v[0-9]+|Windows7.1SDK)'
+-- CMAKE_VS_PLATFORM_TOOLSET_CUDA='0.0'
diff --git a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaVersionOnly.cmake
index befa0af9d..befa0af9d 100644
--- a/Tests/RunCMake/GeneratorToolset/TestToolsetCudaOnly.cmake
+++ b/Tests/RunCMake/GeneratorToolset/TestToolsetCudaVersionOnly.cmake
diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
index f2d749b68..d5c480d79 100644
--- a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/BinInInstallPrefix-CMP0052-NEW-build/foo"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/prefix/BinInInstallPrefix-CMP0052-NEW-build/foo"
which is prefixed in the build directory.
diff --git a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
index 3d838926c..eb4d56d5e 100644
--- a/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
+++ b/Tests/RunCMake/IfacePaths/BinInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
@@ -6,15 +6,15 @@ CMake Warning \(dev\) in CMakeLists.txt:
Directory:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/BinInInstallPrefix-CMP0052-WARN-build/foo"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/prefix/BinInInstallPrefix-CMP0052-WARN-build/foo"
in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory
of the install directory:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/prefix"
however it is also a subdirectory of the build tree:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/BinInInstallPrefix-CMP0052-WARN-build"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/prefix/BinInInstallPrefix-CMP0052-WARN-build"
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt
index ed7cd58e3..8794a8743 100644
--- a/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt
+++ b/Tests/RunCMake/IfacePaths/BinaryDirectoryInInterface-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*RunCMake/IfacePaths_INCLUDE_DIRECTORIES/BinaryDirectoryInInterface-build/foo"
+ ".*RunCMake/IfacePaths_INCDIRS/BinaryDirectoryInInterface-build/foo"
which is prefixed in the build directory.
diff --git a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt
index 3d60831d1..4ba9360fc 100644
--- a/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt
+++ b/Tests/RunCMake/IfacePaths/InstallInBinDir-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/InstallInBinDir-build/foo"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/InstallInBinDir-build/foo"
which is prefixed in the build directory.
diff --git a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt
index 11994ddb3..3c126df2f 100644
--- a/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt
+++ b/Tests/RunCMake/IfacePaths/InstallInSrcDir-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/copy/foo"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/copy/foo"
which is prefixed in the source directory.
diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
index ed5df34a4..38bfa4e99 100644
--- a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-NEW-stderr_INCLUDE_DIRECTORIES.txt
@@ -1,6 +1,6 @@
CMake Error in CMakeLists.txt:
Target "testTarget" INTERFACE_INCLUDE_DIRECTORIES property contains path:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/prefix/src/foo"
which is prefixed in the source directory.
diff --git a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
index cb5a51ccb..fd6e3726d 100644
--- a/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
+++ b/Tests/RunCMake/IfacePaths/SrcInInstallPrefix-CMP0052-WARN-stderr_INCLUDE_DIRECTORIES.txt
@@ -6,15 +6,15 @@ CMake Warning \(dev\) in CMakeLists.txt:
Directory:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src/foo"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/prefix/src/foo"
in INTERFACE_INCLUDE_DIRECTORIES of target "testTarget" is a subdirectory
of the install directory:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/prefix"
however it is also a subdirectory of the source tree:
- ".*Tests/RunCMake/IfacePaths_INCLUDE_DIRECTORIES/prefix/src"
+ ".*Tests/RunCMake/IfacePaths_INCDIRS/prefix/src"
This warning is for project developers. Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/ObjectLibrary/InstallLinkedObj1-stderr.txt b/Tests/RunCMake/ObjectLibrary/InstallLinkedObj1-stderr.txt
index f2f0f94d1..c6637070e 100644
--- a/Tests/RunCMake/ObjectLibrary/InstallLinkedObj1-stderr.txt
+++ b/Tests/RunCMake/ObjectLibrary/InstallLinkedObj1-stderr.txt
@@ -1 +1 @@
-CMake Error: install\(EXPORT "exp" ...\) includes target "UseA" which requires target "A" that is not in the export set.
+CMake Error: install\(EXPORT "exp" ...\) includes target "UseA" which requires target "A" that is not in any export set.
diff --git a/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.c b/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.c
new file mode 100644
index 000000000..088da30b1
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.c
@@ -0,0 +1,17 @@
+#ifndef REQUIRED
+# error "REQUIRED not defined"
+#endif
+
+#if defined(_WIN32)
+# define IMPORT __declspec(dllimport)
+#else
+# define IMPORT
+#endif
+
+IMPORT int a(void);
+extern int required(void);
+
+int main(void)
+{
+ return required() + a();
+}
diff --git a/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake b/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake
index 4aa7bba6f..0a76932ec 100644
--- a/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake
+++ b/Tests/RunCMake/ObjectLibrary/LinkObjLHSShared.cmake
@@ -1,7 +1,15 @@
project(LinkObjLHSShared C)
+# Create a versioned shared library that does not build as part of "all".
add_library(OtherLib SHARED a.c)
-target_compile_definitions(OtherLib INTERFACE REQUIRED)
+target_compile_definitions(OtherLib INTERFACE REQUIRED PRIVATE COMPILE_FOR_SHARED_LIB)
+set_target_properties(OtherLib PROPERTIES SOVERSION 0 VERSION 0.0.0 EXCLUDE_FROM_ALL ON)
add_library(AnObjLib OBJECT requires.c)
-target_link_libraries(AnObjLib OtherLib)
+target_link_libraries(AnObjLib PUBLIC OtherLib)
+
+add_executable(LinkObjLHSShared LinkObjLHSShared.c)
+target_link_libraries(LinkObjLHSShared AnObjLib)
+
+# Verify that our dependency on OtherLib generated its versioning symlinks.
+add_custom_command(TARGET LinkObjLHSShared POST_BUILD COMMAND LinkObjLHSShared)
diff --git a/Tests/RunCMake/ParseImplicitData/CMakeLists.txt b/Tests/RunCMake/ParseImplicitData/CMakeLists.txt
new file mode 100644
index 000000000..7a8570bed
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/CMakeLists.txt
@@ -0,0 +1,91 @@
+#
+# helper CMakeLists.txt file that can be used to generate input files
+# for the Tests/RunCMake/ParseImplicit[Include|Lib]Info tests.
+#
+# usage:
+# [create a temporary build directory and chdir to it]
+# cmake [-D options] $CMAKE_SRC/Tests/RunCMake/ParseImplicitIncludeInfo/data
+#
+# where useful -D options include:
+# -DLANGUAGES="C;CXX" -- list of languages to generate inputs for
+# -DUNAME="Darwin" -- operating system name (def: CMAKE_SYSTEM_NAME)
+#
+
+cmake_minimum_required(VERSION 3.3)
+if(POLICY CMP0089)
+ cmake_policy(SET CMP0089 NEW)
+endif()
+
+set(lngs C CXX)
+set(LANGUAGES "${lngs}" CACHE STRING "List of languages to generate inputs for")
+
+project(gen_implicit_include_data ${LANGUAGES})
+
+set(UNAME "${CMAKE_SYSTEM_NAME}" CACHE STRING "System uname")
+string(TOLOWER "${UNAME}" UNAME)
+message("Generate input for system type: ${UNAME}")
+
+# CMAKE_<LANG>_COMPILER_* variables we save in the resultfile
+set(compvars ABI AR ARCHITECTURE_ID EXTERNAL_TOOLCHAIN ID LAUNCHER LOADED
+ RANLIB TARGET VERSION VERSION_INTERAL)
+
+foreach(lang IN ITEMS ${LANGUAGES})
+
+ if("${lang}" STREQUAL "C")
+ set(file ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
+ elseif("${lang}" STREQUAL "CXX")
+ set(file ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
+ elseif("${lang}" STREQUAL "CUDA")
+ set(file ${CMAKE_ROOT}/Modules/CMakeCUDACompilerABI.cu)
+ elseif("${lang}" STREQUAL "Fortran")
+ set(file ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
+ else()
+ message(FATAL_ERROR "unknown language ${lang}")
+ endif()
+
+ set(resultfile "${CMAKE_BINARY_DIR}/")
+ string(APPEND resultfile ${UNAME}-${lang}-${CMAKE_${lang}_COMPILER_ID})
+ string(APPEND resultfile -${CMAKE_${lang}_COMPILER_VERSION})
+ string(APPEND resultfile .input)
+ message("Generate input for language ${lang}")
+ message("Input file: ${file}")
+ message("Result file: ${resultfile}")
+
+ # replicate logic from CMakeDetermineCompilerABI
+ set(outfile "${CMAKE_PLATFORM_INFO_DIR}/test${lang}.out")
+ set(CMAKE_FLAGS )
+ set(COMPILE_DEFINITIONS )
+ if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
+ set(CMAKE_FLAGS "-DEXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
+ set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_FLAG}")
+ endif()
+ if(DEFINED CMAKE_${lang}_VERBOSE_COMPILE_FLAG)
+ set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_COMPILE_FLAG}")
+ endif()
+ if(NOT "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC")
+ # Avoid adding our own platform standard libraries for compilers
+ # from which we might detect implicit link libraries.
+ list(APPEND CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD_LIBRARIES=")
+ endif()
+
+ try_compile(rv ${CMAKE_BINARY_DIR} ${file}
+ CMAKE_FLAGS ${CMAKE_FLAGS}
+ COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS}
+ CMAKE_FLAGS ${CMAKE_FLAGS}
+ OUTPUT_VARIABLE output
+ COPY_FILE "${outfile}"
+ COPY_FILE_ERROR copy_error)
+
+ if(NOT rv)
+ message(FATAL_ERROR "${lang} compile failed!!")
+ endif()
+
+ set(result "CMAKE_LANG=${lang}\n")
+ list(APPEND result "CMAKE_LINKER=${CMAKE_LINKER}\n")
+ foreach(var IN ITEMS ${compvars})
+ list(APPEND result
+ "CMAKE_${lang}_COMPILER_${var}=${CMAKE_${lang}_COMPILER_${var}}\n")
+ endforeach()
+
+ file(WRITE ${resultfile} ${result} ${output})
+endforeach()
diff --git a/Tests/RunCMake/ParseImplicitData/README b/Tests/RunCMake/ParseImplicitData/README
new file mode 100644
index 000000000..46802544d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/README
@@ -0,0 +1,26 @@
+This directory contains sample input files for the implicit include
+directories, and link info parsers for testing. For each configuration
+ there is one ".input" file and matching ".output" files in
+ParseImplicitIncludeInfo/results and ParseImplicitLinkInfo/results.
+
+To generate ".input" files for a system, create a temporary build
+directory and chdir to it. Then run cmake pointing to this directory.
+The CMakeLists.txt file here will generate ".input" files in your
+build directory. The default set of languages is C and CXX. This
+can be changed with -DLANGUAGES=language_list. For example:
+-DLANGUAGES=Fortran will generate Fortran parser input.
+
+The ".output" files should be generated by hand from the input files.
+The test will compare the parser output to the manually generated
+".output" file. The two should match.
+
+For compilers that support "-nostdinc"-like flags, you can generate
+a test for this with a command like:
+cmake -DUNAME=netbsd_nostdinc \
+ -DCMAKE_C_FLAGS=-nostdinc -DCMAKE_CXX_FLAGS=-nostdinc .
+
+Here is an example for testing the XL compiler with both -I and nostdinc:
+
+env CC=xlc CXX=xlC cmake -DUNAME=linux_nostdinc_i \
+ -DCMAKE_C_FLAGS='-qnostdinc -I/tmp/ii/test_c' \
+ -DCMAKE_CXX_FLAGS='-qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx' .
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input b/Tests/RunCMake/ParseImplicitData/aix-C-XL-13.1.3.input
index 14517c5cb..14517c5cb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.input
+++ b/Tests/RunCMake/ParseImplicitData/aix-C-XL-13.1.3.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XLClang-16.1.0.1.input b/Tests/RunCMake/ParseImplicitData/aix-C-XLClang-16.1.0.1.input
index 2f018e624..2f018e624 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XLClang-16.1.0.1.input
+++ b/Tests/RunCMake/ParseImplicitData/aix-C-XLClang-16.1.0.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input b/Tests/RunCMake/ParseImplicitData/aix-CXX-XL-13.1.3.input
index 5aec849e1..5aec849e1 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.input
+++ b/Tests/RunCMake/ParseImplicitData/aix-CXX-XL-13.1.3.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XLClang-16.1.0.1.input b/Tests/RunCMake/ParseImplicitData/aix-CXX-XLClang-16.1.0.1.input
index da16db3a0..da16db3a0 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XLClang-16.1.0.1.input
+++ b/Tests/RunCMake/ParseImplicitData/aix-CXX-XLClang-16.1.0.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.input b/Tests/RunCMake/ParseImplicitData/craype-C-Cray-8.7.input
index b3218a2f5..b3218a2f5 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-C-Cray-8.7.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input b/Tests/RunCMake/ParseImplicitData/craype-C-Cray-9.0-hlist-ad.input
index e82bd97c1..e82bd97c1 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-C-Cray-9.0-hlist-ad.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitData/craype-C-GNU-7.3.0.input
index 2dc60aff2..2dc60aff2 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-C-GNU-7.3.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.input b/Tests/RunCMake/ParseImplicitData/craype-C-Intel-18.0.2.20180210.input
index 8c68e5bf5..8c68e5bf5 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-C-Intel-18.0.2.20180210.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.input b/Tests/RunCMake/ParseImplicitData/craype-CXX-Cray-8.7.input
index 73c9c8a7f..73c9c8a7f 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-CXX-Cray-8.7.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input b/Tests/RunCMake/ParseImplicitData/craype-CXX-Cray-9.0-hlist-ad.input
index 06a4ac929..06a4ac929 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-CXX-Cray-9.0-hlist-ad.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitData/craype-CXX-GNU-7.3.0.input
index 50f2859c7..50f2859c7 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-CXX-GNU-7.3.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.input b/Tests/RunCMake/ParseImplicitData/craype-CXX-Intel-18.0.2.20180210.input
index e25f7cf9d..e25f7cf9d 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-CXX-Intel-18.0.2.20180210.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-8.7.input
index 4c4e2f483..4c4e2f483 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-8.7.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-9.0-hlist-ad.input
index 0ba430a4f..0ba430a4f 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Cray-9.0-hlist-ad.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitData/craype-Fortran-GNU-7.3.0.input
index bee298c37..bee298c37 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-Fortran-GNU-7.3.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Intel-18.0.2.20180210.input
index 4cdff74ec..4cdff74ec 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.input
+++ b/Tests/RunCMake/ParseImplicitData/craype-Fortran-Intel-18.0.2.20180210.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitData/darwin-C-AppleClang-8.0.0.8000042.input
index 4bc26bcba..4bc26bcba 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.input
+++ b/Tests/RunCMake/ParseImplicitData/darwin-C-AppleClang-8.0.0.8000042.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitData/darwin-CXX-AppleClang-8.0.0.8000042.input
index 907a92e24..907a92e24 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.input
+++ b/Tests/RunCMake/ParseImplicitData/darwin-CXX-AppleClang-8.0.0.8000042.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitData/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input
index effaedf55..effaedf55 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input
+++ b/Tests/RunCMake/ParseImplicitData/darwin_nostdinc-C-AppleClang-8.0.0.8000042.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input b/Tests/RunCMake/ParseImplicitData/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input
index 5504e9472..5504e9472 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input
+++ b/Tests/RunCMake/ParseImplicitData/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.input b/Tests/RunCMake/ParseImplicitData/freebsd-C-Clang-3.3.0.input
index 81626f932..81626f932 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.input
+++ b/Tests/RunCMake/ParseImplicitData/freebsd-C-Clang-3.3.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.input b/Tests/RunCMake/ParseImplicitData/freebsd-CXX-Clang-3.3.0.input
index 1f7758b17..1f7758b17 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.input
+++ b/Tests/RunCMake/ParseImplicitData/freebsd-CXX-Clang-3.3.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input b/Tests/RunCMake/ParseImplicitData/freebsd-Fortran-GNU-4.6.4.input
index 8a5d7411a..8a5d7411a 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.input
+++ b/Tests/RunCMake/ParseImplicitData/freebsd-Fortran-GNU-4.6.4.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-empty.input b/Tests/RunCMake/ParseImplicitData/hand-C-empty.input
index b27eb027d..b27eb027d 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-empty.input
+++ b/Tests/RunCMake/ParseImplicitData/hand-C-empty.input
diff --git a/Tests/RunCMake/ParseImplicitData/hand-C-relative.input b/Tests/RunCMake/ParseImplicitData/hand-C-relative.input
new file mode 100644
index 000000000..52ac9df09
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/hand-C-relative.input
@@ -0,0 +1,23 @@
+CMAKE_LANG=C
+CMAKE_C_COMPILER_ABI=ELF
+CMAKE_C_COMPILER_AR=/usr/bin/gcc-ar-7
+CMAKE_C_COMPILER_ARCHITECTURE_ID=
+CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_C_COMPILER_ID=GNU
+CMAKE_C_COMPILER_LAUNCHER=
+CMAKE_C_COMPILER_LOADED=1
+CMAKE_C_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
+CMAKE_C_COMPILER_TARGET=
+CMAKE_C_COMPILER_VERSION=7.3.0
+CMAKE_C_COMPILER_VERSION_INTERAL=
+
+This is a hand-written test case.
+
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/include
+ ../../../adaptive/relative/include
+ /usr/include
+End of search list.
+
+/usr/bin/ld -L/usr/lib64 -L../../../adaptive/relative/lib
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-empty.input b/Tests/RunCMake/ParseImplicitData/hand-CXX-empty.input
index b983d6b63..b983d6b63 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-empty.input
+++ b/Tests/RunCMake/ParseImplicitData/hand-CXX-empty.input
diff --git a/Tests/RunCMake/ParseImplicitData/hand-CXX-relative.input b/Tests/RunCMake/ParseImplicitData/hand-CXX-relative.input
new file mode 100644
index 000000000..0b223a130
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/hand-CXX-relative.input
@@ -0,0 +1,23 @@
+CMAKE_LANG=CXX
+CMAKE_CXX_COMPILER_ABI=ELF
+CMAKE_CXX_COMPILER_AR=/usr/bin/gcc-ar-7
+CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
+CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CXX_COMPILER_ID=GNU
+CMAKE_CXX_COMPILER_LAUNCHER=
+CMAKE_CXX_COMPILER_LOADED=1
+CMAKE_CXX_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
+CMAKE_CXX_COMPILER_TARGET=
+CMAKE_CXX_COMPILER_VERSION=7.3.0
+CMAKE_CXX_COMPILER_VERSION_INTERAL=
+
+This is a hand-written test case.
+
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/include
+ ../../../adaptive/relative/include
+ /usr/include
+End of search list.
+
+/usr/bin/ld -L/usr/lib64 -L../../../adaptive/relative/lib
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitData/linux-C-GNU-7.3.0.input
index ee296a7a1..ee296a7a1 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-C-GNU-7.3.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.input b/Tests/RunCMake/ParseImplicitData/linux-C-Intel-18.0.0.20170811.input
index 1e6544b90..1e6544b90 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-C-Intel-18.0.0.20170811.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitData/linux-C-PGI-18.10.1.input
index cfc3e7b1c..cfc3e7b1c 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-C-PGI-18.10.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitData/linux-C-XL-12.1.0.input
index a6d9e5a48..a6d9e5a48 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-C-XL-12.1.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input b/Tests/RunCMake/ParseImplicitData/linux-C-XL-16.1.0.0.input
index 97fa28be9..97fa28be9 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-C-XL-16.1.0.0.input
diff --git a/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-10.1.168-CLANG.input b/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-10.1.168-CLANG.input
new file mode 100644
index 000000000..954697dbc
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-10.1.168-CLANG.input
@@ -0,0 +1,242 @@
+CMAKE_LANG=CUDA
+CMAKE_LINKER=/usr/bin/ld
+CMAKE_CUDA_COMPILER_ABI=
+CMAKE_CUDA_COMPILER_AR=
+CMAKE_CUDA_COMPILER_ARCHITECTURE_ID=
+CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CUDA_COMPILER_ID=NVIDIA
+CMAKE_CUDA_COMPILER_LAUNCHER=
+CMAKE_CUDA_COMPILER_LOADED=1
+CMAKE_CUDA_COMPILER_RANLIB=
+CMAKE_CUDA_COMPILER_TARGET=
+CMAKE_CUDA_COMPILER_VERSION=10.1.168
+CMAKE_CUDA_COMPILER_VERSION_INTERAL=
+Change Dir: /home/robert/Work/cmake/cuda_clang_compiler_info/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/ninja cmTC_e3386 && [1/2] Building CUDA object CMakeFiles/cmTC_e3386.dir/CMakeCUDACompilerABI.cu.o
+clang version 8.0.1-svn369350-1~exp1~20190820121219.79 (branches/release_80)
+Target: x86_64-pc-linux-gnu
+Thread model: posix
+InstalledDir: /usr/bin
+Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
+Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found CUDA installation: /usr/local/cuda-10.1, version unknown
+ "/usr/lib/llvm-8/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCUDACompilerABI.cu -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-8/lib/clang/8.0.1 -include cuda_runtime.h -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS -D __CUDACC__ -D __NVCC__ -I /usr/local/cuda/bin/../targets/x86_64-linux/include -D __CUDACC_VER_MAJOR__=10 -D __CUDACC_VER_MINOR__=1 -D __CUDACC_VER_BUILD__=168 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward -internal-isystem /usr/include/clang/8.0.1/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/robert/Work/cmake/cuda_clang_compiler_info/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o - -x c++ /opt/cmake-3.15/share/cmake-3.15/Modules/CMakeCUDACompilerABI.cu -faddrsig
+clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target x86_64-pc-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8"
+ignoring duplicate directory "/usr/include/clang/8.0.1/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/cuda/bin/../targets/x86_64-linux/include
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
+ /usr/include/clang/8.0.1/include
+ /usr/local/include
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+clang version 8.0.1-svn369350-1~exp1~20190820121219.79 (branches/release_80)
+Target: x86_64-pc-linux-gnu
+Thread model: posix
+InstalledDir: /usr/bin
+Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
+Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found CUDA installation: /usr/local/cuda-10.1, version unknown
+ "/usr/lib/llvm-8/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCUDACompilerABI.cu -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-8/lib/clang/8.0.1 -include cuda_runtime.h -D __CUDACC__ -D __NVCC__ -I /usr/local/cuda/bin/../targets/x86_64-linux/include -D __CUDACC_VER_MAJOR__=10 -D __CUDACC_VER_MINOR__=1 -D __CUDACC_VER_BUILD__=168 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward -internal-isystem /usr/include/clang/8.0.1/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/robert/Work/cmake/cuda_clang_compiler_info/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o - -x c++ /opt/cmake-3.15/share/cmake-3.15/Modules/CMakeCUDACompilerABI.cu -faddrsig
+clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target x86_64-pc-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8"
+ignoring duplicate directory "/usr/include/clang/8.0.1/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/cuda/bin/../targets/x86_64-linux/include
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
+ /usr/include/clang/8.0.1/include
+ /usr/local/include
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+clang version 8.0.1-svn369350-1~exp1~20190820121219.79 (branches/release_80)
+Target: x86_64-pc-linux-gnu
+Thread model: posix
+InstalledDir: /usr/bin
+Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
+Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found CUDA installation: /usr/local/cuda-10.1, version unknown
+ "/usr/lib/llvm-8/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name tmpxft_00005e34_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -coverage-notes-file /home/robert/Work/cmake/cuda_clang_compiler_info/CMakeFiles/CMakeTmp/CMakeFiles/cmTC_e3386.dir/CMakeCUDACompilerABI.cu.gcno -resource-dir /usr/lib/llvm-8/lib/clang/8.0.1 -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS -I /usr/local/cuda/bin/../targets/x86_64-linux/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward -internal-isystem /usr/include/clang/8.0.1/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/robert/Work/cmake/cuda_clang_compiler_info/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o CMakeFiles/cmTC_e3386.dir/CMakeCUDACompilerABI.cu.o -x c++ /tmp/tmpxft_00005e34_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp -faddrsig
+clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target x86_64-pc-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8"
+ignoring duplicate directory "/usr/include/clang/8.0.1/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/cuda/bin/../targets/x86_64-linux/include
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
+ /usr/include/clang/8.0.1/include
+ /usr/local/include
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+clang version 8.0.1-svn369350-1~exp1~20190820121219.79 (branches/release_80)
+Target: x86_64-pc-linux-gnu
+Thread model: posix
+InstalledDir: /usr/bin
+Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
+Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found CUDA installation: /usr/local/cuda-10.1, version unknown
+ "/usr/lib/llvm-8/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCUDACompilerABI.cu -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-8/lib/clang/8.0.1 -include cuda_runtime.h -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS -D __CUDACC__ -D __NVCC__ -I /usr/local/cuda/bin/../targets/x86_64-linux/include -D __CUDACC_VER_MAJOR__=10 -D __CUDACC_VER_MINOR__=1 -D __CUDACC_VER_BUILD__=168 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward -internal-isystem /usr/include/clang/8.0.1/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/robert/Work/cmake/cuda_clang_compiler_info/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o - -x c++ /opt/cmake-3.15/share/cmake-3.15/Modules/CMakeCUDACompilerABI.cu -faddrsig
+clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target x86_64-pc-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8"
+ignoring duplicate directory "/usr/include/clang/8.0.1/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/cuda/bin/../targets/x86_64-linux/include
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
+ /usr/include/clang/8.0.1/include
+ /usr/local/include
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+clang version 8.0.1-svn369350-1~exp1~20190820121219.79 (branches/release_80)
+Target: x86_64-pc-linux-gnu
+Thread model: posix
+InstalledDir: /usr/bin
+Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
+Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found CUDA installation: /usr/local/cuda-10.1, version unknown
+ "/usr/lib/llvm-8/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name CMakeCUDACompilerABI.cu -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-8/lib/clang/8.0.1 -include cuda_runtime.h -D __CUDACC__ -D __NVCC__ -I /usr/local/cuda/bin/../targets/x86_64-linux/include -D __CUDACC_VER_MAJOR__=10 -D __CUDACC_VER_MINOR__=1 -D __CUDACC_VER_BUILD__=168 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward -internal-isystem /usr/include/clang/8.0.1/include/ -internal-isystem /usr/local/include -internal-isystem /usr/lib/llvm-8/lib/clang/8.0.1/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /home/robert/Work/cmake/cuda_clang_compiler_info/CMakeFiles/CMakeTmp -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o - -x c++ /opt/cmake-3.15/share/cmake-3.15/Modules/CMakeCUDACompilerABI.cu -faddrsig
+clang -cc1 version 8.0.1 based upon LLVM 8.0.1 default target x86_64-pc-linux-gnu
+ignoring nonexistent directory "/include"
+ignoring duplicate directory "/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8"
+ignoring duplicate directory "/usr/include/clang/8.0.1/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/local/cuda/bin/../targets/x86_64-linux/include
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
+ /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
+ /usr/include/clang/8.0.1/include
+ /usr/local/include
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+[2/2] Linking CUDA executable cmTC_e3386
+clang version 8.0.1-svn369350-1~exp1~20190820121219.79 (branches/release_80)
+Target: x86_64-pc-linux-gnu
+Thread model: posix
+InstalledDir: /usr/bin
+Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.4.0
+Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
+Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
+Candidate multilib: .@m64
+Selected multilib: .@m64
+Found CUDA installation: /usr/local/cuda-10.1, version unknown
+ "/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_e3386 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crt1.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtbegin.o -L/usr/local/cuda/targets/x86_64-linux/lib/stubs -L/usr/local/cuda/targets/x86_64-linux/lib -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../.. -L/usr/lib/llvm-8/bin/../lib -L/lib -L/usr/lib CMakeFiles/cmTC_e3386.dir/CMakeCUDACompilerABI.cu.o -lcudadevrt -lcudart_static -lrt -lpthread -ldl -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/bin/../lib/gcc/x86_64-linux-gnu/8/crtend.o /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../x86_64-linux-gnu/crtn.o
diff --git a/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-10.1.168-XLClang-v.input b/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-10.1.168-XLClang-v.input
new file mode 100644
index 000000000..7b202884d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-10.1.168-XLClang-v.input
@@ -0,0 +1,51 @@
+CMAKE_LANG=CUDA
+CMAKE_LINKER=/sw/summit/xalt/1.1.3/bin/ld
+CMAKE_CUDA_COMPILER_ABI=ELF
+CMAKE_CUDA_COMPILER_AR=
+CMAKE_CUDA_COMPILER_ARCHITECTURE_ID=
+CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CUDA_COMPILER_ID=NVIDIA
+CMAKE_CUDA_COMPILER_LAUNCHER=
+CMAKE_CUDA_COMPILER_LOADED=1
+CMAKE_CUDA_COMPILER_RANLIB=
+CMAKE_CUDA_COMPILER_TARGET=
+CMAKE_CUDA_COMPILER_VERSION=10.1.168
+CMAKE_CUDA_COMPILER_VERSION_INTERAL=
+Change Dir: /ccs/home/rmaynard/cmake/extract_xlc_info/CMakeFiles/CMakeTmp
+
+Run Build Command(s):/usr/bin/gmake cmTC_e9f3e/fast && /usr/bin/gmake -f CMakeFiles/cmTC_e9f3e.dir/build.make CMakeFiles/cmTC_e9f3e.dir/build
+gmake[1]: Entering directory `/autofs/nccs-svm1_home1/rmaynard/cmake/extract_xlc_info/CMakeFiles/CMakeTmp'
+Building CUDA object CMakeFiles/cmTC_e9f3e.dir/CMakeCUDACompilerABI.cu.o
+/sw/summit/cuda/10.1.168/bin/nvcc -ccbin=/sw/summit/xl/16.1.1-3/xlC/16.1.1/bin/xlc++ -v -x cu -c /ccs/home/rmaynard/cmake/src/Modules/CMakeCUDACompilerABI.cu -o CMakeFiles/cmTC_e9f3e.dir/CMakeCUDACompilerABI.cu.o
+#$ _SPACE_=
+#$ _CUDART_=cudart
+#$ _HERE_=/sw/summit/cuda/10.1.168/bin
+#$ _THERE_=/sw/summit/cuda/10.1.168/bin
+#$ _TARGET_SIZE_=
+#$ _TARGET_DIR_=
+#$ _TARGET_DIR_=targets/ppc64le-linux
+#$ TOP=/sw/summit/cuda/10.1.168/bin/..
+#$ NVVMIR_LIBRARY_DIR=/sw/summit/cuda/10.1.168/bin/../nvvm/libdevice
+#$ LD_LIBRARY_PATH=/sw/summit/cuda/10.1.168/bin/../lib:/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/xl-16.1.1-3/spectrum-mpi-10.3.0.1-20190611-aqjt3jo53mogrrhcrd2iufr435azcaha/lib:/sw/summit/xl/16.1.1-3/xlsmp/5.1.1/lib:/sw/summit/xl/16.1.1-3/xlmass/9.1.1/lib:/sw/summit/xl/16.1.1-3/xlC/16.1.1/lib:/sw/summit/xl/16.1.1-3/xlf/16.1.1/lib:/sw/summit/xl/16.1.1-3/lib:/sw/summit/cuda/10.1.168/lib64:/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-csygoqyym3m3ysoaperhxlhoiluvpa2u/lib:/opt/ibm/spectrumcomputing/lsf/10.1/linux3.10-glibc2.17-ppc64le-csm/lib
+#$ PATH=/sw/summit/cuda/10.1.168/bin/../nvvm/bin:/sw/summit/cuda/10.1.168/bin:/sw/sources/lsf-tools/2.0/summit/bin:/sw/summit/xalt/1.1.3/bin:/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/xl-16.1.1-3/spectrum-mpi-10.3.0.1-20190611-aqjt3jo53mogrrhcrd2iufr435azcaha/bin:/sw/summit/xl/16.1.1-3/xlC/16.1.1/bin:/sw/summit/xl/16.1.1-3/xlf/16.1.1/bin:/sw/summit/cuda/10.1.168/bin:/usr/bin:/usr/sbin:/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-csygoqyym3m3ysoaperhxlhoiluvpa2u/bin:/sw/sources/hpss/bin:/opt/ibm/spectrumcomputing/lsf/10.1/linux3.10-glibc2.17-ppc64le-csm/etc:/opt/ibm/spectrumcomputing/lsf/10.1/linux3.10-glibc2.17-ppc64le-csm/bin:/opt/ibm/csm/bin:/usr/local/bin:/usr/local/sbin:/opt/ibm/flightlog/bin:/opt/ibutils/bin:/opt/ibm/spectrum_mpi/jsm_pmix/bin:/opt/puppetlabs/bin:/usr/lpp/mmfs/bin
+#$ INCLUDES="-I/sw/summit/cuda/10.1.168/bin/../targets/ppc64le-linux/include"
+#$ LIBRARIES= "-L/sw/summit/cuda/10.1.168/bin/../targets/ppc64le-linux/lib/stubs" "-L/sw/summit/cuda/10.1.168/bin/../targets/ppc64le-linux/lib"
+#$ CUDAFE_FLAGS=
+#$ PTXAS_FLAGS=
+#$ "/sw/summit/xl/16.1.1-3/xlC/16.1.1/bin"/xlc++ -D__CUDA_ARCH__=300 -E -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__ "-I/sw/summit/cuda/10.1.168/bin/../targets/ppc64le-linux/include" -D__CUDACC_VER_MAJOR__=10 -D__CUDACC_VER_MINOR__=1 -D__CUDACC_VER_BUILD__=168 -include "cuda_runtime.h" "/ccs/home/rmaynard/cmake/src/Modules/CMakeCUDACompilerABI.cu" > "/tmp/tmpxft_0000de61_00000000-6_CMakeCUDACompilerABI.cpp1.ii"
+#$ cicc --clang --clang_version=40000 --allow_managed --unsigned_chars -arch compute_30 -m64 -ftz=0 -prec_div=1 -prec_sqrt=1 -fmad=1 --include_file_name "tmpxft_0000de61_00000000-2_CMakeCUDACompilerABI.fatbin.c" -tused -nvvmir-library "/sw/summit/cuda/10.1.168/bin/../nvvm/libdevice/libdevice.10.bc" --gen_module_id_file --module_id_file_name "/tmp/tmpxft_0000de61_00000000-3_CMakeCUDACompilerABI.module_id" --orig_src_file_name "/ccs/home/rmaynard/cmake/src/Modules/CMakeCUDACompilerABI.cu" --gen_c_file_name "/tmp/tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.cudafe1.c" --stub_file_name "/tmp/tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.cudafe1.stub.c" --gen_device_file_name "/tmp/tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.cudafe1.gpu" "/tmp/tmpxft_0000de61_00000000-6_CMakeCUDACompilerABI.cpp1.ii" -o "/tmp/tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.ptx"
+#$ ptxas -arch=sm_30 -m64 "/tmp/tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.ptx" -o "/tmp/tmpxft_0000de61_00000000-7_CMakeCUDACompilerABI.sm_30.cubin"
+#$ fatbinary --create="/tmp/tmpxft_0000de61_00000000-2_CMakeCUDACompilerABI.fatbin" -64 -no-asm "--image=profile=sm_30,file=/tmp/tmpxft_0000de61_00000000-7_CMakeCUDACompilerABI.sm_30.cubin" "--image=profile=compute_30,file=/tmp/tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.ptx" --embedded-fatbin="/tmp/tmpxft_0000de61_00000000-2_CMakeCUDACompilerABI.fatbin.c"
+#$ rm /tmp/tmpxft_0000de61_00000000-2_CMakeCUDACompilerABI.fatbin
+#$ "/sw/summit/xl/16.1.1-3/xlC/16.1.1/bin"/xlc++ -E -x c++ -D__CUDACC__ -D__NVCC__ "-I/sw/summit/cuda/10.1.168/bin/../targets/ppc64le-linux/include" -D__CUDACC_VER_MAJOR__=10 -D__CUDACC_VER_MINOR__=1 -D__CUDACC_VER_BUILD__=168 -include "cuda_runtime.h" "/ccs/home/rmaynard/cmake/src/Modules/CMakeCUDACompilerABI.cu" > "/tmp/tmpxft_0000de61_00000000-4_CMakeCUDACompilerABI.cpp4.ii"
+#$ cudafe++ --clang --clang_version=40000 --allow_managed --unsigned_chars --m64 --parse_templates --gen_c_file_name "/tmp/tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp" --stub_file_name "tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.cudafe1.stub.c" --module_id_file_name "/tmp/tmpxft_0000de61_00000000-3_CMakeCUDACompilerABI.module_id" "/tmp/tmpxft_0000de61_00000000-4_CMakeCUDACompilerABI.cpp4.ii"
+#$ "/sw/summit/xl/16.1.1-3/xlC/16.1.1/bin"/xlc++ -D__CUDA_ARCH__=300 -c -x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS "-I/sw/summit/cuda/10.1.168/bin/../targets/ppc64le-linux/include" -o "CMakeFiles/cmTC_e9f3e.dir/CMakeCUDACompilerABI.cu.o" "/tmp/tmpxft_0000de61_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp"
+Linking CUDA executable cmTC_e9f3e
+/ccs/home/rmaynard/cmake/build/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e9f3e.dir/link.txt --verbose=1
+/sw/summit/xl/16.1.1-3/xlC/16.1.1/bin/xlc++ -v CMakeFiles/cmTC_e9f3e.dir/CMakeCUDACompilerABI.cu.o -o cmTC_e9f3e -L"/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib/stubs" -L"/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib" -lcudadevrt -lcudart_static -lrt -lpthread -ldl
+exec: export(export,XL_CONFIG=/sw/summit/xl/16.1.1-3/xlC/16.1.1/etc/xlc.cfg.rhel.7.6.gcc.4.8.5.cuda.10.1:xlc++,NULL)
+exec: /sw/summit/xalt/1.1.3/bin/ld(/sw/summit/xalt/1.1.3/bin/ld,--eh-frame-hdr,-Qy,-melf64lppc,-dynamic-linker,/lib64/ld64.so.2,--enable-new-dtags,-L/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib/stubs,-L/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib,-L/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/xl-16.1.1-3/spectrum-mpi-10.3.0.1-20190611-aqjt3jo53mogrrhcrd2iufr435azcaha/lib,-L/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-csygoqyym3m3ysoaperhxlhoiluvpa2u/lib,/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crt1.o,/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crti.o,/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtbegin.o,-L/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlsmp/5.1.1/lib,-L/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlmass/9.1.1/lib,-L/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlC/16.1.1/lib,-R/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/lib,-L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5,-L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64,-L/lib/../lib64,-L/usr/lib/../lib64,-L/autofs/nccs-svm1_sw/peak/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-ytwv7xbkub6mqnpvygdthwqa7mhjqbc5/lib,-L/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../..,CMakeFiles/cmTC_e9f3e.dir/CMakeCUDACompilerABI.cu.o,-o,cmTC_e9f3e,-lcudadevrt,-lcudart_static,-lrt,-lpthread,-ldl,-lxlopt,-lxl,-libmc++,-lstdc++,-lm,-ldl,-lgcc_s,-lgcc,--as-needed,-lpthread,--no-as-needed,-lm,-lc,-lgcc_s,-lgcc,/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/crtend.o,/usr/lib/gcc/ppc64le-redhat-linux/4.8.5/../../../../lib64/crtn.o,NULL)
+unlink: /tmp/xlcW0by5DKQ
+unlink: /tmp/xlcW1dqSZDp
+unlink: /tmp/xlcW2nyAlxY
+gmake[1]: Leaving directory `/autofs/nccs-svm1_home1/rmaynard/cmake/extract_xlc_info/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-9.2.148-GCC.input b/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-9.2.148-GCC.input
new file mode 100644
index 000000000..98aee98f8
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitData/linux-CUDA-NVIDIA-9.2.148-GCC.input
@@ -0,0 +1,125 @@
+CMAKE_LANG=CUDA
+CMAKE_LINKER=/usr/bin/ld
+CMAKE_CUDA_COMPILER_ABI=ELF
+CMAKE_CUDA_COMPILER_AR=
+CMAKE_CUDA_COMPILER_ARCHITECTURE_ID=
+CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN=
+CMAKE_CUDA_COMPILER_ID=NVIDIA
+CMAKE_CUDA_COMPILER_LAUNCHER=
+CMAKE_CUDA_COMPILER_LOADED=1
+CMAKE_CUDA_COMPILER_RANLIB=
+CMAKE_CUDA_COMPILER_TARGET=
+CMAKE_CUDA_COMPILER_VERSION=9.2.148
+CMAKE_CUDA_COMPILER_VERSION_INTERAL=
+Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
+
+Run Build Command:"/usr/bin/make" "cmTC_5996d/fast"
+/usr/bin/make -f CMakeFiles/cmTC_5996d.dir/build.make CMakeFiles/cmTC_5996d.dir/build
+make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
+Building CUDA object CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o
+/usr/bin/nvcc -Xcompiler=-v -x cu -c "/tmp/CMake/Modules/CMakeCUDACompilerABI.cu" -o CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o
+Using built-in specs.
+COLLECT_GCC=gcc-5
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 5.5.0 20171010 (Debian 5.5.0-12)
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-E' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS -D __CUDACC__ -D __NVCC__ -D __CUDACC_VER_BUILD__=148 -D __CUDACC_VER_MINOR__=2 -D __CUDACC_VER_MAJOR__=9 -include cuda_runtime.h /tmp/CMake/Modules/CMakeCUDACompilerABI.cu -m64 -mtune=generic -march=x86-64 -std=c++14
+ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/5
+ /usr/include/x86_64-linux-gnu/c++/5
+ /usr/include/c++/5/backward
+ /usr/lib/gcc/x86_64-linux-gnu/5/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-E' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
+Using built-in specs.
+COLLECT_GCC=gcc-5
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 5.5.0 20171010 (Debian 5.5.0-12)
+COLLECT_GCC_OPTIONS='-std=c++14' '-E' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDACC__ -D __NVCC__ -D __CUDACC_VER_BUILD__=148 -D __CUDACC_VER_MINOR__=2 -D __CUDACC_VER_MAJOR__=9 -include cuda_runtime.h /tmp/CMake/Modules/CMakeCUDACompilerABI.cu -m64 -mtune=generic -march=x86-64 -std=c++14
+ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/5
+ /usr/include/x86_64-linux-gnu/c++/5
+ /usr/include/c++/5/backward
+ /usr/lib/gcc/x86_64-linux-gnu/5/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-std=c++14' '-E' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
+Using built-in specs.
+COLLECT_GCC=gcc-5
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 5.5.0 20171010 (Debian 5.5.0-12)
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS /tmp/tmpxft_00002df4_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp -quiet -dumpbase tmpxft_00002df4_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp -m64 -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o -std=c++14 -version -o /tmp/ccSDI00n.s
+GNU C++14 (Debian 5.5.0-12) version 5.5.0 20171010 (x86_64-linux-gnu)
+ compiled by GNU C version 5.5.0 20171010, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0
+warning: MPFR header version 4.0.1 differs from library version 4.0.2-rc1.
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
+ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
+ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
+#include "..." search starts here:
+#include <...> search starts here:
+ /usr/include/c++/5
+ /usr/include/x86_64-linux-gnu/c++/5
+ /usr/include/c++/5/backward
+ /usr/lib/gcc/x86_64-linux-gnu/5/include
+ /usr/local/include
+ /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
+ /usr/include/x86_64-linux-gnu
+ /usr/include
+End of search list.
+GNU C++14 (Debian 5.5.0-12) version 5.5.0 20171010 (x86_64-linux-gnu)
+ compiled by GNU C version 5.5.0 20171010, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0
+warning: MPFR header version 4.0.1 differs from library version 4.0.2-rc1.
+GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
+Compiler executable checksum: 3caa6244fa07ed8a2b405a77ac6cb692
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
+ as -v --64 -o CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o /tmp/ccSDI00n.s
+GNU assembler version 2.31.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.31.1
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
+Linking CUDA device code CMakeFiles/cmTC_5996d.dir/cmake_device_link.o
+"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_5996d.dir/dlink.txt --verbose=1
+/usr/bin/nvcc -Xcompiler=-fPIC -Wno-deprecated-gpu-targets -shared -dlink CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o -o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -L"/usr/lib/x86_64-linux-gnu"
+Linking CUDA executable cmTC_5996d
+"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_5996d.dir/link.txt --verbose=1
+/usr/lib/nvidia-cuda-toolkit/bin/g++ -v CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -o cmTC_5996d -L"/usr/lib/x86_64-linux-gnu/stubs" -lcudadevrt -lcudart_static -lrt -lpthread -ldl
+Using built-in specs.
+COLLECT_GCC=g++-5
+COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
+Target: x86_64-linux-gnu
+Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
+Thread model: posix
+gcc version 5.5.0 20171010 (Debian 5.5.0-12)
+COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
+COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_5996d' '-L/usr/lib/x86_64-linux-gnu/stubs' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
+ /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cc85GscA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_5996d /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/x86_64-linux-gnu/stubs -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -lcudadevrt -lcudart_static -lrt -lpthread -ldl -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
+make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitData/linux-CXX-GNU-7.3.0.input
index 633a0efa7..633a0efa7 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-CXX-GNU-7.3.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.input b/Tests/RunCMake/ParseImplicitData/linux-CXX-Intel-18.0.0.20170811.input
index 22d871598..22d871598 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-CXX-Intel-18.0.0.20170811.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitData/linux-CXX-PGI-18.10.1.input
index f95627ee4..f95627ee4 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-CXX-PGI-18.10.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitData/linux-CXX-XL-12.1.0.input
index 494b45c14..494b45c14 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-CXX-XL-12.1.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input b/Tests/RunCMake/ParseImplicitData/linux-CXX-XL-16.1.0.0.input
index 37aa450fb..37aa450fb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-CXX-XL-16.1.0.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input b/Tests/RunCMake/ParseImplicitData/linux-Fortran-GNU-7.3.0.input
index 4582433de..4582433de 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-Fortran-GNU-7.3.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitData/linux-Fortran-PGI-18.10.1.input
index fe49bcdee..fe49bcdee 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-Fortran-PGI-18.10.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input b/Tests/RunCMake/ParseImplicitData/linux-Fortran-XL-14.1.0.input
index d80cedef7..d80cedef7 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux-Fortran-XL-14.1.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-C-PGI-18.10.1.input
index 5e2e49ab8..5e2e49ab8 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-PGI-18.10.1.input
+++ b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-C-PGI-18.10.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-C-XL-12.1.0.input
index 8b1e2860b..8b1e2860b 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-C-XL-12.1.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-C-XL-12.1.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-CXX-PGI-18.10.1.input
index dd2b55d91..dd2b55d91 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.input
+++ b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-CXX-PGI-18.10.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-CXX-XL-12.1.0.input
index f6b5d9111..f6b5d9111 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-XL-12.1.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-CXX-XL-12.1.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-Fortran-PGI-18.10.1.input
index 12727f048..12727f048 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.input
+++ b/Tests/RunCMake/ParseImplicitData/linux_nostdinc-Fortran-PGI-18.10.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitData/linux_nostdinc_i-C-XL-12.1.0.input
index a552d7052..a552d7052 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux_nostdinc_i-C-XL-12.1.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input b/Tests/RunCMake/ParseImplicitData/linux_nostdinc_i-CXX-XL-12.1.0.input
index 4b20f2ee4..4b20f2ee4 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.input
+++ b/Tests/RunCMake/ParseImplicitData/linux_nostdinc_i-CXX-XL-12.1.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input b/Tests/RunCMake/ParseImplicitData/linux_pgf77-Fortran-PGI-18.10.1.input
index 01abe8d50..01abe8d50 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.input
+++ b/Tests/RunCMake/ParseImplicitData/linux_pgf77-Fortran-PGI-18.10.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input
index 81e9ee04b..81e9ee04b 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.input
+++ b/Tests/RunCMake/ParseImplicitData/mingw.org-C-GNU-4.9.3.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.input b/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input
index cd773402c..cd773402c 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.input
+++ b/Tests/RunCMake/ParseImplicitData/mingw.org-CXX-GNU-4.9.3.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitData/netbsd-C-GNU-4.8.5.input
index b46848433..b46848433 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.input
+++ b/Tests/RunCMake/ParseImplicitData/netbsd-C-GNU-4.8.5.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitData/netbsd-CXX-GNU-4.8.5.input
index e3c5f72e9..e3c5f72e9 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.input
+++ b/Tests/RunCMake/ParseImplicitData/netbsd-CXX-GNU-4.8.5.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitData/netbsd_nostdinc-C-GNU-4.8.5.input
index cd5845ae5..cd5845ae5 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.input
+++ b/Tests/RunCMake/ParseImplicitData/netbsd_nostdinc-C-GNU-4.8.5.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input b/Tests/RunCMake/ParseImplicitData/netbsd_nostdinc-CXX-GNU-4.8.5.input
index b9a585cc1..b9a585cc1 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.input
+++ b/Tests/RunCMake/ParseImplicitData/netbsd_nostdinc-CXX-GNU-4.8.5.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.input b/Tests/RunCMake/ParseImplicitData/openbsd-C-Clang-5.0.1.input
index 9f34f3d41..9f34f3d41 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.input
+++ b/Tests/RunCMake/ParseImplicitData/openbsd-C-Clang-5.0.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.input b/Tests/RunCMake/ParseImplicitData/openbsd-CXX-Clang-5.0.1.input
index 93f1a9570..93f1a9570 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.input
+++ b/Tests/RunCMake/ParseImplicitData/openbsd-CXX-Clang-5.0.1.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.input b/Tests/RunCMake/ParseImplicitData/sunos-C-SunPro-5.13.0.input
index b0b504acb..b0b504acb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.input
+++ b/Tests/RunCMake/ParseImplicitData/sunos-C-SunPro-5.13.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.input b/Tests/RunCMake/ParseImplicitData/sunos-CXX-SunPro-5.13.0.input
index 9abd06a28..9abd06a28 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.input
+++ b/Tests/RunCMake/ParseImplicitData/sunos-CXX-SunPro-5.13.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input b/Tests/RunCMake/ParseImplicitData/sunos-Fortran-SunPro-8.8.0.input
index 4a2bedd87..4a2bedd87 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.input
+++ b/Tests/RunCMake/ParseImplicitData/sunos-Fortran-SunPro-8.8.0.input
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
index 5880378c5..abd0eaa02 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/ParseImplicitIncludeInfo.cmake
@@ -32,7 +32,8 @@ set(targets
linux_nostdinc-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
linux_nostdinc_i-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
linux-C-XL-16.1.0.0 linux-CXX-XL-16.1.0.0
- linux-CUDA-NVIDIA-9.2.148
+ linux-CUDA-NVIDIA-10.1.168-CLANG linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty
+ linux-CUDA-NVIDIA-9.2.148-GCC
mingw.org-C-GNU-4.9.3 mingw.org-CXX-GNU-4.9.3
netbsd-C-GNU-4.8.5 netbsd-CXX-GNU-4.8.5
netbsd_nostdinc-C-GNU-4.8.5 netbsd_nostdinc-CXX-GNU-4.8.5
@@ -97,22 +98,30 @@ endfunction()
# main test loop
#
foreach(t ${targets})
- set(infile "${CMAKE_SOURCE_DIR}/data/${t}.input")
- set(outfile "${CMAKE_SOURCE_DIR}/data/${t}.output")
- if (NOT EXISTS ${infile} OR NOT EXISTS ${outfile})
- message("missing files for target ${t} in ${CMAKE_SOURCE_DIR}/data")
+ set(infile "${CMAKE_SOURCE_DIR}/../ParseImplicitData/${t}.input")
+ set(outfile "${CMAKE_SOURCE_DIR}/results/${t}.output")
+ if (NOT EXISTS ${infile})
+ string(REPLACE "-empty" "" infile "${infile}")
+ if (NOT EXISTS ${infile})
+ message("missing input file for target ${t} in ${CMAKE_SOURCE_DIR}/../ParseImplicitData/")
+ continue()
+ endif()
+ elseif(NOT EXISTS ${outfile})
+ message("missing files for target ${t} in ${CMAKE_SOURCE_DIR}/results/")
continue()
endif()
+
load_compiler_info(${infile} lang cmvars input)
file(READ ${outfile} output)
string(STRIP "${output}" output)
cmake_parse_implicit_include_info("${input}" "${lang}" idirs log state)
+
if(t MATCHES "-empty$") # empty isn't supposed to parse
if("${state}" STREQUAL "done")
message("empty parse failed: ${idirs}, log=${log}")
endif()
elseif(NOT "${state}" STREQUAL "done" OR NOT "${idirs}" MATCHES "^${output}$")
- message("parse failed: state=${state}, '${idirs}' does not match '^${output}$', log=${log}")
+ message("${t} parse failed: state=${state}, '${idirs}' does not match '^${output}$', log=${log}")
endif()
unload_compiler_info("${cmvars}")
endforeach(t)
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt b/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt
deleted file mode 100644
index bffe819a8..000000000
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/CMakeLists.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# helper CMakeLists.txt file that can be used to generate input files
-# for the Tests/RunCMake/ParseImplicitIncludeInfo test.
-#
-# usage:
-# [create a temporary build directory and chdir to it]
-# cmake [-D options] $CMAKE_SRC/Tests/RunCMake/ParseImplicitIncludeInfo/data
-#
-# where useful -D options include:
-# -DLANGUAGES="C;CXX" -- list of languages to generate inputs for
-# -DUNAME="Darwin" -- operating system name (def: CMAKE_SYSTEM_NAME)
-#
-
-cmake_minimum_required(VERSION 3.3)
-if(POLICY CMP0089)
- cmake_policy(SET CMP0089 NEW)
-endif()
-
-set(lngs C CXX)
-set(LANGUAGES "${lngs}" CACHE STRING "List of languages to generate inputs for")
-
-project(gen_implicit_include_data ${LANGUAGES})
-
-set(UNAME "${CMAKE_SYSTEM_NAME}" CACHE STRING "System uname")
-string(TOLOWER "${UNAME}" UNAME)
-message("Generate input for system type: ${UNAME}")
-
-# CMAKE_<LANG>_COMPILER_* variables we save in the resultfile
-set(compvars ABI AR ARCHITECTURE_ID EXTERNAL_TOOLCHAIN ID LAUNCHER LOADED
- RANLIB TARGET VERSION VERSION_INTERAL)
-
-foreach(lang IN ITEMS ${LANGUAGES})
-
- if("${lang}" STREQUAL "C")
- set(file ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
- elseif("${lang}" STREQUAL "CXX")
- set(file ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
- elseif("${lang}" STREQUAL "CUDA")
- set(file ${CMAKE_ROOT}/Modules/CMakeCUDACompilerABI.cu)
- elseif("${lang}" STREQUAL "Fortran")
- set(file ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
- else()
- message(FATAL_ERROR "unknown language ${lang}")
- endif()
-
- set(resultfile "${CMAKE_BINARY_DIR}/")
- string(APPEND resultfile ${UNAME}-${lang}-${CMAKE_${lang}_COMPILER_ID})
- string(APPEND resultfile -${CMAKE_${lang}_COMPILER_VERSION})
- string(APPEND resultfile .input)
- message("Generate input for language ${lang}")
- message("Input file: ${file}")
- message("Result file: ${resultfile}")
-
- # replicate logic from CMakeDetermineCompilerABI
- set(outfile "${CMAKE_PLATFORM_INFO_DIR}/test${lang}.out")
- set(CMAKE_FLAGS )
- set(COMPILE_DEFINITIONS )
- if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
- set(CMAKE_FLAGS "-DEXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
- set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_FLAG}")
- endif()
- if(DEFINED CMAKE_${lang}_VERBOSE_COMPILE_FLAG)
- set(COMPILE_DEFINITIONS "${CMAKE_${lang}_VERBOSE_COMPILE_FLAG}")
- endif()
- if(NOT "x${CMAKE_${lang}_COMPILER_ID}" STREQUAL "xMSVC")
- # Avoid adding our own platform standard libraries for compilers
- # from which we might detect implicit link libraries.
- list(APPEND CMAKE_FLAGS "-DCMAKE_${lang}_STANDARD_LIBRARIES=")
- endif()
-
- try_compile(rv ${CMAKE_BINARY_DIR} ${file}
- CMAKE_FLAGS ${CMAKE_FLAGS}
- COMPILE_DEFINITIONS ${COMPILE_DEFINITIONS}
- CMAKE_FLAGS ${CMAKE_FLAGS}
- OUTPUT_VARIABLE output
- COPY_FILE "${outfile}"
- COPY_FILE_ERROR copy_error)
-
- if(NOT rv)
- message(FATAL_ERROR "${lang} compile failed!!")
- endif()
-
- set(result "CMAKE_LANG=${lang}\n")
- foreach(var IN ITEMS ${compvars})
- list(APPEND result
- "CMAKE_${lang}_COMPILER_${var}=${CMAKE_${lang}_COMPILER_${var}}\n")
- endforeach()
-
- file(WRITE ${resultfile} ${result} ${output})
-endforeach()
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/README b/Tests/RunCMake/ParseImplicitIncludeInfo/data/README
deleted file mode 100644
index 4f19b3c23..000000000
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/README
+++ /dev/null
@@ -1,25 +0,0 @@
-This directory contains sample input files for the implicit include
-directories parser for testing. For each configuration there is one
-".input" file and one ".output" file.
-
-To generate ".input" files for a system, create a temporary build
-directory and chdir to it. Then run cmake pointing to this directory.
-The CMakeLists.txt file here will generate ".input" files in your
-build directory. The default set of languages is C and CXX. This
-can be changed with -DLANGUAGES=language_list. For example:
--DLANGUAGES=Fortran will generate Fortran parser input.
-
-The ".output" files should be generated by hand from the input files.
-The test will compare the parser output to the manually generated
-".output" file. The two should match.
-
-For compilers that support "-nostdinc"-like flags, you can generate
-a test for this with a command like:
-cmake -DUNAME=netbsd_nostdinc \
- -DCMAKE_C_FLAGS=-nostdinc -DCMAKE_CXX_FLAGS=-nostdinc .
-
-Here is an example for testing the XL compiler with both -I and nostdinc:
-
-env CC=xlc CXX=xlC cmake -DUNAME=linux_nostdinc_i \
- -DCMAKE_C_FLAGS='-qnostdinc -I/tmp/ii/test_c' \
- -DCMAKE_CXX_FLAGS='-qnostdinc -I/tmp/ii/test_c -I/tmp/ii/test_cxx' .
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-relative.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-relative.input
deleted file mode 100644
index dd846e33f..000000000
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-relative.input
+++ /dev/null
@@ -1,21 +0,0 @@
-CMAKE_LANG=C
-CMAKE_C_COMPILER_ABI=ELF
-CMAKE_C_COMPILER_AR=/usr/bin/gcc-ar-7
-CMAKE_C_COMPILER_ARCHITECTURE_ID=
-CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN=
-CMAKE_C_COMPILER_ID=GNU
-CMAKE_C_COMPILER_LAUNCHER=
-CMAKE_C_COMPILER_LOADED=1
-CMAKE_C_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
-CMAKE_C_COMPILER_TARGET=
-CMAKE_C_COMPILER_VERSION=7.3.0
-CMAKE_C_COMPILER_VERSION_INTERAL=
-
-This is a hand-written test case.
-
-#include "..." search starts here:
-#include <...> search starts here:
- /usr/local/include
- ../../../adaptive/relative/include
- /usr/include
-End of search list.
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-relative.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-relative.input
deleted file mode 100644
index 54cc4db46..000000000
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-relative.input
+++ /dev/null
@@ -1,21 +0,0 @@
-CMAKE_LANG=CXX
-CMAKE_CXX_COMPILER_ABI=ELF
-CMAKE_CXX_COMPILER_AR=/usr/bin/gcc-ar-7
-CMAKE_CXX_COMPILER_ARCHITECTURE_ID=
-CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN=
-CMAKE_CXX_COMPILER_ID=GNU
-CMAKE_CXX_COMPILER_LAUNCHER=
-CMAKE_CXX_COMPILER_LOADED=1
-CMAKE_CXX_COMPILER_RANLIB=/usr/bin/gcc-ranlib-7
-CMAKE_CXX_COMPILER_TARGET=
-CMAKE_CXX_COMPILER_VERSION=7.3.0
-CMAKE_CXX_COMPILER_VERSION_INTERAL=
-
-This is a hand-written test case.
-
-#include "..." search starts here:
-#include <...> search starts here:
- /usr/local/include
- ../../../adaptive/relative/include
- /usr/include
-End of search list.
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.input b/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.input
deleted file mode 100644
index 5dd36508e..000000000
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.input
+++ /dev/null
@@ -1,124 +0,0 @@
-CMAKE_LANG=CUDA
-CMAKE_CUDA_COMPILER_ABI=ELF
-CMAKE_CUDA_COMPILER_AR=
-CMAKE_CUDA_COMPILER_ARCHITECTURE_ID=
-CMAKE_CUDA_COMPILER_EXTERNAL_TOOLCHAIN=
-CMAKE_CUDA_COMPILER_ID=NVIDIA
-CMAKE_CUDA_COMPILER_LAUNCHER=
-CMAKE_CUDA_COMPILER_LOADED=1
-CMAKE_CUDA_COMPILER_RANLIB=
-CMAKE_CUDA_COMPILER_TARGET=
-CMAKE_CUDA_COMPILER_VERSION=9.2.148
-CMAKE_CUDA_COMPILER_VERSION_INTERAL=
-Change Dir: /tmp/ii/CMakeFiles/CMakeTmp
-
-Run Build Command:"/usr/bin/make" "cmTC_5996d/fast"
-/usr/bin/make -f CMakeFiles/cmTC_5996d.dir/build.make CMakeFiles/cmTC_5996d.dir/build
-make[1]: Entering directory '/tmp/ii/CMakeFiles/CMakeTmp'
-Building CUDA object CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o
-/usr/bin/nvcc -Xcompiler=-v -x cu -c "/tmp/CMake/Modules/CMakeCUDACompilerABI.cu" -o CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o
-Using built-in specs.
-COLLECT_GCC=gcc-5
-Target: x86_64-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
-Thread model: posix
-gcc version 5.5.0 20171010 (Debian 5.5.0-12)
-COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-E' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
- /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS -D __CUDACC__ -D __NVCC__ -D __CUDACC_VER_BUILD__=148 -D __CUDACC_VER_MINOR__=2 -D __CUDACC_VER_MAJOR__=9 -include cuda_runtime.h /tmp/CMake/Modules/CMakeCUDACompilerABI.cu -m64 -mtune=generic -march=x86-64 -std=c++14
-ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
-ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
-ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
-#include "..." search starts here:
-#include <...> search starts here:
- /usr/include/c++/5
- /usr/include/x86_64-linux-gnu/c++/5
- /usr/include/c++/5/backward
- /usr/lib/gcc/x86_64-linux-gnu/5/include
- /usr/local/include
- /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
- /usr/include/x86_64-linux-gnu
- /usr/include
-End of search list.
-COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
-LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
-COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-E' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
-Using built-in specs.
-COLLECT_GCC=gcc-5
-Target: x86_64-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
-Thread model: posix
-gcc version 5.5.0 20171010 (Debian 5.5.0-12)
-COLLECT_GCC_OPTIONS='-std=c++14' '-E' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
- /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -E -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDACC__ -D __NVCC__ -D __CUDACC_VER_BUILD__=148 -D __CUDACC_VER_MINOR__=2 -D __CUDACC_VER_MAJOR__=9 -include cuda_runtime.h /tmp/CMake/Modules/CMakeCUDACompilerABI.cu -m64 -mtune=generic -march=x86-64 -std=c++14
-ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
-ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
-ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
-#include "..." search starts here:
-#include <...> search starts here:
- /usr/include/c++/5
- /usr/include/x86_64-linux-gnu/c++/5
- /usr/include/c++/5/backward
- /usr/lib/gcc/x86_64-linux-gnu/5/include
- /usr/local/include
- /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
- /usr/include/x86_64-linux-gnu
- /usr/include
-End of search list.
-COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
-LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
-COLLECT_GCC_OPTIONS='-std=c++14' '-E' '-D' '__CUDACC__' '-D' '__NVCC__' '-v' '-D' '__CUDACC_VER_BUILD__=148' '-D' '__CUDACC_VER_MINOR__=2' '-D' '__CUDACC_VER_MAJOR__=9' '-include' 'cuda_runtime.h' '-m64' '-mtune=generic' '-march=x86-64'
-Using built-in specs.
-COLLECT_GCC=gcc-5
-Target: x86_64-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
-Thread model: posix
-gcc version 5.5.0 20171010 (Debian 5.5.0-12)
-COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
- /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -imultiarch x86_64-linux-gnu -D_GNU_SOURCE -D __CUDA_ARCH__=300 -D CUDA_DOUBLE_MATH_FUNCTIONS /tmp/tmpxft_00002df4_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp -quiet -dumpbase tmpxft_00002df4_00000000-5_CMakeCUDACompilerABI.cudafe1.cpp -m64 -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o -std=c++14 -version -o /tmp/ccSDI00n.s
-GNU C++14 (Debian 5.5.0-12) version 5.5.0 20171010 (x86_64-linux-gnu)
- compiled by GNU C version 5.5.0 20171010, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0
-warning: MPFR header version 4.0.1 differs from library version 4.0.2-rc1.
-GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
-ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
-ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
-ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
-#include "..." search starts here:
-#include <...> search starts here:
- /usr/include/c++/5
- /usr/include/x86_64-linux-gnu/c++/5
- /usr/include/c++/5/backward
- /usr/lib/gcc/x86_64-linux-gnu/5/include
- /usr/local/include
- /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
- /usr/include/x86_64-linux-gnu
- /usr/include
-End of search list.
-GNU C++14 (Debian 5.5.0-12) version 5.5.0 20171010 (x86_64-linux-gnu)
- compiled by GNU C version 5.5.0 20171010, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0
-warning: MPFR header version 4.0.1 differs from library version 4.0.2-rc1.
-GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
-Compiler executable checksum: 3caa6244fa07ed8a2b405a77ac6cb692
-COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
- as -v --64 -o CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o /tmp/ccSDI00n.s
-GNU assembler version 2.31.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.31.1
-COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
-LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
-COLLECT_GCC_OPTIONS='-std=c++14' '-D' '__CUDA_ARCH__=300' '-c' '-D' 'CUDA_DOUBLE_MATH_FUNCTIONS' '-v' '-m64' '-o' 'CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o' '-mtune=generic' '-march=x86-64'
-Linking CUDA device code CMakeFiles/cmTC_5996d.dir/cmake_device_link.o
-"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_5996d.dir/dlink.txt --verbose=1
-/usr/bin/nvcc -Xcompiler=-fPIC -Wno-deprecated-gpu-targets -shared -dlink CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o -o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -L"/usr/lib/x86_64-linux-gnu"
-Linking CUDA executable cmTC_5996d
-"/tmp/CMake/bin/cmake" -E cmake_link_script CMakeFiles/cmTC_5996d.dir/link.txt --verbose=1
-/usr/lib/nvidia-cuda-toolkit/bin/g++ -v CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -o cmTC_5996d -L"/usr/lib/x86_64-linux-gnu/stubs" -lcudadevrt -lcudart_static -lrt -lpthread -ldl
-Using built-in specs.
-COLLECT_GCC=g++-5
-COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
-Target: x86_64-linux-gnu
-Configured with: ../src/configure -v --with-pkgversion='Debian 5.5.0-12' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --enable-objc-gc --enable-multiarch --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
-Thread model: posix
-gcc version 5.5.0 20171010 (Debian 5.5.0-12)
-COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
-LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
-COLLECT_GCC_OPTIONS='-v' '-o' 'cmTC_5996d' '-L/usr/lib/x86_64-linux-gnu/stubs' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
- /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/cc85GscA.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_5996d /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -L/usr/lib/x86_64-linux-gnu/stubs -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. CMakeFiles/cmTC_5996d.dir/CMakeCUDACompilerABI.cu.o CMakeFiles/cmTC_5996d.dir/cmake_device_link.o -lcudadevrt -lcudart_static -lrt -lpthread -ldl -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
-make[1]: Leaving directory '/tmp/ii/CMakeFiles/CMakeTmp'
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-C-XL-13.1.3.output
index 91b35ad15..91b35ad15 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XL-13.1.3.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-C-XL-13.1.3.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XLClang-16.1.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-C-XLClang-16.1.0.1.output
index 85399b75b..85399b75b 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-C-XLClang-16.1.0.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-C-XLClang-16.1.0.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-CXX-XL-13.1.3.output
index 264e4fe3b..264e4fe3b 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XL-13.1.3.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-CXX-XL-13.1.3.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XLClang-16.1.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-CXX-XLClang-16.1.0.1.output
index 7666f7e81..7666f7e81 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/aix-CXX-XLClang-16.1.0.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/aix-CXX-XLClang-16.1.0.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Cray-8.7.output
index cbd213278..cbd213278 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-8.7.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Cray-8.7.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Cray-9.0-hlist-ad.output
index 42b194acf..42b194acf 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Cray-9.0-hlist-ad.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Cray-9.0-hlist-ad.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-GNU-7.3.0.output
index 64f127ef2..64f127ef2 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-GNU-7.3.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Intel-18.0.2.20180210.output
index a26a007ce..a26a007ce 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-C-Intel-18.0.2.20180210.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-C-Intel-18.0.2.20180210.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Cray-8.7.output
index 263f8cb25..263f8cb25 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-8.7.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Cray-8.7.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Cray-9.0-hlist-ad.output
index a3b876813..a3b876813 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Cray-9.0-hlist-ad.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Cray-9.0-hlist-ad.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-GNU-7.3.0.output
index b76c5dbb9..b76c5dbb9 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-GNU-7.3.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Intel-18.0.2.20180210.output
index 031c32440..031c32440 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-CXX-Intel-18.0.2.20180210.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-CXX-Intel-18.0.2.20180210.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-8.7.output
index daa34e2ea..daa34e2ea 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-8.7.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-8.7.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-9.0-hlist-ad.output
index 234483b4e..234483b4e 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Cray-9.0-hlist-ad.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Cray-9.0-hlist-ad.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-GNU-7.3.0.output
index 5b96c9d08..5b96c9d08 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-GNU-7.3.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Intel-18.0.2.20180210.output
index 8e484bca6..8e484bca6 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/craype-Fortran-Intel-18.0.2.20180210.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/craype-Fortran-Intel-18.0.2.20180210.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin-C-AppleClang-8.0.0.8000042.output
index 20f9b0e94..20f9b0e94 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-C-AppleClang-8.0.0.8000042.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin-C-AppleClang-8.0.0.8000042.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin-CXX-AppleClang-8.0.0.8000042.output
index de0f91f43..de0f91f43 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/darwin-CXX-AppleClang-8.0.0.8000042.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin-CXX-AppleClang-8.0.0.8000042.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-Fortran-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-C-GNU-4.8.5.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-C-Clang-3.3.0.output
index 893ec4972..893ec4972 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-C-Clang-3.3.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-C-Clang-3.3.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-CXX-Clang-3.3.0.output
index 97410f20a..97410f20a 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-CXX-Clang-3.3.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-CXX-Clang-3.3.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-Fortran-GNU-4.6.4.output
index c0aee1118..c0aee1118 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/freebsd-Fortran-GNU-4.6.4.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/freebsd-Fortran-GNU-4.6.4.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-C-empty.output
index e69de29bb..e69de29bb 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd_nostdinc-CXX-GNU-4.8.5.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-C-empty.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-relative.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-C-relative.output
index e43139b73..e43139b73 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-C-relative.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-C-relative.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-CXX-empty.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-CXX-empty.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-CXX-empty.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-relative.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-CXX-relative.output
index e43139b73..e43139b73 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/hand-CXX-relative.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/hand-CXX-relative.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-GNU-7.3.0.output
index dcd6565d7..dcd6565d7 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-GNU-7.3.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-Intel-18.0.0.20170811.output
index 714131c3e..714131c3e 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-Intel-18.0.0.20170811.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-Intel-18.0.0.20170811.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-PGI-18.10.1.output
index 289c530a6..289c530a6 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-XL-12.1.0.output
index eceacf954..eceacf954 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-XL-16.1.0.0.output
index 6dac25fb4..6dac25fb4 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-C-XL-16.1.0.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-C-XL-16.1.0.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
new file mode 100644
index 000000000..84149e6c3
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
@@ -0,0 +1 @@
+/usr/local/cuda/targets/x86_64-linux/include;/usr/include/c\+\+/8;/usr/include/x86_64-linux-gnu/c\+\+/8;/usr/include/c\+\+/8/backward;/usr/include/clang/8.0.1/include;/usr/local/include;/usr/include/x86_64-linux-gnu;/usr/include
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v-empty.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output
index 497fb887b..497fb887b 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CUDA-NVIDIA-9.2.148.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-GNU-7.3.0.output
index af33ba8fe..af33ba8fe 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-GNU-7.3.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-Intel-18.0.0.20170811.output
index 95bdf991c..95bdf991c 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-Intel-18.0.0.20170811.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-Intel-18.0.0.20170811.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-PGI-18.10.1.output
index 8eb97c84e..8eb97c84e 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-XL-12.1.0.output
index d6d3e58fd..d6d3e58fd 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-XL-16.1.0.0.output
index 9e118fc5a..9e118fc5a 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-CXX-XL-16.1.0.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-CXX-XL-16.1.0.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-GNU-7.3.0.output
index d84842b6f..d84842b6f 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-GNU-7.3.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-GNU-7.3.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-PGI-18.10.1.output
index 289c530a6..289c530a6 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-XL-14.1.0.output
index 39a28a46b..39a28a46b 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux-Fortran-XL-14.1.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux-Fortran-XL-14.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-C-PGI-18.10.1.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-C-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-C-XL-12.1.0.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-C-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output
index 8eb97c84e..8eb97c84e 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc-CXX-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-CXX-XL-12.1.0.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-CXX-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc_i-C-XL-12.1.0.output
index 38f0b3734..38f0b3734 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-C-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc_i-C-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc_i-CXX-XL-12.1.0.output
index 727afdbc0..727afdbc0 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_nostdinc_i-CXX-XL-12.1.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_nostdinc_i-CXX-XL-12.1.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output
index 289c530a6..289c530a6 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/linux_pgf77-Fortran-PGI-18.10.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/mingw.org-C-GNU-4.9.3.output
index d23e7fe7c..d23e7fe7c 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-C-GNU-4.9.3.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/mingw.org-C-GNU-4.9.3.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/mingw.org-CXX-GNU-4.9.3.output
index 999694050..999694050 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/mingw.org-CXX-GNU-4.9.3.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/mingw.org-CXX-GNU-4.9.3.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd-C-GNU-4.8.5.output
index 6b69b2d7c..6b69b2d7c 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-C-GNU-4.8.5.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd-C-GNU-4.8.5.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd-CXX-GNU-4.8.5.output
index d2289eb81..d2289eb81 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/netbsd-CXX-GNU-4.8.5.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd-CXX-GNU-4.8.5.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/openbsd-C-Clang-5.0.1.output
index 60dbe246a..60dbe246a 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-C-Clang-5.0.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/openbsd-C-Clang-5.0.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/openbsd-CXX-Clang-5.0.1.output
index d77687b3c..d77687b3c 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/openbsd-CXX-Clang-5.0.1.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/openbsd-CXX-Clang-5.0.1.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-C-SunPro-5.13.0.output
index 27c452d26..27c452d26 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-C-SunPro-5.13.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-C-SunPro-5.13.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-CXX-SunPro-5.13.0.output
index be851c2ac..be851c2ac 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-CXX-SunPro-5.13.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-CXX-SunPro-5.13.0.output
diff --git a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output b/Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-Fortran-SunPro-8.8.0.output
index 3c31e16c9..3c31e16c9 100644
--- a/Tests/RunCMake/ParseImplicitIncludeInfo/data/sunos-Fortran-SunPro-8.8.0.output
+++ b/Tests/RunCMake/ParseImplicitIncludeInfo/results/sunos-Fortran-SunPro-8.8.0.output
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/CMakeLists.txt b/Tests/RunCMake/ParseImplicitLinkInfo/CMakeLists.txt
new file mode 100644
index 000000000..289710955
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.0)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
new file mode 100644
index 000000000..bb6beb22b
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/ParseImplicitLinkInfo.cmake
@@ -0,0 +1,146 @@
+cmake_minimum_required(VERSION 3.14)
+project(Minimal NONE)
+
+#
+# list of targets to test. to add a target: put its files in the data
+# subdirectory and add it to this list... we run each target's
+# data/*.input file through the parser and check to see if it matches
+# the corresponding data/*.output file. note that the empty-* case
+# has special handling (it should not parse).
+#
+set(targets
+ aix-C-XL-13.1.3 aix-CXX-XL-13.1.3
+ aix-C-XLClang-16.1.0.1 aix-CXX-XLClang-16.1.0.1
+ craype-C-Cray-8.7 craype-CXX-Cray-8.7 craype-Fortran-Cray-8.7
+ craype-C-Cray-9.0-hlist-ad craype-CXX-Cray-9.0-hlist-ad craype-Fortran-Cray-9.0-hlist-ad
+ craype-C-GNU-7.3.0 craype-CXX-GNU-7.3.0 craype-Fortran-GNU-7.3.0
+ craype-C-Intel-18.0.2.20180210 craype-CXX-Intel-18.0.2.20180210
+ craype-Fortran-Intel-18.0.2.20180210
+ darwin-C-AppleClang-8.0.0.8000042 darwin-CXX-AppleClang-8.0.0.8000042
+ darwin_nostdinc-C-AppleClang-8.0.0.8000042
+ darwin_nostdinc-CXX-AppleClang-8.0.0.8000042
+ freebsd-C-Clang-3.3.0 freebsd-CXX-Clang-3.3.0 freebsd-Fortran-GNU-4.6.4
+ hand-C-empty hand-CXX-empty
+ hand-C-relative hand-CXX-relative
+ linux-C-GNU-7.3.0 linux-CXX-GNU-7.3.0 linux-Fortran-GNU-7.3.0
+ linux-C-Intel-18.0.0.20170811 linux-CXX-Intel-18.0.0.20170811
+ linux-C-PGI-18.10.1 linux-CXX-PGI-18.10.1
+ linux-Fortran-PGI-18.10.1 linux_pgf77-Fortran-PGI-18.10.1
+ linux_nostdinc-C-PGI-18.10.1 linux_nostdinc-CXX-PGI-18.10.1
+ linux_nostdinc-Fortran-PGI-18.10.1
+ linux-C-XL-12.1.0 linux-CXX-XL-12.1.0 linux-Fortran-XL-14.1.0
+ linux_nostdinc-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
+ linux_nostdinc_i-C-XL-12.1.0 linux_nostdinc-CXX-XL-12.1.0
+ linux-C-XL-16.1.0.0 linux-CXX-XL-16.1.0.0
+ linux-CUDA-NVIDIA-10.1.168-CLANG linux-CUDA-NVIDIA-10.1.168-XLClang-v
+ linux-CUDA-NVIDIA-9.2.148-GCC
+ mingw.org-C-GNU-4.9.3 mingw.org-CXX-GNU-4.9.3
+ netbsd-C-GNU-4.8.5 netbsd-CXX-GNU-4.8.5
+ netbsd_nostdinc-C-GNU-4.8.5 netbsd_nostdinc-CXX-GNU-4.8.5
+ openbsd-C-Clang-5.0.1 openbsd-CXX-Clang-5.0.1
+ sunos-C-SunPro-5.13.0 sunos-CXX-SunPro-5.13.0 sunos-Fortran-SunPro-8.8.0
+ )
+
+if(CMAKE_HOST_WIN32)
+ # The KWSys actual-case cache breaks case sensitivity on Windows.
+ list(FILTER targets EXCLUDE REGEX "-XL|-SunPro")
+else()
+ # Windows drive letters are not recognized as absolute on other platforms.
+ list(FILTER targets EXCLUDE REGEX "mingw")
+endif()
+
+include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
+
+#
+# load_compiler_info: read infile, parsing out cmake compiler info
+# variables as we go. returns language, a list of variables we set
+# (so we can clear them later), and the remaining verbose output
+# from the compiler.
+#
+function(load_compiler_info infile lang_var outcmvars_var outstr_var)
+ unset(lang)
+ unset(outcmvars)
+ unset(outstr)
+ file(READ "${infile}" in)
+ string(REGEX REPLACE "\r?\n" ";" in_lines "${in}")
+ foreach(line IN LISTS in_lines)
+ # check for special CMAKE variable lines and parse them if found
+ if("${line}" MATCHES "^CMAKE_([_A-Za-z0-9]+)=(.*)$")
+ if("${CMAKE_MATCH_1}" STREQUAL "LANG") # handle CMAKE_LANG here
+ set(lang "${CMAKE_MATCH_2}")
+ else()
+ set(CMAKE_${CMAKE_MATCH_1} "${CMAKE_MATCH_2}" PARENT_SCOPE)
+ list(APPEND outcmvars "CMAKE_${CMAKE_MATCH_1}")
+ endif()
+ else()
+ string(APPEND outstr "${line}\n")
+ endif()
+ endforeach()
+ if(NOT lang)
+ message("load_compiler_info: ${infile} no LANG info; default to C")
+ set(lang C)
+ endif()
+ set(${lang_var} "${lang}" PARENT_SCOPE)
+ set(${outcmvars_var} "${outcmvars}" PARENT_SCOPE)
+ set(${outstr_var} "${outstr}" PARENT_SCOPE)
+endfunction()
+
+#
+# unload_compiler_info: clear out any CMAKE_* vars load previously set
+#
+function(unload_compiler_info cmvars)
+ foreach(var IN LISTS cmvars)
+ unset("${var}" PARENT_SCOPE)
+ endforeach()
+endfunction()
+
+#
+# main test loop
+#
+foreach(t ${targets})
+ set(infile "${CMAKE_SOURCE_DIR}/../ParseImplicitData/${t}.input")
+ set(outfile "${CMAKE_SOURCE_DIR}/results/${t}.output")
+ if (NOT EXISTS ${infile})
+ string(REPLACE "-empty" "" infile "${infile}")
+ if (NOT EXISTS ${infile})
+ message("missing input file for target ${t} in ${CMAKE_SOURCE_DIR}/../ParseImplicitData/")
+ continue()
+ endif()
+ elseif(NOT EXISTS ${outfile})
+ message("missing files for target ${t} in ${CMAKE_SOURCE_DIR}/results/")
+ continue()
+ endif()
+
+ load_compiler_info(${infile} lang cmvars input)
+
+ # Need to handle files with empty entries for both libs or dirs
+ set(implicit_lib_output "")
+ set(idirs_output "")
+ file(STRINGS ${outfile} outputs)
+ foreach(line IN LISTS outputs)
+ if(line MATCHES "libs=")
+ string(REPLACE "libs=" "" implicit_lib_output "${line}")
+ endif()
+ if(line MATCHES "dirs=")
+ string(REPLACE "dirs=" "" idirs_output "${line}")
+ endif()
+ endforeach()
+
+ cmake_parse_implicit_link_info("${input}" implicit_libs idirs implicit_fwks log
+ "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
+
+ # File format
+ # file(WRITE ${outfile} "libs=${implicit_libs}\ndirs=${idirs}\n")
+
+ if(t MATCHES "-empty$") # empty isn't supposed to parse
+ if("${state}" STREQUAL "done")
+ message("empty parse failed: ${idirs}, log=${log}")
+ endif()
+ elseif(NOT "${idirs}" STREQUAL "${idirs_output}")
+ message("${t} parse failed: state=${state}, '${idirs}' does not match '${idirs_output}'")
+ elseif(NOT "${implicit_libs}" STREQUAL "${implicit_lib_output}")
+ message("${t} parse failed: state=${state}, '${implicit_libs}' does not match '${implicit_lib_output}'")
+ endif()
+
+ unload_compiler_info("${cmvars}")
+endforeach(t)
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/RunCMakeTest.cmake b/Tests/RunCMake/ParseImplicitLinkInfo/RunCMakeTest.cmake
new file mode 100644
index 000000000..713e2e76c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(ParseImplicitLinkInfo)
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XL-13.1.3.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XL-13.1.3.output
new file mode 100644
index 000000000..4e030b3de
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XL-13.1.3.output
@@ -0,0 +1,2 @@
+libs=xlopt;xlipa;xl;c
+dirs=/opt/IBM/xlmass/8.1.3/lib/aix61;/opt/IBM/xlc/13.1.3/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XLClang-16.1.0.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XLClang-16.1.0.1.output
new file mode 100644
index 000000000..6f677a000
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-C-XLClang-16.1.0.1.output
@@ -0,0 +1,2 @@
+libs=xlopt;xlipa;xl;c;pthreads
+dirs=/opt/IBM/xlmass/9.1.0/lib/aix61;/opt/IBM/xlc/16.1.0/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XL-13.1.3.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XL-13.1.3.output
new file mode 100644
index 000000000..6cbc792c5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XL-13.1.3.output
@@ -0,0 +1,2 @@
+libs=xlopt;xlipa;xl;C;m;c
+dirs=/opt/IBM/xlmass/8.1.3/lib/aix61;/opt/IBM/xlc/13.1.3/lib;/opt/IBM/xlC/13.1.3/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XLClang-16.1.0.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XLClang-16.1.0.1.output
new file mode 100644
index 000000000..2dc5832b3
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/aix-CXX-XLClang-16.1.0.1.output
@@ -0,0 +1,2 @@
+libs=xlopt;xlipa;xl;c++;Ccore;pthreads;m;c
+dirs=/opt/IBM/xlmass/9.1.0/lib/aix61;/opt/IBM/xlc/16.1.0/lib;/opt/IBM/xlC/16.1.0/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-8.7.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-8.7.output
new file mode 100644
index 000000000..674975cbd
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-8.7.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;pthread;sci_cray_mpi_mp;m;f;sci_cray_mp;craymp;m;pthread;f;hugetlbfs;mpich_cray;rt;pthread;ugni;pmi;pgas-dmapp;fi;u;rt;dmapp;ugni;udreg;pthread;m;cray-c++-rts;stdc++;xpmem;dmapp;pthread;pmi;pthread;alpslli;pthread;wlm_detect;ugni;pthread;alpsutil;pthread;rca;udreg;quadmath;m;omp;rt;craymp;pthread;rt;dl;cray-c++-rts;stdc++;m;modules;m;rt;fi;m;quadmath;rt;craymath;m;gfortran;quadmath;rt;f;m;pthread;rt;u;rt;dl;cray-c++-rts;stdc++;m;csup;rt;atomic;stdc++;pthread;c;csup;m;gcc
+dirs=/opt/gcc/6.1.0/snos/lib64;/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/lib;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64;/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/lib64;/opt/cray/pe/pmi/5.0.14/lib64;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/pe/cce/8.7.4/cce/x86_64/lib;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64;/usr/lib64;/lib64;/opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0;/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-unknown-linux-gnu/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-9.0-hlist-ad.output
new file mode 100644
index 000000000..1bf2f6d05
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Cray-9.0-hlist-ad.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;rca;mpich_cray_90;sci_cray_mpi;sci_cray;pgas-dmapp;quadmath;modules;fi;craymath;f;u;csup;atomic;tcmalloc_minimal;cray-c++-rts;stdc++;pthread;c;csup;m;clang_rt.craypgo-x86_64;gcc
+dirs=/opt/gcc/8.1.0/snos/lib64;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/lib;/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/lib;/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/pe/cce/9.0.0/cce/x86_64/lib;/usr/lib64;/lib64;/opt/cray/pe/cce/9.0.0/cce-clang/x86_64/lib/clang/9.0.0/lib/linux;/opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0;/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-unknown-linux-gnu/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-GNU-7.3.0.output
new file mode 100644
index 000000000..267bf58bb
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-GNU-7.3.0.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;pthread;sci_gnu_71_mpi;sci_gnu_71;pthread;hugetlbfs;mpich_gnu_71;rt;ugni;pthread;pmi;pthread;alpslli;pthread;wlm_detect;alpsutil;pthread;rca;xpmem;ugni;pthread;udreg;gfortran;quadmath;mvec;m;pthread;gcc;c
+dirs=/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64;/opt/cray/pe/pmi/5.0.14/lib64;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0;/opt/gcc/7.3.0/snos/lib64;/lib64;/usr/lib64;/opt/gcc/7.3.0/snos/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Intel-18.0.2.20180210.output
new file mode 100644
index 000000000..e9e67396f
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-C-Intel-18.0.2.20180210.output
@@ -0,0 +1,2 @@
+libs=imf;svml;irng;m;ipgo;decimal;cilkrts;stdc++;gcc;gcc_s;irc;svml;c;gcc;gcc_s;irc_s;dl;c
+dirs=/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0;/opt/gcc/6.3.0/snos/lib64;/lib64;/usr/lib64;/opt/gcc/6.3.0/snos/lib;/lib;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-8.7.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-8.7.output
new file mode 100644
index 000000000..7daa29d40
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-8.7.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;pthread;sci_cray_mpi_mp;m;f;sci_cray_mp;craymp;m;pthread;f;hugetlbfs;mpichcxx_cray;rt;pthread;ugni;pmi;mpich_cray;rt;pthread;ugni;pmi;pgas-dmapp;fi;u;rt;dmapp;ugni;udreg;pthread;m;cray-c++-rts;stdc++;xpmem;dmapp;pthread;pmi;pthread;alpslli;pthread;wlm_detect;ugni;pthread;alpsutil;pthread;rca;udreg;quadmath;m;omp;rt;craymp;pthread;rt;dl;cray-c++-rts;stdc++;m;modules;m;rt;fi;m;quadmath;rt;craymath;m;gfortran;quadmath;rt;f;m;pthread;rt;u;rt;dl;cray-c++-rts;stdc++;m;csup;rt;atomic;cray-c++-rts;stdc++;supc++;stdc++;pthread;c;csup;m;gcc
+dirs=/opt/gcc/6.1.0/snos/lib64;/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/lib;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64;/opt/cray/dmapp/7.1.1-6.0.5.0_49.8__g1125556.ari/lib64;/opt/cray/pe/pmi/5.0.14/lib64;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/pe/cce/8.7.4/cce/x86_64/lib;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64;/usr/lib64;/lib64;/opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0;/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-unknown-linux-gnu/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-9.0-hlist-ad.output
new file mode 100644
index 000000000..958a6b1cf
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Cray-9.0-hlist-ad.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;rca;mpich_cray_90;mpichcxx_cray_90;sci_cray_mpi;sci_cray;pgas-dmapp;quadmath;modules;fi;craymath;f;u;csup;atomic;cray-c++-rts;cray-c++-rts;stdc++;supc++;tcmalloc_minimal;cray-c++-rts;stdc++;pthread;c;csup;m;clang_rt.craypgo-x86_64;gcc
+dirs=/opt/gcc/8.1.0/snos/lib64;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/lib;/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/lib;/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/pe/cce/9.0.0/cce/x86_64/lib;/usr/lib64;/lib64;/opt/cray/pe/cce/9.0.0/cce-clang/x86_64/lib/clang/9.0.0/lib/linux;/opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0;/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-unknown-linux-gnu/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-GNU-7.3.0.output
new file mode 100644
index 000000000..40d0047c7
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-GNU-7.3.0.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;pthread;sci_gnu_71_mpi;sci_gnu_71;pthread;hugetlbfs;mpichcxx_gnu_71;rt;ugni;pthread;pmi;mpich_gnu_71;rt;ugni;pthread;pmi;pthread;alpslli;pthread;wlm_detect;alpsutil;pthread;rca;ugni;pthread;xpmem;udreg;gfortran;quadmath;mvec;m;pthread;stdc++;m;gcc;c
+dirs=/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64;/opt/cray/pe/pmi/5.0.14/lib64;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0;/opt/gcc/7.3.0/snos/lib64;/lib64;/usr/lib64;/opt/gcc/7.3.0/snos/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Intel-18.0.2.20180210.output
new file mode 100644
index 000000000..621284418
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-CXX-Intel-18.0.2.20180210.output
@@ -0,0 +1,2 @@
+libs=imf;svml;irng;stdc++;m;ipgo;decimal;cilkrts;stdc++;gcc;gcc_s;irc;svml;c;gcc;gcc_s;irc_s;dl;c
+dirs=/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0;/opt/gcc/6.3.0/snos/lib64;/lib64;/usr/lib64;/opt/gcc/6.3.0/snos/lib;/lib;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-8.7.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-8.7.output
new file mode 100644
index 000000000..9828bf3cf
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-8.7.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;rca;sci_cray_mpi_mp;sci_cray_mp;mpich_cray;mpichf90_cray;pgas-dmapp;quadmath;omp;craymp;modules;fi;craymath;f;u;csup;atomic;gfortran;tcmalloc_minimal;stdc++;pthread;c;csup;m;gcc
+dirs=/opt/gcc/6.1.0/snos/lib64;/opt/cray/pe/libsci/18.07.1/CRAY/8.6/x86_64/lib;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.3/gni/mpich-cray/8.6/lib;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/pe/cce/8.7.4/cce/x86_64/lib;/usr/lib64;/lib64;/opt/gcc/6.1.0/snos/lib/gcc/x86_64-suse-linux/6.1.0;/opt/cray/pe/cce/8.7.4/binutils/x86_64/x86_64-unknown-linux-gnu/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-9.0-hlist-ad.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-9.0-hlist-ad.output
new file mode 100644
index 000000000..46754080f
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Cray-9.0-hlist-ad.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;rca;mpich_cray_90;mpichf90_cray_90;sci_cray_mpi;sci_cray;pgas-dmapp;quadmath;modules;fi;craymath;f;u;csup;gfortran;tcmalloc_minimal;cray-c++-rts;stdc++;pthread;c;csup;m;clang_rt.craypgo-x86_64;gcc
+dirs=/opt/gcc/8.1.0/snos/lib64;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.8/gni/mpich-cray/9.0/lib;/opt/cray/pe/libsci/19.06.1/CRAY/9.0/x86_64/lib;/opt/cray/rca/2.2.18-6.0.7.0_33.3__g2aa4f39.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/pe/cce/9.0.0/cce/x86_64/lib;/usr/lib64;/lib64;/opt/cray/pe/cce/9.0.0/cce-clang/x86_64/lib/clang/9.0.0/lib/linux;/opt/gcc/8.1.0/snos/lib/gcc/x86_64-suse-linux/8.1.0;/opt/cray/pe/cce/9.0.0/binutils/x86_64/x86_64-unknown-linux-gnu/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-GNU-7.3.0.output
new file mode 100644
index 000000000..da2e55729
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-GNU-7.3.0.output
@@ -0,0 +1,2 @@
+libs=AtpSigHandler;AtpSigHCommData;rca;sci_gnu_71_mpi;sci_gnu_71;mpich_gnu_71;mpichf90_gnu_71;gfortran;quadmath;pthread;gfortran;m;gcc_s;gcc;quadmath;m;gcc_s;gcc;c;gcc_s;gcc
+dirs=/opt/cray/pe/libsci/18.07.1/GNU/7.1/x86_64/lib;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.3/gni/mpich-gnu/7.1/lib;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/gcc/7.3.0/snos/lib/gcc/x86_64-suse-linux/7.3.0;/opt/gcc/7.3.0/snos/lib64;/lib64;/usr/lib64;/opt/gcc/7.3.0/snos/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Intel-18.0.2.20180210.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Intel-18.0.2.20180210.output
new file mode 100644
index 000000000..e73cbe9fd
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/craype-Fortran-Intel-18.0.2.20180210.output
@@ -0,0 +1,2 @@
+libs=hugetlbfs;AtpSigHandler;AtpSigHCommData;pthread;mpichf90_intel;rt;ugni;pmi;imf;m;pthread;dl;sci_intel_mpi;sci_intel;imf;m;dl;mpich_intel;rt;ugni;pthread;pmi;imf;m;dl;pmi;pthread;alpslli;pthread;wlm_detect;alpsutil;pthread;rca;xpmem;ugni;pthread;udreg;sci_intel;imf;m;pthread;dl;hugetlbfs;imf;m;pthread;ifport;ifcore;imf;svml;m;ipgo;irc;svml;c;gcc;irc_s;dl;c
+dirs=/opt/cray/pe/libsci/18.07.1/INTEL/16.0/x86_64/lib;/opt/cray/dmapp/default/lib64;/opt/cray/pe/mpt/7.7.3/gni/mpich-intel/16.0/lib;/opt/cray/rca/2.2.16-6.0.5.0_15.34__g5e09e6d.ari/lib64;/opt/cray/alps/6.5.28-6.0.5.0_18.6__g13a91b6.ari/lib64;/opt/cray/xpmem/2.2.4-6.0.5.1_8.26__g35d5e73.ari/lib64;/opt/cray/pe/pmi/5.0.14/lib64;/opt/cray/ugni/6.0.14-6.0.5.0_16.9__g19583bb.ari/lib64;/opt/cray/udreg/2.3.2-6.0.5.0_13.12__ga14955a.ari/lib64;/opt/cray/pe/atp/2.1.3/libApp;/opt/cray/wlm_detect/1.3.2-6.0.5.0_3.1__g388ccd5.ari/lib64;/opt/intel/2018.2.199/compilers_and_libraries_2018/linux/mkl/lib/intel64;/opt/intel/2018.2.199/compilers_and_libraries_2018.2.199/linux/compiler/lib/intel64_lin;/opt/gcc/6.3.0/snos/lib/gcc/x86_64-suse-linux/6.3.0;/opt/gcc/6.3.0/snos/lib64;/lib64;/usr/lib64;/opt/gcc/6.3.0/snos/lib;/lib;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-C-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-C-AppleClang-8.0.0.8000042.output
new file mode 100644
index 000000000..c041faa4e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-C-AppleClang-8.0.0.8000042.output
@@ -0,0 +1,2 @@
+libs=
+dirs=/usr/lib;/usr/local/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-CXX-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-CXX-AppleClang-8.0.0.8000042.output
new file mode 100644
index 000000000..f75637c57
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin-CXX-AppleClang-8.0.0.8000042.output
@@ -0,0 +1,2 @@
+libs=c++
+dirs=/usr/lib;/usr/local/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
new file mode 100644
index 000000000..c041faa4e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-C-AppleClang-8.0.0.8000042.output
@@ -0,0 +1,2 @@
+libs=
+dirs=/usr/lib;/usr/local/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
new file mode 100644
index 000000000..f75637c57
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/darwin_nostdinc-CXX-AppleClang-8.0.0.8000042.output
@@ -0,0 +1,2 @@
+libs=c++
+dirs=/usr/lib;/usr/local/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-C-Clang-3.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-C-Clang-3.3.0.output
new file mode 100644
index 000000000..4ce854adc
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-C-Clang-3.3.0.output
@@ -0,0 +1,2 @@
+libs=gcc;gcc_s;c;gcc;gcc_s
+dirs=/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-CXX-Clang-3.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-CXX-Clang-3.3.0.output
new file mode 100644
index 000000000..b0b8e25b5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-CXX-Clang-3.3.0.output
@@ -0,0 +1,2 @@
+libs=c++;m;gcc;gcc_s;c;gcc;gcc_s
+dirs=/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-Fortran-GNU-4.6.4.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-Fortran-GNU-4.6.4.output
new file mode 100644
index 000000000..12283333a
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/freebsd-Fortran-GNU-4.6.4.output
@@ -0,0 +1,2 @@
+libs=gfortran;m;gcc_s;gcc;quadmath;m;gcc_s;gcc;c;gcc_s;gcc
+dirs=/usr/local/lib/gcc46/gcc/x86_64-portbld-freebsd10.0/4.6.4;/usr/local/x86_64-portbld-freebsd10.0/lib;/usr/local/lib/gcc46
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-empty.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-empty.output
new file mode 100644
index 000000000..1b14cd558
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-empty.output
@@ -0,0 +1,2 @@
+libs=
+dirs=
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-relative.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-relative.output
new file mode 100644
index 000000000..9bb651af5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-C-relative.output
@@ -0,0 +1,2 @@
+libs=
+dirs=/usr/lib64
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-empty.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-empty.output
new file mode 100644
index 000000000..1b14cd558
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-empty.output
@@ -0,0 +1,2 @@
+libs=
+dirs=
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-relative.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-relative.output
new file mode 100644
index 000000000..9bb651af5
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/hand-CXX-relative.output
@@ -0,0 +1,2 @@
+libs=
+dirs=/usr/lib64
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output
new file mode 100644
index 000000000..63b51a1ec
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-GNU-7.3.0.output
@@ -0,0 +1,2 @@
+libs=gcc;gcc_s;c;gcc;gcc_s
+dirs=/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output
new file mode 100644
index 000000000..b61e097d2
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-Intel-18.0.0.20170811.output
@@ -0,0 +1,2 @@
+libs=imf;svml;irng;m;ipgo;decimal;cilkrts;stdc++;gcc;gcc_s;irc;svml;c;gcc;gcc_s;irc_s;dl;c
+dirs=/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7;/usr/lib/gcc/x86_64-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib;/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output
new file mode 100644
index 000000000..7b2091502
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-PGI-18.10.1.output
@@ -0,0 +1,2 @@
+libs=pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
+dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output
new file mode 100644
index 000000000..de407f2f0
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-12.1.0.output
@@ -0,0 +1,2 @@
+libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
+dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output
new file mode 100644
index 000000000..de515e790
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-C-XL-16.1.0.0.output
@@ -0,0 +1,2 @@
+libs=xlopt;xl;dl;gcc_s;pthread;gcc;m;c;gcc_s;gcc
+dirs=/opt/ibm/xlsmp/5.1.0/lib;/opt/ibm/xlmass/9.1.0/lib;/opt/ibm/xlC/16.1.0/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
new file mode 100644
index 000000000..a657b8508
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-CLANG.output
@@ -0,0 +1,2 @@
+libs=cudadevrt;cudart_static;rt;pthread;dl;stdc++;m;gcc_s;gcc;c;gcc_s;gcc
+dirs=/usr/local/cuda/targets/x86_64-linux/lib/stubs;/usr/local/cuda/targets/x86_64-linux/lib;/usr/lib/gcc/x86_64-linux-gnu/8;/usr/lib/x86_64-linux-gnu;/lib/x86_64-linux-gnu;/lib64;/usr/lib;/usr/lib/llvm-8/lib;/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output
new file mode 100644
index 000000000..58ae64d60
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-10.1.168-XLClang-v.output
@@ -0,0 +1,2 @@
+libs=cudadevrt;cudart_static;rt;pthread;dl;xlopt;xl;ibmc++;stdc++;m;dl;gcc_s;gcc;pthread;m;c;gcc_s;gcc
+dirs=/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib/stubs;/sw/summit/cuda/10.1.168/targets/ppc64le-linux/lib;/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/xl-16.1.1-3/spectrum-mpi-10.3.0.1-20190611-aqjt3jo53mogrrhcrd2iufr435azcaha/lib;/autofs/nccs-svm1_sw/summit/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-csygoqyym3m3ysoaperhxlhoiluvpa2u/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlsmp/5.1.1/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlmass/9.1.1/lib;/autofs/nccs-svm1_sw/summit/xl/16.1.1-3/xlC/16.1.1/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/autofs/nccs-svm1_sw/peak/.swci/1-compute/opt/spack/20180914/linux-rhel7-ppc64le/gcc-4.8.5/darshan-runtime-3.1.7-ytwv7xbkub6mqnpvygdthwqa7mhjqbc5/lib;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output
new file mode 100644
index 000000000..7c99bf669
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CUDA-NVIDIA-9.2.148-GCC.output
@@ -0,0 +1,2 @@
+libs=cudadevrt;cudart_static;rt;pthread;dl;stdc++;m;gcc_s;gcc;c;gcc_s;gcc
+dirs=/usr/lib/x86_64-linux-gnu/stubs;/usr/lib/gcc/x86_64-linux-gnu/5;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output
new file mode 100644
index 000000000..4fc79373d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-GNU-7.3.0.output
@@ -0,0 +1,2 @@
+libs=stdc++;m;gcc_s;gcc;c;gcc_s;gcc
+dirs=/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output
new file mode 100644
index 000000000..5d857892c
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-Intel-18.0.0.20170811.output
@@ -0,0 +1,2 @@
+libs=imf;svml;irng;stdc++;m;ipgo;decimal;cilkrts;stdc++;gcc;gcc_s;irc;svml;c;gcc;gcc_s;irc_s;dl;c
+dirs=/opt/intel/compilers_and_libraries_2018.0.128/linux/ipp/lib/intel64;/opt/intel/compilers_and_libraries_2018.0.128/linux/compiler/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin;/opt/intel/compilers_and_libraries_2018.0.128/linux/tbb/lib/intel64/gcc4.7;/usr/lib/gcc/x86_64-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib;/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output
new file mode 100644
index 000000000..db0b29c90
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-PGI-18.10.1.output
@@ -0,0 +1,2 @@
+libs=atomic;pgatm;stdc++;pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
+dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output
new file mode 100644
index 000000000..4466415b3
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-12.1.0.output
@@ -0,0 +1,2 @@
+libs=xlopt;xl;ibmc++;xlopt;xl;stdc++;m;dl;gcc_s;gcc;m;c;gcc_s;gcc;dl;gcc_s;gcc;m;c;gcc_s;gcc
+dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output
new file mode 100644
index 000000000..8124911fa
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-CXX-XL-16.1.0.0.output
@@ -0,0 +1,2 @@
+libs=xlopt;xl;ibmc++;stdc++;m;dl;gcc_s;gcc;pthread;m;c;gcc_s;gcc
+dirs=/opt/ibm/xlsmp/5.1.0/lib;/opt/ibm/xlmass/9.1.0/lib;/opt/ibm/xlC/16.1.0/lib;/usr/lib/gcc/ppc64le-redhat-linux/4.8.5;/usr/lib64;/lib64;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output
new file mode 100644
index 000000000..f985a0330
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-GNU-7.3.0.output
@@ -0,0 +1,2 @@
+libs=gfortran;m;gcc_s;gcc;quadmath;m;gcc_s;gcc;c;gcc_s;gcc
+dirs=/usr/lib/gcc/x86_64-linux-gnu/7;/usr/lib/x86_64-linux-gnu;/usr/lib;/lib/x86_64-linux-gnu;/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output
new file mode 100644
index 000000000..d40f81eb9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-PGI-18.10.1.output
@@ -0,0 +1,2 @@
+libs=pgf90rtl;pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
+dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output
new file mode 100644
index 000000000..3c5d23bfc
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux-Fortran-XL-14.1.0.output
@@ -0,0 +1,2 @@
+libs=xlf90;xlopt;xlomp_ser;xl;xlfmath;gcc_s;dl;rt;pthread;gcc;m;c;gcc_s;gcc
+dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/xlf/bg/14.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output
new file mode 100644
index 000000000..7b2091502
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-PGI-18.10.1.output
@@ -0,0 +1,2 @@
+libs=pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
+dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output
new file mode 100644
index 000000000..de407f2f0
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-C-XL-12.1.0.output
@@ -0,0 +1,2 @@
+libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
+dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output
new file mode 100644
index 000000000..db0b29c90
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-PGI-18.10.1.output
@@ -0,0 +1,2 @@
+libs=atomic;pgatm;stdc++;pgmp;numa;pthread;pgmath;nspgc;pgc;m;gcc;c;gcc;gcc_s
+dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output
new file mode 100644
index 000000000..4466415b3
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-CXX-XL-12.1.0.output
@@ -0,0 +1,2 @@
+libs=xlopt;xl;ibmc++;xlopt;xl;stdc++;m;dl;gcc_s;gcc;m;c;gcc_s;gcc;dl;gcc_s;gcc;m;c;gcc_s;gcc
+dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output
new file mode 100644
index 000000000..d40f81eb9
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc-Fortran-PGI-18.10.1.output
@@ -0,0 +1,2 @@
+libs=pgf90rtl;pgf90;pgf90_rpm1;pgf902;pgf90rtl;pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
+dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output
new file mode 100644
index 000000000..de407f2f0
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_nostdinc_i-C-XL-12.1.0.output
@@ -0,0 +1,2 @@
+libs=xlopt;xl;dl;gcc_s;gcc;m;c;gcc_s;gcc
+dirs=/soft/compilers/ibmcmp-oct2017/xlsmp/bg/3.1/lib64;/soft/compilers/ibmcmp-oct2017/xlmass/bg/7.3/lib64;/soft/compilers/ibmcmp-oct2017/vac/bg/12.1/lib64;/soft/compilers/ibmcmp-oct2017/vacpp/bg/12.1/lib64;/usr/lib/gcc/ppc64-redhat-linux/4.4.7;/usr/lib64;/lib64;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output
new file mode 100644
index 000000000..7b523ea9d
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/linux_pgf77-Fortran-PGI-18.10.1.output
@@ -0,0 +1,2 @@
+libs=pgftnrtl;pgmp;numa;pthread;pgmath;nspgc;pgc;rt;pthread;m;gcc;c;gcc;gcc_s
+dirs=/mnt/pgi/linux86-64/18.10/lib;/usr/lib64;/usr/lib/gcc/x86_64-linux-gnu/7
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-C-GNU-4.9.3.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-C-GNU-4.9.3.output
new file mode 100644
index 000000000..8aee7cf44
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-C-GNU-4.9.3.output
@@ -0,0 +1,2 @@
+libs=mingw32;gcc;moldname;mingwex;advapi32;shell32;user32;kernel32;mingw32;gcc;moldname;mingwex
+dirs=C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3;C:/DoesNotExist/mingw/lib/gcc;C:/DoesNotExist/mingw/mingw32/lib;C:/DoesNotExist/mingw/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-CXX-GNU-4.9.3.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-CXX-GNU-4.9.3.output
new file mode 100644
index 000000000..5e79cc1ad
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/mingw.org-CXX-GNU-4.9.3.output
@@ -0,0 +1,2 @@
+libs=stdc++;mingw32;gcc_s;gcc;moldname;mingwex;advapi32;shell32;user32;kernel32;mingw32;gcc_s;gcc;moldname;mingwex
+dirs=C:/DoesNotExist/mingw/lib/gcc/mingw32/4.9.3;C:/DoesNotExist/mingw/lib/gcc;C:/DoesNotExist/mingw/mingw32/lib;C:/DoesNotExist/mingw/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-C-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-C-GNU-4.8.5.output
new file mode 100644
index 000000000..4a09c5b13
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-C-GNU-4.8.5.output
@@ -0,0 +1,2 @@
+libs=gcc;gcc_s;c;gcc;gcc_s
+dirs=
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-CXX-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-CXX-GNU-4.8.5.output
new file mode 100644
index 000000000..d747e5b87
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd-CXX-GNU-4.8.5.output
@@ -0,0 +1,2 @@
+libs=stdc++;m;gcc_s;gcc;c;gcc_s;gcc
+dirs=
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output
new file mode 100644
index 000000000..4a09c5b13
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-C-GNU-4.8.5.output
@@ -0,0 +1,2 @@
+libs=gcc;gcc_s;c;gcc;gcc_s
+dirs=
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output
new file mode 100644
index 000000000..d747e5b87
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/netbsd_nostdinc-CXX-GNU-4.8.5.output
@@ -0,0 +1,2 @@
+libs=stdc++;m;gcc_s;gcc;c;gcc_s;gcc
+dirs=
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-C-Clang-5.0.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-C-Clang-5.0.1.output
new file mode 100644
index 000000000..5bb5db4d7
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-C-Clang-5.0.1.output
@@ -0,0 +1,2 @@
+libs=compiler_rt;c;compiler_rt
+dirs=/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-CXX-Clang-5.0.1.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-CXX-Clang-5.0.1.output
new file mode 100644
index 000000000..4158973ca
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/openbsd-CXX-Clang-5.0.1.output
@@ -0,0 +1,2 @@
+libs=c++;c++abi;pthread;m;compiler_rt;c;compiler_rt
+dirs=/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-C-SunPro-5.13.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-C-SunPro-5.13.0.output
new file mode 100644
index 000000000..0d636e60e
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-C-SunPro-5.13.0.output
@@ -0,0 +1,2 @@
+libs=c
+dirs=/opt/solarisstudio12.4/lib/compilers/staticlib;/opt/solarisstudio12.4/lib/compilers/sparc;/opt/solarisstudio12.4/lib/compilers;/usr/ccs/lib;/lib;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-CXX-SunPro-5.13.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-CXX-SunPro-5.13.0.output
new file mode 100644
index 000000000..f7c821356
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-CXX-SunPro-5.13.0.output
@@ -0,0 +1,2 @@
+libs=Cstd;Crun;m;c
+dirs=/opt/solarisstudio12.4/lib/compilers/sparc;/opt/solarisstudio12.4/lib/compilers;/opt/solarisstudio12.4/lib/sparc;/opt/solarisstudio12.4/lib;/usr/ccs/lib;/lib;/usr/lib
diff --git a/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-Fortran-SunPro-8.8.0.output b/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-Fortran-SunPro-8.8.0.output
new file mode 100644
index 000000000..b49557a91
--- /dev/null
+++ b/Tests/RunCMake/ParseImplicitLinkInfo/results/sunos-Fortran-SunPro-8.8.0.output
@@ -0,0 +1,2 @@
+libs=fsu;sunmath;mtsk;m;c
+dirs=/opt/developerstudio12.6/lib/compilers/sparcvis2;/opt/developerstudio12.6/lib/compilers;/opt/developerstudio12.6/lib;/usr/ccs/lib;/lib;/usr/lib
diff --git a/Tests/RunCMake/PrecompileHeaders/CMakeLists.txt b/Tests/RunCMake/PrecompileHeaders/CMakeLists.txt
new file mode 100644
index 000000000..7dbf32e86
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.15.0)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/PrecompileHeaders/DisabledPch-check.cmake b/Tests/RunCMake/PrecompileHeaders/DisabledPch-check.cmake
new file mode 100644
index 000000000..494bcf726
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/DisabledPch-check.cmake
@@ -0,0 +1,12 @@
+set(foo_pch_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/foo.dir/cmake_pch.h")
+set(foobar_pch_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/foobar.dir/cmake_pch.h")
+
+if (NOT EXISTS ${foo_pch_header})
+ set(RunCMake_TEST_FAILED "Generated foo pch header ${foo_pch_header} does not exist")
+ return()
+endif()
+
+if (EXISTS ${foobar_pch_header})
+ set(RunCMake_TEST_FAILED "Generated foobar pch header ${foobar_pch_header} should not exist")
+ return()
+endif()
diff --git a/Tests/RunCMake/PrecompileHeaders/DisabledPch.cmake b/Tests/RunCMake/PrecompileHeaders/DisabledPch.cmake
new file mode 100644
index 000000000..59ee14b9f
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/DisabledPch.cmake
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 3.15)
+project(DisabledPch C)
+
+add_library(foo foo.c)
+target_include_directories(foo PUBLIC include)
+target_precompile_headers(foo PUBLIC
+ include/foo.h
+ <stdio.h>
+ \"string.h\"
+)
+
+add_executable(foobar foobar.c)
+target_link_libraries(foobar foo)
+set_target_properties(foobar PROPERTIES DISABLE_PRECOMPILE_HEADERS ON)
diff --git a/Tests/RunCMake/PrecompileHeaders/PchInterface-check.cmake b/Tests/RunCMake/PrecompileHeaders/PchInterface-check.cmake
new file mode 100644
index 000000000..4e62b81c0
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchInterface-check.cmake
@@ -0,0 +1,26 @@
+set(foo_pch_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/foo.dir/cmake_pch.h")
+set(foobar_pch_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/foobar.dir/cmake_pch.h")
+
+if (NOT EXISTS ${foo_pch_header})
+ set(RunCMake_TEST_FAILED "Generated foo pch header ${foo_pch_header} does not exist")
+ return()
+endif()
+
+if (NOT EXISTS ${foobar_pch_header})
+ set(RunCMake_TEST_FAILED "Generated foobar pch header ${foobar_pch_header} does not exist")
+ return()
+endif()
+
+file(STRINGS ${foo_pch_header} foo_pch_header_strings)
+
+if (NOT foo_pch_header_strings MATCHES ";#include \"[^\"]*PrecompileHeaders/include/foo.h\";#include \"foo2.h\";#include <stdio.h>;#include \"string.h\"(;|$)")
+ set(RunCMake_TEST_FAILED "Generated foo pch header\n ${foo_pch_header}\nhas bad content:\n ${foo_pch_header_strings}")
+ return()
+endif()
+
+file(STRINGS ${foobar_pch_header} foobar_pch_header_strings)
+
+if (NOT foobar_pch_header_strings MATCHES ";#include \"[^\"]*PrecompileHeaders/include/foo.h\";#include \"foo2.h\";#include <stdio.h>;#include \"string.h\";#include \"[^\"]*PrecompileHeaders/include/bar.h\"(;|$)")
+ set(RunCMake_TEST_FAILED "Generated foobar pch header\n ${foobar_pch_header}\nhas bad content:\n ${foobar_pch_header_strings}")
+ return()
+endif()
diff --git a/Tests/RunCMake/PrecompileHeaders/PchInterface.cmake b/Tests/RunCMake/PrecompileHeaders/PchInterface.cmake
new file mode 100644
index 000000000..a1e079273
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchInterface.cmake
@@ -0,0 +1,21 @@
+cmake_minimum_required(VERSION 3.15)
+project(PchInterface C)
+
+add_library(foo foo.c)
+target_include_directories(foo PUBLIC include)
+target_precompile_headers(foo PUBLIC
+ include/foo.h
+ \"foo2.h\"
+ <stdio.h>
+ \"string.h\"
+)
+
+add_library(bar INTERFACE)
+target_include_directories(bar INTERFACE include)
+target_precompile_headers(bar INTERFACE include/bar.h)
+
+add_executable(foobar foobar.c)
+target_link_libraries(foobar foo bar)
+
+enable_testing()
+add_test(NAME foobar COMMAND foobar)
diff --git a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake
new file mode 100644
index 000000000..cc01ecb0d
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage-check.cmake
@@ -0,0 +1,26 @@
+set(foobar_pch_h_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/foobar.dir/cmake_pch.h")
+set(foobar_pch_hxx_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/foobar.dir/cmake_pch.hxx")
+
+if (NOT EXISTS ${foobar_pch_h_header})
+ set(RunCMake_TEST_FAILED "Generated foobar C pch header ${foobar_pch_h_header} does not exist")
+ return()
+endif()
+
+if (NOT EXISTS ${foobar_pch_hxx_header})
+ set(RunCMake_TEST_FAILED "Generated foobar C++ pch header ${foobar_pch_hxx_header} does not exist")
+ return()
+endif()
+
+file(STRINGS ${foobar_pch_h_header} foobar_pch_h_header_strings)
+
+if (NOT foobar_pch_h_header_strings MATCHES ";#include <stddef.h>(;|$)")
+ set(RunCMake_TEST_FAILED "Generated foo pch header\n ${foobar_pch_h_header}\nhas bad content:\n ${foobar_pch_h_header_strings}")
+ return()
+endif()
+
+file(STRINGS ${foobar_pch_hxx_header} foobar_pch_hxx_header_strings)
+
+if (NOT foobar_pch_hxx_header_strings MATCHES ";#include <cstddef>(;|$)")
+ set(RunCMake_TEST_FAILED "Generated foo pch header\n ${foobar_pch_hxx_header}\nhas bad content:\n ${foobar_pch_hxx_header_strings}")
+ return()
+endif()
diff --git a/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake
new file mode 100644
index 000000000..cdc42b2a2
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchMultilanguage.cmake
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.15)
+project(PchMultilanguage C CXX)
+
+add_executable(foobar
+ foo.c
+ main.cpp
+)
+target_include_directories(foobar PUBLIC include)
+target_precompile_headers(foobar PRIVATE
+ "$<$<COMPILE_LANGUAGE:C>:<stddef.h$<ANGLE-R>>"
+ "$<$<COMPILE_LANGUAGE:CXX>:<cstddef$<ANGLE-R>>"
+ )
diff --git a/Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue-check.cmake b/Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue-check.cmake
new file mode 100644
index 000000000..9018664b2
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue-check.cmake
@@ -0,0 +1,8 @@
+set(main_pch_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/main.dir/cmake_pch.hxx")
+
+file(STRINGS ${main_pch_header} main_pch_header_strings)
+string(REGEX MATCH "#pragma warning\\(push, 0\\).*#include.*pch.h.*#pragma warning\\(pop\\)" matched_code ${main_pch_header_strings})
+if(NOT matched_code)
+ set(RunCMake_TEST_FAILED "Generated pch file doesn't include expected prologue and epilogue code")
+ return()
+endif()
diff --git a/Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue.cmake b/Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue.cmake
new file mode 100644
index 000000000..3e27620f9
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchPrologueEpilogue.cmake
@@ -0,0 +1,11 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(PchPrologueEpilogue)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+set(CMAKE_PCH_PROLOGUE "#pragma warning(push, 0)")
+set(CMAKE_PCH_EPILOGUE "#pragma warning(pop)")
+
+add_executable(main main.cpp)
+target_precompile_headers(main PRIVATE pch.h)
diff --git a/Tests/RunCMake/PrecompileHeaders/PchReuseFrom.cmake b/Tests/RunCMake/PrecompileHeaders/PchReuseFrom.cmake
new file mode 100644
index 000000000..03a97eda4
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchReuseFrom.cmake
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 3.15)
+project(PchReuseFrom C)
+
+if(CMAKE_C_COMPILE_OPTIONS_USE_PCH)
+ add_definitions(-DHAVE_PCH_SUPPORT)
+endif()
+
+add_library(empty empty.c)
+target_precompile_headers(empty PRIVATE
+ <stdio.h>
+ <string.h>
+)
+target_include_directories(empty PUBLIC include)
+
+add_library(foo foo.c)
+target_include_directories(foo PUBLIC include)
+target_precompile_headers(foo REUSE_FROM empty)
+
+# should not cause problems if configured multiple times
+target_precompile_headers(foo REUSE_FROM empty)
+
+add_executable(foobar foobar.c)
+target_link_libraries(foobar foo )
+set_target_properties(foobar PROPERTIES PRECOMPILE_HEADERS_REUSE_FROM foo)
+
+enable_testing()
+add_test(NAME foobar COMMAND foobar)
diff --git a/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir-build-stderr.txt b/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir-build-stderr.txt
new file mode 100644
index 000000000..8cdcfd941
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir-build-stderr.txt
@@ -0,0 +1,2 @@
+^(|Warning #670: precompiled header file [^
+]* was not generated in this directory)$
diff --git a/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake b/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake
new file mode 100644
index 000000000..fff74dcd6
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/PchReuseFromSubdir.cmake
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.15)
+project(PchReuseFromSubdir C)
+
+add_library(empty empty.c)
+target_precompile_headers(empty PUBLIC
+ <stdio.h>
+ <string.h>
+)
+target_include_directories(empty PUBLIC include)
+
+add_library(foo foo.c)
+target_include_directories(foo PUBLIC include)
+target_precompile_headers(foo REUSE_FROM empty)
+
+subdirs(subdir)
+
+enable_testing()
+add_test(NAME foobar COMMAND foobar)
diff --git a/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
new file mode 100644
index 000000000..ec13663d5
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/RunCMakeTest.cmake
@@ -0,0 +1,21 @@
+cmake_policy(SET CMP0057 NEW)
+include(RunCMake)
+
+function(run_test name)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
+ run_cmake(${name})
+ # Precompiled headers are not supported with multiple architectures.
+ if(NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]")
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(${name}-test ${CMAKE_CTEST_COMMAND} -C Debug)
+ endif()
+endfunction()
+
+run_cmake(DisabledPch)
+run_test(PchInterface)
+run_cmake(PchPrologueEpilogue)
+run_test(SkipPrecompileHeaders)
+run_test(PchReuseFrom)
+run_test(PchReuseFromSubdir)
+run_cmake(PchMultilanguage)
diff --git a/Tests/RunCMake/PrecompileHeaders/SkipPrecompileHeaders.cmake b/Tests/RunCMake/PrecompileHeaders/SkipPrecompileHeaders.cmake
new file mode 100644
index 000000000..49efbfbab
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/SkipPrecompileHeaders.cmake
@@ -0,0 +1,13 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(SkipPrecompileHeaders)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+add_executable(pch-test main.cpp non-pch.cpp)
+target_precompile_headers(pch-test PRIVATE pch.h)
+
+set_source_files_properties(non-pch.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
+
+enable_testing()
+add_test(NAME pch-test COMMAND pch-test)
diff --git a/Tests/RunCMake/PrecompileHeaders/empty.c b/Tests/RunCMake/PrecompileHeaders/empty.c
new file mode 100644
index 000000000..30ae1c4ef
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/empty.c
@@ -0,0 +1,3 @@
+void nothing()
+{
+}
diff --git a/Tests/RunCMake/PrecompileHeaders/foo.c b/Tests/RunCMake/PrecompileHeaders/foo.c
new file mode 100644
index 000000000..eb88726f0
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/foo.c
@@ -0,0 +1,13 @@
+#include "foo.h"
+
+#include "foo2.h"
+
+int foo()
+{
+ return 0;
+}
+
+int foo2()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/PrecompileHeaders/foobar.c b/Tests/RunCMake/PrecompileHeaders/foobar.c
new file mode 100644
index 000000000..97d465c01
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/foobar.c
@@ -0,0 +1,14 @@
+#include "bar.h"
+#include "foo.h"
+#include "foo2.h"
+
+int main()
+{
+ int zeroSize = 0;
+
+#ifdef HAVE_PCH_SUPPORT
+ zeroSize = (int)strlen("");
+#endif
+
+ return foo() + foo2() + bar() + zeroSize;
+}
diff --git a/Tests/RunCMake/PrecompileHeaders/include/bar.h b/Tests/RunCMake/PrecompileHeaders/include/bar.h
new file mode 100644
index 000000000..5feb98361
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/include/bar.h
@@ -0,0 +1,9 @@
+#ifndef bar_h
+#define bar_h
+
+static int bar()
+{
+ return 0;
+}
+
+#endif
diff --git a/Tests/RunCMake/PrecompileHeaders/include/foo.h b/Tests/RunCMake/PrecompileHeaders/include/foo.h
new file mode 100644
index 000000000..fc0ae143a
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/include/foo.h
@@ -0,0 +1,6 @@
+#ifndef foo_h
+#define foo_h
+
+int foo(void);
+
+#endif
diff --git a/Tests/RunCMake/PrecompileHeaders/include/foo2.h b/Tests/RunCMake/PrecompileHeaders/include/foo2.h
new file mode 100644
index 000000000..4bf9c8167
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/include/foo2.h
@@ -0,0 +1,6 @@
+#ifndef foo2_h
+#define foo2_h
+
+int foo2(void);
+
+#endif
diff --git a/Tests/RunCMake/PrecompileHeaders/main.cpp b/Tests/RunCMake/PrecompileHeaders/main.cpp
new file mode 100644
index 000000000..f8b643afb
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/main.cpp
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/PrecompileHeaders/non-pch.cpp b/Tests/RunCMake/PrecompileHeaders/non-pch.cpp
new file mode 100644
index 000000000..df5a79f12
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/non-pch.cpp
@@ -0,0 +1,3 @@
+#ifdef PCH_INCLUDED
+# error "PCH must not be included into this file!"
+#endif
diff --git a/Tests/RunCMake/PrecompileHeaders/pch.h b/Tests/RunCMake/PrecompileHeaders/pch.h
new file mode 100644
index 000000000..81b6d9eed
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/pch.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#define PCH_INCLUDED 1
diff --git a/Tests/RunCMake/PrecompileHeaders/subdir/CMakeLists.txt b/Tests/RunCMake/PrecompileHeaders/subdir/CMakeLists.txt
new file mode 100644
index 000000000..fa926c4e4
--- /dev/null
+++ b/Tests/RunCMake/PrecompileHeaders/subdir/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_executable(foobar ../foobar.c)
+target_link_libraries(foobar foo )
+set_target_properties(foobar PROPERTIES PRECOMPILE_HEADERS_REUSE_FROM foo)
diff --git a/Tests/RunCMake/README.rst b/Tests/RunCMake/README.rst
index d8b43feef..ebe40cf48 100644
--- a/Tests/RunCMake/README.rst
+++ b/Tests/RunCMake/README.rst
@@ -55,6 +55,12 @@ but do not actually build anything. To add a test:
``<SubTest>-check.cmake``
Custom result check.
+ Note that when a specific platform expects differing stdout or stderr that
+ can be done by adding a platform specific output file. These follow the
+ naming convention of:
+ ``<SubTest>-stdout-<platform_lower_case>.txt``
+ ``<SubTest>-stderr-<platform_lower_case>.txt``
+
Note that trailing newlines will be stripped from actual and expected
test output before matching against the stdout and stderr expressions.
The code in ``<SubTest>-check.cmake`` may use variables
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index c743a02a3..da4d1e532 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -21,10 +21,20 @@ function(run_cmake test)
else()
set(expect_result 0)
endif()
+
+ string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} platform_name)
+ if(platform_name MATCHES cygwin)
+ #remove all additional bits from cygwin name
+ set(platform_name cygwin)
+ endif()
+
foreach(o out err)
if(RunCMake-std${o}-file AND EXISTS ${top_src}/${RunCMake-std${o}-file})
file(READ ${top_src}/${RunCMake-std${o}-file} expect_std${o})
string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
+ elseif(EXISTS ${top_src}/${test}-std${o}-${platform_name}.txt)
+ file(READ ${top_src}/${test}-std${o}-${platform_name}.txt expect_std${o})
+ string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
elseif(EXISTS ${top_src}/${test}-std${o}.txt)
file(READ ${top_src}/${test}-std${o}.txt expect_std${o})
string(REGEX REPLACE "\n+$" "" expect_std${o} "${expect_std${o}}")
@@ -137,8 +147,6 @@ function(run_cmake test)
"|Error kstat returned"
"|Hit xcodebuild bug"
"|[^\n]*xcodebuild[^\n]*warning: file type[^\n]*is based on missing file type"
- "|ld: 0711-224 WARNING: Duplicate symbol: .__init_aix_libgcc_cxa_atexit"
- "|ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information"
"|[^\n]*is a member of multiple groups"
"|[^\n]*from Time Machine by path"
"|[^\n]*Bullseye Testing Technology"
diff --git a/Tests/RunCMake/RuntimePath/Genex.cmake b/Tests/RunCMake/RuntimePath/Genex.cmake
new file mode 100644
index 000000000..152238a30
--- /dev/null
+++ b/Tests/RunCMake/RuntimePath/Genex.cmake
@@ -0,0 +1,29 @@
+enable_language(C)
+
+add_library(A STATIC A.c)
+
+add_executable(buildge main.c)
+target_link_libraries(buildge A)
+set_target_properties(buildge PROPERTIES
+ BUILD_RPATH $<1:/opt/foo/lib>
+ )
+
+add_executable(buildnoge main.c)
+target_link_libraries(buildnoge A)
+set_target_properties(buildnoge PROPERTIES
+ BUILD_RPATH /opt/foo/lib
+ )
+
+add_executable(installge main.c)
+target_link_libraries(installge A)
+set_target_properties(installge PROPERTIES
+ INSTALL_RPATH $<1:/opt/foo/lib>
+ BUILD_WITH_INSTALL_RPATH 1
+ )
+
+add_executable(installnoge main.c)
+target_link_libraries(installnoge A)
+set_target_properties(installnoge PROPERTIES
+ INSTALL_RPATH /opt/foo/lib
+ BUILD_WITH_INSTALL_RPATH 1
+ )
diff --git a/Tests/RunCMake/RuntimePath/GenexCheck.cmake b/Tests/RunCMake/RuntimePath/GenexCheck.cmake
new file mode 100644
index 000000000..07dc4967d
--- /dev/null
+++ b/Tests/RunCMake/RuntimePath/GenexCheck.cmake
@@ -0,0 +1,7 @@
+file(GLOB_RECURSE files "${dir}/*")
+
+foreach(file IN LISTS files)
+ if(file MATCHES "/(build|install)(no)?ge$")
+ file(RPATH_CHANGE FILE "${file}" OLD_RPATH "/opt/foo/lib" NEW_RPATH "/opt/bar/lib")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake b/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
index 6f1baa1d9..4c9ddcdb9 100644
--- a/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
+++ b/Tests/RunCMake/RuntimePath/RunCMakeTest.cmake
@@ -1,32 +1,26 @@
include(RunCMake)
-function(run_SymlinkImplicit)
+function(run_RuntimePath name)
# Use a single build tree for a few tests without cleaning.
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/SymlinkImplicit-build)
+ 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)
endif()
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
- run_cmake(SymlinkImplicit)
- run_cmake_command(SymlinkImplicit-build ${CMAKE_COMMAND} --build . --config Debug)
- run_cmake_command(SymlinkImplicitCheck
- ${CMAKE_COMMAND} -Ddir=${RunCMake_TEST_BINARY_DIR} -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake)
+ run_cmake(${name})
+ run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug)
endfunction()
-run_SymlinkImplicit()
-function(run_Relative)
- # Use a single build tree for a few tests without cleaning.
- set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Relative-build)
- set(RunCMake_TEST_NO_CLEAN 1)
- if(NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
- set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
- endif()
- file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
- file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
- run_cmake(Relative)
- run_cmake_command(Relative-build ${CMAKE_COMMAND} --build . --config Debug)
-endfunction()
-run_Relative()
+run_RuntimePath(SymlinkImplicit)
+run_cmake_command(SymlinkImplicitCheck
+ ${CMAKE_COMMAND} -Ddir=${RunCMake_BINARY_DIR}/SymlinkImplicit-build -P ${RunCMake_SOURCE_DIR}/SymlinkImplicitCheck.cmake)
+
+run_RuntimePath(Relative)
+# FIXME: Run RelativeCheck (appears to be broken currently)
+
+run_RuntimePath(Genex)
+run_cmake_command(GenexCheck
+ ${CMAKE_COMMAND} -Ddir=${RunCMake_BINARY_DIR}/Genex-build -P ${RunCMake_SOURCE_DIR}/GenexCheck.cmake)
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 0bcf88678..6d72fac8b 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -27,6 +27,7 @@
\* CMP0076
\* CMP0081
\* CMP0083
+ \* CMP0095
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/UnityBuild/CMakeLists.txt b/Tests/RunCMake/UnityBuild/CMakeLists.txt
new file mode 100644
index 000000000..77030d63b
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.15)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
new file mode 100644
index 000000000..8e484d0be
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
@@ -0,0 +1,23 @@
+include(RunCMake)
+
+run_cmake(unitybuild_c)
+run_cmake(unitybuild_cxx)
+run_cmake(unitybuild_c_and_cxx)
+run_cmake(unitybuild_batchsize)
+run_cmake(unitybuild_default_batchsize)
+run_cmake(unitybuild_skip)
+run_cmake(unitybuild_code_before_and_after_include)
+run_cmake(unitybuild_c_no_unity_build)
+run_cmake(unitybuild_order)
+
+function(run_test name)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${name}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ run_cmake(${name})
+ run_cmake_command(${name}-build ${CMAKE_COMMAND} --build . --config Debug)
+ run_cmake_command(${name}-test ${CMAKE_CTEST_COMMAND} -C Debug)
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endfunction()
+
+run_test(unitybuild_runtest)
diff --git a/Tests/RunCMake/UnityBuild/func.c b/Tests/RunCMake/UnityBuild/func.c
new file mode 100644
index 000000000..b14c90708
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/func.c
@@ -0,0 +1,6 @@
+#include "func.h"
+
+int func(void)
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/UnityBuild/func.h b/Tests/RunCMake/UnityBuild/func.h
new file mode 100644
index 000000000..563a98012
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/func.h
@@ -0,0 +1,6 @@
+#ifndef func_h
+#define func_h
+
+extern int func(void);
+
+#endif
diff --git a/Tests/RunCMake/UnityBuild/main.c b/Tests/RunCMake/UnityBuild/main.c
new file mode 100644
index 000000000..19c18d407
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/main.c
@@ -0,0 +1,6 @@
+#include "func.h"
+
+int main(void)
+{
+ return func();
+}
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake
new file mode 100644
index 000000000..32bb8e7eb
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_batchsize-check.cmake
@@ -0,0 +1,11 @@
+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")
+if(NOT EXISTS "${unitybuild_c0}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
+ return()
+endif()
+
+if(NOT EXISTS "${unitybuild_c1}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c1} does not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_batchsize.cmake b/Tests/RunCMake/UnityBuild/unitybuild_batchsize.cmake
new file mode 100644
index 000000000..7caf25168
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_batchsize.cmake
@@ -0,0 +1,16 @@
+project(unitybuild_batchsize C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt
+ PROPERTIES
+ UNITY_BUILD ON
+ UNITY_BUILD_BATCH_SIZE 4
+)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake
new file mode 100644
index 000000000..c980df0aa
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c-check.cmake
@@ -0,0 +1,5 @@
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+if(NOT EXISTS "${unitybuild_c}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} does not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c.cmake
new file mode 100644
index 000000000..77a09cb00
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c.cmake
@@ -0,0 +1,12 @@
+project(unitybuild_c C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake
new file mode 100644
index 000000000..32c2992a6
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx-check.cmake
@@ -0,0 +1,11 @@
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.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")
+if(NOT EXISTS "${unitybuild_cxx}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_cxx} does not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx.cmake
new file mode 100644
index 000000000..073aff29a
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_and_cxx.cmake
@@ -0,0 +1,17 @@
+project(unitybuild_c_and_cxx C CXX)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src_c "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src_c}" "int s${s}(void) { return 0; }\n")
+
+ set(src_cxx "${CMAKE_CURRENT_BINARY_DIR}/s${s}.cxx")
+ file(WRITE "${src_cxx}" "int s${s}(void) { return 0; }\n")
+
+ list(APPEND srcs "${src_c}")
+ list(APPEND srcs "${src_cxx}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake
new file mode 100644
index 000000000..cb71ea312
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build-check.cmake
@@ -0,0 +1,5 @@
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+if(EXISTS "${unitybuild_c}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c} should not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build.cmake b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build.cmake
new file mode 100644
index 000000000..1185e9fcd
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_c_no_unity_build.cmake
@@ -0,0 +1,10 @@
+project(unitybuild_c_no_unity_build C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
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
new file mode 100644
index 000000000..8fcb18f37
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include-check.cmake
@@ -0,0 +1,7 @@
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.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)
+ set(RunCMake_TEST_FAILED "Generated unity file doesn't include expected code before and after include")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include.cmake b/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include.cmake
new file mode 100644
index 000000000..cc9cc2843
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_code_before_and_after_include.cmake
@@ -0,0 +1,13 @@
+project(unitybuild_code_before_and_after_include C)
+
+set(src "${CMAKE_CURRENT_BINARY_DIR}/s1.c")
+file(WRITE "${src}" "int s1(void) { return 0; }\n")
+
+add_library(tgt SHARED ${src})
+
+set_target_properties(tgt
+ PROPERTIES
+ UNITY_BUILD ON
+ UNITY_BUILD_CODE_BEFORE_INCLUDE "#define NOMINMAX"
+ UNITY_BUILD_CODE_AFTER_INCLUDE "#undef NOMINMAX"
+)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake
new file mode 100644
index 000000000..89a037a28
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_cxx-check.cmake
@@ -0,0 +1,5 @@
+set(unitybuild_cxx "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.cxx")
+if(NOT EXISTS "${unitybuild_cxx}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_cxx} does not exist.")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_cxx.cmake b/Tests/RunCMake/UnityBuild/unitybuild_cxx.cmake
new file mode 100644
index 000000000..be800d7b1
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_cxx.cmake
@@ -0,0 +1,12 @@
+project(unitybuild_cxx CXX)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.cxx")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake
new file mode 100644
index 000000000..7dfc007fa
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize-check.cmake
@@ -0,0 +1,7 @@
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.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)
+ set(RunCMake_TEST_FAILED "Generated unity doesn't include the expect number of files")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize.cmake b/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize.cmake
new file mode 100644
index 000000000..60b98750d
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_default_batchsize.cmake
@@ -0,0 +1,15 @@
+project(unitybuild_default_batchsize C)
+
+set(srcs "")
+foreach(s RANGE 1 10)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt
+ PROPERTIES
+ UNITY_BUILD ON
+)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
new file mode 100644
index 000000000..533a89c61
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_order-check.cmake
@@ -0,0 +1,7 @@
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.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)
+ set(RunCMake_TEST_FAILED "Generated unity file doesn't include expected oder of source files")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_order.cmake b/Tests/RunCMake/UnityBuild/unitybuild_order.cmake
new file mode 100644
index 000000000..819603dd3
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_order.cmake
@@ -0,0 +1,12 @@
+project(unitybuild_order C)
+
+set(srcs "")
+foreach(s 3 1 2)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake b/Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake
new file mode 100644
index 000000000..3589cc868
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_runtest.cmake
@@ -0,0 +1,9 @@
+project(unitybuild_runtest C)
+
+set(CMAKE_UNITY_BUILD ON) # This tests that the variable works in addition to the property
+
+add_library(lib main.c func.c)
+add_executable(main main.c func.c)
+
+enable_testing()
+add_test(NAME main COMMAND main)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
new file mode 100644
index 000000000..fdd45bc83
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_skip-check.cmake
@@ -0,0 +1,14 @@
+set(unitybuild_c "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+file(STRINGS ${unitybuild_c} unitybuild_c_strings)
+
+string(REGEX MATCH "\\/s[1-6].c" matched_files_1_6 ${unitybuild_c_strings})
+if(matched_files_1_6)
+ set(RunCMake_TEST_FAILED "Generated unity contains s1.c -> s6.c which should have been skipped")
+ return()
+endif()
+
+string(REGEX MATCH "\\/s[7-8].c" matched_files_7_8 ${unitybuild_c_strings})
+if(NOT matched_files_7_8)
+ set(RunCMake_TEST_FAILED "Generated unity should have contained s7.c, s8.c!")
+ return()
+endif()
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake b/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake
new file mode 100644
index 000000000..94e5aa327
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_skip.cmake
@@ -0,0 +1,30 @@
+project(unitybuild_skip C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
+
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s1.c
+ PROPERTIES HEADER_FILE_ONLY ON)
+
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s2.c
+ PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
+
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s3.c
+ PROPERTIES COMPILE_OPTIONS "val")
+
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s4.c
+ PROPERTIES COMPILE_DEFINITIONS "val")
+
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s5.c
+ PROPERTIES COMPILE_FLAGS "val")
+
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/s6.c
+ PROPERTIES INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}")
diff --git a/Tests/RunCMake/VS10Project/Dir/DirNested/foo_nested.cpp b/Tests/RunCMake/VS10Project/Dir/DirNested/foo_nested.cpp
new file mode 100644
index 000000000..3695dc91e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/Dir/DirNested/foo_nested.cpp
@@ -0,0 +1,3 @@
+void foo()
+{
+}
diff --git a/Tests/RunCMake/VS10Project/Dir/foo.cpp b/Tests/RunCMake/VS10Project/Dir/foo.cpp
new file mode 100644
index 000000000..3695dc91e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/Dir/foo.cpp
@@ -0,0 +1,3 @@
+void foo()
+{
+}
diff --git a/Tests/RunCMake/VS10Project/Prefixed/PrefixedNested/bar_nested.cpp b/Tests/RunCMake/VS10Project/Prefixed/PrefixedNested/bar_nested.cpp
new file mode 100644
index 000000000..3695dc91e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/Prefixed/PrefixedNested/bar_nested.cpp
@@ -0,0 +1,3 @@
+void foo()
+{
+}
diff --git a/Tests/RunCMake/VS10Project/Prefixed/bar.cpp b/Tests/RunCMake/VS10Project/Prefixed/bar.cpp
new file mode 100644
index 000000000..b72a1a516
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/Prefixed/bar.cpp
@@ -0,0 +1,3 @@
+void bar()
+{
+}
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 27b81b7cd..44ccd6b58 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -5,6 +5,7 @@ run_cmake(VsCSharpCompilerOpts)
run_cmake(ExplicitCMakeLists)
run_cmake(RuntimeLibrary)
run_cmake(SourceGroupCMakeLists)
+run_cmake(SourceGroupTreeCMakeLists)
run_cmake(VsConfigurationType)
run_cmake(VsTargetsFileReferences)
@@ -22,6 +23,10 @@ run_cmake(VsSdkDirectories)
run_cmake(VsGlobals)
run_cmake(VsProjectImport)
run_cmake(VsPackageReferences)
+run_cmake(VsDpiAware)
+run_cmake(VsDpiAwareBadParam)
+run_cmake(VsPrecompileHeaders)
+run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
run_cmake(VsJustMyCode)
@@ -30,3 +35,12 @@ endif()
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.20)
run_cmake(VsSpectreMitigation)
endif()
+
+# Visual Studio 2017 has toolset version 141
+string(REPLACE "v" "" generator_toolset "${RunCMake_GENERATOR_TOOLSET}")
+if (RunCMake_GENERATOR MATCHES "Visual Studio 1[0-4] 201[0-5]" OR
+ (RunCMake_GENERATOR_TOOLSET AND generator_toolset VERSION_LESS "141"))
+ run_cmake(UnityBuildPre2017)
+else()
+ run_cmake(UnityBuildNative)
+endif()
diff --git a/Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake
index c2a94bbbe..616f38b07 100644
--- a/Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake
+++ b/Tests/RunCMake/VS10Project/SourceGroupCMakeLists-check.cmake
@@ -4,30 +4,8 @@ if(NOT EXISTS "${vcFiltersFile}")
return()
endif()
-set(foundFileFilter 0)
-set(foundFilter 0)
file(STRINGS "${vcFiltersFile}" lines)
-foreach(line IN LISTS lines)
- if(line MATCHES "<Filter>CMakeListsSourceGroup</Filter>")
- set(rule "${CMAKE_MATCH_1}")
- if(foundFileFilter)
- set(RunCMake_TEST_FAILED "Multiple files listed with filter for CMakeListsSourceGroup.")
- return()
- endif()
- set(foundFileFilter 1)
- endif()
- if(line MATCHES "<Filter.*Include=\"CMakeListsSourceGroup\"")
- set(rule "${CMAKE_MATCH_1}")
- if(foundFilter)
- set(RunCMake_TEST_FAILED "Multiple copies of CMakeListsSourceGroup filter listed.")
- return()
- endif()
- set(foundFilter 1)
- endif()
-endforeach()
-if(NOT foundFileFilter)
- set(RunCMake_TEST_FAILED "File filter for CMakeListsSourceGroup not found.")
-endif()
-if(NOT foundFilter)
- set(RunCMake_TEST_FAILED "Filter CMakeListsSourceGroup not found.")
-endif()
+
+include(${RunCMake_TEST_SOURCE_DIR}/SourceGroupHelpers.cmake)
+
+find_source_group("${lines}" CMakeListsSourceGroup)
diff --git a/Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake b/Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake
new file mode 100644
index 000000000..c82a66e8c
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/SourceGroupHelpers.cmake
@@ -0,0 +1,35 @@
+function(find_source_group LINES NAME)
+ set(foundFileFilter 0)
+ set(foundFilter 0)
+ foreach(line IN LISTS LINES)
+ if(line MATCHES "<Filter>${NAME}</Filter>")
+ if(foundFileFilter)
+ set(RunCMake_TEST_FAILED "Multiple files listed with filter for ${NAME}." PARENT_SCOPE)
+ set(FILTER_FOUND 0 PARENT_SCOPE)
+ return()
+ endif()
+ set(foundFileFilter 1)
+ endif()
+ if(line MATCHES "<Filter.*Include=\"${NAME}\"")
+ if(foundFilter)
+ set(RunCMake_TEST_FAILED "Multiple copies of ${NAME} filter listed." PARENT_SCOPE)
+ set(FILTER_FOUND 0 PARENT_SCOPE)
+ return()
+ endif()
+ set(foundFilter 1)
+ endif()
+ endforeach()
+
+ if(NOT foundFileFilter)
+ set(RunCMake_TEST_FAILED "File filter for ${NAME} not found." PARENT_SCOPE)
+ set(FILTER_FOUND 0 PARENT_SCOPE)
+ return()
+ endif()
+ if(NOT foundFilter)
+ set(RunCMake_TEST_FAILED "Filter ${NAME} not found." PARENT_SCOPE)
+ set(FILTER_FOUND 0 PARENT_SCOPE)
+ return()
+ endif()
+
+ set(FILTER_FOUND 1 PARENT_SCOPE)
+endfunction()
diff --git a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
new file mode 100644
index 000000000..ee0c4120c
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists-check.cmake
@@ -0,0 +1,26 @@
+cmake_policy(SET CMP0011 NEW)
+
+set(vcFiltersFile "${RunCMake_TEST_BINARY_DIR}/SourceGroupTree.vcxproj.filters")
+if(NOT EXISTS "${vcFiltersFile}")
+ set(RunCMake_TEST_FAILED "Filters file ${vcFiltersFile} does not exist.")
+ return()
+endif()
+
+file(STRINGS "${vcFiltersFile}" lines)
+
+include(${RunCMake_TEST_SOURCE_DIR}/SourceGroupHelpers.cmake)
+
+set(SOURCE_GROUPS_TO_FIND
+ "Dir"
+ "Dir\\DirNested"
+ "Generated"
+ "SourcesPrefix"
+ "SourcesPrefix\\PrefixedNested"
+)
+
+foreach(GROUP_NAME IN LISTS ${SOURCE_GROUPS_TO_FIND})
+ find_source_group("${lines}" ${GROUP_NAME})
+ if(NOT ${FILTER_FOUND})
+ return()
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake
new file mode 100644
index 000000000..7655e6094
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/SourceGroupTreeCMakeLists.cmake
@@ -0,0 +1,45 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+
+# Test regular tree grouping.
+set(SRC_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/Dir/foo.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Dir/DirNested/foo_nested.cpp
+)
+
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${SRC_FILES})
+
+
+# Test files that are not present at configuration time.
+set(GENERATED_SRC_FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/Generated/generated.cpp
+)
+
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Generated)
+
+if(WIN32)
+ add_custom_command(OUTPUT ${GENERATED_SRC_FILES}
+ COMMAND echo. 2>${CMAKE_CURRENT_BINARY_DIR}\\Generated\\generated.cpp
+ )
+else()
+ add_custom_command(OUTPUT ${GENERATED_SRC_FILES}
+ COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/Generated/generated.cpp
+ )
+endif()
+
+source_group(TREE ${CMAKE_CURRENT_BINARY_DIR} FILES ${GENERATED_SRC_FILES})
+
+
+# Test prefixed tree grouping.
+set(PREFIXED_SRC_FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/Prefixed/bar.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/Prefixed/PrefixedNested/bar_nested.cpp
+)
+
+add_custom_target(SourceGroupTree
+ SOURCES
+ ${SRC_FILES}
+ ${GENERATED_SRC_FILES}
+ ${PREFIXED_SRC_FILES}
+)
+
+source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Prefixed PREFIX SourcesPrefix FILES ${PREFIXED_SRC_FILES})
diff --git a/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake
new file mode 100644
index 000000000..87f247dce
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/UnityBuildNative-check.cmake
@@ -0,0 +1,45 @@
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+if(NOT EXISTS "${unitybuild_c0}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
+ return()
+endif()
+
+set(tgt_project "${RunCMake_TEST_BINARY_DIR}/tgt.vcxproj")
+if (NOT EXISTS "${tgt_project}")
+ set(RunCMake_TEST_FAILED "Generated project file ${tgt_project} doesn't exist.")
+ return()
+endif()
+
+file(STRINGS ${tgt_project} tgt_projects_strings)
+
+foreach(line IN LISTS tgt_projects_strings)
+ if (line MATCHES "<EnableUnitySupport>true</EnableUnitySupport>")
+ set(have_unity_support ON)
+ endif()
+
+ if (line MATCHES "<ClCompile Include=.*IncludeInUnityFile=\"false\" CustomUnityFile=\"true\"")
+ set(unity_source_line ${line})
+ endif()
+
+ if (line MATCHES "<ClCompile Include=.*IncludeInUnityFile=\"true\" CustomUnityFile=\"true\"")
+ list(APPEND sources_list ${line})
+ endif()
+endforeach()
+
+if (NOT have_unity_support)
+ set(RunCMake_TEST_FAILED "Generated project should include the <EnableUnitySupport> block.")
+ return()
+endif()
+
+string(REPLACE "\\" "/" unity_source_line "${unity_source_line}")
+string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0.c" unity_source_file_position)
+if (unity_source_file_position EQUAL "-1")
+ set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.")
+ return()
+endif()
+
+list(LENGTH sources_list number_of_sources)
+if(NOT number_of_sources EQUAL 8)
+ set(RunCMake_TEST_FAILED "Generated project doesn't include the expect number of files.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/UnityBuildNative.cmake b/Tests/RunCMake/VS10Project/UnityBuildNative.cmake
new file mode 100644
index 000000000..77a09cb00
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/UnityBuildNative.cmake
@@ -0,0 +1,12 @@
+project(unitybuild_c C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
new file mode 100644
index 000000000..1c6bab838
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017-check.cmake
@@ -0,0 +1,48 @@
+set(unitybuild_c0 "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/Unity/unity_0.c")
+if(NOT EXISTS "${unitybuild_c0}")
+ set(RunCMake_TEST_FAILED "Generated unity source files ${unitybuild_c0} does not exist.")
+ return()
+endif()
+
+set(tgt_project "${RunCMake_TEST_BINARY_DIR}/tgt.vcxproj")
+if (NOT EXISTS "${tgt_project}")
+ set(RunCMake_TEST_FAILED "Generated project file ${tgt_project} doesn't exist.")
+ return()
+endif()
+
+file(STRINGS ${tgt_project} tgt_projects_strings)
+
+foreach(line IN LISTS tgt_projects_strings)
+ if (line MATCHES "<ClCompile Include=.*/>")
+ set(unity_source_line ${line})
+ endif()
+
+ if (line MATCHES "<ClCompile Include=\"[^\"]*\">")
+ string(REGEX MATCH "<ClCompile Include=\"([^\"]*)\">" source_file ${line})
+ list(APPEND sources_list ${source_file})
+ endif()
+
+ if (line MATCHES "<ExcludedFromBuild.*</ExcludedFromBuild>")
+ list(APPEND excluded_sources_list ${source_file})
+ endif()
+endforeach()
+
+string(REPLACE "\\" "/" unity_source_line ${unity_source_line})
+string(FIND "${unity_source_line}" "CMakeFiles/tgt.dir/Unity/unity_0.c" unity_source_file_position)
+if (unity_source_file_position EQUAL "-1")
+ set(RunCMake_TEST_FAILED "Generated project should include the generated unity source file.")
+ return()
+endif()
+
+list(LENGTH sources_list number_of_sources)
+if(NOT number_of_sources EQUAL 8)
+ set(RunCMake_TEST_FAILED "Generated project doesn't include the expect number of files.")
+ return()
+endif()
+
+# Exclusions for Debug|Release|MinSizeRel|RelWithDebInfo
+list(LENGTH excluded_sources_list number_of_excluded_sources)
+if(NOT number_of_excluded_sources EQUAL 32)
+ set(RunCMake_TEST_FAILED "Generated project doesn't exclude the source files for all configurations.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/UnityBuildPre2017.cmake b/Tests/RunCMake/VS10Project/UnityBuildPre2017.cmake
new file mode 100644
index 000000000..77a09cb00
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/UnityBuildPre2017.cmake
@@ -0,0 +1,12 @@
+project(unitybuild_c C)
+
+set(srcs "")
+foreach(s RANGE 1 8)
+ set(src "${CMAKE_CURRENT_BINARY_DIR}/s${s}.c")
+ file(WRITE "${src}" "int s${s}(void) { return 0; }\n")
+ list(APPEND srcs "${src}")
+endforeach()
+
+add_library(tgt SHARED ${srcs})
+
+set_target_properties(tgt PROPERTIES UNITY_BUILD ON)
diff --git a/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake b/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake
index 4690970a3..bbd34da14 100644
--- a/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsConfigurationType-check.cmake
@@ -9,7 +9,7 @@ file(STRINGS "${vcProjectFile}" lines)
foreach(line IN LISTS lines)
if(line MATCHES "^ *<ConfigurationType>(.*)</ConfigurationType>$")
set(propertyFound TRUE)
- set(expectedValue "MyValue")
+ set(expectedValue "MyValue foo")
set(actualValue ${CMAKE_MATCH_1})
if(NOT (${actualValue} STREQUAL ${expectedValue}))
set(RunCMake_TEST_FAILED "ConfigurationType \"${actualValue}\" differs from expected value \"${expectedValue}\".")
diff --git a/Tests/RunCMake/VS10Project/VsConfigurationType.cmake b/Tests/RunCMake/VS10Project/VsConfigurationType.cmake
index a73dfe8c0..a2f544aa9 100644
--- a/Tests/RunCMake/VS10Project/VsConfigurationType.cmake
+++ b/Tests/RunCMake/VS10Project/VsConfigurationType.cmake
@@ -1,3 +1,3 @@
enable_language(CXX)
add_library(foo foo.cpp)
-set_target_properties(foo PROPERTIES VS_CONFIGURATION_TYPE "MyValue")
+set_target_properties(foo PROPERTIES VS_CONFIGURATION_TYPE "MyValue $<TARGET_PROPERTY:foo,NAME>")
diff --git a/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake b/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake
new file mode 100644
index 000000000..fbb64f0d3
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAware-check.cmake
@@ -0,0 +1,41 @@
+macro(VSDpiAware_check tgt dpiaware_match_expect)
+ set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/${tgt}.vcxproj")
+ if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not exist.")
+ return()
+ endif()
+
+ set(HAVE_DPIAWARE_MATCH 0)
+ set(IN_MANIFEST_SETTINGS 0)
+
+ file(STRINGS "${vcProjectFile}" lines)
+ foreach(line IN LISTS lines)
+ if(line MATCHES "^ *<Manifest>")
+ set(IN_MANIFEST_SETTINGS 1)
+ elseif(line MATCHES "^ *</Manifest>")
+ set(IN_MANIFEST_SETTINGS 0)
+ elseif(IN_MANIFEST_SETTINGS AND (line MATCHES "^ *<EnableDpiAwareness>([^<>]+)</EnableDpiAwareness>"))
+ set(dpiaware_match_actual "${CMAKE_MATCH_1}")
+ if(NOT "${dpiaware_match_actual}" STREQUAL "${dpiaware_match_expect}")
+ set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj has <EnableDpiAwareness> '${dpiaware_match_actual}', not '${dpiaware_match_expect}'.")
+ return()
+ endif()
+ set(HAVE_DPIAWARE_MATCH 1)
+ break()
+ endif()
+ endforeach()
+
+ if(NOT HAVE_DPIAWARE_MATCH AND NOT "${dpiaware_match_expect}" STREQUAL "")
+ set(RunCMake_TEST_FAILED "Project file ${tgt}.vcxproj does not have a <EnableDpiAwareness> property group.")
+ return()
+ endif()
+endmacro()
+
+VSDpiAware_check(DPIAWARE-default-C "")
+VSDpiAware_check(DPIAWARE-default-CXX "")
+VSDpiAware_check(DPIAWARE-TGT-PERMONITOR-C "PerMonitorHighDPIAware")
+VSDpiAware_check(DPIAWARE-TGT-PERMONITOR-CXX "PerMonitorHighDPIAware")
+VSDpiAware_check(DPIAWARE-TGT-ON-C "true")
+VSDpiAware_check(DPIAWARE-TGT-ON-CXX "true")
+VSDpiAware_check(DPIAWARE-TGT-OFF-C "false")
+VSDpiAware_check(DPIAWARE-TGT-OFF-CXX "false")
diff --git a/Tests/RunCMake/VS10Project/VsDpiAware.cmake b/Tests/RunCMake/VS10Project/VsDpiAware.cmake
new file mode 100644
index 000000000..74e3d212c
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAware.cmake
@@ -0,0 +1,19 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(C)
+enable_language(CXX)
+
+add_executable(DPIAWARE-default-C empty.c)
+add_executable(DPIAWARE-default-CXX empty.cxx)
+
+add_executable(DPIAWARE-TGT-PERMONITOR-C empty.c)
+set_property(TARGET DPIAWARE-TGT-PERMONITOR-C PROPERTY VS_DPI_AWARE "PerMonitor")
+add_executable(DPIAWARE-TGT-PERMONITOR-CXX empty.cxx)
+set_property(TARGET DPIAWARE-TGT-PERMONITOR-CXX PROPERTY VS_DPI_AWARE "PerMonitor")
+add_executable(DPIAWARE-TGT-ON-C empty.c)
+set_property(TARGET DPIAWARE-TGT-ON-C PROPERTY VS_DPI_AWARE ON)
+add_executable(DPIAWARE-TGT-ON-CXX empty.cxx)
+set_property(TARGET DPIAWARE-TGT-ON-CXX PROPERTY VS_DPI_AWARE ON)
+add_executable(DPIAWARE-TGT-OFF-C empty.c)
+set_property(TARGET DPIAWARE-TGT-OFF-C PROPERTY VS_DPI_AWARE OFF)
+add_executable(DPIAWARE-TGT-OFF-CXX empty.cxx)
+set_property(TARGET DPIAWARE-TGT-OFF-CXX PROPERTY VS_DPI_AWARE OFF)
diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt
new file mode 100644
index 000000000..95fc5caec
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam-stderr.txt
@@ -0,0 +1,3 @@
+CMake Error: Bad parameter for VS_DPI_AWARE: Bar
+CMake Error: Bad parameter for VS_DPI_AWARE: Foo
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake
new file mode 100644
index 000000000..e05452bf9
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsDpiAwareBadParam.cmake
@@ -0,0 +1,8 @@
+set(CMAKE_CONFIGURATION_TYPES Debug)
+enable_language(C)
+enable_language(CXX)
+
+add_executable(DPIAWARE-TGT-BADPARAM-C empty.c)
+set_property(TARGET DPIAWARE-TGT-BADPARAM-C PROPERTY VS_DPI_AWARE "Foo")
+add_executable(DPIAWARE-TGT-BADPARAM-CXX empty.cxx)
+set_property(TARGET DPIAWARE-TGT-BADPARAM-CXX PROPERTY VS_DPI_AWARE "Bar")
diff --git a/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake b/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
index 4ff5327a9..512a1c99c 100644
--- a/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
+++ b/Tests/RunCMake/VS10Project/VsPackageReferences-check.cmake
@@ -25,7 +25,7 @@ foreach(i 1 2)
if(line MATCHES "^ *<PackageReference .* Version=\"${testVersion}\".*>$")
set(Library${i}Found TRUE)
message(STATUS "foo.vcxproj is using package reference ${testLibrary} with version ${testVersion}")
- elseif()
+ else()
message(STATUS "foo.vcxproj failed to define reference ${testLibrary} with version ${testVersion}")
set(Library${i}Found FALSE)
endif()
diff --git a/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake b/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake
new file mode 100644
index 000000000..27842f98e
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsPrecompileHeaders-check.cmake
@@ -0,0 +1,66 @@
+set(pch_header "CMakeFiles/tgt.dir/cmake_pch.hxx")
+set(pch_source [=[CMakeFiles\\tgt.dir\\cmake_pch.cxx]=])
+
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/${pch_header}")
+ set(RunCMake_TEST_FAILED "Generated PCH header ${pch_header} does not exist.")
+ return()
+endif()
+if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/${pch_source}")
+ set(RunCMake_TEST_FAILED "Generated PCH header ${pch_source} does not exist.")
+ return()
+endif()
+
+set(tgt_project "${RunCMake_TEST_BINARY_DIR}/tgt.vcxproj")
+if (NOT EXISTS "${tgt_project}")
+ set(RunCMake_TEST_FAILED "Generated project file ${tgt_project} doesn't exist.")
+ return()
+endif()
+
+file(STRINGS ${tgt_project} tgt_projects_strings)
+
+foreach(line IN LISTS tgt_projects_strings)
+ if (line MATCHES "<PrecompiledHeader.*>Use</PrecompiledHeader>")
+ set(have_pch_use ON)
+ endif()
+
+ if (line MATCHES "<PrecompiledHeader.*>Create</PrecompiledHeader>")
+ set(have_pch_create ON)
+ endif()
+
+ if (line MATCHES "<PrecompiledHeaderFile.*>.*${pch_header}</PrecompiledHeaderFile>")
+ set(have_pch_header ON)
+ endif()
+
+ if (line MATCHES "<ForcedIncludeFiles.*>.*${pch_header}</ForcedIncludeFiles>")
+ set(have_force_pch_header ON)
+ endif()
+
+ if (line MATCHES "<ClCompile Include=.*${pch_source}\">")
+ set(have_pch_source_compile ON)
+ endif()
+endforeach()
+
+if (NOT have_pch_use)
+ set(RunCMake_TEST_FAILED "Generated project should have the <PrecompiledHeader>Use</PrecompiledHeader> block.")
+ return()
+endif()
+
+if (NOT have_pch_create)
+ set(RunCMake_TEST_FAILED "Generated project should have the <PrecompiledHeader>Create</PrecompiledHeader> block.")
+ return()
+endif()
+
+if (NOT have_pch_header)
+ set(RunCMake_TEST_FAILED "Generated project should have the <PrecompiledHeaderFile>${pch_header}</PrecompiledHeaderFile> block.")
+ return()
+endif()
+
+if (NOT have_force_pch_header)
+ set(RunCMake_TEST_FAILED "Generated project should have the <ForcedIncludeFiles>${pch_header}</ForcedIncludeFiles> block.")
+ return()
+endif()
+
+if (NOT have_pch_source_compile)
+ set(RunCMake_TEST_FAILED "Generated project should have the <ClCompile Include=\"${pch_source}\"> block.")
+ return()
+endif()
diff --git a/Tests/RunCMake/VS10Project/VsPrecompileHeaders.cmake b/Tests/RunCMake/VS10Project/VsPrecompileHeaders.cmake
new file mode 100644
index 000000000..6d208c988
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsPrecompileHeaders.cmake
@@ -0,0 +1,4 @@
+project(VsPrecompileHeaders CXX)
+
+add_library(tgt SHARED empty.cxx)
+target_precompile_headers(tgt PRIVATE stdafx.h)
diff --git a/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName-result.txt b/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName-stderr.txt b/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName-stderr.txt
new file mode 100644
index 000000000..2ff57cda4
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at VsPrecompileHeadersReuseFromCompilePDBName.cmake:6 \(add_library\):
+ PRECOMPILE_HEADERS_REUSE_FROM property is set on target \("b"\). Reusable
+ precompile headers requires the COMPILE_PDB_NAME property to have the value
+ "a"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName.cmake b/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName.cmake
new file mode 100644
index 000000000..ec1100805
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/VsPrecompileHeadersReuseFromCompilePDBName.cmake
@@ -0,0 +1,9 @@
+project(VsPrecompileHeadersReuseFromCompilePDBName CXX)
+
+add_library(a SHARED empty.cxx)
+target_precompile_headers(a PRIVATE <windows.h>)
+
+add_library(b SHARED empty.cxx)
+target_precompile_headers(b REUSE_FROM a)
+
+set_target_properties(b PROPERTIES COMPILE_PDB_NAME b)
diff --git a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
index dab1c33a3..b1deb9907 100644
--- a/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
+++ b/Tests/RunCMake/VS10ProjectWinCE/VsCEDebuggerDeploy-check.cmake
@@ -14,6 +14,9 @@ endif()
set(FoundCEAdditionalFiles FALSE)
set(FoundRemoteDirectory FALSE)
set(FoundToolsVersion4 FALSE)
+set(FoundEnableRedirectPlatform FALSE)
+set(FoundRedirectPlatformValue FALSE)
+
file(STRINGS "${vcProjectFile}" lines)
foreach(line IN LISTS lines)
@@ -23,6 +26,10 @@ foreach(line IN LISTS lines)
set(FoundRemoteDirectory TRUE)
elseif(line MATCHES " *<Project +.*ToolsVersion=\"4.0\".*> *$")
set(FoundToolsVersion4 TRUE)
+ elseif(line MATCHES "^ *<EnableRedirectPlatform>true</EnableRedirectPlatform> *$")
+ set(FoundEnableRedirectPlatform TRUE)
+ elseif(line MATCHES "^ *<RedirectPlatformValue>.+</RedirectPlatformValue> *$")
+ set(FoundRedirectPlatformValue TRUE)
endif()
endforeach()
@@ -41,6 +48,16 @@ if(NOT FoundToolsVersion4)
return()
endif()
+if(NOT FoundEnableRedirectPlatform)
+ set(RunCMake_TEST_FAILED "Failed to find EnableRedirectPlatform true property.")
+ return()
+endif()
+
+if(NOT FoundRedirectPlatformValue)
+ set(RunCMake_TEST_FAILED "Failed to find RedirectPlatformValue property.")
+ return()
+endif()
+
#
# Test solution file deployment items.
#
diff --git a/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake
new file mode 100644
index 000000000..c6bbc1be1
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists-check.cmake
@@ -0,0 +1,20 @@
+set(xcProjectFile "${RunCMake_TEST_BINARY_DIR}/ImplicitCMakeLists.xcodeproj/project.pbxproj")
+if(NOT EXISTS "${xcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${xcProjectFile} does not exist.")
+ return()
+endif()
+
+set(foundCMakeLists 0)
+file(STRINGS "${xcProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES "PBXFileReference.*CMakeLists.txt")
+ if(foundCMakeLists)
+ set(RunCMake_TEST_FAILED "CMakeLists.txt referenced multiple times")
+ return()
+ endif()
+ set(foundCMakeLists 1)
+ endif()
+endforeach()
+if(NOT foundCMakeLists)
+ set(RunCMake_TEST_FAILED "CMakeLists.txt not referenced")
+endif()
diff --git a/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/ImplicitCMakeLists.cmake
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
index 191f56dd7..6ecf3f2c8 100644
--- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
+++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake
@@ -1,6 +1,7 @@
include(RunCMake)
run_cmake(ExplicitCMakeLists)
+run_cmake(ImplicitCMakeLists)
run_cmake(XcodeFileType)
run_cmake(XcodeAttributeLocation)
@@ -12,6 +13,7 @@ run_cmake(XcodeObjectNeedsQuote)
run_cmake(XcodeOptimizationFlags)
run_cmake(XcodePreserveNonOptimizationFlags)
run_cmake(XcodePreserveObjcFlag)
+run_cmake(XcodePrecompileHeaders)
if (NOT XCODE_VERSION VERSION_LESS 6)
run_cmake(XcodePlatformFrameworks)
endif()
@@ -52,6 +54,20 @@ endfunction()
XcodeDependOnZeroCheck()
+function(XcodeObjcxxFlags testName)
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${testName}-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+
+ run_cmake(${testName})
+ run_cmake_command(${testName}-build ${CMAKE_COMMAND} --build .)
+endfunction()
+
+XcodeObjcxxFlags(XcodeObjcFlags)
+XcodeObjcxxFlags(XcodeObjcxxFlags)
+
# Isolate device tests from host architecture selection.
unset(ENV{CMAKE_OSX_ARCHITECTURES})
diff --git a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
index ef772ea65..8c0b470c2 100644
--- a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake
@@ -5,6 +5,7 @@ enable_language(C)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+ set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
endif()
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
index f6c00b165..c2210332e 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombined.cmake
@@ -11,6 +11,7 @@ if(NOT IOS)
endif()
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "NO")
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
index ec11dbbd4..172f2e85e 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedPrune.cmake
@@ -7,6 +7,7 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
endif()
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
add_library(foo SHARED foo.cpp)
diff --git a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
index 58e96b4f3..038a89057 100644
--- a/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
+++ b/Tests/RunCMake/XcodeProject/XcodeIOSInstallCombinedSingleArch.cmake
@@ -7,6 +7,7 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 9)
endif()
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf")
add_library(foo SHARED foo.cpp)
diff --git a/Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake b/Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake
new file mode 100644
index 000000000..4840276ae
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeObjcFlags.cmake
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.15)
+project(objctest LANGUAGES C OBJC)
+
+include(CheckOBJCCompilerFlag)
+check_objc_compiler_flag(-fobjc-arc HAVE_OBJC_ARC)
+
+if(HAVE_OBJC_ARC)
+ add_compile_options(-fobjc-arc)
+ add_compile_definitions(HAVE_OBJC_ARC)
+endif()
+
+add_library(myfuncs STATIC myfuncs.m)
diff --git a/Tests/RunCMake/XcodeProject/XcodeObjcxxFlags.cmake b/Tests/RunCMake/XcodeProject/XcodeObjcxxFlags.cmake
new file mode 100644
index 000000000..0ad942f28
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodeObjcxxFlags.cmake
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 3.15)
+project(objcxxtest LANGUAGES CXX OBJCXX)
+
+include(CheckOBJCXXCompilerFlag)
+check_objcxx_compiler_flag(-fobjc-arc HAVE_OBJC_ARC)
+
+if(HAVE_OBJC_ARC)
+ add_compile_options(-fobjc-arc)
+ add_compile_definitions(HAVE_OBJC_ARC)
+endif()
+
+add_library(myfuncs STATIC myfuncs.mm)
diff --git a/Tests/RunCMake/XcodeProject/XcodePrecompileHeaders-check.cmake b/Tests/RunCMake/XcodeProject/XcodePrecompileHeaders-check.cmake
new file mode 100644
index 000000000..aa3eafc26
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodePrecompileHeaders-check.cmake
@@ -0,0 +1,35 @@
+set(pch_header "${RunCMake_TEST_BINARY_DIR}/CMakeFiles/tgt.dir/cmake_pch.hxx")
+
+if(NOT EXISTS "${pch_header}")
+ set(RunCMake_TEST_FAILED "Generated PCH header ${pch_header} does not exist.")
+ return()
+endif()
+
+set(tgt_project "${RunCMake_TEST_BINARY_DIR}/XcodePrecompileHeaders.xcodeproj/project.pbxproj")
+if (NOT EXISTS "${tgt_project}")
+ set(RunCMake_TEST_FAILED "Generated project file ${tgt_project} doesn't exist.")
+ return()
+endif()
+
+file(STRINGS ${tgt_project} tgt_projects_strings)
+
+foreach(line IN LISTS tgt_projects_strings)
+ if (line MATCHES "GCC_PRECOMPILE_PREFIX_HEADER = YES;")
+ set(have_pch_prefix ON)
+ endif()
+
+ string(FIND "${line}" "GCC_PREFIX_HEADER = \"${pch_header}\";" find_pos)
+ if (NOT find_pos EQUAL "-1")
+ set(have_pch_header ON)
+ endif()
+endforeach()
+
+if (NOT have_pch_prefix)
+ set(RunCMake_TEST_FAILED "Generated project should have the GCC_PRECOMPILE_PREFIX_HEADER = YES; line.")
+ return()
+endif()
+
+if (NOT have_pch_header)
+ set(RunCMake_TEST_FAILED "Generated project should have the GCC_PREFIX_HEADER = \"${pch_header}\"; line.")
+ return()
+endif()
diff --git a/Tests/RunCMake/XcodeProject/XcodePrecompileHeaders.cmake b/Tests/RunCMake/XcodeProject/XcodePrecompileHeaders.cmake
new file mode 100644
index 000000000..f86bcf415
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/XcodePrecompileHeaders.cmake
@@ -0,0 +1,4 @@
+project(XcodePrecompileHeaders CXX)
+
+add_library(tgt foo.cpp)
+target_precompile_headers(tgt PRIVATE stdafx.h)
diff --git a/Tests/RunCMake/XcodeProject/myfuncs.m b/Tests/RunCMake/XcodeProject/myfuncs.m
new file mode 100644
index 000000000..742ba8ecf
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/myfuncs.m
@@ -0,0 +1,3 @@
+#if defined(HAVE_OBJC_ARC) && ! __has_feature(objc_arc)
+#error THIS CODE MUST BE COMPILED WITH ARC ENABLED!
+#endif
diff --git a/Tests/RunCMake/XcodeProject/myfuncs.mm b/Tests/RunCMake/XcodeProject/myfuncs.mm
new file mode 100644
index 000000000..742ba8ecf
--- /dev/null
+++ b/Tests/RunCMake/XcodeProject/myfuncs.mm
@@ -0,0 +1,3 @@
+#if defined(HAVE_OBJC_ARC) && ! __has_feature(objc_arc)
+#error THIS CODE MUST BE COMPILED WITH ARC ENABLED!
+#endif
diff --git a/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-result.txt b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-stderr.txt b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-stderr.txt
new file mode 100644
index 000000000..503385fdc
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at AppendLiteralQuotes.cmake:2 \(add_custom_command\):
+ COMMAND may not contain literal quotes:
+
+ "c"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/AppendLiteralQuotes.cmake b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes.cmake
new file mode 100644
index 000000000..038fb3f92
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/AppendLiteralQuotes.cmake
@@ -0,0 +1,2 @@
+add_custom_command(OUTPUT a COMMAND b)
+add_custom_command(OUTPUT a COMMAND "\"c\"" APPEND)
diff --git a/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt b/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt
index cd542d875..b7ee23a55 100644
--- a/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt
+++ b/Tests/RunCMake/add_custom_command/AppendNotOutput-stderr.txt
@@ -1,7 +1,7 @@
CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
add_custom_command given APPEND option with output
- .*RunCMake/add_custom_command/AppendNotOutput-build/out.*
+ .*RunCMake/add_custom_command/AppendNotOutput-build/out
which is not already a custom command output.
Call Stack \(most recent call first\):
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-result.txt b/Tests/RunCMake/add_custom_command/BadByproduct-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadByproduct-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
new file mode 100644
index 000000000..086e39752
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
@@ -0,0 +1,36 @@
+CMake Error at BadByproduct.cmake:2 \(add_custom_command\):
+ add_custom_command called with BYPRODUCTS containing a "#". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:3 \(add_custom_command\):
+ add_custom_command called with BYPRODUCTS containing a "<". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:4 \(add_custom_command\):
+ add_custom_command called with BYPRODUCTS containing a ">". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:5 \(add_custom_command\):
+ add_custom_command called with BYPRODUCTS containing a "<". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:6 \(add_custom_command\):
+ add_custom_command attempted to have a file
+
+ .*RunCMake/add_custom_command/f
+
+ in a source directory as an output of custom command.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct.cmake b/Tests/RunCMake/add_custom_command/BadByproduct.cmake
new file mode 100644
index 000000000..91bca5220
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadByproduct.cmake
@@ -0,0 +1,6 @@
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+add_custom_command(OUTPUT a BYPRODUCTS "a#")
+add_custom_command(OUTPUT b BYPRODUCTS "a<")
+add_custom_command(OUTPUT c BYPRODUCTS "a>")
+add_custom_command(OUTPUT d BYPRODUCTS "$<CONFIG>/#")
+add_custom_command(OUTPUT e BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/f)
diff --git a/Tests/RunCMake/add_custom_command/BadOutput-result.txt b/Tests/RunCMake/add_custom_command/BadOutput-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadOutput-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
new file mode 100644
index 000000000..731e58d03
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
@@ -0,0 +1,36 @@
+CMake Error at BadOutput.cmake:2 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "#". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadOutput.cmake:3 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "<". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadOutput.cmake:4 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a ">". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadOutput.cmake:5 \(add_custom_command\):
+ add_custom_command called with OUTPUT containing a "<". This character is
+ not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadOutput.cmake:6 \(add_custom_command\):
+ add_custom_command attempted to have a file
+
+ .*RunCMake/add_custom_command/e
+
+ in a source directory as an output of custom command.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/BadOutput.cmake b/Tests/RunCMake/add_custom_command/BadOutput.cmake
new file mode 100644
index 000000000..6875fe966
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/BadOutput.cmake
@@ -0,0 +1,6 @@
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+add_custom_command(OUTPUT "a#" COMMAND a)
+add_custom_command(OUTPUT "a<" COMMAND b)
+add_custom_command(OUTPUT "a>" COMMAND c)
+add_custom_command(OUTPUT "$<CONFIG>/#" COMMAND d)
+add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/e COMMAND f)
diff --git a/Tests/RunCMake/add_custom_command/GeneratedProperty.cmake b/Tests/RunCMake/add_custom_command/GeneratedProperty.cmake
new file mode 100644
index 000000000..628134b8b
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/GeneratedProperty.cmake
@@ -0,0 +1,10 @@
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../GeneratedProperty-build/a"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../GeneratedProperty-build/b"
+ COMMAND c
+ )
+get_source_file_property(GENERATED_A "${CMAKE_CURRENT_BINARY_DIR}/a" GENERATED)
+get_source_file_property(GENERATED_B "${CMAKE_CURRENT_BINARY_DIR}/b" GENERATED)
+if(NOT GENERATED_A OR NOT GENERATED_B)
+ message(FATAL_ERROR "failed")
+endif()
diff --git a/Tests/RunCMake/add_custom_command/LiteralQuotes-result.txt b/Tests/RunCMake/add_custom_command/LiteralQuotes-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/LiteralQuotes-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/LiteralQuotes-stderr.txt b/Tests/RunCMake/add_custom_command/LiteralQuotes-stderr.txt
new file mode 100644
index 000000000..e7d615555
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/LiteralQuotes-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at LiteralQuotes.cmake:1 \(add_custom_command\):
+ COMMAND may not contain literal quotes:
+
+ "b"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/LiteralQuotes.cmake b/Tests/RunCMake/add_custom_command/LiteralQuotes.cmake
new file mode 100644
index 000000000..046ddd902
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/LiteralQuotes.cmake
@@ -0,0 +1 @@
+add_custom_command(OUTPUT a COMMAND "\"b\"")
diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
index 0387dbb60..96642faf1 100644
--- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake
@@ -1,14 +1,20 @@
include(RunCMake)
+run_cmake(AppendLiteralQuotes)
run_cmake(AppendNoOutput)
run_cmake(AppendNotOutput)
run_cmake(BadArgument)
+run_cmake(BadByproduct)
+run_cmake(BadOutput)
+run_cmake(GeneratedProperty)
+run_cmake(LiteralQuotes)
run_cmake(NoArguments)
run_cmake(NoOutputOrTarget)
run_cmake(OutputAndTarget)
run_cmake(SourceByproducts)
run_cmake(SourceUsesTerminal)
run_cmake(TargetImported)
+run_cmake(TargetLiteralQuotes)
run_cmake(TargetNotInDir)
if(${RunCMake_GENERATOR} MATCHES "Visual Studio ([^89]|[89][0-9])")
diff --git a/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-result.txt b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-stderr.txt b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-stderr.txt
new file mode 100644
index 000000000..c4589b4b3
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at TargetLiteralQuotes.cmake:2 \(add_custom_command\):
+ COMMAND may not contain literal quotes:
+
+ "b"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_command/TargetLiteralQuotes.cmake b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes.cmake
new file mode 100644
index 000000000..5f11ed1a4
--- /dev/null
+++ b/Tests/RunCMake/add_custom_command/TargetLiteralQuotes.cmake
@@ -0,0 +1,2 @@
+add_library(a)
+add_custom_command(TARGET a POST_BUILD COMMAND "\"b\"")
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-result.txt b/Tests/RunCMake/add_custom_target/BadByproduct-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadByproduct-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
new file mode 100644
index 000000000..0f58550a3
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
@@ -0,0 +1,36 @@
+CMake Error at BadByproduct.cmake:2 \(add_custom_target\):
+ add_custom_target called with BYPRODUCTS containing a "#". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:3 \(add_custom_target\):
+ add_custom_target called with BYPRODUCTS containing a "<". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:4 \(add_custom_target\):
+ add_custom_target called with BYPRODUCTS containing a ">". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:5 \(add_custom_target\):
+ add_custom_target called with BYPRODUCTS containing a "<". This character
+ is not allowed.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+
+CMake Error at BadByproduct.cmake:6 \(add_custom_target\):
+ add_custom_target attempted to have a file
+
+ .*RunCMake/add_custom_target/j
+
+ in a source directory as an output of custom command.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct.cmake b/Tests/RunCMake/add_custom_target/BadByproduct.cmake
new file mode 100644
index 000000000..963d6416b
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/BadByproduct.cmake
@@ -0,0 +1,6 @@
+set(CMAKE_DISABLE_SOURCE_CHANGES ON)
+add_custom_target(a BYPRODUCTS "a#" COMMAND b)
+add_custom_target(c BYPRODUCTS "a<" COMMAND d)
+add_custom_target(e BYPRODUCTS "a>" COMMAND f)
+add_custom_target(g BYPRODUCTS "$<CONFIG>/#" COMMAND h)
+add_custom_target(i BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/j COMMAND k)
diff --git a/Tests/RunCMake/add_custom_target/GeneratedProperty.cmake b/Tests/RunCMake/add_custom_target/GeneratedProperty.cmake
new file mode 100644
index 000000000..d03453494
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/GeneratedProperty.cmake
@@ -0,0 +1,14 @@
+add_custom_command(
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/../GeneratedProperty-build/a"
+ COMMAND b
+ )
+add_custom_target(CollapseFullPath
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/a"
+ BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/../GeneratedProperty-build/c"
+ COMMAND d
+ )
+get_source_file_property(GENERATED_A "${CMAKE_CURRENT_BINARY_DIR}/a" GENERATED)
+get_source_file_property(GENERATED_C "${CMAKE_CURRENT_BINARY_DIR}/c" GENERATED)
+if(NOT GENERATED_A OR NOT GENERATED_C)
+ message(FATAL_ERROR "failed")
+endif()
diff --git a/Tests/RunCMake/add_custom_target/LiteralQuotes-result.txt b/Tests/RunCMake/add_custom_target/LiteralQuotes-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/LiteralQuotes-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/add_custom_target/LiteralQuotes-stderr.txt b/Tests/RunCMake/add_custom_target/LiteralQuotes-stderr.txt
new file mode 100644
index 000000000..bc5187adc
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/LiteralQuotes-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error at LiteralQuotes.cmake:1 \(add_custom_target\):
+ COMMAND may not contain literal quotes:
+
+ "b"
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/add_custom_target/LiteralQuotes.cmake b/Tests/RunCMake/add_custom_target/LiteralQuotes.cmake
new file mode 100644
index 000000000..987060852
--- /dev/null
+++ b/Tests/RunCMake/add_custom_target/LiteralQuotes.cmake
@@ -0,0 +1 @@
+add_custom_target(a COMMAND "\"b\"")
diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
index 2caed0328..f5d5dd2b5 100644
--- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
+++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake
@@ -1,9 +1,12 @@
include(RunCMake)
-run_cmake(CommandExpandsEmpty)
-run_cmake(NoArguments)
+run_cmake(BadByproduct)
run_cmake(BadTargetName)
run_cmake(ByproductsNoCommand)
+run_cmake(CommandExpandsEmpty)
+run_cmake(GeneratedProperty)
+run_cmake(LiteralQuotes)
+run_cmake(NoArguments)
run_cmake(UsesTerminalNoCommand)
function(run_TargetOrder)
diff --git a/Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt b/Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt
index e332281d2..838992b05 100644
--- a/Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt
+++ b/Tests/RunCMake/add_library/UNKNOWNwithOnlyObjectSources-stderr.txt
@@ -1,4 +1,4 @@
^CMake Error at UNKNOWNwithOnlyObjectSources.cmake:[0-9]+ \(target_sources\):
- target_sources called with non-compilable target type
+ target_sources may only set INTERFACE properties on IMPORTED targets
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake b/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
index ff676a6ba..57ab93877 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll.cmake
@@ -11,4 +11,6 @@ set(foo_lib \"$<TARGET_FILE:foo>\")
set(bar_lib \"$<TARGET_FILE:bar>\")
set(zot_lib \"$<TARGET_FILE:zot>\")
set(subinc_lib \"$<TARGET_FILE:subinc>\")
+set(subsub_lib \"$<TARGET_FILE:subsub>\")
+set(subsubinc_lib \"$<TARGET_FILE:subsubinc>\")
")
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
index 790da542f..9ed9e5517 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/CMakeLists.txt
@@ -1,5 +1,7 @@
project(ExcludeFromAllSub NONE)
+add_subdirectory(SubSub EXCLUDE_FROM_ALL)
+
add_library(bar STATIC EXCLUDE_FROM_ALL bar.cpp)
add_library(zot STATIC zot.cpp)
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/SubSub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/SubSub/CMakeLists.txt
new file mode 100644
index 000000000..ec2827542
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/SubSub/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_library(subsub STATIC subsub.cpp)
+add_library(subsubinc STATIC subsub.cpp)
+set_property(TARGET subsubinc PROPERTY EXCLUDE_FROM_ALL OFF)
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/SubSub/subsub.cpp b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/SubSub/subsub.cpp
new file mode 100644
index 000000000..ca689edaa
--- /dev/null
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/SubSub/subsub.cpp
@@ -0,0 +1,4 @@
+int subsub()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check-sub.cmake b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check-sub.cmake
index 297ad1e22..d318c100e 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check-sub.cmake
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check-sub.cmake
@@ -8,6 +8,7 @@ if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
"${foo_lib}"
"${subinc_lib}"
"${zot_lib}"
+ "${subsubinc_lib}"
)
if(NOT EXISTS "${file}")
set(RunCMake_TEST_FAILED
@@ -18,6 +19,7 @@ if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
foreach(file
"${main_exe}"
"${bar_lib}"
+ "${subsub_lib}"
)
if(EXISTS "${file}")
set(RunCMake_TEST_FAILED
diff --git a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
index 433c03208..d4bdef23d 100644
--- a/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
+++ b/Tests/RunCMake/add_subdirectory/ExcludeFromAll/check.cmake
@@ -8,6 +8,7 @@ if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
"${foo_lib}"
"${subinc_lib}"
"${main_exe}"
+ "${subsubinc_lib}"
)
if(EXISTS "${file}")
# Remove for next step of test.
@@ -21,6 +22,7 @@ if(EXISTS ${RunCMake_TEST_BINARY_DIR}/check-debug.cmake)
foreach(file
"${zot_lib}"
"${bar_lib}"
+ "${subsub_lib}"
)
if(EXISTS "${file}")
set(RunCMake_TEST_FAILED
diff --git a/Tests/RunCMake/color_warning.c b/Tests/RunCMake/color_warning.c
new file mode 100644
index 000000000..831abd96a
--- /dev/null
+++ b/Tests/RunCMake/color_warning.c
@@ -0,0 +1,7 @@
+#include <stdio.h>
+int main(void)
+{
+ printf(
+ "/tmp/hello.c:3:2: \033[35mwarning:\033[0m Hello, World! [-W#warnings]\n");
+ return 0;
+}
diff --git a/Tests/RunCMake/ctest_build/IgnoreColor-stdout.txt b/Tests/RunCMake/ctest_build/IgnoreColor-stdout.txt
new file mode 100644
index 000000000..cd1720f53
--- /dev/null
+++ b/Tests/RunCMake/ctest_build/IgnoreColor-stdout.txt
@@ -0,0 +1,2 @@
+ 0 Compiler errors
+ 1 Compiler warnings
diff --git a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
index 1092d2ad4..b2e562a93 100644
--- a/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_build/RunCMakeTest.cmake
@@ -1,6 +1,8 @@
include(RunCTest)
set(CASE_CTEST_BUILD_ARGS "")
+set(RunCMake_USE_LAUNCHERS TRUE)
+set(RunCMake_USE_CUSTOM_BUILD_COMMAND FALSE)
function(run_ctest_build CASE_NAME)
set(CASE_CTEST_BUILD_ARGS "${ARGN}")
@@ -45,3 +47,9 @@ function(run_BuildChangeId)
run_ctest(BuildChangeId)
endfunction()
run_BuildChangeId()
+
+set(RunCMake_USE_LAUNCHERS FALSE)
+set(RunCMake_USE_CUSTOM_BUILD_COMMAND TRUE)
+set(RunCMake_BUILD_COMMAND "${COLOR_WARNING}")
+run_ctest(IgnoreColor)
+unset(RunCMake_BUILD_COMMAND)
diff --git a/Tests/RunCMake/ctest_build/test.cmake.in b/Tests/RunCMake/ctest_build/test.cmake.in
index 6f15ec98e..9f7fa13e0 100644
--- a/Tests/RunCMake/ctest_build/test.cmake.in
+++ b/Tests/RunCMake/ctest_build/test.cmake.in
@@ -9,7 +9,10 @@ set(CTEST_CMAKE_GENERATOR "@RunCMake_GENERATOR@")
set(CTEST_CMAKE_GENERATOR_PLATFORM "@RunCMake_GENERATOR_PLATFORM@")
set(CTEST_CMAKE_GENERATOR_TOOLSET "@RunCMake_GENERATOR_TOOLSET@")
set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
-set(CTEST_USE_LAUNCHERS TRUE)
+set(CTEST_USE_LAUNCHERS "@RunCMake_USE_LAUNCHERS@")
+if (@RunCMake_USE_CUSTOM_BUILD_COMMAND@)
+ set(CTEST_BUILD_COMMAND "\"@RunCMake_BUILD_COMMAND@\"")
+endif()
set(ctest_build_args "@CASE_CTEST_BUILD_ARGS@")
ctest_start(Experimental)
diff --git a/Tests/RunCMake/ctest_start/AppendDifferentGroup-stderr.txt b/Tests/RunCMake/ctest_start/AppendDifferentGroup-stderr.txt
new file mode 100644
index 000000000..9e493a6ce
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/AppendDifferentGroup-stderr.txt
@@ -0,0 +1 @@
+^Group given in TAG does not match group given in ctest_start\(\)$
diff --git a/Tests/RunCMake/ctest_start/AppendDifferentGroup-stdout.txt b/Tests/RunCMake/ctest_start/AppendDifferentGroup-stdout.txt
new file mode 100644
index 000000000..5f8365325
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/AppendDifferentGroup-stdout.txt
@@ -0,0 +1,8 @@
+Run dashboard with to-be-determined model
+ Source directory: .*/Tests/RunCMake/ctest_start/AppendDifferentGroup
+ Build directory: .*/Tests/RunCMake/ctest_start/AppendDifferentGroup-build
+ Group: ExperimentalDifferent
+ Site: test-site
+ Build name: test-build-name
+ Use existing tag: 19551112-2204 - ExperimentalDifferent
+ Use ExperimentalDifferent tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_start/AppendDifferentTrack-stderr.txt b/Tests/RunCMake/ctest_start/AppendDifferentTrack-stderr.txt
index 0d6d19d73..9e493a6ce 100644
--- a/Tests/RunCMake/ctest_start/AppendDifferentTrack-stderr.txt
+++ b/Tests/RunCMake/ctest_start/AppendDifferentTrack-stderr.txt
@@ -1 +1 @@
-^Track given in TAG does not match track given in ctest_start\(\)$
+^Group given in TAG does not match group given in ctest_start\(\)$
diff --git a/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt b/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt
index 25085ef26..022e2ecaa 100644
--- a/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt
+++ b/Tests/RunCMake/ctest_start/AppendDifferentTrack-stdout.txt
@@ -1,7 +1,7 @@
Run dashboard with to-be-determined model
Source directory: .*/Tests/RunCMake/ctest_start/AppendDifferentTrack
Build directory: .*/Tests/RunCMake/ctest_start/AppendDifferentTrack-build
- Track: ExperimentalDifferent
+ Group: ExperimentalDifferent
Site: test-site
Build name: test-build-name
Use existing tag: 19551112-2204 - ExperimentalDifferent
diff --git a/Tests/RunCMake/ctest_start/MissingGroupArg-result.txt b/Tests/RunCMake/ctest_start/MissingGroupArg-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/MissingGroupArg-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_start/MissingGroupArg-stderr.txt b/Tests/RunCMake/ctest_start/MissingGroupArg-stderr.txt
new file mode 100644
index 000000000..e0480f647
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/MissingGroupArg-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error at .*/Tests/RunCMake/ctest_start/MissingGroupArg/test\.cmake:[0-9]+ \(ctest_start\):
+ ctest_start GROUP argument missing group name$
diff --git a/Tests/RunCMake/ctest_start/MissingGroupArgAppend-result.txt b/Tests/RunCMake/ctest_start/MissingGroupArgAppend-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/MissingGroupArgAppend-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_start/MissingGroupArgAppend-stderr.txt b/Tests/RunCMake/ctest_start/MissingGroupArgAppend-stderr.txt
new file mode 100644
index 000000000..8ae53ff32
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/MissingGroupArgAppend-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error at .*/Tests/RunCMake/ctest_start/MissingGroupArgAppend/test\.cmake:[0-9]+ \(ctest_start\):
+ ctest_start GROUP argument missing group name$
diff --git a/Tests/RunCMake/ctest_start/MissingGroupArgQuiet-result.txt b/Tests/RunCMake/ctest_start/MissingGroupArgQuiet-result.txt
new file mode 100644
index 000000000..b57e2deb7
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/MissingGroupArgQuiet-result.txt
@@ -0,0 +1 @@
+(-1|255)
diff --git a/Tests/RunCMake/ctest_start/MissingGroupArgQuiet-stderr.txt b/Tests/RunCMake/ctest_start/MissingGroupArgQuiet-stderr.txt
new file mode 100644
index 000000000..c4f8900f2
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/MissingGroupArgQuiet-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error at .*/Tests/RunCMake/ctest_start/MissingGroupArgQuiet/test\.cmake:[0-9]+ \(ctest_start\):
+ ctest_start GROUP argument missing group name$
diff --git a/Tests/RunCMake/ctest_start/MissingTrackArg-stderr.txt b/Tests/RunCMake/ctest_start/MissingTrackArg-stderr.txt
index 7b42bc9db..2a72a834e 100644
--- a/Tests/RunCMake/ctest_start/MissingTrackArg-stderr.txt
+++ b/Tests/RunCMake/ctest_start/MissingTrackArg-stderr.txt
@@ -1,2 +1,2 @@
^CMake Error at .*/Tests/RunCMake/ctest_start/MissingTrackArg/test\.cmake:[0-9]+ \(ctest_start\):
- ctest_start TRACK argument missing track name$
+ ctest_start TRACK argument missing group name$
diff --git a/Tests/RunCMake/ctest_start/MissingTrackArgAppend-stderr.txt b/Tests/RunCMake/ctest_start/MissingTrackArgAppend-stderr.txt
index 695bfad37..7ff82ab32 100644
--- a/Tests/RunCMake/ctest_start/MissingTrackArgAppend-stderr.txt
+++ b/Tests/RunCMake/ctest_start/MissingTrackArgAppend-stderr.txt
@@ -1,2 +1,2 @@
^CMake Error at .*/Tests/RunCMake/ctest_start/MissingTrackArgAppend/test\.cmake:[0-9]+ \(ctest_start\):
- ctest_start TRACK argument missing track name$
+ ctest_start TRACK argument missing group name$
diff --git a/Tests/RunCMake/ctest_start/MissingTrackArgQuiet-stderr.txt b/Tests/RunCMake/ctest_start/MissingTrackArgQuiet-stderr.txt
index 943852206..c23b1bfe7 100644
--- a/Tests/RunCMake/ctest_start/MissingTrackArgQuiet-stderr.txt
+++ b/Tests/RunCMake/ctest_start/MissingTrackArgQuiet-stderr.txt
@@ -1,2 +1,2 @@
^CMake Error at .*/Tests/RunCMake/ctest_start/MissingTrackArgQuiet/test\.cmake:[0-9]+ \(ctest_start\):
- ctest_start TRACK argument missing track name$
+ ctest_start TRACK argument missing group name$
diff --git a/Tests/RunCMake/ctest_start/NoAppendDifferentGroup-stdout.txt b/Tests/RunCMake/ctest_start/NoAppendDifferentGroup-stdout.txt
new file mode 100644
index 000000000..13a3883f0
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/NoAppendDifferentGroup-stdout.txt
@@ -0,0 +1,7 @@
+Run dashboard with model Experimental
+ Source directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentGroup
+ Build directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentGroup-build
+ Group: ExperimentalDifferent
+ Site: test-site
+ Build name: test-build-name
+ Use ExperimentalDifferent tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt b/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt
index 20a29beb9..c511e0db8 100644
--- a/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt
+++ b/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-stdout.txt
@@ -1,7 +1,7 @@
Run dashboard with model Experimental
Source directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack
Build directory: .*/Tests/RunCMake/ctest_start/NoAppendDifferentTrack-build
- Track: ExperimentalDifferent
+ Group: ExperimentalDifferent
Site: test-site
Build name: test-build-name
Use ExperimentalDifferent tag: [0-9-]+
diff --git a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
index 905ad0003..da85b39ab 100644
--- a/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ctest_start/RunCMakeTest.cmake
@@ -26,18 +26,24 @@ run_ctest_start(WriteModelToTagExperimental Experimental QUIET)
run_ctest_start(WriteModelToTagContinuous Continuous QUIET)
run_ctest_start(WriteModelToTagNightly Nightly QUIET)
run_ctest_start(WriteModelToTagNoMatchingTrack Continuous TRACK SomeWeirdTrackName QUIET)
+run_ctest_start(WriteModelToTagNoMatchingGroup Continuous GROUP SomeWeirdTrackName QUIET)
run_ctest_start(AppendSameModel Continuous APPEND)
run_ctest_start(AppendDifferentModel Experimental APPEND)
run_ctest_start(AppendNoModel APPEND)
run_ctest_start(AppendDifferentTrack TRACK ExperimentalDifferent APPEND)
+run_ctest_start(AppendDifferentGroup GROUP ExperimentalDifferent APPEND)
run_ctest_start(NoAppendDifferentTrack Experimental TRACK ExperimentalDifferent)
+run_ctest_start(NoAppendDifferentGroup Experimental GROUP ExperimentalDifferent)
run_ctest_start(AppendNoMatchingTrack Continuous APPEND)
run_ctest_start(AppendOldContinuous Continuous APPEND)
run_ctest_start(AppendOldNoModel APPEND)
run_ctest_start(NoModel QUIET)
run_ctest_start(MissingTrackArg Experimental TRACK)
+run_ctest_start(MissingGroupArg Experimental GROUP)
run_ctest_start(MissingTrackArgAppend Experimental TRACK APPEND)
+run_ctest_start(MissingGroupArgAppend Experimental GROUP APPEND)
run_ctest_start(MissingTrackArgQuiet Experimental TRACK QUIET)
+run_ctest_start(MissingGroupArgQuiet Experimental GROUP QUIET)
run_ctest_start(TooManyArgs Experimental
${RunCMake_BINARY_DIR}/TooManyArgs-build
${RunCMake_BINARY_DIR}/TooManyArgs-build
diff --git a/Tests/RunCMake/ctest_start/WriteModelToTagNoMatchingGroup-check.cmake b/Tests/RunCMake/ctest_start/WriteModelToTagNoMatchingGroup-check.cmake
new file mode 100644
index 000000000..bd2862deb
--- /dev/null
+++ b/Tests/RunCMake/ctest_start/WriteModelToTagNoMatchingGroup-check.cmake
@@ -0,0 +1 @@
+check_tag_contents("^[0-9-]+\nSomeWeirdTrackName\nContinuous\n$")
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-result.txt b/Tests/RunCMake/export/DependOnDoubleExport-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDoubleExport-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
new file mode 100644
index 000000000..b78c7e461
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDoubleExport-stderr.txt
@@ -0,0 +1,13 @@
+CMake Error in CMakeLists.txt:
+ export called with target "exported" which requires target "doubleexported"
+ that is not in this export set, but in multiple other export sets:
+ .*/Tests/RunCMake/export/DependOnDoubleExport-build/exportset.cmake,
+ .*/Tests/RunCMake/export/DependOnDoubleExport-build/manual.cmake.
+
+
+ An exported target cannot depend upon another target which is exported
+ multiple times. Consider consolidating the exports of the "doubleexported"
+ target to a single export.
+
+
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/export/DependOnDoubleExport.cmake b/Tests/RunCMake/export/DependOnDoubleExport.cmake
new file mode 100644
index 000000000..8d108d7ef
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnDoubleExport.cmake
@@ -0,0 +1,7 @@
+add_library(doubleexported INTERFACE)
+install(TARGETS doubleexported EXPORT exportset)
+export(TARGETS doubleexported FILE "${CMAKE_CURRENT_BINARY_DIR}/manual.cmake")
+export(EXPORT exportset FILE "${CMAKE_CURRENT_BINARY_DIR}/exportset.cmake")
+add_library(exported INTERFACE)
+target_link_libraries(exported INTERFACE doubleexported)
+export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")
diff --git a/Tests/RunCMake/export/DependOnNotExport-result.txt b/Tests/RunCMake/export/DependOnNotExport-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnNotExport-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/export/DependOnNotExport-stderr.txt b/Tests/RunCMake/export/DependOnNotExport-stderr.txt
new file mode 100644
index 000000000..80f57584f
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnNotExport-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error in CMakeLists.txt:
+ export called with target "exported" which requires target "notexported"
+ that is not in any export set.
+
+
+CMake Generate step failed. Build files cannot be regenerated correctly.
diff --git a/Tests/RunCMake/export/DependOnNotExport.cmake b/Tests/RunCMake/export/DependOnNotExport.cmake
new file mode 100644
index 000000000..06c1ad951
--- /dev/null
+++ b/Tests/RunCMake/export/DependOnNotExport.cmake
@@ -0,0 +1,4 @@
+add_library(notexported INTERFACE)
+add_library(exported INTERFACE)
+target_link_libraries(exported INTERFACE notexported)
+export(TARGETS exported FILE "${CMAKE_CURRENT_BINARY_DIR}/exports.cmake")
diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake
index 97a0ca6d8..4d2f2171e 100644
--- a/Tests/RunCMake/export/RunCMakeTest.cmake
+++ b/Tests/RunCMake/export/RunCMakeTest.cmake
@@ -10,3 +10,5 @@ run_cmake(ForbiddenToExportInterfaceProperties)
run_cmake(ForbiddenToExportImportedProperties)
run_cmake(ForbiddenToExportPropertyWithGenExp)
run_cmake(ExportPropertiesUndefined)
+run_cmake(DependOnNotExport)
+run_cmake(DependOnDoubleExport)
diff --git a/Tests/RunCMake/find_file/FromPATHEnv-stdout-cygwin.txt b/Tests/RunCMake/find_file/FromPATHEnv-stdout-cygwin.txt
new file mode 100644
index 000000000..6912bdfac
--- /dev/null
+++ b/Tests/RunCMake/find_file/FromPATHEnv-stdout-cygwin.txt
@@ -0,0 +1,9 @@
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
diff --git a/Tests/RunCMake/find_file/FromPATHEnv-stdout-windows.txt b/Tests/RunCMake/find_file/FromPATHEnv-stdout-windows.txt
new file mode 100644
index 000000000..6912bdfac
--- /dev/null
+++ b/Tests/RunCMake/find_file/FromPATHEnv-stdout-windows.txt
@@ -0,0 +1,9 @@
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
diff --git a/Tests/RunCMake/find_file/FromPATHEnv-stdout.txt b/Tests/RunCMake/find_file/FromPATHEnv-stdout.txt
new file mode 100644
index 000000000..27a83ad22
--- /dev/null
+++ b/Tests/RunCMake/find_file/FromPATHEnv-stdout.txt
@@ -0,0 +1,9 @@
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
diff --git a/Tests/RunCMake/find_file/FromPATHEnv.cmake b/Tests/RunCMake/find_file/FromPATHEnv.cmake
new file mode 100644
index 000000000..9f058dd70
--- /dev/null
+++ b/Tests/RunCMake/find_file/FromPATHEnv.cmake
@@ -0,0 +1,24 @@
+set(ENV_PATH "$ENV{PATH}")
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h NO_SYSTEM_ENVIRONMENT_PATH)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_file/FromPrefixPath-stdout.txt b/Tests/RunCMake/find_file/FromPrefixPath-stdout.txt
new file mode 100644
index 000000000..4bd24aa5c
--- /dev/null
+++ b/Tests/RunCMake/find_file/FromPrefixPath-stdout.txt
@@ -0,0 +1,6 @@
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_File='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
+-- PrefixInPATH_File='PrefixInPATH_File-NOTFOUND'
diff --git a/Tests/RunCMake/find_file/FromPrefixPath.cmake b/Tests/RunCMake/find_file/FromPrefixPath.cmake
new file mode 100644
index 000000000..63c6a0791
--- /dev/null
+++ b/Tests/RunCMake/find_file/FromPrefixPath.cmake
@@ -0,0 +1,19 @@
+set(ENV_PATH "$ENV{PATH}")
+set(ENV{PATH} "")
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+
+set(CMAKE_FIND_USE_CMAKE_PATH OFF)
+set(CMAKE_PREFIX_PATH )
+foreach(path "/does_not_exist" "/include" "")
+ unset(PrefixInPATH_File CACHE)
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_file(PrefixInPATH_File NAMES PrefixInPATH.h)
+ message(STATUS "PrefixInPATH_File='${PrefixInPATH_File}'")
+endforeach()
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_file/PrefixInPATH-stdout-cygwin.txt b/Tests/RunCMake/find_file/PrefixInPATH-stdout-cygwin.txt
new file mode 100644
index 000000000..d73bc1dfd
--- /dev/null
+++ b/Tests/RunCMake/find_file/PrefixInPATH-stdout-cygwin.txt
@@ -0,0 +1,4 @@
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
diff --git a/Tests/RunCMake/find_file/PrefixInPATH-stdout-windows.txt b/Tests/RunCMake/find_file/PrefixInPATH-stdout-windows.txt
new file mode 100644
index 000000000..d73bc1dfd
--- /dev/null
+++ b/Tests/RunCMake/find_file/PrefixInPATH-stdout-windows.txt
@@ -0,0 +1,4 @@
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
diff --git a/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt
index d73bc1dfd..947a9003f 100644
--- a/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt
+++ b/Tests/RunCMake/find_file/PrefixInPATH-stdout.txt
@@ -1,4 +1,4 @@
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
--- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
--- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
--- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_file/include/PrefixInPATH.h'
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
diff --git a/Tests/RunCMake/find_file/RunCMakeTest.cmake b/Tests/RunCMake/find_file/RunCMakeTest.cmake
index 5ce96e0e8..9f56a570f 100644
--- a/Tests/RunCMake/find_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_file/RunCMakeTest.cmake
@@ -1,5 +1,5 @@
include(RunCMake)
-if(WIN32 OR CYGWIN)
- run_cmake(PrefixInPATH)
-endif()
+run_cmake(FromPATHEnv)
+run_cmake(FromPrefixPath)
+run_cmake(PrefixInPATH)
diff --git a/Tests/RunCMake/find_library/FromPATHEnv-stdout-cygwin.txt b/Tests/RunCMake/find_library/FromPATHEnv-stdout-cygwin.txt
new file mode 100644
index 000000000..01e272050
--- /dev/null
+++ b/Tests/RunCMake/find_library/FromPATHEnv-stdout-cygwin.txt
@@ -0,0 +1,6 @@
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a'
+-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
diff --git a/Tests/RunCMake/find_library/FromPATHEnv-stdout-windows.txt b/Tests/RunCMake/find_library/FromPATHEnv-stdout-windows.txt
new file mode 100644
index 000000000..01e272050
--- /dev/null
+++ b/Tests/RunCMake/find_library/FromPATHEnv-stdout-windows.txt
@@ -0,0 +1,6 @@
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a'
+-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
diff --git a/Tests/RunCMake/find_library/FromPATHEnv-stdout.txt b/Tests/RunCMake/find_library/FromPATHEnv-stdout.txt
new file mode 100644
index 000000000..4e570a6de
--- /dev/null
+++ b/Tests/RunCMake/find_library/FromPATHEnv-stdout.txt
@@ -0,0 +1,6 @@
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPATHEnv-build/lib/libcreated.a'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
diff --git a/Tests/RunCMake/find_library/FromPATHEnv.cmake b/Tests/RunCMake/find_library/FromPATHEnv.cmake
new file mode 100644
index 000000000..fec041d3e
--- /dev/null
+++ b/Tests/RunCMake/find_library/FromPATHEnv.cmake
@@ -0,0 +1,22 @@
+list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
+list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
+set(ENV_PATH "$ENV{PATH}")
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created")
+
+foreach(path "/does_not_exist" "/lib" "")
+ unset(CREATED_LIBRARY CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}${path}")
+ find_library(CREATED_LIBRARY NAMES created)
+ message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+foreach(path "/does_not_exist" "/lib" "")
+ unset(CREATED_LIBRARY CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_BINARY_DIR}${path}")
+ find_library(CREATED_LIBRARY NAMES created)
+ message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'")
+endforeach()
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_library/FromPrefixPath-stdout.txt b/Tests/RunCMake/find_library/FromPrefixPath-stdout.txt
new file mode 100644
index 000000000..de3df1a22
--- /dev/null
+++ b/Tests/RunCMake/find_library/FromPrefixPath-stdout.txt
@@ -0,0 +1,6 @@
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPrefixPath-build/lib/libcreated.a'
+-- CREATED_LIBRARY='[^']*/Tests/RunCMake/find_library/FromPrefixPath-build/lib/libcreated.a'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
+-- CREATED_LIBRARY='CREATED_LIBRARY-NOTFOUND'
diff --git a/Tests/RunCMake/find_library/FromPrefixPath.cmake b/Tests/RunCMake/find_library/FromPrefixPath.cmake
new file mode 100644
index 000000000..04763a942
--- /dev/null
+++ b/Tests/RunCMake/find_library/FromPrefixPath.cmake
@@ -0,0 +1,24 @@
+list(APPEND CMAKE_FIND_LIBRARY_PREFIXES lib)
+list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES .a)
+set(ENV_PATH "$ENV{PATH}")
+set(ENV{PATH} "")
+file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/lib/libcreated.a" "created")
+
+foreach(path "/does_not_exist" "/lib" "")
+ unset(CREATED_LIBRARY CACHE)
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}${path}")
+ find_library(CREATED_LIBRARY NAMES created)
+ message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'")
+endforeach()
+
+set(CMAKE_FIND_USE_CMAKE_PATH OFF)
+set(CMAKE_PREFIX_PATH )
+foreach(path "/does_not_exist" "/lib" "")
+ unset(CREATED_LIBRARY CACHE)
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_BINARY_DIR}${path}")
+ find_library(CREATED_LIBRARY NAMES created)
+ message(STATUS "CREATED_LIBRARY='${CREATED_LIBRARY}'")
+endforeach()
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_library/PrefixInPATH-stdout-cygwin.txt b/Tests/RunCMake/find_library/PrefixInPATH-stdout-cygwin.txt
new file mode 100644
index 000000000..1ab884cb7
--- /dev/null
+++ b/Tests/RunCMake/find_library/PrefixInPATH-stdout-cygwin.txt
@@ -0,0 +1,4 @@
+-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
+-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
+-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
+-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
diff --git a/Tests/RunCMake/find_library/PrefixInPATH-stdout-windows.txt b/Tests/RunCMake/find_library/PrefixInPATH-stdout-windows.txt
new file mode 100644
index 000000000..1ab884cb7
--- /dev/null
+++ b/Tests/RunCMake/find_library/PrefixInPATH-stdout-windows.txt
@@ -0,0 +1,4 @@
+-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
+-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
+-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
+-- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
diff --git a/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt
index 1ab884cb7..c6ff51374 100644
--- a/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt
+++ b/Tests/RunCMake/find_library/PrefixInPATH-stdout.txt
@@ -1,4 +1,4 @@
-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
--- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
--- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
--- PrefixInPATH_LIBRARY='.*/Tests/RunCMake/find_library/lib/libPrefixInPATH.a'
+-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
+-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
+-- PrefixInPATH_LIBRARY='PrefixInPATH_LIBRARY-NOTFOUND'
diff --git a/Tests/RunCMake/find_library/RunCMakeTest.cmake b/Tests/RunCMake/find_library/RunCMakeTest.cmake
index e7e8db39a..643a5b9b4 100644
--- a/Tests/RunCMake/find_library/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_library/RunCMakeTest.cmake
@@ -1,9 +1,9 @@
include(RunCMake)
run_cmake(Created)
+run_cmake(FromPrefixPath)
+run_cmake(FromPATHEnv)
if(CMAKE_HOST_UNIX)
run_cmake(LibArchLink)
endif()
-if(WIN32 OR CYGWIN)
- run_cmake(PrefixInPATH)
-endif()
+run_cmake(PrefixInPATH)
diff --git a/Tests/RunCMake/find_package/FromPATHEnv-stdout.txt b/Tests/RunCMake/find_package/FromPATHEnv-stdout.txt
new file mode 100644
index 000000000..2ead34911
--- /dev/null
+++ b/Tests/RunCMake/find_package/FromPATHEnv-stdout.txt
@@ -0,0 +1,9 @@
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='1'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
diff --git a/Tests/RunCMake/find_package/FromPATHEnv.cmake b/Tests/RunCMake/find_package/FromPATHEnv.cmake
new file mode 100644
index 000000000..4822b133d
--- /dev/null
+++ b/Tests/RunCMake/find_package/FromPATHEnv.cmake
@@ -0,0 +1,27 @@
+set(ENV_PATH "$ENV{PATH}")
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved NO_SYSTEM_ENVIRONMENT_PATH QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_package/FromPrefixPath-stdout.txt b/Tests/RunCMake/find_package/FromPrefixPath-stdout.txt
new file mode 100644
index 000000000..2ead34911
--- /dev/null
+++ b/Tests/RunCMake/find_package/FromPrefixPath-stdout.txt
@@ -0,0 +1,9 @@
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='1'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
+-- Resolved_FOUND='0'
diff --git a/Tests/RunCMake/find_package/FromPrefixPath.cmake b/Tests/RunCMake/find_package/FromPrefixPath.cmake
new file mode 100644
index 000000000..be853c118
--- /dev/null
+++ b/Tests/RunCMake/find_package/FromPrefixPath.cmake
@@ -0,0 +1,29 @@
+set(ENV_PATH "$ENV{PATH}")
+set(ENV{PATH} "")
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+
+set(CMAKE_FIND_USE_CMAKE_PATH OFF)
+set(CMAKE_PREFIX_PATH )
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+
+set(CMAKE_FIND_USE_CMAKE_PATH ON)
+foreach(path "/does_not_exist" "/PackageRoot" "")
+ unset(Resolved_FOUND CACHE)
+ set(Resolved_DIR "")
+ set(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_package(Resolved NO_CMAKE_PATH QUIET)
+ message(STATUS "Resolved_FOUND='${Resolved_FOUND}'")
+endforeach()
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_package/RunCMakeTest.cmake b/Tests/RunCMake/find_package/RunCMakeTest.cmake
index 066523ec6..208f83c91 100644
--- a/Tests/RunCMake/find_package/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_package/RunCMakeTest.cmake
@@ -3,6 +3,8 @@ include(RunCMake)
run_cmake(CMP0074-WARN)
run_cmake(CMP0074-OLD)
run_cmake(ComponentRequiredAndOptional)
+run_cmake(FromPATHEnv)
+run_cmake(FromPrefixPath)
run_cmake(MissingNormal)
run_cmake(MissingNormalRequired)
run_cmake(MissingNormalVersion)
diff --git a/Tests/RunCMake/find_path/FromPATHEnv-stdout-cygwin.txt b/Tests/RunCMake/find_path/FromPATHEnv-stdout-cygwin.txt
new file mode 100644
index 000000000..8f3e7ca5f
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnv-stdout-cygwin.txt
@@ -0,0 +1,9 @@
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
diff --git a/Tests/RunCMake/find_path/FromPATHEnv-stdout-windows.txt b/Tests/RunCMake/find_path/FromPATHEnv-stdout-windows.txt
new file mode 100644
index 000000000..8f3e7ca5f
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnv-stdout-windows.txt
@@ -0,0 +1,9 @@
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
diff --git a/Tests/RunCMake/find_path/FromPATHEnv-stdout.txt b/Tests/RunCMake/find_path/FromPATHEnv-stdout.txt
new file mode 100644
index 000000000..fd41bf415
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnv-stdout.txt
@@ -0,0 +1,9 @@
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='.*/Tests/RunCMake/find_path/include'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
+-- PATH_IN_ENV_PATH='PATH_IN_ENV_PATH-NOTFOUND'
diff --git a/Tests/RunCMake/find_path/FromPATHEnv.cmake b/Tests/RunCMake/find_path/FromPATHEnv.cmake
new file mode 100644
index 000000000..af13d09fa
--- /dev/null
+++ b/Tests/RunCMake/find_path/FromPATHEnv.cmake
@@ -0,0 +1,25 @@
+set(ENV_PATH "$ENV{PATH}")
+foreach(path "/does_not_exist" "/include" "")
+ unset(PATH_IN_ENV_PATH CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h)
+ message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+foreach(path "/does_not_exist" "/include" "")
+ unset(PATH_IN_ENV_PATH CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h)
+ message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH}'")
+endforeach()
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH ON)
+foreach(path "/does_not_exist" "/include" "")
+ unset(PATH_IN_ENV_PATH CACHE)
+ set(ENV{PATH} "${CMAKE_CURRENT_SOURCE_DIR}${path}")
+ find_path(PATH_IN_ENV_PATH NAMES PrefixInPATH.h NO_SYSTEM_ENVIRONMENT_PATH)
+ message(STATUS "PATH_IN_ENV_PATH='${PATH_IN_ENV_PATH}'")
+endforeach()
+
+set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_path/PrefixInPATH-stdout-cygwin.txt b/Tests/RunCMake/find_path/PrefixInPATH-stdout-cygwin.txt
new file mode 100644
index 000000000..bb2ceb725
--- /dev/null
+++ b/Tests/RunCMake/find_path/PrefixInPATH-stdout-cygwin.txt
@@ -0,0 +1,4 @@
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
diff --git a/Tests/RunCMake/find_path/PrefixInPATH-stdout-windows.txt b/Tests/RunCMake/find_path/PrefixInPATH-stdout-windows.txt
new file mode 100644
index 000000000..bb2ceb725
--- /dev/null
+++ b/Tests/RunCMake/find_path/PrefixInPATH-stdout-windows.txt
@@ -0,0 +1,4 @@
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
+-- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
diff --git a/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt b/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt
index bb2ceb725..947a9003f 100644
--- a/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt
+++ b/Tests/RunCMake/find_path/PrefixInPATH-stdout.txt
@@ -1,4 +1,4 @@
-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
--- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
--- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
--- PrefixInPATH_INCLUDE_DIR='.*/Tests/RunCMake/find_path/include'
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
+-- PrefixInPATH_INCLUDE_DIR='PrefixInPATH_INCLUDE_DIR-NOTFOUND'
diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake
index 3afbedc90..ed55f5107 100644
--- a/Tests/RunCMake/find_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake
@@ -1,9 +1,8 @@
include(RunCMake)
run_cmake(EmptyOldStyle)
-if(WIN32 OR CYGWIN)
- run_cmake(PrefixInPATH)
-endif()
+run_cmake(FromPATHEnv)
+run_cmake(PrefixInPATH)
if(APPLE)
run_cmake(FrameworksWithSubdirs)
diff --git a/Tests/RunCMake/find_program/EnvAndHints-stdout.txt b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt
index 39329b22e..0051636d3 100644
--- a/Tests/RunCMake/find_program/EnvAndHints-stdout.txt
+++ b/Tests/RunCMake/find_program/EnvAndHints-stdout.txt
@@ -1 +1,4 @@
-- PROG='[^']*/Tests/RunCMake/find_program/A/testAandB'
+-- PROG='PROG-NOTFOUND'
+-- PROG='[^']*/Tests/RunCMake/find_program/B/testAandB'
+-- PROG='[^']*/Tests/RunCMake/find_program/A/testAandB'
diff --git a/Tests/RunCMake/find_program/EnvAndHints.cmake b/Tests/RunCMake/find_program/EnvAndHints.cmake
index 14ebd6e2f..0f12effc0 100644
--- a/Tests/RunCMake/find_program/EnvAndHints.cmake
+++ b/Tests/RunCMake/find_program/EnvAndHints.cmake
@@ -1,8 +1,31 @@
+
set(ENV_PATH "$ENV{PATH}")
set(ENV{PATH} ${CMAKE_CURRENT_SOURCE_DIR}/A)
find_program(PROG
NAMES testAandB
+ )
+message(STATUS "PROG='${PROG}'")
+unset(PROG CACHE)
+
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+find_program(PROG
+ NAMES testAandB
+ )
+message(STATUS "PROG='${PROG}'")
+unset(PROG CACHE)
+
+find_program(PROG
+ NAMES testAandB
+ HINTS ${CMAKE_CURRENT_SOURCE_DIR}/B ${CMAKE_CURRENT_SOURCE_DIR}/A
+ )
+message(STATUS "PROG='${PROG}'")
+unset(PROG CACHE)
+set(ENV{PATH} "${ENV_PATH}")
+
+find_program(PROG
+ NAMES testAandB
HINTS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B
)
message(STATUS "PROG='${PROG}'")
+unset(PROG CACHE)
set(ENV{PATH} "${ENV_PATH}")
diff --git a/Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt b/Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt
index cb3c99f5e..d2312e7af 100644
--- a/Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt
+++ b/Tests/RunCMake/find_program/RelAndAbsPath-stdout.txt
@@ -1,6 +1,8 @@
-- PROG_ABS='PROG_ABS-NOTFOUND'
-- PROG_ABS_NPD='PROG_ABS_NPD-NOTFOUND'
-- PROG_CWD='PROG_CWD-NOTFOUND'
+-- PROG_CWD='PROG_CWD-NOTFOUND'
+-- PROG_CWD='[^']*/Tests/RunCMake/find_program/testCWD'
-- PROG_CWD_NPD='PROG_CWD_NPD-NOTFOUND'
-- PROG_CWD_DOT='[^']*/Tests/RunCMake/find_program/testCWD'
-- PROG_CWD_DOT_NPD='[^']*/Tests/RunCMake/find_program/testCWD'
diff --git a/Tests/RunCMake/find_program/RelAndAbsPath.cmake b/Tests/RunCMake/find_program/RelAndAbsPath.cmake
index 9a42c5e17..6b61980f3 100644
--- a/Tests/RunCMake/find_program/RelAndAbsPath.cmake
+++ b/Tests/RunCMake/find_program/RelAndAbsPath.cmake
@@ -10,7 +10,6 @@ endfunction()
strip_windows_path_prefix("${CMAKE_CURRENT_SOURCE_DIR}" srcdir)
-file(MAKE_DIRECTORY "tmp${srcdir}")
configure_file(testCWD "tmp${srcdir}/testNoSuchFile" COPYONLY)
find_program(PROG_ABS
@@ -38,6 +37,28 @@ find_program(PROG_CWD
)
message(STATUS "PROG_CWD='${PROG_CWD}'")
+
+set(CMAKE_PREFIX_PATH ".")
+# On some platforms / dashboards the current working
+# directory can be in PATH or other search locations
+# so disable all searching to make sure this fails
+set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF)
+set(CMAKE_FIND_USE_CMAKE_PATH OFF)
+set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH OFF)
+set(CMAKE_FIND_USE_PACKAGE_ROOT_PATH OFF)
+set(CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH OFF)
+find_program(PROG_CWD
+ NAMES testCWD
+ )
+message(STATUS "PROG_CWD='${PROG_CWD}'")
+
+set(CMAKE_PREFIX_PATH ".")
+set(CMAKE_FIND_USE_CMAKE_PATH ON)
+find_program(PROG_CWD
+ NAMES testCWD
+ )
+message(STATUS "PROG_CWD='${PROG_CWD}'")
+
find_program(PROG_CWD_NPD
NAMES testCWD
NAMES_PER_DIR
diff --git a/Tests/RunCMake/install/CMakeLists.txt b/Tests/RunCMake/install/CMakeLists.txt
index 6dd8cdf55..c7e99ada4 100644
--- a/Tests/RunCMake/install/CMakeLists.txt
+++ b/Tests/RunCMake/install/CMakeLists.txt
@@ -1,3 +1,6 @@
cmake_minimum_required(VERSION 3.4)
+if(RunCMake_TEST MATCHES "^file-GET_RUNTIME_DEPENDENCIES")
+ cmake_policy(SET CMP0087 NEW)
+endif()
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index c637db151..21c320b04 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -48,6 +48,22 @@ in directory:
endif()
endfunction()
+# Wrapper for run_cmake() that skips platforms that are non-ELF or have no RPATH support
+function(run_cmake_ELFRPATH_only case)
+ if(UNIX AND CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG AND CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
+ run_cmake(${case})
+ else()
+ # Sanity check against a platform known to be ELF-based
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ message(FATAL_ERROR "Expected platform Linux to advertize itself as ELF-based, but it did not.")
+ else()
+ message(STATUS "${case} - SKIPPED (No ELF-based platform found)")
+ endif()
+ endif()
+endfunction()
+
+run_cmake(TARGETS-FILE_RPATH_CHANGE-old_rpath)
+run_cmake_ELFRPATH_only(TARGETS-FILE_RPATH_CHANGE-new_rpath)
run_cmake(DIRECTORY-MESSAGE_NEVER)
run_cmake(DIRECTORY-PATTERN-MESSAGE_NEVER)
run_cmake(DIRECTORY-message)
@@ -139,6 +155,36 @@ run_install_test(FILES-PERMISSIONS)
run_install_test(TARGETS-RPATH)
run_install_test(InstallRequiredSystemLibraries)
+if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos)
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-unresolved)
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-conflict)
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-macos-notfile)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-project)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2)
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows)
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-unresolved)
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-conflict)
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-windows-notfile)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-project)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2)
+elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ if(NOT CMAKE_C_COMPILER_ID MATCHES "^XL")
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux)
+ endif()
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-unresolved)
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-conflict)
+ run_install_test(file-GET_RUNTIME_DEPENDENCIES-linux-notfile)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-project)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs1)
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-badargs2)
+else()
+ run_cmake(file-GET_RUNTIME_DEPENDENCIES-unsupported)
+endif()
+
set(run_install_test_components 1)
run_install_test(FILES-EXCLUDE_FROM_ALL)
run_install_test(TARGETS-EXCLUDE_FROM_ALL)
diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake
new file mode 100644
index 000000000..673fdde19
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-check-common.cmake
@@ -0,0 +1,30 @@
+file(READ ${RunCMake_TEST_BINARY_DIR}/cmake_install.cmake install_script)
+#message(STATUS ${install_script})
+
+set(wsnl " *[\n\r]+ *") # whitespace + single newline + whitespace
+set(wssl " *[\n\r]+[^\n\r]*[\n\r]+ *") # ws nl skipline nl ws
+string(CONCAT prefix [[file\(RPATH_CHANGE]])
+set(_msg "cmake_install.cmake does not match ")
+
+macro(check)
+ if(NOT install_script MATCHES "${regex}")
+ message(STATUS "${test} - check \"${target}\" - FAILED:")
+ string(CONCAT RunCMake_TEST_FAILED "${_msg}" ">>>${regex}<<<")
+ return()
+ else()
+ message(STATUS "${test} - check \"${target}\" - PASSED")
+ endif()
+endmacro()
+
+macro(skip_without_rpath_change_rule)
+# Not all platforms generate a file(RPATH_CHANGE) rule
+ if(NOT install_script MATCHES [[file\(RPATH_CHANGE]])
+ # Sanity check against a platform known to generate a file(RPATH_CHANGE) rule
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ message(FATAL_ERROR "Expected generated file(RPATH_CHANGE) rule on platform Linux.")
+ else()
+ message(STATUS "${test} - All checks skipped. No file(RPATH_CHANGE) rule found on this platform.")
+ return()
+ endif()
+ endif()
+endmacro()
diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake
new file mode 100644
index 000000000..930ef7044
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-check.cmake
@@ -0,0 +1,63 @@
+include(${RunCMake_SOURCE_DIR}/TARGETS-FILE_RPATH_CHANGE-check-common.cmake)
+skip_without_rpath_change_rule()
+string(APPEND prefix "${wsnl}" [[FILE "[^"]*/]])
+
+set(target "exe1_cmp0095_old")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "/foo/bar]])
+check()
+
+set(target "exe1_cmp0095_warn")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "/foo/bar]])
+check()
+
+set(target "exe1_cmp0095_new")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "/foo/bar]])
+check()
+
+set(target "exe2_cmp0095_old")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "\$ORIGIN/../lib]])
+check()
+
+set(target "exe2_cmp0095_warn")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "\$ORIGIN/../lib]])
+check()
+
+set(target "exe2_cmp0095_new")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "\\\$ORIGIN/../lib]])
+check()
+
+set(target "exe3_cmp0095_old")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "\${ORIGIN}/../lib]])
+check()
+
+set(target "exe3_cmp0095_warn")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "\${ORIGIN}/../lib]])
+check()
+
+set(target "exe3_cmp0095_new")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "\\\${ORIGIN}/../lib]])
+check()
+
+set(target "exe4_cmp0095_old")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "/foo/bar/\${PLATFORM}]])
+check()
+
+set(target "exe4_cmp0095_warn")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "/foo/bar/\${PLATFORM}]])
+check()
+
+set(target "exe4_cmp0095_new")
+string(CONCAT regex "${prefix}${target}\"${wssl}"
+ [[NEW_RPATH "/foo/bar/\\\${PLATFORM}]])
+check()
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
new file mode 100644
index 000000000..1e123f6e5
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath-stderr.txt
@@ -0,0 +1,23 @@
+^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
+ suppress this warning\.
+
+ RPATH entries for target 'exe3_cmp0095_warn' will not be escaped in the
+ 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\.
+
+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
+ suppress this warning\.
+
+ RPATH entries for target 'exe4_cmp0095_warn' will not be escaped in the
+ 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\.$
diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake
new file mode 100644
index 000000000..cba04b266
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-new_rpath.cmake
@@ -0,0 +1,72 @@
+cmake_minimum_required(VERSION 3.14)
+enable_language(C)
+
+# test matrix
+#
+# A :=
+# | no cmake syntax | cmake syntax |
+# -----------------------+-----------------+--------------+
+# absolute install RPATH | exe1 | exe4 |
+# relative install RPATH | exe2 | exe3 |
+#
+# all := A * CMP005_OLD + A * CMP0095_WARN + A * CMP0095_NEW
+
+add_library(utils SHARED obj1.c)
+set(targets utils)
+
+set(exe1_install_rpath "/foo/bar")
+set(exe2_install_rpath "\$ORIGIN/../lib")
+set(exe3_install_rpath "\${ORIGIN}/../lib")
+set(exe4_install_rpath "/foo/bar/\${PLATFORM}")
+
+macro(A_CMP0095 policy_value)
+ cmake_policy(PUSH)
+ if(NOT "x${policy_value}x" STREQUAL "xWARNx")
+ cmake_policy(SET CMP0095 ${policy_value})
+ endif()
+ string(TOLOWER "${policy_value}" p)
+
+ # exe1: absolute install RPATH, no cmake syntax
+ set(case "exe1")
+ set(target "${case}_cmp0095_${p}")
+ list(APPEND targets ${target})
+ add_executable(${target} main.c)
+ target_link_libraries(${target} PRIVATE utils)
+ set_target_properties(${target} PROPERTIES
+ INSTALL_RPATH "${${case}_install_rpath}")
+
+ # exe2: relative install RPATH, no cmake syntax
+ set(case "exe2")
+ set(target "${case}_cmp0095_${p}")
+ list(APPEND targets ${target})
+ add_executable(${target} main.c)
+ target_link_libraries(${target} PRIVATE utils)
+ set_target_properties(${target} PROPERTIES
+ INSTALL_RPATH "${${case}_install_rpath}")
+
+ # exe3: relative install RPATH, cmake syntax
+ set(case "exe3")
+ set(target "${case}_cmp0095_${p}")
+ list(APPEND targets ${target})
+ add_executable(${target} main.c)
+ target_link_libraries(${target} PRIVATE utils)
+ set_target_properties(${target} PROPERTIES
+ INSTALL_RPATH "${${case}_install_rpath}")
+
+ # exe4: absolute install RPATH, cmake syntax
+ set(case "exe4")
+ set(target "${case}_cmp0095_${p}")
+ list(APPEND targets ${target})
+ add_executable(${target} main.c)
+ target_link_libraries(${target} PRIVATE utils)
+ set_target_properties(${target} PROPERTIES
+ INSTALL_RPATH "${${case}_install_rpath}")
+
+ cmake_policy(POP)
+endmacro()
+
+A_CMP0095("OLD")
+A_CMP0095("WARN") # exe3 and exe4 are expected to issue an author warning
+A_CMP0095("NEW")
+
+install(TARGETS ${targets})
diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake
new file mode 100644
index 000000000..814f405a9
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake
@@ -0,0 +1,15 @@
+include(${RunCMake_SOURCE_DIR}/TARGETS-FILE_RPATH_CHANGE-check-common.cmake)
+skip_without_rpath_change_rule()
+string(APPEND prefix "${wsnl}" [[FILE "[^"]*/]])
+
+set(target "exe1")
+string(CONCAT regex "${prefix}${target}\"${wsnl}"
+ [[OLD_RPATH "]] "${RunCMake_BINARY_DIR}")
+check()
+
+if("x${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN}" STREQUAL "x\$ORIGIN")
+ set(target "exe2")
+ string(CONCAT regex "${prefix}${target}\"${wsnl}"
+ [[OLD_RPATH "\\\$ORIGIN]])
+ check()
+endif()
diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake
new file mode 100644
index 000000000..43ae78708
--- /dev/null
+++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath.cmake
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 3.14)
+enable_language(C)
+
+add_library(utils SHARED obj1.c)
+
+# exe1: absolute build RPATH, no cmake syntax
+set(CMAKE_BUILD_RPATH_USE_ORIGIN OFF)
+set(CMAKE_INSTALL_RPATH "/foo/bar")
+add_executable(exe1 main.c)
+target_link_libraries(exe1 PRIVATE utils)
+
+# exe2: relative build RPATH, no cmake syntax
+set(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
+set(CMAKE_INSTALL_RPATH "/foo/bar")
+add_executable(exe2 main.c)
+target_link_libraries(exe2 PRIVATE utils)
+
+install(TARGETS utils exe1 exe2)
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt
new file mode 100644
index 000000000..b66d1fe5b
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1-stderr.txt
@@ -0,0 +1,18 @@
+^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\):
+ You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
+ probably not what you intended to do\. Instead, please consider using it in
+ an install\(CODE\) or install\(SCRIPT\) command\. For example:
+
+ install\(CODE \[\[
+ file\(GET_RUNTIME_DEPENDENCIES
+ # \.\.\.
+ \)
+ ]]\)
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
+
+CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs1\.cmake:[0-9]+ \(file\):
+ file Unrecognized argument: "invalid"
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake
new file mode 100644
index 000000000..f3b8ce472
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs1.cmake
@@ -0,0 +1,2 @@
+file(GET_RUNTIME_DEPENDENCIES invalid)
+message(FATAL_ERROR "This message should not be displayed")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt
new file mode 100644
index 000000000..94f0f4610
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2-stderr.txt
@@ -0,0 +1,18 @@
+^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\):
+ You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
+ probably not what you intended to do\. Instead, please consider using it in
+ an install\(CODE\) or install\(SCRIPT\) command\. For example:
+
+ install\(CODE \[\[
+ file\(GET_RUNTIME_DEPENDENCIES
+ # \.\.\.
+ \)
+ ]]\)
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.
+
+CMake Error at file-GET_RUNTIME_DEPENDENCIES-badargs2\.cmake:[0-9]+ \(file\):
+ file Keyword missing value: BUNDLE_EXECUTABLE
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake
new file mode 100644
index 000000000..138ab959b
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-badargs2.cmake
@@ -0,0 +1,2 @@
+file(GET_RUNTIME_DEPENDENCIES BUNDLE_EXECUTABLE)
+message(FATAL_ERROR "This message should not be displayed")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake
new file mode 100644
index 000000000..ab630f0ac
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-check.cmake
@@ -0,0 +1,44 @@
+function(check_contents filename contents_regex)
+ if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
+ file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
+ if(NOT contents MATCHES "${contents_regex}")
+ string(APPEND RunCMake_TEST_FAILED "File contents:
+ ${contents}
+do not match what we expected:
+ ${contents_regex}
+in file:
+ ${CMAKE_INSTALL_PREFIX}/${filename}\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+set(_check
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_rpath\.so]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/libtest_runpath\.so]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath/librpath\.so]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_parent/librpath_parent\.so]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search/librpath_search\.so]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath/librunpath\.so]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search/librunpath_search\.so]]
+ )
+check_contents(deps/deps1.txt "^${_check}$")
+check_contents(deps/deps2.txt "^${_check}$")
+check_contents(deps/deps3.txt "^${_check}$")
+set(_check
+ [[librpath_unresolved\.so]]
+ [[librunpath_parent_unresolved\.so]]
+ [[librunpath_unresolved\.so]]
+ )
+check_contents(deps/udeps1.txt "^${_check}$")
+check_contents(deps/udeps2.txt "^${_check}$")
+check_contents(deps/udeps3.txt "^${_check}$")
+set(_check
+ "^libconflict\\.so:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict/libconflict\\.so;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/conflict2/libconflict\\.so\n$"
+ )
+check_contents(deps/cdeps1.txt "${_check}")
+check_contents(deps/cdeps2.txt "${_check}")
+check_contents(deps/cdeps3.txt "${_check}")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt
new file mode 100644
index 000000000..123ae48ab
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-all-stderr.txt
@@ -0,0 +1,119 @@
+^CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/rpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search_postexcluded\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search_postexcluded
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)
+
+*CMake Warning at cmake_install\.cmake:[0-9]+ \(file\):
+ Dependency librunpath_search\.so found in search directory:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-build/root-all/lib/runpath_search
+
+ See file\(GET_RUNTIME_DEPENDENCIES\) documentation for more information\.
+Call Stack \(most recent call first\):
+ cmake_install\.cmake:[0-9]+ \(exec_get_runtime_dependencies\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt
new file mode 100644
index 000000000..1692348f4
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-all-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Multiple conflicting paths found for librpath\.so:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath1/librpath\.so
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict-build/root-all/lib/rpath2/librpath\.so$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake
new file mode 100644
index 000000000..f7194995d
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-conflict.cmake
@@ -0,0 +1,54 @@
+enable_language(C)
+
+set(test1_names rpath)
+set(test2_names rpath)
+
+file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n")
+add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c")
+install(TARGETS rpath DESTINATION lib/rpath1)
+install(TARGETS rpath DESTINATION lib/rpath2)
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test1.c")
+add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c")
+foreach(name ${test1_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n")
+foreach(name ${test1_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n")
+
+target_link_libraries(test1 PRIVATE ${test1_names})
+set_property(TARGET test1 PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath1"
+ )
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test2.c")
+add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c")
+foreach(name ${test2_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n")
+foreach(name ${test2_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n")
+
+target_link_libraries(test2 PRIVATE ${test2_names})
+set_property(TARGET test2 PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath2"
+ )
+
+install(TARGETS test1 test2 DESTINATION lib)
+
+install(CODE [[
+ file(GET_RUNTIME_DEPENDENCIES
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:test1>"
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:test2>"
+ PRE_INCLUDE_REGEXES "^librpath\\.so$"
+ PRE_EXCLUDE_REGEXES ".*"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt
new file mode 100644
index 000000000..83a87c9c5
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-all-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Failed to run objdump on:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile-build/root-all/bin/\.\./lib/libtest\.so$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake
new file mode 100644
index 000000000..6567438a2
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-notfile.cmake
@@ -0,0 +1,30 @@
+enable_language(C)
+cmake_policy(SET CMP0095 NEW)
+
+file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n")
+file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void);
+
+int main(void)
+{
+ test();
+ return 0;
+}
+]])
+
+add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c")
+add_executable(exe "${CMAKE_BINARY_DIR}/main.c")
+target_link_libraries(exe PRIVATE test)
+set_property(TARGET exe PROPERTY INSTALL_RPATH "\${ORIGIN}/../lib")
+
+install(TARGETS exe DESTINATION bin)
+
+install(CODE [[
+ file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:test>")
+ file(GET_RUNTIME_DEPENDENCIES
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:exe>"
+ PRE_INCLUDE_REGEXES "^libtest\\.so$"
+ PRE_EXCLUDE_REGEXES ".*"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt
new file mode 100644
index 000000000..eaca5121b
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved-all-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Could not resolve file libunresolved\.so$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake
new file mode 100644
index 000000000..3efa305be
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux-unresolved.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n")
+add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
+file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n")
+add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c")
+target_link_libraries(testlib PRIVATE unresolved)
+install(TARGETS testlib DESTINATION lib)
+
+install(CODE [[
+ file(GET_RUNTIME_DEPENDENCIES
+ PRE_INCLUDE_REGEXES "^libunresolved\\.so$"
+ PRE_EXCLUDE_REGEXES ".*"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:testlib>"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake
new file mode 100644
index 000000000..bd0f9f169
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux.cmake
@@ -0,0 +1,169 @@
+enable_language(C)
+cmake_policy(SET CMP0095 NEW)
+
+set(test_rpath_names
+ preexcluded
+ rpath_postexcluded
+ rpath
+ rpath_parent_postexcluded
+ rpath_parent
+ rpath_origin_postexcluded
+ rpath_origin
+ rpath_search_postexcluded
+ rpath_search
+ rpath_unresolved
+ conflict
+ )
+set(test_runpath_names
+ runpath_postexcluded
+ runpath
+ runpath_origin_postexcluded
+ runpath_origin
+ runpath_parent_unresolved
+ runpath_search_postexcluded
+ runpath_search
+ runpath_unresolved
+ )
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test_rpath.c")
+add_library(test_rpath SHARED "${CMAKE_BINARY_DIR}/test_rpath.c")
+foreach(name ${test_rpath_names})
+ file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
+ add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
+
+ file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "void test_rpath(void)\n{\n")
+foreach(name ${test_rpath_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test_rpath.c" "}\n")
+
+install(TARGETS rpath_postexcluded DESTINATION lib/rpath_postexcluded)
+install(TARGETS rpath DESTINATION lib/rpath)
+install(TARGETS rpath_origin_postexcluded DESTINATION lib/rpath_origin_postexcluded)
+install(TARGETS rpath_origin DESTINATION lib/rpath_origin)
+install(TARGETS rpath_parent_postexcluded DESTINATION lib/rpath_parent_postexcluded)
+install(TARGETS rpath rpath_origin rpath_parent DESTINATION lib/rpath_parent)
+install(TARGETS rpath_search_postexcluded DESTINATION lib/rpath_search_postexcluded)
+install(TARGETS rpath rpath_origin rpath_parent rpath_search DESTINATION lib/rpath_search)
+install(TARGETS conflict DESTINATION lib/conflict)
+
+target_link_libraries(test_rpath PRIVATE ${test_rpath_names})
+set_property(TARGET test_rpath PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath_postexcluded"
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath"
+ "\$ORIGIN/rpath_origin_postexcluded"
+ "\${ORIGIN}/rpath_origin"
+ "${CMAKE_BINARY_DIR}/root-all/lib/conflict"
+ )
+target_link_options(test_rpath PRIVATE -Wl,--disable-new-dtags)
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test_runpath.c")
+add_library(test_runpath SHARED "${CMAKE_BINARY_DIR}/test_runpath.c")
+foreach(name ${test_runpath_names} rpath conflict)
+ file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
+ if(NOT name MATCHES "^(rpath|conflict)$")
+ add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
+ endif()
+
+ file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "void test_runpath(void)\n{\n")
+foreach(name ${test_runpath_names} rpath conflict)
+ file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test_runpath.c" "}\n")
+
+install(TARGETS runpath_postexcluded DESTINATION lib/runpath_postexcluded)
+install(TARGETS runpath DESTINATION lib/runpath)
+install(TARGETS runpath_origin_postexcluded DESTINATION lib/runpath_origin_postexcluded)
+install(TARGETS runpath_origin DESTINATION lib/runpath_origin)
+install(TARGETS runpath_parent_unresolved DESTINATION lib/runpath_parent_unresolved)
+install(TARGETS runpath_search_postexcluded DESTINATION lib/runpath_search_postexcluded)
+install(TARGETS runpath runpath_origin runpath_search DESTINATION lib/runpath_search)
+install(TARGETS conflict DESTINATION lib/conflict2)
+
+target_link_libraries(test_runpath PRIVATE ${test_runpath_names} rpath conflict)
+set_property(TARGET test_runpath PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib/runpath/../rpath" # Ensure that files that don't conflict are treated correctly
+ "${CMAKE_BINARY_DIR}/root-all/lib/runpath_postexcluded"
+ "${CMAKE_BINARY_DIR}/root-all/lib/runpath"
+ "\${ORIGIN}/runpath_origin_postexcluded"
+ "\$ORIGIN/runpath_origin"
+ "${CMAKE_BINARY_DIR}/root-all/lib/conflict2"
+ )
+target_link_options(test_runpath PRIVATE -Wl,--enable-new-dtags)
+
+set_property(TARGET test_rpath ${test_rpath_names} test_runpath ${test_runpath_names} PROPERTY LIBRARY_OUTPUT_DIRECTORY lib)
+install(TARGETS test_rpath test_runpath DESTINATION lib)
+
+add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c)
+add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c)
+add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c)
+target_link_libraries(topexe PRIVATE test_rpath test_runpath)
+target_link_libraries(toplib PRIVATE test_rpath test_runpath)
+target_link_libraries(topmod PRIVATE test_rpath test_runpath)
+set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib"
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent_postexcluded"
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath_parent"
+ "${CMAKE_BINARY_DIR}/root-all/lib/runpath_parent_unresolved"
+ )
+target_link_options(topexe PRIVATE -Wl,--disable-new-dtags)
+target_link_options(toplib PRIVATE -Wl,--disable-new-dtags)
+target_link_options(topmod PRIVATE -Wl,--disable-new-dtags)
+
+install(TARGETS topexe toplib RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
+install(TARGETS topmod LIBRARY DESTINATION lib/modules)
+
+install(CODE [[
+ function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
+ file(GET_RUNTIME_DEPENDENCIES
+ RESOLVED_DEPENDENCIES_VAR deps
+ UNRESOLVED_DEPENDENCIES_VAR udeps
+ CONFLICTING_DEPENDENCIES_PREFIX cdeps
+ PRE_INCLUDE_REGEXES
+ "^lib(test_rpath|rpath_postexcluded|rpath|rpath_parent_postexcluded|rpath_parent|rpath_origin_postexcluded|rpath_origin|rpath_search_postexcluded|rpath_search|rpath_unresolved|test_runpath|runpath_postexcluded|runpath|runpath_origin_postexcluded|runpath_origin|runpath_parent_unresolved|runpath_search_postexcluded|runpath_search|runpath_unresolved|conflict)\\.so$"
+ "^libc\\.so"
+ PRE_EXCLUDE_REGEXES ".*"
+ POST_INCLUDE_REGEXES "^.*/(libtest_rpath|rpath/librpath|rpath_parent/librpath_parent|rpath_search/librpath_search|libtest_runpath|runpath/librunpath|runpath_origin_postexcluded|runpath_origin|runpath_search/librunpath_search|conflict2?/libconflict)\\.so$"
+ POST_EXCLUDE_REGEXES ".*"
+ DIRECTORIES
+ "${CMAKE_INSTALL_PREFIX}/lib/rpath_search_postexcluded"
+ "${CMAKE_INSTALL_PREFIX}/lib/rpath_search"
+ "${CMAKE_INSTALL_PREFIX}/lib/runpath_search_postexcluded"
+ "${CMAKE_INSTALL_PREFIX}/lib/runpath_search"
+ ${ARGN}
+ )
+ list(SORT deps)
+ list(SORT udeps)
+ list(SORT cdeps_FILENAMES)
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
+ foreach(cdep IN LISTS cdeps_FILENAMES)
+ set(cdep_values ${cdeps_${cdep}})
+ list(SORT cdep_values)
+ file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
+ endforeach()
+ endfunction()
+
+ exec_get_runtime_dependencies(
+ deps1.txt udeps1.txt cdeps1.txt
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topexe>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps2.txt udeps2.txt cdeps2.txt
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:toplib>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps3.txt udeps3.txt cdeps3.txt
+ MODULES
+ "${CMAKE_INSTALL_PREFIX}/lib/modules/$<TARGET_FILE_NAME:topmod>"
+ )
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c
new file mode 100644
index 000000000..d196afe0d
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/topexe.c
@@ -0,0 +1,9 @@
+extern void test_rpath(void);
+extern void test_runpath(void);
+
+int main(void)
+{
+ test_rpath();
+ test_runpath();
+ return 0;
+}
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c
new file mode 100644
index 000000000..040e59191
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-linux/toplib.c
@@ -0,0 +1,8 @@
+extern void test_rpath(void);
+extern void test_runpath(void);
+
+void toplib(void)
+{
+ test_rpath();
+ test_runpath();
+}
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake
new file mode 100644
index 000000000..4d6dde12d
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-all-check.cmake
@@ -0,0 +1,157 @@
+function(check_contents filename contents_regex)
+ if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
+ file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
+ if(NOT contents MATCHES "${contents_regex}")
+ string(APPEND RunCMake_TEST_FAILED "File contents:
+ ${contents}
+do not match what we expected:
+ ${contents_regex}
+in file:
+ ${CMAKE_INSTALL_PREFIX}/${filename}\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+set(_check
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ [[/usr/lib/libSystem\.B\.dylib]]
+ )
+check_contents(deps/deps1.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps1.txt "^${_check}$")
+
+set(_check
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ [[/usr/lib/libSystem\.B\.dylib]]
+ )
+check_contents(deps/deps2.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
+ [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_executable_path_postexcluded\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps2.txt "^${_check}$")
+
+set(_check
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ [[/usr/lib/libSystem\.B\.dylib]]
+ )
+check_contents(deps/deps3.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
+ [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[@executable_path/../lib/executable_path_postexcluded/libexecutable_path_postexcluded\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_executable_path_postexcluded\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps3.txt "^${_check}$")
+
+set(_check
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/executable_path/libexecutable_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/bin/../lib/rpath_executable_path/librpath_executable_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ [[/usr/lib/libSystem\.B\.dylib]]
+ )
+check_contents(deps/deps4.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps4.txt "^${_check}$")
+
+set(_check
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ [[/usr/lib/libSystem\.B\.dylib]]
+ )
+check_contents(deps/deps5.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps5.txt "^${_check}$")
+
+set(_check
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/bundle_executable/bin/../lib/executable_path_bundle/libexecutable_path_bundle\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/libtestlib\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/loader_path/libloader_path\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/../rpath/librpath\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/normal/libnormal\.dylib]]
+ [[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/rpath_loader_path/librpath_loader_path\.dylib]]
+ [[/usr/lib/libSystem\.B\.dylib]]
+ )
+check_contents(deps/deps6.txt "^${_check}$")
+
+set(_check
+ [[@executable_path/../lib/executable_path/libexecutable_path\.dylib]]
+ [[@loader_path/loader_path_unresolved/libloader_path_unresolved\.dylib]]
+ [[@rpath/librpath_executable_path\.dylib]]
+ [[@rpath/librpath_executable_path_bundle\.dylib]]
+ [[@rpath/librpath_loader_path_unresolved\.dylib]]
+ [[@rpath/librpath_unresolved\.dylib]]
+ )
+check_contents(deps/udeps6.txt "^${_check}$")
+
+set(_check
+ "^libconflict\\.dylib:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict/libconflict\\.dylib;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-build/root-all/executable/lib/conflict2/libconflict\\.dylib\n$"
+ )
+check_contents(deps/cdeps1.txt "${_check}")
+check_contents(deps/cdeps2.txt "${_check}")
+check_contents(deps/cdeps3.txt "${_check}")
+check_contents(deps/cdeps4.txt "${_check}")
+check_contents(deps/cdeps5.txt "${_check}")
+check_contents(deps/cdeps6.txt "${_check}")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt
new file mode 100644
index 000000000..bc9e97a82
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-all-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Multiple conflicting paths found for librpath\.dylib:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath1/librpath\.dylib
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict-build/root-all/lib/rpath2/librpath\.dylib$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake
new file mode 100644
index 000000000..a8446fe2d
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-conflict.cmake
@@ -0,0 +1,55 @@
+enable_language(C)
+
+set(test1_names rpath)
+set(test2_names rpath)
+
+file(WRITE "${CMAKE_BINARY_DIR}/rpath.c" "void rpath(void) {}\n")
+add_library(rpath SHARED "${CMAKE_BINARY_DIR}/rpath.c")
+set_property(TARGET rpath PROPERTY INSTALL_NAME_DIR @rpath)
+install(TARGETS rpath DESTINATION lib/rpath1)
+install(TARGETS rpath DESTINATION lib/rpath2)
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test1.c")
+add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c")
+foreach(name ${test1_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "void test1(void)\n{\n")
+foreach(name ${test1_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n")
+
+target_link_libraries(test1 PRIVATE ${test1_names})
+set_property(TARGET test1 PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath1"
+ )
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test2.c")
+add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c")
+foreach(name ${test2_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "void test2(void)\n{\n")
+foreach(name ${test2_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n")
+
+target_link_libraries(test2 PRIVATE ${test2_names})
+set_property(TARGET test2 PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/lib/rpath2"
+ )
+
+install(TARGETS test1 test2 DESTINATION lib)
+
+install(CODE [[
+ file(GET_RUNTIME_DEPENDENCIES
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:test1>"
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:test2>"
+ PRE_INCLUDE_REGEXES "^@rpath/librpath\\.dylib$"
+ PRE_EXCLUDE_REGEXES ".*"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt
new file mode 100644
index 000000000..73ab9f1c5
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-all-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Failed to run otool on:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile-build/root-all/bin/\.\./lib/libtest\.dylib$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake
new file mode 100644
index 000000000..3e4c43423
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-notfile.cmake
@@ -0,0 +1,30 @@
+enable_language(C)
+
+file(WRITE "${CMAKE_BINARY_DIR}/test.c" "void test(void) {}\n")
+file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[extern void test(void);
+
+int main(void)
+{
+ test();
+ return 0;
+}
+]])
+
+add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c")
+set_property(TARGET test PROPERTY INSTALL_NAME_DIR @rpath)
+add_executable(exe "${CMAKE_BINARY_DIR}/main.c")
+target_link_libraries(exe PRIVATE test)
+set_property(TARGET exe PROPERTY INSTALL_RPATH "@loader_path/../lib")
+
+install(TARGETS exe DESTINATION bin)
+
+install(CODE [[
+ file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:test>")
+ file(GET_RUNTIME_DEPENDENCIES
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:exe>"
+ PRE_INCLUDE_REGEXES "^@rpath/libtest\\.dylib$"
+ PRE_EXCLUDE_REGEXES ".*"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt
new file mode 100644
index 000000000..01762b45f
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved-all-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Could not resolve file @rpath/libunresolved\.dylib$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake
new file mode 100644
index 000000000..c9b6c9559
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos-unresolved.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "extern void unresolved(void);\nvoid testlib(void)\n{\n unresolved();\n}\n")
+add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
+file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "void unresolved(void) {}\n")
+add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c")
+target_link_libraries(testlib PRIVATE unresolved)
+install(TARGETS testlib DESTINATION lib)
+
+install(CODE [[
+ file(GET_RUNTIME_DEPENDENCIES
+ PRE_INCLUDE_REGEXES "^@rpath/libunresolved\\.dylib$"
+ PRE_EXCLUDE_REGEXES ".*"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:testlib>"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake
new file mode 100644
index 000000000..6db05b3ff
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos.cmake
@@ -0,0 +1,216 @@
+enable_language(C)
+
+set(testlib_names
+ preexcluded
+ executable_path
+ executable_path_bundle
+ executable_path_postexcluded
+ loader_path
+ loader_path_unresolved
+ loader_path_postexcluded
+ rpath
+ rpath_unresolved
+ rpath_postexcluded
+ rpath_executable_path
+ rpath_executable_path_bundle
+ rpath_executable_path_postexcluded
+ rpath_loader_path
+ rpath_loader_path_unresolved
+ rpath_loader_path_postexcluded
+ normal
+ normal_unresolved
+ normal_postexcluded
+ conflict
+ )
+
+file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c")
+add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
+foreach(name ${testlib_names})
+ if(name STREQUAL "normal")
+ file(WRITE "${CMAKE_BINARY_DIR}/normal.c" "extern void rpath(void);\nvoid normal(void)\n{\n rpath();\n}\n")
+ else()
+ file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "void ${name}(void) {}\n")
+ endif()
+ add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
+
+ file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "void testlib(void)\n{\n")
+foreach(name ${testlib_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n")
+set_property(TARGET ${testlib_names} PROPERTY BUILD_WITH_INSTALL_NAME_DIR 1)
+target_link_libraries(normal PRIVATE rpath)
+set_property(TARGET normal PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/normal/../rpath"
+ )
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "extern void conflict(void);\nvoid testlib_conflict(void)\n{\n conflict();\n}\n")
+add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c")
+target_link_libraries(testlib_conflict PRIVATE conflict)
+
+set_property(TARGET testlib PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath"
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_unresolved"
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/rpath_postexcluded"
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict"
+ @executable_path/../lib/rpath_executable_path
+ @executable_path/../lib/rpath_executable_path_unresolved
+ @executable_path/../lib/rpath_executable_path_postexcluded
+ @loader_path/rpath_loader_path
+ @loader_path/rpath_loader_path_unresolved
+ @loader_path/rpath_loader_path_postexcluded
+ )
+set_property(TARGET testlib_conflict PROPERTY INSTALL_RPATH
+ "${CMAKE_BINARY_DIR}/root-all/executable/lib/conflict2"
+ )
+
+foreach(t
+ executable_path
+ executable_path_postexcluded
+ loader_path
+ loader_path_postexcluded
+ rpath
+ rpath_postexcluded
+ rpath_executable_path
+ rpath_executable_path_postexcluded
+ rpath_loader_path
+ rpath_loader_path_postexcluded
+ conflict
+ )
+ install(TARGETS ${t} DESTINATION executable/lib/${t})
+endforeach()
+install(TARGETS conflict DESTINATION executable/lib/conflict2)
+
+foreach(t
+ executable_path_bundle
+ executable_path_postexcluded
+ loader_path_postexcluded
+ rpath_postexcluded
+ rpath_executable_path_bundle
+ rpath_executable_path_postexcluded
+ rpath_loader_path_postexcluded
+ )
+ install(TARGETS ${t} DESTINATION bundle_executable/lib/${t})
+endforeach()
+
+foreach(t executable_path executable_path_bundle executable_path_postexcluded)
+ set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @executable_path/../lib/${t})
+endforeach()
+
+foreach(t loader_path loader_path_unresolved loader_path_postexcluded)
+ set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @loader_path/${t})
+endforeach()
+
+foreach(t
+ rpath
+ rpath_unresolved
+ rpath_postexcluded
+ rpath_executable_path
+ rpath_executable_path_bundle
+ rpath_executable_path_postexcluded
+ rpath_loader_path
+ rpath_loader_path_unresolved
+ rpath_loader_path_postexcluded
+ conflict
+ )
+ set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR @rpath)
+endforeach()
+
+foreach(t normal normal_unresolved normal_postexcluded)
+ set_property(TARGET ${t} PROPERTY INSTALL_NAME_DIR "${CMAKE_BINARY_DIR}/root-all/executable/lib/${t}")
+ if(NOT t STREQUAL "normal_unresolved")
+ install(TARGETS ${t} DESTINATION executable/lib/${t})
+ endif()
+endforeach()
+
+target_link_libraries(testlib PRIVATE ${testlib_names})
+
+add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c)
+add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c)
+add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c)
+target_link_libraries(topexe PRIVATE testlib)
+target_link_libraries(toplib PRIVATE testlib)
+target_link_libraries(topmod PRIVATE testlib)
+
+set_property(TARGET topexe toplib topmod PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/root-all/executable/lib")
+
+install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION executable/bin LIBRARY DESTINATION executable/lib)
+install(TARGETS topexe toplib topmod testlib testlib_conflict RUNTIME DESTINATION bundle_executable/bin LIBRARY DESTINATION bundle_executable/lib)
+
+install(CODE [[
+ function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
+ file(GET_RUNTIME_DEPENDENCIES
+ RESOLVED_DEPENDENCIES_VAR deps
+ UNRESOLVED_DEPENDENCIES_VAR udeps
+ CONFLICTING_DEPENDENCIES_PREFIX cdeps
+ PRE_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|executable_path_postexcluded|loader_path|loader_path_unresolved|loader_path_postexcluded|rpath|rpath_unresolved|rpath_postexcluded|rpath_executable_path|rpath_executable_path_bundle|rpath_executable_path_postexcluded|rpath_loader_path|rpath_loader_path_unresolved|rpath_loader_path_postexcluded|normal|normal_unresolved|normal_postexcluded|conflict|System\\.B)\\.dylib$"
+ PRE_EXCLUDE_REGEXES ".*"
+ POST_INCLUDE_REGEXES "^.*/lib(testlib|executable_path|executable_path_bundle|loader_path|rpath|rpath_executable_path|rpath_executable_path_bundle|rpath_loader_path|normal|conflict|System\\.B)\\.dylib$"
+ POST_EXCLUDE_REGEXES ".*"
+ ${ARGN}
+ )
+ list(SORT deps)
+ list(SORT udeps)
+ list(SORT cdeps_FILENAMES)
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
+ foreach(cdep IN LISTS cdeps_FILENAMES)
+ set(cdep_values ${cdeps_${cdep}})
+ list(SORT cdep_values)
+ file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
+ endforeach()
+ endfunction()
+
+ exec_get_runtime_dependencies(
+ deps1.txt udeps1.txt cdeps1.txt
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/executable/bin/$<TARGET_FILE_NAME:topexe>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps2.txt udeps2.txt cdeps2.txt
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:toplib>"
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps3.txt udeps3.txt cdeps3.txt
+ MODULES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:topmod>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps4.txt udeps4.txt cdeps4.txt
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/executable/bin/$<TARGET_FILE_NAME:topexe>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ BUNDLE_EXECUTABLE
+ "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps5.txt udeps5.txt cdeps5.txt
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:toplib>"
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps6.txt udeps6.txt cdeps6.txt
+ MODULES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:topmod>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/executable/lib/$<TARGET_FILE_NAME:testlib_conflict>"
+ BUNDLE_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bundle_executable/bin/$<TARGET_FILE_NAME:topexe>"
+ )
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c
new file mode 100644
index 000000000..20c608731
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/topexe.c
@@ -0,0 +1,7 @@
+extern void testlib(void);
+
+int main(void)
+{
+ testlib();
+ return 0;
+}
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c
new file mode 100644
index 000000000..cff1bff3f
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-macos/toplib.c
@@ -0,0 +1,6 @@
+extern void testlib(void);
+
+void toplib(void)
+{
+ testlib();
+}
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt
new file mode 100644
index 000000000..d506645a0
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project-stderr.txt
@@ -0,0 +1,13 @@
+^CMake Warning \(dev\) at file-GET_RUNTIME_DEPENDENCIES-project\.cmake:[0-9]+ \(file\):
+ You have used file\(GET_RUNTIME_DEPENDENCIES\) in project mode\. This is
+ probably not what you intended to do\. Instead, please consider using it in
+ an install\(CODE\) or install\(SCRIPT\) command\. For example:
+
+ install\(CODE \[\[
+ file\(GET_RUNTIME_DEPENDENCIES
+ # \.\.\.
+ \)
+ ]]\)
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)
+This warning is for project developers\. Use -Wno-dev to suppress it\.$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake
new file mode 100644
index 000000000..842d7abd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-project.cmake
@@ -0,0 +1 @@
+file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps)
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt
new file mode 100644
index 000000000..3db835c08
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at file-GET_RUNTIME_DEPENDENCIES-unsupported\.cmake:[0-9]+ \(file\):
+ file GET_RUNTIME_DEPENDENCIES is not supported on system "[^
+ ]+"
+Call Stack \(most recent call first\):
+ CMakeLists\.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake
new file mode 100644
index 000000000..b91eefef3
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-unsupported.cmake
@@ -0,0 +1,2 @@
+file(GET_RUNTIME_DEPENDENCIES RESOLVED_DEPENDENCIES_VAR deps)
+message(FATAL_ERROR "This message should not be displayed")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake
new file mode 100644
index 000000000..c120ce461
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-all-check.cmake
@@ -0,0 +1,38 @@
+function(check_contents filename contents_regex)
+ if(EXISTS "${CMAKE_INSTALL_PREFIX}/${filename}")
+ file(READ "${CMAKE_INSTALL_PREFIX}/${filename}" contents)
+ if(NOT contents MATCHES "${contents_regex}")
+ string(APPEND RunCMake_TEST_FAILED "File contents:
+ ${contents}
+do not match what we expected:
+ ${contents_regex}
+in file:
+ ${CMAKE_INSTALL_PREFIX}/${filename}\n")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+ else()
+ string(APPEND RunCMake_TEST_FAILED "File ${CMAKE_INSTALL_PREFIX}/${filename} does not exist")
+ set(RunCMake_TEST_FAILED "${RunCMake_TEST_FAILED}" PARENT_SCOPE)
+ endif()
+endfunction()
+
+set(_check
+ [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.conflict/\.\./(lib)?libdir\.dll]=]
+ [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\.search/(lib)?search\.dll]=]
+ [=[[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?testlib\.dll]=]
+ )
+check_contents(deps/deps1.txt "^${_check}$")
+check_contents(deps/deps2.txt "^${_check}$")
+check_contents(deps/deps3.txt "^${_check}$")
+set(_check
+ [=[(lib)?unresolved\.dll]=]
+ )
+check_contents(deps/udeps1.txt "^${_check}$")
+check_contents(deps/udeps2.txt "^${_check}$")
+check_contents(deps/udeps3.txt "^${_check}$")
+set(_check
+ "^(lib)?conflict\\.dll:[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/\\.conflict/(lib)?conflict\\.dll;[^;]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-build/root-all/bin/(lib)?conflict\\.dll\n$"
+ )
+check_contents(deps/cdeps1.txt "${_check}")
+check_contents(deps/cdeps2.txt "${_check}")
+check_contents(deps/cdeps3.txt "${_check}")
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt
new file mode 100644
index 000000000..66ecb932c
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-all-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Multiple conflicting paths found for (lib)?path\.dll:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test1/(lib)?path\.dll
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict-build/root-all/lib/test2/(lib)?path\.dll$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake
new file mode 100644
index 000000000..d41344375
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-conflict.cmake
@@ -0,0 +1,47 @@
+enable_language(C)
+
+set(test1_names path)
+set(test2_names path)
+
+file(WRITE "${CMAKE_BINARY_DIR}/path.c" "__declspec(dllexport) void path(void) {}\n")
+add_library(path SHARED "${CMAKE_BINARY_DIR}/path.c")
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test1.c")
+add_library(test1 SHARED "${CMAKE_BINARY_DIR}/test1.c")
+foreach(name ${test1_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllimport) extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "__declspec(dllexport) void test1(void)\n{\n")
+foreach(name ${test1_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test1.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test1.c" "}\n")
+
+target_link_libraries(test1 PRIVATE ${test1_names})
+
+file(REMOVE "${CMAKE_BINARY_DIR}/test2.c")
+add_library(test2 SHARED "${CMAKE_BINARY_DIR}/test2.c")
+foreach(name ${test2_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllimport) extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "__declspec(dllexport) void test2(void)\n{\n")
+foreach(name ${test2_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/test2.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/test2.c" "}\n")
+
+target_link_libraries(test2 PRIVATE ${test2_names})
+
+install(TARGETS test1 path DESTINATION lib/test1)
+install(TARGETS test2 path DESTINATION lib/test2)
+
+install(CODE [[
+ file(GET_RUNTIME_DEPENDENCIES
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/test1/$<TARGET_FILE_NAME:test1>"
+ "${CMAKE_INSTALL_PREFIX}/lib/test2/$<TARGET_FILE_NAME:test2>"
+ PRE_INCLUDE_REGEXES "^(lib)?path\\.dll$"
+ PRE_EXCLUDE_REGEXES ".*"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt
new file mode 100644
index 000000000..f921409f9
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-all-stderr.txt
@@ -0,0 +1,5 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Failed to run (dumpbin|objdump) on:
+
+ [^
+]*/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile-build/root-all/bin/(lib)?test\.dll$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake
new file mode 100644
index 000000000..6665a3b3e
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-notfile.cmake
@@ -0,0 +1,28 @@
+enable_language(C)
+
+file(WRITE "${CMAKE_BINARY_DIR}/test.c" "__declspec(dllexport) void test(void) {}\n")
+file(WRITE "${CMAKE_BINARY_DIR}/main.c" [[__declspec(dllimport) extern void test(void);
+
+int main(void)
+{
+ test();
+ return 0;
+}
+]])
+
+add_library(test SHARED "${CMAKE_BINARY_DIR}/test.c")
+add_executable(exe "${CMAKE_BINARY_DIR}/main.c")
+target_link_libraries(exe PRIVATE test)
+
+install(TARGETS exe DESTINATION bin)
+
+install(CODE [[
+ file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:test>")
+ file(GET_RUNTIME_DEPENDENCIES
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:exe>"
+ PRE_INCLUDE_REGEXES "^(lib)?test\\.dll$"
+ PRE_EXCLUDE_REGEXES ".*"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt
new file mode 100644
index 000000000..a20654c5a
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved-all-stderr.txt
@@ -0,0 +1,2 @@
+^CMake Error at cmake_install\.cmake:[0-9]+ \(file\):
+ file Could not resolve file (lib)?unresolved\.dll$
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake
new file mode 100644
index 000000000..4cc74c70d
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows-unresolved.cmake
@@ -0,0 +1,18 @@
+enable_language(C)
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void unresolved(void);\n__declspec(dllexport) void testlib(void)\n{\n unresolved();\n}\n")
+add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
+file(WRITE "${CMAKE_BINARY_DIR}/unresolved.c" "__declspec(dllexport) void unresolved(void) {}\n")
+add_library(unresolved SHARED "${CMAKE_BINARY_DIR}/unresolved.c")
+target_link_libraries(testlib PRIVATE unresolved)
+install(TARGETS testlib DESTINATION lib)
+
+install(CODE [[
+ file(GET_RUNTIME_DEPENDENCIES
+ PRE_INCLUDE_REGEXES "^(lib)?unresolved\\.dll$"
+ PRE_EXCLUDE_REGEXES ".*"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/lib/$<TARGET_FILE_NAME:testlib>"
+ )
+ message(FATAL_ERROR "This message should not be displayed")
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake
new file mode 100644
index 000000000..19288d853
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows.cmake
@@ -0,0 +1,114 @@
+enable_language(C)
+
+set(testlib_names
+ preexcluded
+ libdir_postexcluded
+ libdir
+ search_postexcluded
+ search
+ unresolved
+ conflict
+ )
+
+file(REMOVE "${CMAKE_BINARY_DIR}/testlib.c")
+add_library(testlib SHARED "${CMAKE_BINARY_DIR}/testlib.c")
+foreach(name ${testlib_names})
+ file(WRITE "${CMAKE_BINARY_DIR}/${name}.c" "__declspec(dllexport) void ${name}(void) {}\n")
+ add_library(${name} SHARED "${CMAKE_BINARY_DIR}/${name}.c")
+
+ file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllimport) extern void ${name}(void);\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "__declspec(dllexport) void testlib(void)\n{\n")
+foreach(name ${testlib_names})
+ file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" " ${name}();\n")
+endforeach()
+file(APPEND "${CMAKE_BINARY_DIR}/testlib.c" "}\n")
+
+target_link_libraries(testlib PRIVATE ${testlib_names})
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib_conflict.c" "__declspec(dllimport) extern void conflict(void);\n__declspec(dllexport) void testlib_conflict(void)\n{\n conflict();\n}\n")
+add_library(testlib_conflict SHARED "${CMAKE_BINARY_DIR}/testlib_conflict.c")
+target_link_libraries(testlib_conflict PRIVATE conflict)
+
+file(WRITE "${CMAKE_BINARY_DIR}/testlib_noconflict.c" "__declspec(dllimport) extern void libdir(void);\n__declspec(dllexport) void testlib_noconflict(void)\n{\n libdir();\n}\n")
+add_library(testlib_noconflict SHARED "${CMAKE_BINARY_DIR}/testlib_noconflict.c")
+target_link_libraries(testlib_noconflict PRIVATE libdir)
+
+install(TARGETS testlib libdir_postexcluded libdir conflict testlib_noconflict DESTINATION bin)
+install(TARGETS libdir search_postexcluded search DESTINATION bin/.search) # Prefixing with "." ensures it is the first item after list(SORT)
+install(TARGETS testlib_conflict conflict DESTINATION bin/.conflict)
+
+add_executable(topexe file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c)
+add_library(toplib SHARED file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c)
+add_library(topmod MODULE file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c)
+target_link_libraries(topexe PRIVATE testlib)
+target_link_libraries(toplib PRIVATE testlib)
+target_link_libraries(topmod PRIVATE testlib)
+
+install(TARGETS topexe toplib topmod DESTINATION bin)
+
+install(CODE [[
+ function(exec_get_runtime_dependencies depsfile udepsfile cdepsfile)
+ file(GET_RUNTIME_DEPENDENCIES
+ RESOLVED_DEPENDENCIES_VAR deps
+ UNRESOLVED_DEPENDENCIES_VAR udeps
+ CONFLICTING_DEPENDENCIES_PREFIX cdeps
+ PRE_INCLUDE_REGEXES
+ "^(lib)?testlib\\.dll$"
+ "^(lib)?libdir_postexcluded\\.dll$"
+ "^(lib)?libdir\\.dll$"
+ "^(lib)?search_postexcluded\\.dll$"
+ "^(lib)?search\\.dll$"
+ "^(lib)?unresolved\\.dll$"
+ "^(lib)?conflict\\.dll$"
+ "^kernel32\\.dll$"
+ PRE_EXCLUDE_REGEXES ".*"
+ POST_INCLUDE_REGEXES
+ "^.*/(lib)?testlib\\.dll$"
+ "^.*/(lib)?libdir\\.dll$"
+ "^.*/(lib)?search\\.dll$"
+ "^.*/(lib)?conflict\\.dll$"
+ POST_EXCLUDE_REGEXES ".*"
+ DIRECTORIES
+ "${CMAKE_INSTALL_PREFIX}/bin/.search"
+ ${ARGN}
+ )
+ list(SORT deps)
+ list(SORT udeps)
+ list(SORT cdeps_FILENAMES)
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${depsfile}" "${deps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${udepsfile}" "${udeps}")
+ file(WRITE "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "")
+ foreach(cdep IN LISTS cdeps_FILENAMES)
+ set(cdep_values ${cdeps_${cdep}})
+ list(SORT cdep_values)
+ file(APPEND "${CMAKE_INSTALL_PREFIX}/deps/${cdepsfile}" "${cdep}:${cdep_values}\n")
+ endforeach()
+ endfunction()
+
+ exec_get_runtime_dependencies(
+ deps1.txt udeps1.txt cdeps1.txt
+ EXECUTABLES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topexe>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps2.txt udeps2.txt cdeps2.txt
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:toplib>"
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
+ )
+
+ exec_get_runtime_dependencies(
+ deps3.txt udeps3.txt cdeps3.txt
+ MODULES
+ "${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:topmod>"
+ LIBRARIES
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/$<TARGET_FILE_NAME:testlib_conflict>"
+ "${CMAKE_INSTALL_PREFIX}/bin/.conflict/../$<TARGET_FILE_NAME:testlib_noconflict>"
+ )
+ ]])
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c
new file mode 100644
index 000000000..713b8eb41
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/topexe.c
@@ -0,0 +1,7 @@
+__declspec(dllimport) extern void testlib(void);
+
+int main(void)
+{
+ testlib();
+ return 0;
+}
diff --git a/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c
new file mode 100644
index 000000000..69971759e
--- /dev/null
+++ b/Tests/RunCMake/install/file-GET_RUNTIME_DEPENDENCIES-windows/toplib.c
@@ -0,0 +1,6 @@
+__declspec(dllimport) extern void testlib(void);
+
+__declspec(dllexport) void toplib(void)
+{
+ testlib();
+}
diff --git a/Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt b/Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt
index 9e73ed5b2..22226f2ae 100644
--- a/Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt
+++ b/Tests/RunCMake/math/MATH-InvalidExpression-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error at MATH-InvalidExpression.cmake:1 \(math\):
- math cannot parse the expression: "INVALID": syntax error, unexpected \$end,
- expecting exp_PLUS or exp_MINUS or exp_OPENPARENT or exp_NUMBER \(7\).
+ math cannot parse the expression: "INVALID": syntax error, unexpected \$end
+ \(7\).
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/message/RunCMakeTest.cmake b/Tests/RunCMake/message/RunCMakeTest.cmake
index cecfc7fe5..681839d84 100644
--- a/Tests/RunCMake/message/RunCMakeTest.cmake
+++ b/Tests/RunCMake/message/RunCMakeTest.cmake
@@ -5,50 +5,70 @@ run_cmake(nomessage)
run_cmake(message-internal-warning)
run_cmake(nomessage-internal-warning)
run_cmake(warnmessage)
+
+# Have to explicitly give the command for the working dir to be honoured
+set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY /)
+run_cmake_command(
+ warnmessage-rootdir
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/warnmessage-rootdir.cmake
+ )
+unset(RunCMake_TEST_COMMAND_WORKING_DIRECTORY)
+
# message command sets fatal occurred flag, so check each type of error
# separately
run_cmake(errormessage_deprecated)
run_cmake(errormessage_dev)
-run_cmake_command(
- message-loglevel-invalid
- ${CMAKE_COMMAND} --loglevel=blah -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
- )
+foreach(opt IN ITEMS loglevel log-level)
+ run_cmake_command(
+ message-${opt}-invalid
+ ${CMAKE_COMMAND} --${opt}=blah -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+
+ # Checking various combinations of `message(...)` and log levels `WARNING` to `TRACE`
+ # - no CLI option -> `WARNING` to `STATUS` output
+ run_cmake_command(
+ message-${opt}-default
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+ # - Only `WARNING` output
+ run_cmake_command(
+ message-${opt}-warning
+ ${CMAKE_COMMAND} --${opt}=warning -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+ # - Only `WARNING` and `NOTICE` output
+ run_cmake_command(
+ message-${opt}-notice
+ ${CMAKE_COMMAND} --${opt}=notice -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+ # - `WARNING` to `STATUS` output
+ run_cmake_command(
+ message-${opt}-status
+ ${CMAKE_COMMAND} --${opt}=status -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+ # - `WARNING` to `VERBOSE` output
+ run_cmake_command(
+ message-${opt}-verbose
+ ${CMAKE_COMMAND} --${opt}=verbose -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+ # - `WARNING` to `DEBUG` output
+ run_cmake_command(
+ message-${opt}-debug
+ ${CMAKE_COMMAND} --${opt}=debug -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+ # - `WARNING` to `TRACE` output
+ run_cmake_command(
+ message-${opt}-trace
+ ${CMAKE_COMMAND} --${opt}=trace -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ )
+endforeach()
-# Checking various combinations of `message(...)` and log levels `WARNING` to `TRACE`
-# - no CLI option -> `WARNING` to `STATUS` output
-run_cmake_command(
- message-loglevel-default
- ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
- )
-# - Only `WARNING` output
-run_cmake_command(
- message-loglevel-warning
- ${CMAKE_COMMAND} --loglevel=warning -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
- )
-# - Only `WARNING` and `NOTICE` output
-run_cmake_command(
- message-loglevel-notice
- ${CMAKE_COMMAND} --loglevel=notice -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
- )
-# - `WARNING` to `STATUS` output
-run_cmake_command(
- message-loglevel-status
- ${CMAKE_COMMAND} --loglevel=status -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
- )
-# - `WARNING` to `VERBOSE` output
-run_cmake_command(
- message-loglevel-verbose
- ${CMAKE_COMMAND} --loglevel=verbose -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
- )
-# - `WARNING` to `DEBUG` output
run_cmake_command(
- message-loglevel-debug
- ${CMAKE_COMMAND} --loglevel=debug -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ message-indent
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent.cmake
)
-# - `WARNING` to `TRACE` output
run_cmake_command(
- message-loglevel-trace
- ${CMAKE_COMMAND} --loglevel=trace -P ${RunCMake_SOURCE_DIR}/message-all-loglevels.cmake
+ message-indent-multiline
+ ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/message-indent-multiline.cmake
)
diff --git a/Tests/RunCMake/message/message-indent-multiline-stderr.txt b/Tests/RunCMake/message/message-indent-multiline-stderr.txt
new file mode 100644
index 000000000..5853a31d3
--- /dev/null
+++ b/Tests/RunCMake/message/message-indent-multiline-stderr.txt
@@ -0,0 +1,3 @@
+ >This is
+ >the multiline
+ >message
diff --git a/Tests/RunCMake/message/message-indent-multiline-stdout.txt b/Tests/RunCMake/message/message-indent-multiline-stdout.txt
new file mode 100644
index 000000000..ae0c72e79
--- /dev/null
+++ b/Tests/RunCMake/message/message-indent-multiline-stdout.txt
@@ -0,0 +1,8 @@
+-- >This is
+ >the multiline
+ >message
+ >
+ >
+-- >This is
+ >the multiline
+ >message
diff --git a/Tests/RunCMake/message/message-indent-multiline.cmake b/Tests/RunCMake/message/message-indent-multiline.cmake
new file mode 100644
index 000000000..0f789bfce
--- /dev/null
+++ b/Tests/RunCMake/message/message-indent-multiline.cmake
@@ -0,0 +1,13 @@
+# NOTE Use non-space indent string, to check indentation
+# of line endings and "empty" lines.
+# ALERT Do not put any space characters after the non-space!
+list(APPEND CMAKE_MESSAGE_INDENT " >")
+set(msg [[This is
+the multiline
+message]]) # No `\n` at the end!
+# NOTE Two empty lines after the text
+message(STATUS "${msg}\n\n")
+message(STATUS "${msg}")
+# This is just to make sure NOTICE messages are also get indented:
+# https://gitlab.kitware.com/cmake/cmake/issues/19418#note_588011
+message(NOTICE "${msg}")
diff --git a/Tests/RunCMake/message/message-indent-stdout.txt b/Tests/RunCMake/message/message-indent-stdout.txt
new file mode 100644
index 000000000..b2c3c60d1
--- /dev/null
+++ b/Tests/RunCMake/message/message-indent-stdout.txt
@@ -0,0 +1,13 @@
+-- COUNTING:
+-- COUNTING_ENGLISH:
+-- one
+-- two
+-- three
+-- four
+-- five
+-- COUNTING_BAHASA:
+-- satu
+-- dua
+-- tiga
+-- empat
+-- lima
diff --git a/Tests/RunCMake/message/message-indent.cmake b/Tests/RunCMake/message/message-indent.cmake
new file mode 100644
index 000000000..c07ff45eb
--- /dev/null
+++ b/Tests/RunCMake/message/message-indent.cmake
@@ -0,0 +1,19 @@
+function(debug_list LIST_VAR)
+ message(STATUS "${LIST_VAR}:")
+ list(APPEND CMAKE_MESSAGE_INDENT " ")
+ foreach(_item IN LISTS ${LIST_VAR})
+ list(LENGTH ${_item} _item_len)
+ if(_item_len GREATER 1)
+ debug_list(${_item})
+ else()
+ message(STATUS "${_item}")
+ endif()
+ endforeach()
+endfunction()
+
+list(APPEND COUNTING_ENGLISH one two three four five)
+list(APPEND COUNTING_BAHASA satu dua tiga empat lima)
+
+list(APPEND COUNTING COUNTING_ENGLISH COUNTING_BAHASA)
+
+debug_list(COUNTING)
diff --git a/Tests/RunCMake/message/message-log-level-debug-stderr.txt b/Tests/RunCMake/message/message-log-level-debug-stderr.txt
new file mode 100644
index 000000000..efec736fe
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-debug-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-debug-stdout.txt b/Tests/RunCMake/message/message-log-level-debug-stdout.txt
new file mode 100644
index 000000000..145213703
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-debug-stdout.txt
@@ -0,0 +1,3 @@
+-- STATUS message
+-- VERBOSE message
+-- DEBUG message
diff --git a/Tests/RunCMake/message/message-log-level-default-stderr.txt b/Tests/RunCMake/message/message-log-level-default-stderr.txt
new file mode 100644
index 000000000..efec736fe
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-default-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-default-stdout.txt b/Tests/RunCMake/message/message-log-level-default-stdout.txt
new file mode 100644
index 000000000..809f4cc4a
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-default-stdout.txt
@@ -0,0 +1 @@
+-- STATUS message
diff --git a/Tests/RunCMake/message/message-log-level-invalid-result.txt b/Tests/RunCMake/message/message-log-level-invalid-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-invalid-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/message/message-log-level-invalid-stderr.txt b/Tests/RunCMake/message/message-log-level-invalid-stderr.txt
new file mode 100644
index 000000000..a166bbcca
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-invalid-stderr.txt
@@ -0,0 +1 @@
+CMake Error: Invalid level specified for --log-level
diff --git a/Tests/RunCMake/message/message-log-level-notice-stderr.txt b/Tests/RunCMake/message/message-log-level-notice-stderr.txt
new file mode 100644
index 000000000..efec736fe
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-notice-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-status-stderr.txt b/Tests/RunCMake/message/message-log-level-status-stderr.txt
new file mode 100644
index 000000000..efec736fe
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-status-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-status-stdout.txt b/Tests/RunCMake/message/message-log-level-status-stdout.txt
new file mode 100644
index 000000000..809f4cc4a
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-status-stdout.txt
@@ -0,0 +1 @@
+-- STATUS message
diff --git a/Tests/RunCMake/message/message-log-level-trace-stderr.txt b/Tests/RunCMake/message/message-log-level-trace-stderr.txt
new file mode 100644
index 000000000..efec736fe
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-trace-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-trace-stdout.txt b/Tests/RunCMake/message/message-log-level-trace-stdout.txt
new file mode 100644
index 000000000..1cfce6f11
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-trace-stdout.txt
@@ -0,0 +1,4 @@
+-- STATUS message
+-- VERBOSE message
+-- DEBUG message
+-- TRACE message
diff --git a/Tests/RunCMake/message/message-log-level-verbose-stderr.txt b/Tests/RunCMake/message/message-log-level-verbose-stderr.txt
new file mode 100644
index 000000000..efec736fe
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-verbose-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-verbose-stdout.txt b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
new file mode 100644
index 000000000..c15d43fc4
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-verbose-stdout.txt
@@ -0,0 +1,2 @@
+-- STATUS message
+-- VERBOSE message
diff --git a/Tests/RunCMake/message/message-log-level-warning-stderr.txt b/Tests/RunCMake/message/message-log-level-warning-stderr.txt
new file mode 100644
index 000000000..c721b063c
--- /dev/null
+++ b/Tests/RunCMake/message/message-log-level-warning-stderr.txt
@@ -0,0 +1,9 @@
+^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$
diff --git a/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt b/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt
new file mode 100644
index 000000000..19d93989a
--- /dev/null
+++ b/Tests/RunCMake/message/warnmessage-rootdir-stderr.txt
@@ -0,0 +1 @@
+We expect to see this warning message
diff --git a/Tests/RunCMake/message/warnmessage-rootdir.cmake b/Tests/RunCMake/message/warnmessage-rootdir.cmake
new file mode 100644
index 000000000..f82efb909
--- /dev/null
+++ b/Tests/RunCMake/message/warnmessage-rootdir.cmake
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.15)
+
+# Generating the backtrace for this warning message used to trigger a
+# spurious assertion when the current directory is the root directory
+message(WARNING "We expect to see this warning message")
diff --git a/Tests/RunCMake/project/CMP0048-NEW.cmake b/Tests/RunCMake/project/CMP0048-NEW.cmake
index 7e16b7081..b6e80aca9 100644
--- a/Tests/RunCMake/project/CMP0048-NEW.cmake
+++ b/Tests/RunCMake/project/CMP0048-NEW.cmake
@@ -1,9 +1,4 @@
-macro(print_versions name)
- foreach(v "" _MAJOR _MINOR _PATCH _TWEAK)
- message(STATUS "PROJECT_VERSION${v}='${PROJECT_VERSION${v}}'")
- message(STATUS "${name}_VERSION${v}='${${name}_VERSION${v}}'")
- endforeach()
-endmacro()
+include(PrintVersions.cmake)
cmake_policy(SET CMP0048 NEW)
diff --git a/Tests/RunCMake/project/CMP0096-NEW-stdout.txt b/Tests/RunCMake/project/CMP0096-NEW-stdout.txt
new file mode 100644
index 000000000..f6b999a43
--- /dev/null
+++ b/Tests/RunCMake/project/CMP0096-NEW-stdout.txt
@@ -0,0 +1,30 @@
+-- PROJECT_VERSION='2019.07.06'
+-- DateVersion_VERSION='2019.07.06'
+-- PROJECT_VERSION_MAJOR='2019'
+-- DateVersion_VERSION_MAJOR='2019'
+-- PROJECT_VERSION_MINOR='07'
+-- DateVersion_VERSION_MINOR='07'
+-- PROJECT_VERSION_PATCH='06'
+-- DateVersion_VERSION_PATCH='06'
+-- PROJECT_VERSION_TWEAK=''
+-- DateVersion_VERSION_TWEAK=''
+-- PROJECT_VERSION='4294967297'
+-- LongVersion_VERSION='4294967297'
+-- PROJECT_VERSION_MAJOR='4294967297'
+-- LongVersion_VERSION_MAJOR='4294967297'
+-- PROJECT_VERSION_MINOR=''
+-- LongVersion_VERSION_MINOR=''
+-- PROJECT_VERSION_PATCH=''
+-- LongVersion_VERSION_PATCH=''
+-- PROJECT_VERSION_TWEAK=''
+-- LongVersion_VERSION_TWEAK=''
+-- PROJECT_VERSION='0009999999999.0009999999999.0009999999999.0009999999999'
+-- VeryLongVersion_VERSION='0009999999999.0009999999999.0009999999999.0009999999999'
+-- PROJECT_VERSION_MAJOR='0009999999999'
+-- VeryLongVersion_VERSION_MAJOR='0009999999999'
+-- PROJECT_VERSION_MINOR='0009999999999'
+-- VeryLongVersion_VERSION_MINOR='0009999999999'
+-- PROJECT_VERSION_PATCH='0009999999999'
+-- VeryLongVersion_VERSION_PATCH='0009999999999'
+-- PROJECT_VERSION_TWEAK='0009999999999'
+-- VeryLongVersion_VERSION_TWEAK='0009999999999'
diff --git a/Tests/RunCMake/project/CMP0096-NEW.cmake b/Tests/RunCMake/project/CMP0096-NEW.cmake
new file mode 100644
index 000000000..e2cdd2001
--- /dev/null
+++ b/Tests/RunCMake/project/CMP0096-NEW.cmake
@@ -0,0 +1,6 @@
+cmake_policy(SET CMP0048 NEW)
+cmake_policy(SET CMP0096 NEW)
+include(CMP0096-common.cmake)
+
+project(VeryLongVersion VERSION 0009999999999.0009999999999.0009999999999.0009999999999 LANGUAGES NONE)
+print_versions(VeryLongVersion)
diff --git a/Tests/RunCMake/project/CMP0096-OLD-stdout.txt b/Tests/RunCMake/project/CMP0096-OLD-stdout.txt
new file mode 100644
index 000000000..6a945ceda
--- /dev/null
+++ b/Tests/RunCMake/project/CMP0096-OLD-stdout.txt
@@ -0,0 +1,20 @@
+-- PROJECT_VERSION='2019.7.6'
+-- DateVersion_VERSION='2019.7.6'
+-- PROJECT_VERSION_MAJOR='2019'
+-- DateVersion_VERSION_MAJOR='2019'
+-- PROJECT_VERSION_MINOR='7'
+-- DateVersion_VERSION_MINOR='7'
+-- PROJECT_VERSION_PATCH='6'
+-- DateVersion_VERSION_PATCH='6'
+-- PROJECT_VERSION_TWEAK=''
+-- DateVersion_VERSION_TWEAK=''
+-- PROJECT_VERSION='(1|4294967295)'
+-- LongVersion_VERSION='(1|4294967295)'
+-- PROJECT_VERSION_MAJOR='(1|4294967295)'
+-- LongVersion_VERSION_MAJOR='(1|4294967295)'
+-- PROJECT_VERSION_MINOR=''
+-- LongVersion_VERSION_MINOR=''
+-- PROJECT_VERSION_PATCH=''
+-- LongVersion_VERSION_PATCH=''
+-- PROJECT_VERSION_TWEAK=''
+-- LongVersion_VERSION_TWEAK=''
diff --git a/Tests/RunCMake/project/CMP0096-OLD.cmake b/Tests/RunCMake/project/CMP0096-OLD.cmake
new file mode 100644
index 000000000..25a3b19f9
--- /dev/null
+++ b/Tests/RunCMake/project/CMP0096-OLD.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0048 NEW)
+cmake_policy(SET CMP0096 OLD)
+include(CMP0096-common.cmake)
diff --git a/Tests/RunCMake/project/CMP0096-WARN-stdout.txt b/Tests/RunCMake/project/CMP0096-WARN-stdout.txt
new file mode 100644
index 000000000..6a945ceda
--- /dev/null
+++ b/Tests/RunCMake/project/CMP0096-WARN-stdout.txt
@@ -0,0 +1,20 @@
+-- PROJECT_VERSION='2019.7.6'
+-- DateVersion_VERSION='2019.7.6'
+-- PROJECT_VERSION_MAJOR='2019'
+-- DateVersion_VERSION_MAJOR='2019'
+-- PROJECT_VERSION_MINOR='7'
+-- DateVersion_VERSION_MINOR='7'
+-- PROJECT_VERSION_PATCH='6'
+-- DateVersion_VERSION_PATCH='6'
+-- PROJECT_VERSION_TWEAK=''
+-- DateVersion_VERSION_TWEAK=''
+-- PROJECT_VERSION='(1|4294967295)'
+-- LongVersion_VERSION='(1|4294967295)'
+-- PROJECT_VERSION_MAJOR='(1|4294967295)'
+-- LongVersion_VERSION_MAJOR='(1|4294967295)'
+-- PROJECT_VERSION_MINOR=''
+-- LongVersion_VERSION_MINOR=''
+-- PROJECT_VERSION_PATCH=''
+-- LongVersion_VERSION_PATCH=''
+-- PROJECT_VERSION_TWEAK=''
+-- LongVersion_VERSION_TWEAK=''
diff --git a/Tests/RunCMake/project/CMP0096-WARN.cmake b/Tests/RunCMake/project/CMP0096-WARN.cmake
new file mode 100644
index 000000000..7fe086179
--- /dev/null
+++ b/Tests/RunCMake/project/CMP0096-WARN.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0048 NEW)
+
+include(CMP0096-common.cmake)
diff --git a/Tests/RunCMake/project/CMP0096-common.cmake b/Tests/RunCMake/project/CMP0096-common.cmake
new file mode 100644
index 000000000..8d26d3060
--- /dev/null
+++ b/Tests/RunCMake/project/CMP0096-common.cmake
@@ -0,0 +1,9 @@
+include(PrintVersions.cmake)
+
+# Test leading zeros motivating this policy.
+project(DateVersion VERSION 2019.07.06 LANGUAGES NONE)
+print_versions(DateVersion)
+
+# Overflow version component in OLD behavior.
+project(LongVersion VERSION 4294967297 #[[ uint32_max + 2 ]] LANGUAGES NONE)
+print_versions(LongVersion)
diff --git a/Tests/RunCMake/project/PrintVersions.cmake b/Tests/RunCMake/project/PrintVersions.cmake
new file mode 100644
index 000000000..ce1b25d66
--- /dev/null
+++ b/Tests/RunCMake/project/PrintVersions.cmake
@@ -0,0 +1,6 @@
+macro(print_versions name)
+ foreach(v "" _MAJOR _MINOR _PATCH _TWEAK)
+ message(STATUS "PROJECT_VERSION${v}='${PROJECT_VERSION${v}}'")
+ message(STATUS "${name}_VERSION${v}='${${name}_VERSION${v}}'")
+ endforeach()
+endmacro()
diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake
index 3a8ad4bbf..69146993b 100644
--- a/Tests/RunCMake/project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/project/RunCMakeTest.cmake
@@ -22,8 +22,13 @@ run_cmake(VersionInvalid)
run_cmake(VersionMissingLanguages)
run_cmake(VersionMissingValueOkay)
run_cmake(VersionTwice)
+run_cmake(VersionMax)
run_cmake(CMP0048-OLD)
run_cmake(CMP0048-OLD-VERSION)
run_cmake(CMP0048-WARN)
run_cmake(CMP0048-NEW)
+
+run_cmake(CMP0096-WARN)
+run_cmake(CMP0096-OLD)
+run_cmake(CMP0096-NEW)
diff --git a/Tests/RunCMake/project/VersionMax.cmake b/Tests/RunCMake/project/VersionMax.cmake
new file mode 100644
index 000000000..e95536438
--- /dev/null
+++ b/Tests/RunCMake/project/VersionMax.cmake
@@ -0,0 +1,32 @@
+cmake_policy(SET CMP0048 NEW)
+cmake_policy(SET CMP0096 OLD)
+
+enable_language(C)
+include(CheckTypeSize)
+check_type_size(unsigned __sizeOfUnsigned BUILTIN_TYPES_ONLY LANGUAGE C)
+
+# We can't use math() to compute this because it only supports up to
+# 64-bit signed integers, so hard-code the types we expect to encounter
+if(__sizeOfUnsigned EQUAL 0)
+ message(STATUS "Multi-architecture build, skipping project version check")
+ return()
+elseif(__sizeOfUnsigned EQUAL 4)
+ set(maxVal 4294967295)
+elseif(__sizeOfUnsigned EQUAL 8)
+ set(maxVal 18446744073709551615)
+else()
+ message(FATAL_ERROR
+ "Test needs to be updated for unsigned integer size ${__sizeOfUnsigned}")
+endif()
+
+# The real value of this test is when an address sanitizer is enabled.
+# It catches situations where the size of the buffer used to compute or
+# hold the version components as strings is too small.
+project(ProjectA VERSION ${maxVal}.${maxVal}.${maxVal}.${maxVal} LANGUAGES NONE)
+
+if(NOT ${PROJECT_VERSION_MAJOR} EQUAL ${maxVal})
+ message(FATAL_ERROR "Project version number parsing failed round trip.\n"
+ "Expected: ${maxVal}\n"
+ "Computed: ${PROJECT_VERSION_MAJOR}"
+ )
+endif()
diff --git a/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake
index b67c5983e..a419cc972 100644
--- a/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_compile_definitions/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
run_cmake(empty_keyword_args)
+run_cmake(unknown_imported_target)
diff --git a/Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake b/Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake
new file mode 100644
index 000000000..4ae1c0dd7
--- /dev/null
+++ b/Tests/RunCMake/target_compile_definitions/unknown_imported_target.cmake
@@ -0,0 +1,11 @@
+# Test that target_compile_definitions works on UNKNOWN IMPORTED target
+add_library(imported UNKNOWN IMPORTED)
+target_compile_definitions(imported INTERFACE FOO)
+
+get_target_property(IMPORTED_INTERFACE_CDS imported INTERFACE_COMPILE_DEFINITIONS)
+
+if (NOT FOO IN_LIST IMPORTED_INTERFACE_CDS)
+ message(
+ FATAL_ERROR "FOO should be in INTERFACE_COMPILE_DEFINITIONS.\n"
+ "Actual INTERFACE_COMPILE_DEFINITIONS: " ${IMPORTED_INTERFACE_CDS})
+endif()
diff --git a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported-stderr.txt b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported-stderr.txt
index 6bb44ab4b..32042254d 100644
--- a/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported-stderr.txt
+++ b/Tests/RunCMake/target_link_libraries/StaticPrivateDepNotExported-stderr.txt
@@ -1 +1 @@
-CMake Error: install\(EXPORT "Exp" ...\) includes target "foo" which requires target "not_exported" that is not in the export set.
+CMake Error: install\(EXPORT "Exp" ...\) includes target "foo" which requires target "not_exported" that is not in any export set.
diff --git a/Tests/RunCMake/try_compile/CMP0067-stderr.txt b/Tests/RunCMake/try_compile/CMP0067-stderr.txt
index e2677ed7f..d955dda2c 100644
--- a/Tests/RunCMake/try_compile/CMP0067-stderr.txt
+++ b/Tests/RunCMake/try_compile/CMP0067-stderr.txt
@@ -19,6 +19,17 @@ Call Stack \(most recent call first\):
This warning is for project developers. Use -Wno-dev to suppress it.
after try_compile with CMP0067 WARN-enabled
+CMake Deprecation Warning at CMP0067.cmake:[0-9]+ \(cmake_policy\):
+ The OLD behavior for policy CMP0067 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\)
++
before try_compile with CMP0067 OLD
after try_compile with CMP0067 OLD
before try_compile with CMP0067 NEW
diff --git a/Tests/RunCMake/try_compile/ObjCStandard-result.txt b/Tests/RunCMake/try_compile/ObjCStandard-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCStandard-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/ObjCStandard-stderr.txt b/Tests/RunCMake/try_compile/ObjCStandard-stderr.txt
new file mode 100644
index 000000000..f1b4df9e0
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCStandard-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .*/Tests/RunCMake/try_compile/ObjCStandard-build/CMakeFiles/CMakeTmp/CMakeLists.txt:[0-9]+ \(add_executable\):
+ OBJC_STANDARD is set to invalid value '3'
++
+CMake Error at ObjCStandard.cmake:[0-9]+ \(try_compile\):
+ Failed to generate test project build system.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/try_compile/ObjCStandard.cmake b/Tests/RunCMake/try_compile/ObjCStandard.cmake
new file mode 100644
index 000000000..b2066f957
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCStandard.cmake
@@ -0,0 +1,7 @@
+enable_language(OBJC)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.m
+ OBJC_STANDARD 3
+ OUTPUT_VARIABLE out
+ )
+message("try_compile output:\n${out}")
diff --git a/Tests/RunCMake/try_compile/ObjCxxStandard-result.txt b/Tests/RunCMake/try_compile/ObjCxxStandard-result.txt
new file mode 100644
index 000000000..d00491fd7
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCxxStandard-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt b/Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt
new file mode 100644
index 000000000..a2f91b48f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCxxStandard-stderr.txt
@@ -0,0 +1,7 @@
+^CMake Error at .*/Tests/RunCMake/try_compile/ObjCxxStandard-build/CMakeFiles/CMakeTmp/CMakeLists.txt:[0-9]+ \(add_executable\):
+ OBJCXX_STANDARD is set to invalid value '3'
++
+CMake Error at ObjCxxStandard.cmake:[0-9]+ \(try_compile\):
+ Failed to generate test project build system.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/try_compile/ObjCxxStandard.cmake b/Tests/RunCMake/try_compile/ObjCxxStandard.cmake
new file mode 100644
index 000000000..1221805c0
--- /dev/null
+++ b/Tests/RunCMake/try_compile/ObjCxxStandard.cmake
@@ -0,0 +1,7 @@
+enable_language(OBJCXX)
+try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
+ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.mm
+ OBJCXX_STANDARD 3
+ OUTPUT_VARIABLE out
+ )
+message("try_compile output:\n${out}")
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 77fb7a0f3..91f014e4d 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -37,11 +37,17 @@ if(CMAKE_C_STANDARD_DEFAULT)
elseif(DEFINED CMAKE_C_STANDARD_DEFAULT)
run_cmake(CStandardNoDefault)
endif()
+if(CMAKE_OBJC_STANDARD_DEFAULT)
+ run_cmake(ObjCStandard)
+endif()
if(CMAKE_CXX_STANDARD_DEFAULT)
run_cmake(CxxStandard)
elseif(DEFINED CMAKE_CXX_STANDARD_DEFAULT)
run_cmake(CxxStandardNoDefault)
endif()
+if(CMAKE_OBJCXX_STANDARD_DEFAULT)
+ run_cmake(ObjCxxStandard)
+endif()
if(CMake_TEST_CUDA)
if(CMAKE_HOST_WIN32)
run_cmake(CudaStandardNoDefault)
diff --git a/Tests/RunCMake/try_compile/src.m b/Tests/RunCMake/try_compile/src.m
new file mode 100644
index 000000000..f8b643afb
--- /dev/null
+++ b/Tests/RunCMake/try_compile/src.m
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RunCMake/try_compile/src.mm b/Tests/RunCMake/try_compile/src.mm
new file mode 100644
index 000000000..f8b643afb
--- /dev/null
+++ b/Tests/RunCMake/try_compile/src.mm
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/RuntimePath/CMakeLists.txt b/Tests/RuntimePath/CMakeLists.txt
index 6583a8712..bb874404a 100644
--- a/Tests/RuntimePath/CMakeLists.txt
+++ b/Tests/RuntimePath/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.6)
+cmake_minimum_required (VERSION 3.15)
project(RuntimePath C)
# Add a simple chain of shared libraries that must be found.
@@ -31,3 +31,14 @@ if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG)
set_property(TARGET bar2 PROPERTY LIBRARY_OUTPUT_DIRECTORY A)
target_link_libraries(bar2 foo2)
endif()
+
+# Add a library that is missing the rpath for its dependency.
+add_library(bar1_no_rpath SHARED bar1.c)
+set_property(TARGET bar1_no_rpath PROPERTY LIBRARY_OUTPUT_DIRECTORY B)
+set_property(TARGET bar1_no_rpath PROPERTY SKIP_BUILD_RPATH 1)
+target_link_libraries(bar1_no_rpath PRIVATE foo1)
+
+# Add an executable linking to the library with a missing dependency rpath.
+# CMake should generate the proper rpath-link flag to find it at build time.
+add_executable(main_with_bar1_no_rpath main.c)
+target_link_libraries(main_with_bar1_no_rpath bar1_no_rpath)
diff --git a/Tests/SourceFileProperty/CMakeLists.txt b/Tests/SourceFileProperty/CMakeLists.txt
index 1b6506da5..5e55f7b3d 100644
--- a/Tests/SourceFileProperty/CMakeLists.txt
+++ b/Tests/SourceFileProperty/CMakeLists.txt
@@ -1,19 +1,27 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.1)
project(SourceFileProperty C)
-set(sources)
-
if (EXISTS icasetest.c)
# If a file exists by this name, use it.
set_source_files_properties(icasetest.c
PROPERTIES
- COMPILE_FLAGS -DNEEDED_TO_WORK)
+ COMPILE_DEFINITIONS NEEDED_TO_WORK)
else ()
# Work on case-sensitive file systems as well.
set_source_files_properties(main.c
PROPERTIES
- COMPILE_FLAGS -DNO_NEED_TO_CALL)
+ COMPILE_DEFINITIONS NO_NEED_TO_CALL)
endif ()
-list(APPEND sources ICaseTest.c)
-add_executable(SourceFileProperty main.c ${sources})
+add_executable(SourceFileProperty main.c)
+target_sources(SourceFileProperty PRIVATE ICaseTest.c)
+
+get_source_file_property(LANG_MAIN main.c LANGUAGE)
+if(NOT "${LANG_MAIN}" STREQUAL "C")
+ message(FATAL_ERROR "Bad language for file main.c")
+endif()
+
+get_property(LANG_TEST SOURCE ICaseTest.c PROPERTY LANGUAGE)
+if (NOT "${LANG_TEST}" STREQUAL "C")
+ message(FATAL_ERROR "Bad language for file ICaseTest.c")
+endif ()
diff --git a/Tests/SystemInformation/DumpInformation.cxx b/Tests/SystemInformation/DumpInformation.cxx
index e0cc0ce6d..43286753b 100644
--- a/Tests/SystemInformation/DumpInformation.cxx
+++ b/Tests/SystemInformation/DumpInformation.cxx
@@ -1,5 +1,7 @@
#include "DumpInformation.h"
+
#include <stdio.h>
+
#include <sys/stat.h>
void cmDumpInformationPrintFile(const char* name, FILE* fout)
diff --git a/Tests/TestsWorkingDirectory/main.c b/Tests/TestsWorkingDirectory/main.c
index 8755c0ef3..ca72f2102 100644
--- a/Tests/TestsWorkingDirectory/main.c
+++ b/Tests/TestsWorkingDirectory/main.c
@@ -37,9 +37,10 @@ static const char* Getcwd(char* buf, unsigned int len)
#else
# include <fcntl.h>
-# include <sys/types.h>
# include <unistd.h>
+# include <sys/types.h>
+
static const char* Getcwd(char* buf, unsigned int len)
{
const char* ret = getcwd(buf, len);
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt
index 54e96a208..9ec9b70fd 100644
--- a/Tests/TryCompile/CMakeLists.txt
+++ b/Tests/TryCompile/CMakeLists.txt
@@ -313,6 +313,79 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes")
endif()
+#########################################################################
+#
+# Test that the CHECK_OBJCC_SOURCE_COMPILES, CHECK_OBJCXX_SOURCE_COMPILES
+# CHECK_OBJC_SOURCE_RUNS and CHECK_OBJCXX_SOURCE_RUNS macros work
+
+if (APPLE)
+ enable_language(OBJC)
+ enable_language(OBJCXX)
+
+ include(CheckOBJCSourceCompiles)
+ include(CheckOBJCXXSourceCompiles)
+ include(CheckOBJCSourceRuns)
+ include(CheckOBJCXXSourceRuns)
+
+ CHECK_OBJC_SOURCE_COMPILES("I don't build in Objective-C" OBJC_BUILD_SHOULD_FAIL)
+ CHECK_OBJC_SOURCE_COMPILES("int main() { return 0; }" SIMPLE_OBJC_BUILD_SHOULD_WORK)
+
+ TEST_FAIL(OBJC_BUILD_SHOULD_FAIL "CHECK_OBJC_SOURCE_COMPILES() succeeded, but should have failed")
+ TEST_ASSERT(SIMPLE_OBJC_BUILD_SHOULD_WORK "CHECK_OBJC_SOURCE_COMPILES() failed, but should have succeeded")
+
+ set(CMAKE_REQUIRED_LIBRARIES "-framework Foundation")
+
+ CHECK_OBJC_SOURCE_COMPILES("#import <Foundation/Foundation.h>\nint main()\n{\nNSObject *foo;\nreturn 0;\n}\n" OBJC_BUILD_SHOULD_WORK)
+ CHECK_OBJC_SOURCE_RUNS("int main() { return 2; }" SIMPLE_OBJC_RUN_SHOULD_FAIL)
+ CHECK_OBJC_SOURCE_RUNS("int main() { return 0; }" SIMPLE_OBJC_RUN_SHOULD_WORK)
+ CHECK_OBJC_SOURCE_RUNS("#import <Foundation/Foundation.h>\nint main()\n{\nNSObject *foo;\nreturn 2;\n}\n" OBJC_RUN_SHOULD_FAIL)
+ CHECK_OBJC_SOURCE_RUNS("#import <Foundation/Foundation.h>\nint main()\n{\nNSObject *foo;\nreturn 0;\n}\n" OBJC_RUN_SHOULD_WORK)
+
+ TEST_ASSERT(OBJC_BUILD_SHOULD_WORK "CHECK_OBJC_SOURCE_COMPILES() failed, but should have succeeded")
+ TEST_FAIL(SIMPLE_OBJC_RUN_SHOULD_FAIL "CHECK_OBJC_SOURC_RUNS() succeeds, but should have failed")
+ TEST_ASSERT(SIMPLE_OBJC_RUN_SHOULD_WORK "CHECK_OBJC_SOURCE_RUNS() failed, but should have succeeded")
+ TEST_FAIL(OBJC_RUN_SHOULD_FAIL "CHECK_OBJC_SOURCE_RUNS() succeeds, but should have failed")
+ TEST_ASSERT(OBJC_RUN_SHOULD_WORK "CHECK_OBJC_SOURCE_RUNS() failed, but should have succeeded")
+
+
+ CHECK_OBJCXX_SOURCE_COMPILES("I don't build in Objective-C++" OBJCXX_BUILD_SHOULD_FAIL)
+ CHECK_OBJCXX_SOURCE_COMPILES("int main() { return 0; }" SIMPLE_OBJCXX_BUILD_SHOULD_WORK)
+
+ TEST_FAIL(OBJCXX_BUILD_SHOULD_FAIL "CHECK_OBJCXX_SOURCE_COMPILES() succeeded, but should have failed")
+ TEST_ASSERT(SIMPLE_OBJCXX_BUILD_SHOULD_WORK "CHECK_OBJCXX_SOURCE_COMPILES() failed, but should have succeeded")
+
+ CHECK_OBJCXX_SOURCE_COMPILES("#import <Foundation/Foundation.h>\n#include <iostream>\nint main()\n{\nNSObject *foo;\nstd::cout << \"Hello\" << std::endl;\nreturn 0;\n}\n" OBJCXX_BUILD_SHOULD_WORK)
+ CHECK_OBJCXX_SOURCE_RUNS("int main() { return 2; }" SIMPLE_OBJCXX_RUN_SHOULD_FAIL)
+ CHECK_OBJCXX_SOURCE_RUNS("int main() { return 0; }" SIMPLE_OBJCXX_RUN_SHOULD_WORK)
+ CHECK_OBJCXX_SOURCE_RUNS("#import <Foundation/Foundation.h>\n#include <vector>\nint main()\n{\nNSObject *foo;\nstd::vector<int> bar;\nreturn 2;\n}\n" OBJCXX_RUN_SHOULD_FAIL)
+ CHECK_OBJCXX_SOURCE_RUNS("#import <Foundation/Foundation.h>\n#include <vector>\nint main()\n{\nNSObject *foo;\nstd::vector<int> bar;\nreturn 0;\n}\n" OBJCXX_RUN_SHOULD_WORK)
+
+ TEST_ASSERT(OBJCXX_BUILD_SHOULD_WORK "CHECK_OBJCXX_SOURCE_COMPILES() failed, but should have succeeded")
+ TEST_FAIL(SIMPLE_OBJCXX_RUN_SHOULD_FAIL "CHECK_OBJCXX_SOURC_RUNS() succeeds, but should have failed")
+ TEST_ASSERT(SIMPLE_OBJCXX_RUN_SHOULD_WORK "CHECK_OBJCXX_SOURCE_RUNS() failed, but should have succeeded")
+ TEST_FAIL(OBJCXX_RUN_SHOULD_FAIL "CHECK_OBJCXX_SOURCE_RUNS() succeeds, but should have failed")
+ TEST_ASSERT(OBJCXX_RUN_SHOULD_WORK "CHECK_OBJCXX_SOURCE_RUNS() failed, but should have succeeded")
+
+ # try to compile a file that should compile
+ try_compile(SHOULD_PASS
+ ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompile_SOURCE_DIR}/pass.m
+ OUTPUT_VARIABLE TRY_OUT)
+ if(NOT SHOULD_PASS)
+ message(SEND_ERROR "should pass failed ${TRY_OUT}")
+ endif()
+
+ # try to compile a file that should not compile
+ try_compile(SHOULD_FAIL
+ ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp
+ ${TryCompile_SOURCE_DIR}/fail.m
+ OUTPUT_VARIABLE TRY_OUT)
+ if(SHOULD_FAIL)
+ message(SEND_ERROR "Should fail passed ${TRY_OUT}")
+ endif()
+
+endif()
+
#######################################################################
#
# also test that the check_prototype_definition macro works
diff --git a/Tests/TryCompile/fail.m b/Tests/TryCompile/fail.m
new file mode 100644
index 000000000..b915ebe4c
--- /dev/null
+++ b/Tests/TryCompile/fail.m
@@ -0,0 +1 @@
+asdflkjasdlj
diff --git a/Tests/TryCompile/pass.m b/Tests/TryCompile/pass.m
new file mode 100644
index 000000000..f8b643afb
--- /dev/null
+++ b/Tests/TryCompile/pass.m
@@ -0,0 +1,4 @@
+int main()
+{
+ return 0;
+}
diff --git a/Tests/Tutorial/Complete/CMakeLists.txt b/Tests/Tutorial/Complete/CMakeLists.txt
deleted file mode 100644
index 9658e6536..000000000
--- a/Tests/Tutorial/Complete/CMakeLists.txt
+++ /dev/null
@@ -1,116 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-# control where the static and shared libraries are built so that on windows
-# we don't need to tinker with the path to run the executable
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-if(APPLE)
- set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
-elseif(UNIX)
- set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
-endif()
-
-# configure a header file to pass the version number only
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library
-add_subdirectory(MathFunctions)
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial MathFunctions)
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-enable_testing()
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-include(InstallRequiredSystemLibraries)
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-include(CPack)
-
-# install the configuration targets
-install(EXPORT MathFunctionsTargets
- FILE MathFunctionsTargets.cmake
- DESTINATION lib/cmake/MathFunctions
-)
-
-include(CMakePackageConfigHelpers)
-# generate the config file that is includes the exports
-configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
- "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
- INSTALL_DESTINATION "lib/cmake/example"
- NO_SET_AND_CHECK_MACRO
- NO_CHECK_REQUIRED_COMPONENTS_MACRO
- )
-# generate the version file for the config file
-write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
- VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
- COMPATIBILITY AnyNewerVersion
-)
-
-# install the configuration file
-install(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
- DESTINATION lib/cmake/MathFunctions
- )
-
-# generate the export targets for the build tree
-# needs to be after the install(TARGETS ) command
-export(EXPORT MathFunctionsTargets
- FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
-)
diff --git a/Tests/Tutorial/Complete/Config.cmake.in b/Tests/Tutorial/Complete/Config.cmake.in
deleted file mode 100644
index 17cbabd99..000000000
--- a/Tests/Tutorial/Complete/Config.cmake.in
+++ /dev/null
@@ -1,4 +0,0 @@
-
-@PACKAGE_INIT@
-
-include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
diff --git a/Tests/Tutorial/Complete/License.txt b/Tests/Tutorial/Complete/License.txt
deleted file mode 100644
index c62d00b9e..000000000
--- a/Tests/Tutorial/Complete/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 161ad6449..000000000
--- a/Tests/Tutorial/Complete/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-
-# add the library that runs
-add_library(MathFunctions MathFunctions.cxx)
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-target_include_directories(MathFunctions
- INTERFACE
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
- $<INSTALL_INTERFACE:include>
- )
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-if(USE_MYMATH)
-
- # does this system provide the log and exp functions?
- include(CheckSymbolExists)
- set(CMAKE_REQUIRED_LIBRARIES "m")
- check_symbol_exists(log "math.h" HAVE_LOG)
- check_symbol_exists(exp "math.h" HAVE_EXP)
-
- # first we add the executable that generates the table
- add_executable(MakeTable MakeTable.cxx)
-
- # add the command to generate the source code
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
- # library that just does sqrt
- add_library(SqrtLibrary STATIC
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
- # state that we depend on our binary dir to find Table.h
- target_include_directories(SqrtLibrary PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
- set_target_properties(SqrtLibrary PROPERTIES
- POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
- )
-
- target_compile_definitions(SqrtLibrary PRIVATE
- "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
- "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
- )
- target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
-endif()
-
-target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
-
-# define the symbol stating we are using the declspec(dllexport) when
-# building on windows
-target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-
-# setup the version numbering
-set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
-set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
-
-install(TARGETS MathFunctions
- DESTINATION lib
- EXPORT MathFunctionsTargets)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/Complete/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx
deleted file mode 100644
index 5351184be..000000000
--- a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.cxx
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include "MathFunctions.h"
-#include <cmath>
-
-#ifdef USE_MYMATH
-# include "mysqrt.h"
-#endif
-
-namespace mathfunctions {
-double sqrt(double x)
-{
-#ifdef USE_MYMATH
- return detail::mysqrt(x);
-#else
- return std::sqrt(x);
-#endif
-}
-}
diff --git a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h b/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h
deleted file mode 100644
index 3fb547b4a..000000000
--- a/Tests/Tutorial/Complete/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#if defined(_WIN32)
-# if defined(EXPORTING_MYMATH)
-# define DECLSPEC __declspec(dllexport)
-# else
-# define DECLSPEC __declspec(dllimport)
-# endif
-#else // non windows
-# define DECLSPEC
-#endif
-
-namespace mathfunctions {
-double DECLSPEC sqrt(double x);
-}
diff --git a/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 96d94212d..000000000
--- a/Tests/Tutorial/Complete/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// include the generated table
-#include "Table.h"
-
-#include <cmath>
-
-namespace mathfunctions {
-namespace detail {
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = exp(log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
- << std::endl;
-#else
- // use the table to help find an initial value
- double result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
-
- // if we have both log and exp then use them
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-#endif
- return result;
-}
-}
-}
diff --git a/Tests/Tutorial/Complete/MathFunctions/mysqrt.h b/Tests/Tutorial/Complete/MathFunctions/mysqrt.h
deleted file mode 100644
index e1c42ef0c..000000000
--- a/Tests/Tutorial/Complete/MathFunctions/mysqrt.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-namespace mathfunctions {
-namespace detail {
-double mysqrt(double x);
-}
-}
diff --git a/Tests/Tutorial/Complete/TutorialConfig.h.in b/Tests/Tutorial/Complete/TutorialConfig.h.in
deleted file mode 100644
index 8cd2fc9c6..000000000
--- a/Tests/Tutorial/Complete/TutorialConfig.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-// the configured version number
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Complete/tutorial.cxx b/Tests/Tutorial/Complete/tutorial.cxx
deleted file mode 100644
index 443d19555..000000000
--- a/Tests/Tutorial/Complete/tutorial.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that computes the square root of a number
-#include <iostream>
-#include <sstream>
-#include <string>
-
-#include "MathFunctions.h"
-#include "TutorialConfig.h"
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
- const double outputValue = mathfunctions::sqrt(inputValue);
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Consumer/CMakeLists.txt b/Tests/Tutorial/Consumer/CMakeLists.txt
deleted file mode 100644
index 4033b4da8..000000000
--- a/Tests/Tutorial/Consumer/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-
-if(NOT DEFINED CMAKE_CXX_STANDARD)
- set(CMAKE_CXX_STANDARD 11)
- set(CMAKE_CXX_STANDARD_REQUIRED True)
-endif()
-
-
-function(find_external_dependency name)
- set(${name}_ROOT "" CACHE PATH "Root directory to find ${name}")
- mark_as_advanced(${name}_DIR)
- find_package(${name} PATHS ${${name}_ROOT} REQUIRED)
-endfunction()
-
-
-project(Consumer)
-
-find_external_dependency(MathFunctions)
-
-add_library(consumer consumer.cxx)
-target_link_libraries(consumer PUBLIC MathFunctions)
-
-# install the consumer library
-install(TARGETS consumer DESTINATION bin EXPORT ConsumerTargets)
-
-# install the configuration targets
-install(EXPORT ConsumerTargets
- FILE ConsumerTargets.cmake
- DESTINATION lib/cmake/Consumer
-)
-
-include(CMakePackageConfigHelpers)
-# generate the config file that is includes the exports
-configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
- "${CMAKE_CURRENT_BINARY_DIR}/ConsumerConfig.cmake"
- INSTALL_DESTINATION "lib/cmake/example"
- NO_SET_AND_CHECK_MACRO
- NO_CHECK_REQUIRED_COMPONENTS_MACRO
- )
-
-# install the configuration file
-install(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/ConsumerConfig.cmake
- DESTINATION lib/cmake/Consumer
- )
-
-# generate the export targets for the build tree
-# needs to be after the install(TARGETS ) command
-export(EXPORT ConsumerTargets
- FILE "${CMAKE_CURRENT_BINARY_DIR}/ConsumerTargets.cmake"
-)
diff --git a/Tests/Tutorial/Consumer/Config.cmake.in b/Tests/Tutorial/Consumer/Config.cmake.in
deleted file mode 100644
index 0b3f1e4ef..000000000
--- a/Tests/Tutorial/Consumer/Config.cmake.in
+++ /dev/null
@@ -1,14 +0,0 @@
-
-@PACKAGE_INIT@
-
-include(CMakeFindDependencyMacro)
-
-function(find_external_dependency name)
- set(${name}_ROOT "" CACHE PATH "Root directory to find ${name}")
- mark_as_advanced(${name}_DIR)
- find_dependency(${name} PATHS ${${name}_ROOT} REQUIRED)
-endfunction()
-
-find_external_dependency(MathFunctions)
-
-include ( "${CMAKE_CURRENT_LIST_DIR}/ConsumerTargets.cmake" )
diff --git a/Tests/Tutorial/Consumer/consumer.cxx b/Tests/Tutorial/Consumer/consumer.cxx
deleted file mode 100644
index ae7877b5a..000000000
--- a/Tests/Tutorial/Consumer/consumer.cxx
+++ /dev/null
@@ -1,11 +0,0 @@
-// A simple function that computes the square root of a number
-#include <iostream>
-#include <sstream>
-#include <string>
-
-#include "MathFunctions.h"
-
-double string_square_root(std::string const& value)
-{
- return mathfunctions::sqrt(std::stod(value));
-}
diff --git a/Tests/Tutorial/Consumer/directions.txt b/Tests/Tutorial/Consumer/directions.txt
deleted file mode 100644
index 6a70aab5e..000000000
--- a/Tests/Tutorial/Consumer/directions.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-# Import a CMake Project#
-
-This examples shows how a project can find other CMake packages that
-generated Config.cmake files.
-
-It also shows how to state a projects external dependencies when generating a Config.cmake.
diff --git a/Tests/Tutorial/MultiPackage/CMakeLists.txt b/Tests/Tutorial/MultiPackage/CMakeLists.txt
deleted file mode 100644
index 067e80729..000000000
--- a/Tests/Tutorial/MultiPackage/CMakeLists.txt
+++ /dev/null
@@ -1,109 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-# control how we mark up Debug libraries compared to Release libraries
-set(CMAKE_DEBUG_POSTFIX "-d")
-
-# control where the static and shared libraries are built so that on windows
-# we don't need to tinker with the path to run the executable
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-
-option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass the version number only
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library
-add_subdirectory(MathFunctions)
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial MathFunctions)
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-enable_testing()
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-include(InstallRequiredSystemLibraries)
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-include(CPack)
-
-# install the configuration targets
-install(EXPORT MathFunctionsTargets
- FILE MathFunctionsTargets.cmake
- DESTINATION lib/cmake/MathFunctions
-)
-
-include(CMakePackageConfigHelpers)
-# generate the config file that is includes the exports
-configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
- "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
- INSTALL_DESTINATION "lib/cmake/example"
- NO_SET_AND_CHECK_MACRO
- NO_CHECK_REQUIRED_COMPONENTS_MACRO
- )
-# generate the version file for the config file
-write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
- VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
- COMPATIBILITY AnyNewerVersion
-)
-
-# install the configuration file
-install(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
- DESTINATION lib/cmake/MathFunctions
- )
-
-# generate the export targets for the build tree
-# needs to be after the install(TARGETS ) command
-export(EXPORT MathFunctionsTargets
- FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
-)
diff --git a/Tests/Tutorial/MultiPackage/Config.cmake.in b/Tests/Tutorial/MultiPackage/Config.cmake.in
deleted file mode 100644
index 17cbabd99..000000000
--- a/Tests/Tutorial/MultiPackage/Config.cmake.in
+++ /dev/null
@@ -1,4 +0,0 @@
-
-@PACKAGE_INIT@
-
-include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
diff --git a/Tests/Tutorial/MultiPackage/License.txt b/Tests/Tutorial/MultiPackage/License.txt
deleted file mode 100644
index c62d00b9e..000000000
--- a/Tests/Tutorial/MultiPackage/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt b/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 161ad6449..000000000
--- a/Tests/Tutorial/MultiPackage/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-
-# add the library that runs
-add_library(MathFunctions MathFunctions.cxx)
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-target_include_directories(MathFunctions
- INTERFACE
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
- $<INSTALL_INTERFACE:include>
- )
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-if(USE_MYMATH)
-
- # does this system provide the log and exp functions?
- include(CheckSymbolExists)
- set(CMAKE_REQUIRED_LIBRARIES "m")
- check_symbol_exists(log "math.h" HAVE_LOG)
- check_symbol_exists(exp "math.h" HAVE_EXP)
-
- # first we add the executable that generates the table
- add_executable(MakeTable MakeTable.cxx)
-
- # add the command to generate the source code
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
- # library that just does sqrt
- add_library(SqrtLibrary STATIC
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
- # state that we depend on our binary dir to find Table.h
- target_include_directories(SqrtLibrary PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
- set_target_properties(SqrtLibrary PROPERTIES
- POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
- )
-
- target_compile_definitions(SqrtLibrary PRIVATE
- "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
- "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
- )
- target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
-endif()
-
-target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
-
-# define the symbol stating we are using the declspec(dllexport) when
-# building on windows
-target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-
-# setup the version numbering
-set_property(TARGET MathFunctions PROPERTY VERSION "1.0.0")
-set_property(TARGET MathFunctions PROPERTY SOVERSION "1")
-
-install(TARGETS MathFunctions
- DESTINATION lib
- EXPORT MathFunctionsTargets)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/MultiPackage/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx
deleted file mode 100644
index 5351184be..000000000
--- a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.cxx
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include "MathFunctions.h"
-#include <cmath>
-
-#ifdef USE_MYMATH
-# include "mysqrt.h"
-#endif
-
-namespace mathfunctions {
-double sqrt(double x)
-{
-#ifdef USE_MYMATH
- return detail::mysqrt(x);
-#else
- return std::sqrt(x);
-#endif
-}
-}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h b/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h
deleted file mode 100644
index 3fb547b4a..000000000
--- a/Tests/Tutorial/MultiPackage/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#if defined(_WIN32)
-# if defined(EXPORTING_MYMATH)
-# define DECLSPEC __declspec(dllexport)
-# else
-# define DECLSPEC __declspec(dllimport)
-# endif
-#else // non windows
-# define DECLSPEC
-#endif
-
-namespace mathfunctions {
-double DECLSPEC sqrt(double x);
-}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 96d94212d..000000000
--- a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// include the generated table
-#include "Table.h"
-
-#include <cmath>
-
-namespace mathfunctions {
-namespace detail {
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = exp(log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
- << std::endl;
-#else
- // use the table to help find an initial value
- double result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
-
- // if we have both log and exp then use them
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-#endif
- return result;
-}
-}
-}
diff --git a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h b/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h
deleted file mode 100644
index e1c42ef0c..000000000
--- a/Tests/Tutorial/MultiPackage/MathFunctions/mysqrt.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-namespace mathfunctions {
-namespace detail {
-double mysqrt(double x);
-}
-}
diff --git a/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake b/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake
deleted file mode 100644
index 403b633e1..000000000
--- a/Tests/Tutorial/MultiPackage/MultiCPackConfig.cmake
+++ /dev/null
@@ -1,7 +0,0 @@
-
-include("release/CPackConfig.cmake")
-
-set(CPACK_INSTALL_CMAKE_PROJECTS
- "debug;Tutorial;ALL;/"
- "release;Tutorial;ALL;/"
- )
diff --git a/Tests/Tutorial/MultiPackage/TutorialConfig.h.in b/Tests/Tutorial/MultiPackage/TutorialConfig.h.in
deleted file mode 100644
index 8cd2fc9c6..000000000
--- a/Tests/Tutorial/MultiPackage/TutorialConfig.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-// the configured version number
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/MultiPackage/directions.txt b/Tests/Tutorial/MultiPackage/directions.txt
deleted file mode 100644
index c3102bb10..000000000
--- a/Tests/Tutorial/MultiPackage/directions.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-# Packaging Debug and Release #
-
-By default CMake is model is that a build directory only contains a single
-configuration, be it Debug, Release, MinSizeRel, or RelWithDebInfo.
-
-But it is possible to setup CPack to bundle multiple build directories at the same
-time to build a package that contains multiple configurations of the same project.
-
-First we need to ahead and construct a directory called 'multi_config' this
-will contain all the builds that we want to package together.
-
-Second create a 'debug' and 'release' directory underneath 'multi_config'. At
-the end you should have a layout that looks like:
-
-─ multi_config
- ├── debug
- └── release
-
-Now we need to setup debug and release builds, which would roughly entail
-the following:
-
- cd debug
- cmake -DCMAKE_BUILD_TYPE=Debug ../../MultiPackage/
- cmake --build .
- cd ../release
- cmake -DCMAKE_BUILD_TYPE=Release ../../MultiPackage/
- cmake --build .
- cd ..
-
-
-Now that both the debug and release builds are complete we can now use
-the custom MultiCPackConfig to package both builds into a single release.
-
- cpack --config ../../MultiPackage/MultiCPackConfig.cmake
diff --git a/Tests/Tutorial/MultiPackage/tutorial.cxx b/Tests/Tutorial/MultiPackage/tutorial.cxx
deleted file mode 100644
index 443d19555..000000000
--- a/Tests/Tutorial/MultiPackage/tutorial.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that computes the square root of a number
-#include <iostream>
-#include <sstream>
-#include <string>
-
-#include "MathFunctions.h"
-#include "TutorialConfig.h"
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
- const double outputValue = mathfunctions::sqrt(inputValue);
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Readme.txt b/Tests/Tutorial/Readme.txt
deleted file mode 100644
index 74eb01ae5..000000000
--- a/Tests/Tutorial/Readme.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-Step 0: A Starting Point
-Step 1: Configure a File and C++11 Controls
-Step 2: Adding a Library
-Step 3: Usage Requirements for Library
-Step 4: Installing and Testing
-Step 5: System Introspection
-Step 6: Custom Command and Generated File
-Step 7: Building an Installer
-Step 8: CDash submission
-Step 9: Mixing Static and Shared
-Step 10: Generator Expressions
-Step 11: Adding Export Configuration
-Complete: End result of Step 11
-Consumer: Example of Import Packages
-MultiPackage: How to package Debug and Release versions
diff --git a/Tests/Tutorial/Step1/CMakeLists.txt b/Tests/Tutorial/Step1/CMakeLists.txt
deleted file mode 100644
index 141f0c27a..000000000
--- a/Tests/Tutorial/Step1/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-project(Tutorial)
-
-add_executable(Tutorial tutorial.cxx)
diff --git a/Tests/Tutorial/Step1/TutorialConfig.h.in b/Tests/Tutorial/Step1/TutorialConfig.h.in
deleted file mode 100644
index 5395a0671..000000000
--- a/Tests/Tutorial/Step1/TutorialConfig.h.in
+++ /dev/null
@@ -1,4 +0,0 @@
-// the configured options and settings for Tutorial
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-
diff --git a/Tests/Tutorial/Step1/directions.txt b/Tests/Tutorial/Step1/directions.txt
deleted file mode 100644
index 827d7754d..000000000
--- a/Tests/Tutorial/Step1/directions.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-# Adding a Version Number and Configured Header File #
-
-The first feature we will add is to provide our executable and project with a
-version number. While we could do this exclusively in the source code, using
-CMakeLists provides more flexibility.
-
-To add a version number we modify the CMakeLists file as follows:
-
- cmake_minimum_required(VERSION 3.3)
- project(Tutorial)
-
- # the version number.
- set(Tutorial_VERSION_MAJOR 1)
- set(Tutorial_VERSION_MINOR 0)
-
- # configure a header file to pass some of the CMake settings
- # to the source code
- configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
- # add the executable
- add_executable(Tutorial tutorial.cxx)
-
- # add the binary tree to the search path for include files
- # so that we will find TutorialConfig.h
- target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-
-We then create a TutorialConfig.h.in file in the source tree with the
-following contents:
-
- // the configured options and settings for Tutorial
- #define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
- #define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-
-When CMake configures this header file the values for @Tutorial_VERSION_MAJOR@
-and @Tutorial_VERSION_MINOR@ will be replaced by the values from the CMakeLists
-file. Next we modify tutorial.cxx to include the configured header file and to
-make use of the version numbers. The resulting source code is listed below.
-
- // A simple program that computes the square root of a number
- #include <cmath>
- #include <iostream>
- #include <string>
- #include <sstream>
-
- #include "TutorialConfig.h"
-
- int main (int argc, char *argv[])
- {
- if (argc < 2) {
- std::cout << argv[0] << " Version "
- << Tutorial_VERSION_MAJOR << "." << Tutorial_VERSION_MINOR
- << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = atof(argv[1]);
-
- double outputValue = sqrt(inputValue);
- std::cout << "The square root of "
- << inputValue << " is " << outputValue << std::endl;
- return 0;
- }
-
-# Adding C++11 support #
-
-Let's add some C++11 features to our project. We will need to explicitly state
-in the CMake code that it should use the correct flags. The easiest way to
-enable C++11 support for CMake is by using the CMAKE_CXX_STANDARD
-and CMAKE_CXX_STANDARD_REQUIRED variables.
-
-First, replace `atof` with `std::stod` in tutorial.cxx.
-
-Then, add the CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED variables to
-the CMakeLists file. The STANADARD value should be set to 11, and REQUIRED
-should be set to True.
-
-
-# Build and Test #
-
-Run cmake or cmake-gui to configure the project and then build it with your
-chosen build tool
-
-cd to the directory where Tutorial was built (likely the make directory or
-a Debug or Release build configuration subdirectory) and run these commands:
-
- Tutorial 4294967296
- Tutorial 10
- Tutorial
diff --git a/Tests/Tutorial/Step1/tutorial.cxx b/Tests/Tutorial/Step1/tutorial.cxx
deleted file mode 100644
index f8dd0c6c8..000000000
--- a/Tests/Tutorial/Step1/tutorial.cxx
+++ /dev/null
@@ -1,20 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <cstdlib>
-#include <iostream>
-#include <string>
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = atof(argv[1]);
-
- double outputValue = sqrt(inputValue);
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step10/CMakeLists.txt b/Tests/Tutorial/Step10/CMakeLists.txt
deleted file mode 100644
index b1d46c4b9..000000000
--- a/Tests/Tutorial/Step10/CMakeLists.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-# control where the static and shared libraries are built so that on windows
-# we don't need to tinker with the path to run the executable
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass the version number only
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library
-add_subdirectory(MathFunctions)
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial MathFunctions)
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-enable_testing()
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-include(InstallRequiredSystemLibraries)
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-include(CPack)
diff --git a/Tests/Tutorial/Step10/License.txt b/Tests/Tutorial/Step10/License.txt
deleted file mode 100644
index c62d00b9e..000000000
--- a/Tests/Tutorial/Step10/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 7a2350572..000000000
--- a/Tests/Tutorial/Step10/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-
-# add the library that runs
-add_library(MathFunctions MathFunctions.cxx)
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- )
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-if(USE_MYMATH)
-
- # does this system provide the log and exp functions?
- include(CheckSymbolExists)
- set(CMAKE_REQUIRED_LIBRARIES "m")
- check_symbol_exists(log "math.h" HAVE_LOG)
- check_symbol_exists(exp "math.h" HAVE_EXP)
-
- # first we add the executable that generates the table
- add_executable(MakeTable MakeTable.cxx)
-
- # add the command to generate the source code
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
- # library that just does sqrt
- add_library(SqrtLibrary STATIC
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
- # state that we depend on our binary dir to find Table.h
- target_include_directories(SqrtLibrary PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
- # state that SqrtLibrary need PIC when the default is shared libraries
- set_target_properties(SqrtLibrary PROPERTIES
- POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
- )
-
- target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
- if(HAVE_LOG AND HAVE_EXP)
- target_compile_definitions(SqrtLibrary
- PRIVATE "HAVE_LOG" "HAVE_EXP")
- endif()
-
- target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
-endif()
-
-# define the symbol stating we are using the declspec(dllexport) when
-# building on windows
-target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-
-install(TARGETS MathFunctions DESTINATION lib)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/Step10/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx
deleted file mode 100644
index 5351184be..000000000
--- a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.cxx
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include "MathFunctions.h"
-#include <cmath>
-
-#ifdef USE_MYMATH
-# include "mysqrt.h"
-#endif
-
-namespace mathfunctions {
-double sqrt(double x)
-{
-#ifdef USE_MYMATH
- return detail::mysqrt(x);
-#else
- return std::sqrt(x);
-#endif
-}
-}
diff --git a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h
deleted file mode 100644
index 3fb547b4a..000000000
--- a/Tests/Tutorial/Step10/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#if defined(_WIN32)
-# if defined(EXPORTING_MYMATH)
-# define DECLSPEC __declspec(dllexport)
-# else
-# define DECLSPEC __declspec(dllimport)
-# endif
-#else // non windows
-# define DECLSPEC
-#endif
-
-namespace mathfunctions {
-double DECLSPEC sqrt(double x);
-}
diff --git a/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 96d94212d..000000000
--- a/Tests/Tutorial/Step10/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// include the generated table
-#include "Table.h"
-
-#include <cmath>
-
-namespace mathfunctions {
-namespace detail {
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = exp(log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
- << std::endl;
-#else
- // use the table to help find an initial value
- double result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
-
- // if we have both log and exp then use them
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-#endif
- return result;
-}
-}
-}
diff --git a/Tests/Tutorial/Step10/MathFunctions/mysqrt.h b/Tests/Tutorial/Step10/MathFunctions/mysqrt.h
deleted file mode 100644
index e1c42ef0c..000000000
--- a/Tests/Tutorial/Step10/MathFunctions/mysqrt.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-namespace mathfunctions {
-namespace detail {
-double mysqrt(double x);
-}
-}
diff --git a/Tests/Tutorial/Step10/TutorialConfig.h.in b/Tests/Tutorial/Step10/TutorialConfig.h.in
deleted file mode 100644
index 8cd2fc9c6..000000000
--- a/Tests/Tutorial/Step10/TutorialConfig.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-// the configured version number
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step10/directions.txt b/Tests/Tutorial/Step10/directions.txt
deleted file mode 100644
index 5317b5430..000000000
--- a/Tests/Tutorial/Step10/directions.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-# Adding Generator Expressions #
-
-Generator expressions are evaluated during build system generation to produce
-information specific to each build configuration.
-
-Generator expressions are allowed in the context of many target properties, such
-as LINK_LIBRARIES, INCLUDE_DIRECTORIES, COMPILE_DEFINITIONS and others. They may
-also be used when using commands to populate those properties, such as
-target_link_libraries(), target_include_directories(),
-target_compile_definitions() and others.
-
-Generator expressions may to used to enable conditional linking, conditional
-definitions used when compiling, and conditional include directories and more.
-The conditions may be based on the build configuration, target properties,
-platform information or any other queryable information.
-
-There are different types of generator expressions including Logical,
-Informational, and Output expressions.
-
-Logical expressions are used to create conditional output. The basic expressions
-are the 0 and 1 expressions. A "$<0:...>" results in the empty string, and
-"$<1:...>" results in the content of "...". They can also be nested.
-For example:
-
- if(HAVE_LOG AND HAVE_EXP)
- target_compile_definitions(SqrtLibrary
- PRIVATE "HAVE_LOG" "HAVE_EXP")
- endif()
-
-Can be rewritten with generator expressions:
-
- target_compile_definitions(SqrtLibrary PRIVATE
- "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
- "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
- )
-
-Note that "${HAVE_LOG}" is evaluated at CMake configure time while
-"$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>" is evaluated at build system generation time.
diff --git a/Tests/Tutorial/Step10/tutorial.cxx b/Tests/Tutorial/Step10/tutorial.cxx
deleted file mode 100644
index 443d19555..000000000
--- a/Tests/Tutorial/Step10/tutorial.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that computes the square root of a number
-#include <iostream>
-#include <sstream>
-#include <string>
-
-#include "MathFunctions.h"
-#include "TutorialConfig.h"
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
- const double outputValue = mathfunctions::sqrt(inputValue);
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step11/CMakeLists.txt b/Tests/Tutorial/Step11/CMakeLists.txt
deleted file mode 100644
index b1d46c4b9..000000000
--- a/Tests/Tutorial/Step11/CMakeLists.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-# control where the static and shared libraries are built so that on windows
-# we don't need to tinker with the path to run the executable
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass the version number only
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library
-add_subdirectory(MathFunctions)
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial MathFunctions)
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-enable_testing()
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-include(InstallRequiredSystemLibraries)
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-include(CPack)
diff --git a/Tests/Tutorial/Step11/License.txt b/Tests/Tutorial/Step11/License.txt
deleted file mode 100644
index c62d00b9e..000000000
--- a/Tests/Tutorial/Step11/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 760d6a57c..000000000
--- a/Tests/Tutorial/Step11/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-
-# add the library that runs
-add_library(MathFunctions MathFunctions.cxx)
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- )
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-if(USE_MYMATH)
-
- # does this system provide the log and exp functions?
- include(CheckSymbolExists)
- set(CMAKE_REQUIRED_LIBRARIES "m")
- check_symbol_exists(log "math.h" HAVE_LOG)
- check_symbol_exists(exp "math.h" HAVE_EXP)
-
- # first we add the executable that generates the table
- add_executable(MakeTable MakeTable.cxx)
-
- # add the command to generate the source code
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
- # library that just does sqrt
- add_library(SqrtLibrary STATIC
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
- # state that we depend on our binary dir to find Table.h
- target_include_directories(SqrtLibrary PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
- set_target_properties(SqrtLibrary PROPERTIES
- POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS}
- )
-
- target_compile_definitions(SqrtLibrary PRIVATE
- "$<$<BOOL:${HAVE_LOG}>:HAVE_LOG>"
- "$<$<BOOL:${HAVE_EXP}>:HAVE_EXP>"
- )
- target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
-endif()
-
-target_compile_definitions(MathFunctions PRIVATE "$<$<BOOL:${USE_MYMATH}>:USE_MYMATH>")
-
-# define the symbol stating we are using the declspec(dllexport) when
-#building on windows
-target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-
-install(TARGETS MathFunctions DESTINATION lib)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/Step11/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx
deleted file mode 100644
index 5351184be..000000000
--- a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.cxx
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include "MathFunctions.h"
-#include <cmath>
-
-#ifdef USE_MYMATH
-# include "mysqrt.h"
-#endif
-
-namespace mathfunctions {
-double sqrt(double x)
-{
-#ifdef USE_MYMATH
- return detail::mysqrt(x);
-#else
- return std::sqrt(x);
-#endif
-}
-}
diff --git a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h
deleted file mode 100644
index 3fb547b4a..000000000
--- a/Tests/Tutorial/Step11/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1,14 +0,0 @@
-
-#if defined(_WIN32)
-# if defined(EXPORTING_MYMATH)
-# define DECLSPEC __declspec(dllexport)
-# else
-# define DECLSPEC __declspec(dllimport)
-# endif
-#else // non windows
-# define DECLSPEC
-#endif
-
-namespace mathfunctions {
-double DECLSPEC sqrt(double x);
-}
diff --git a/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 96d94212d..000000000
--- a/Tests/Tutorial/Step11/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// include the generated table
-#include "Table.h"
-
-#include <cmath>
-
-namespace mathfunctions {
-namespace detail {
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = exp(log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
- << std::endl;
-#else
- // use the table to help find an initial value
- double result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
-
- // if we have both log and exp then use them
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-#endif
- return result;
-}
-}
-}
diff --git a/Tests/Tutorial/Step11/MathFunctions/mysqrt.h b/Tests/Tutorial/Step11/MathFunctions/mysqrt.h
deleted file mode 100644
index e1c42ef0c..000000000
--- a/Tests/Tutorial/Step11/MathFunctions/mysqrt.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-namespace mathfunctions {
-namespace detail {
-double mysqrt(double x);
-}
-}
diff --git a/Tests/Tutorial/Step11/TutorialConfig.h.in b/Tests/Tutorial/Step11/TutorialConfig.h.in
deleted file mode 100644
index 8cd2fc9c6..000000000
--- a/Tests/Tutorial/Step11/TutorialConfig.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-// the configured version number
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step11/directions.txt b/Tests/Tutorial/Step11/directions.txt
deleted file mode 100644
index ebb5defff..000000000
--- a/Tests/Tutorial/Step11/directions.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-# Adding Export Configuration #
-
-During Step 4 of the tutorial we added the ability for CMake to install the
-library and headers of the project. During Step 7 we added the ability
-to package up this information so it could be distributed to other people.
-
-The next step is to add the necessary information so that other CMake projects
-can use our project, be it from a build directory, a local install or when
-packaged.
-
-The first step is to update our install(TARGETS) commands to not only specify
-a DESTINATION but also an EXPORT. The EXPORT keyword generates and installs a
-CMake file containing code to import all targets listed in the install command
-from the installation tree. So let's go ahead and explicitly EXPORT the
-MathFunctions library by updating the install command in
-MathFunctions/CMakeLists.txt to look like:
-
- install(TARGETS MathFunctions DESTINATION lib EXPORT MathFunctionsTargets)
-
-Now that we have MathFunctions being exported, we also need to explicitly install
-the generated MathFunctionsTargets.cmake file. This is done by adding
-the following to the bottom of the top-level CMakeLists.txt:
-
- # install the configuration targets
- install(EXPORT MathFunctionsTargets
- FILE MathFunctionsTargets.cmake
- DESTINATION lib/cmake/MathFunctions
- )
-
-At this point you should try and run CMake. If everything is setup properly
-you will see that CMake will generate an error that looks like:
-
- Target "MathFunctions" INTERFACE_INCLUDE_DIRECTORIES property contains
- path:
-
- "/Users/robert/Documents/CMakeClass/Tutorial/Step11/MathFunctions"
-
- which is prefixed in the source directory.
-
-What CMake is trying to say is that during generating the export information
-it will export a path that is intrinsically tied to the current machine and
-will not be valid on other machines. The solution to this is to update the
-MathFunctions target_include_directories to understand that it needs different
-INTERFACE locations when being used from within the build directory and from an
-install / package. This means converting the target_include_directories
-call for MathFunctions to look like:
-
- target_include_directories(MathFunctions
- INTERFACE
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
- $<INSTALL_INTERFACE:include>
- )
-
-Once this has been updated, we can re-run CMake and see verify that it doesn't
-warn anymore.
-
-At this point, we have CMake properly packaging the target information that is
-required but we will still need to generate a MathFunctionsConfig.cmake, so
-that the CMake find_package command can find our project. So let's go ahead and
-add a new file to the top-level of the project called Config.cmake.in with the
-following contents:
-
- @PACKAGE_INIT@
-
- include ( "${CMAKE_CURRENT_LIST_DIR}/MathFunctionsTargets.cmake" )
-
-Then, to properly configure and install that file, add the following to the
-bottom of the top-level CMakeLists:
-
- include(CMakePackageConfigHelpers)
- # generate the config file that is includes the exports
- configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
- "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake"
- INSTALL_DESTINATION "lib/cmake/example"
- NO_SET_AND_CHECK_MACRO
- NO_CHECK_REQUIRED_COMPONENTS_MACRO
- )
- # generate the version file for the config file
- write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfigVersion.cmake"
- VERSION "${Tutorial_VERSION_MAJOR}.${Tutorial_VERSION_MINOR}"
- COMPATIBILITY AnyNewerVersion
- )
-
- # install the configuration file
- install(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsConfig.cmake
- DESTINATION lib/cmake/MathFunctions
- )
-
-At this point, we have generated a relocatable CMake Configuration for our project
-that can be used after the project has been installed or packaged. If we want
-our project to also be used from a build directory we only have to add
-the following to the bottom of the top level CMakeLists:
-
- # generate the export targets for the build tree
- # needs to be after the install(TARGETS ) command
- export(EXPORT MathFunctionsTargets
- FILE "${CMAKE_CURRENT_BINARY_DIR}/MathFunctionsTargets.cmake"
- )
-
-With this export call we now generate a Targets.cmake, allowing the configured
-MathFunctionsConfig.cmake in the build directory to be used by other projects,
-without needing it to be installed.
diff --git a/Tests/Tutorial/Step11/tutorial.cxx b/Tests/Tutorial/Step11/tutorial.cxx
deleted file mode 100644
index 376885526..000000000
--- a/Tests/Tutorial/Step11/tutorial.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <string>
-
-#include "MathFunctions.h"
-#include "TutorialConfig.h"
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
- const double outputValue = mathfunctions::sqrt(inputValue);
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step2/CMakeLists.txt b/Tests/Tutorial/Step2/CMakeLists.txt
deleted file mode 100644
index 48afaa327..000000000
--- a/Tests/Tutorial/Step2/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
diff --git a/Tests/Tutorial/Step2/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step2/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 8b443a659..000000000
--- a/Tests/Tutorial/Step2/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_library(MathFunctions mysqrt.cxx)
diff --git a/Tests/Tutorial/Step2/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step2/MathFunctions/MathFunctions.h
deleted file mode 100644
index cd36bccff..000000000
--- a/Tests/Tutorial/Step2/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1 +0,0 @@
-double mysqrt(double x);
diff --git a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 7d9379e43..000000000
--- a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- double result = x;
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
- return result;
-}
diff --git a/Tests/Tutorial/Step2/TutorialConfig.h.in b/Tests/Tutorial/Step2/TutorialConfig.h.in
deleted file mode 100644
index 5395a0671..000000000
--- a/Tests/Tutorial/Step2/TutorialConfig.h.in
+++ /dev/null
@@ -1,4 +0,0 @@
-// the configured options and settings for Tutorial
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-
diff --git a/Tests/Tutorial/Step2/directions.txt b/Tests/Tutorial/Step2/directions.txt
deleted file mode 100644
index bb6662c7e..000000000
--- a/Tests/Tutorial/Step2/directions.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-# Adding a Library #
-
-Now we will add a library to our project. This library will contain our own
-implementation for computing the square root of a number. The executable can
-then use this library instead of the standard square root function provided by
-the compiler.
-
-For this tutorial we will put the library into a subdirectory
-called MathFunctions. It will have the following one line CMakeLists file:
-
- add_library(MathFunctions mysqrt.cxx)
-
-The source file mysqrt.cxx has one function called mysqrt that provides similar
-functionality to the compiler’s sqrt function. To make use of the new library
-we add an add_subdirectory call in the top-level CMakeLists file so that the
-library will get built. We add the new library to the executable, and add the
-MathFunctions as an include directory so that mqsqrt.h header file can be
-found. The last few lines of the top-level CMakeLists file now look like:
-
-
- add_subdirectory(MathFunctions)
-
- #add the executable
- add_executable(Tutorial tutorial.cxx)
-
- target_link_libraries(Tutorial ${EXTRA_LIBS})
-
-
-Now let us make the MathFunctions library optional. While for the tutorial
-there really isn’t any need to do so, but with larger projects this is a common
-occurrence. The first step is to add an option to the top-level CMakeLists file.
-
- option (USE_MYMATH
- "Use tutorial provided math implementation" ON)
-
-This will show up in CMake GUI and ccmake with a default value of ON that can
-be changed by the user. This setting will be stored so that the user does not
-need to set the value each time they run CMake on this build directory.
-
-The next change is to make building and linking the MathFunctions library
-conditional. To do this we change the top-level CMakeLists file to look like
-the following:
-
- cmake_minimum_required(VERSION 3.3)
- project(Tutorial)
-
- set(CMAKE_CXX_STANDARD 11)
- set(CMAKE_CXX_STANDARD_REQUIRED True)
-
- # the version number.
- set(Tutorial_VERSION_MAJOR 1)
- set(Tutorial_VERSION_MINOR 0)
-
- # configure a header file to pass some of the CMake settings
- # to the source code
- configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
- # should we use our own math functions
- option(USE_MYMATH "Use tutorial provided math implementation" ON)
-
- # add the MathFunctions library?
- if(USE_MYMATH)
- add_subdirectory(MathFunctions)
- list(APPEND EXTRA_LIBS MathFunctions)
- list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions")
- endif(USE_MYMATH)
-
- # add the executable
- add_executable(Tutorial tutorial.cxx)
-
- target_link_libraries(Tutorial ${EXTRA_LIBS})
-
- # add the binary tree to the search path for include files
- # so that we will find TutorialConfig.h
- target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- ${EXTRA_INCLUDES}
- )
-
-Note the use of the variables EXTRA_LIBS, and EXTRA_INCLUDES to collect
-up any optional libraries to later be linked into the executable. This is a
-classic approach when dealing with many optional components, we will cover the
-modern approach in the next step. For now the corresponding changes to the
-source code are fairly straightforward and leave us with:
-
- #ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
- #else
- double outputValue = sqrt(inputValue);
- #endif
-
-Since the source code now requires USE_MYMATH we can add it to the
-TutorialConfig.h.in. Simply add the following line:
- #cmakedefine USE_MYMATH
-
-Run cmake or cmake-gui to configure the project and then build it with your
-chosen build tool and then run the built Tutorial executable.
-
-Which function gives better results, Step1’s sqrt or Step2’s mysqrt?
diff --git a/Tests/Tutorial/Step2/tutorial.cxx b/Tests/Tutorial/Step2/tutorial.cxx
deleted file mode 100644
index 75b7d67b0..000000000
--- a/Tests/Tutorial/Step2/tutorial.cxx
+++ /dev/null
@@ -1,23 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <string>
-
-#include "TutorialConfig.h"
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
- double outputValue = sqrt(inputValue);
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Tests/Tutorial/Step3/CMakeLists.txt
deleted file mode 100644
index f904ea748..000000000
--- a/Tests/Tutorial/Step3/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library?
-if(USE_MYMATH)
- add_subdirectory(MathFunctions)
- list(APPEND EXTRA_LIBS MathFunctions)
- list(APPEND EXTRA_INCLUDES "${PROJECT_SOURCE_DIR}/MathFunctions")
-endif(USE_MYMATH)
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-
-target_link_libraries(Tutorial ${EXTRA_LIBS})
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- ${EXTRA_INCLUDES}
- )
diff --git a/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 8b443a659..000000000
--- a/Tests/Tutorial/Step3/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1 +0,0 @@
-add_library(MathFunctions mysqrt.cxx)
diff --git a/Tests/Tutorial/Step3/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step3/MathFunctions/MathFunctions.h
deleted file mode 100644
index cd36bccff..000000000
--- a/Tests/Tutorial/Step3/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1 +0,0 @@
-double mysqrt(double x);
diff --git a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 7d9379e43..000000000
--- a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- double result = x;
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
- return result;
-}
diff --git a/Tests/Tutorial/Step3/TutorialConfig.h.in b/Tests/Tutorial/Step3/TutorialConfig.h.in
deleted file mode 100644
index 25a06020a..000000000
--- a/Tests/Tutorial/Step3/TutorialConfig.h.in
+++ /dev/null
@@ -1,5 +0,0 @@
-// the configured options and settings for Tutorial
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-#cmakedefine USE_MYMATH
-
diff --git a/Tests/Tutorial/Step3/directions.txt b/Tests/Tutorial/Step3/directions.txt
deleted file mode 100644
index 54d031806..000000000
--- a/Tests/Tutorial/Step3/directions.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-# Adding Usage Requirements for Library #
-
-Usage requirements allow for far better control over a library / executable's
-link and include line. While also giving more control over the transitive
-property of targets inside CMake. The primary commands that leverage usage
-requirements are:
-
- - target_compile_definitions
- - target_compile_options
- - target_include_directories
- - target_link_libraries
-
-First up is MathFunctions. We first state that anybody linking to MathFunctions
-needs to include the current source directory, while MathFunctions itself
-doesn't. So this can become an INTERFACE usage requirement.
-
-Remember INTERFACE means things that consumers require but the producer doesn't.
-
- target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
-
-Now that we've specified usage requirements for MathFunctions we can safely remove
-our uses of the EXTRA_INCLUDES variable.
-
-Run cmake or cmake-gui to configure the project and then build it with your
-chosen build tool.
diff --git a/Tests/Tutorial/Step3/tutorial.cxx b/Tests/Tutorial/Step3/tutorial.cxx
deleted file mode 100644
index 1d5742d2d..000000000
--- a/Tests/Tutorial/Step3/tutorial.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <string>
-
-#include "TutorialConfig.h"
-
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
-#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
-#else
- double outputValue = sqrt(inputValue);
-#endif
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Tests/Tutorial/Step4/CMakeLists.txt
deleted file mode 100644
index 34eab5558..000000000
--- a/Tests/Tutorial/Step4/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library?
-if(USE_MYMATH)
- add_subdirectory(MathFunctions)
- list(APPEND EXTRA_LIBS MathFunctions)
-endif(USE_MYMATH)
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
diff --git a/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 0515852a0..000000000
--- a/Tests/Tutorial/Step4/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-add_library(MathFunctions mysqrt.cxx)
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- )
diff --git a/Tests/Tutorial/Step4/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step4/MathFunctions/MathFunctions.h
deleted file mode 100644
index cd36bccff..000000000
--- a/Tests/Tutorial/Step4/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1 +0,0 @@
-double mysqrt(double x);
diff --git a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 7d9379e43..000000000
--- a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- double result = x;
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
- return result;
-}
diff --git a/Tests/Tutorial/Step4/TutorialConfig.h.in b/Tests/Tutorial/Step4/TutorialConfig.h.in
deleted file mode 100644
index 25a06020a..000000000
--- a/Tests/Tutorial/Step4/TutorialConfig.h.in
+++ /dev/null
@@ -1,5 +0,0 @@
-// the configured options and settings for Tutorial
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-#cmakedefine USE_MYMATH
-
diff --git a/Tests/Tutorial/Step4/directions.txt b/Tests/Tutorial/Step4/directions.txt
deleted file mode 100644
index 91e4043da..000000000
--- a/Tests/Tutorial/Step4/directions.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-# Installing and Testing #
-
-Now we can start adding testing support and install rules to our project.
-
-The install rules are fairly simple; for MathFunctions we install the library
-and header file, for the application we install the executable and configured
-header.
-
-So to MathFunctions/CMakeLists.txt we add:
-
- install (TARGETS MathFunctions DESTINATION bin)
- install (FILES MathFunctions.h DESTINATION include)
-
-And the to top-level CMakeLists.txt we add:
-
- install(TARGETS Tutorial DESTINATION bin)
- install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-That is all that is needed to create a basic local install of the tutorial.
-
-Run cmake or cmake-gui to configure the project and then build it with your
-chosen build tool. Then build the “install” target by typing 'make install'
-from the command line or build the INSTALL target from an IDE. This will
-install the appropriate header files, libraries, and executables.
-
-Verify that the installed Tutorial runs. Note: The CMake variable
-CMAKE_INSTALL_PREFIX is used to determine the root of where the files will
-be installed.
-
-Next let's test our application. Adding testing is an easy process. At the
-end of the top-level CMakeLists file we can add a number of basic tests to
-verify that the application is working correctly.
-
- # enable testing
- enable_testing()
-
- # does the application run
- add_test(NAME Runs COMMAND Tutorial 25)
-
- # does the usage message work?
- add_test(NAME Usage COMMAND Tutorial)
- set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
- # define a function to simplify adding tests
- function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
- endfunction(do_test)
-
- # do a bunch of result based tests
- do_test(Tutorial 25 "25 is 5")
- do_test(Tutorial -25 "-25 is [-nan|nan|0]")
- do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-The first test simply verifies that the application runs, does not segfault or
-otherwise crash, and has a zero return value. This is the basic form of a CTest
-test.
-
-The Usage test uses a regular expression to verify that the usage message
-is printed when an incorrect number of arguments are provided.
-
-Lastly, we have a function called do_test that simplifies running the
-application and verifying that the computed square root is correct for given
-input.
-
-To run tests, cd to the binary directory and run “ctest -N” and “ctest -VV”.
diff --git a/Tests/Tutorial/Step4/tutorial.cxx b/Tests/Tutorial/Step4/tutorial.cxx
deleted file mode 100644
index 1d5742d2d..000000000
--- a/Tests/Tutorial/Step4/tutorial.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <string>
-
-#include "TutorialConfig.h"
-
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
-#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
-#else
- double outputValue = sqrt(inputValue);
-#endif
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Tests/Tutorial/Step5/CMakeLists.txt
deleted file mode 100644
index 63e541056..000000000
--- a/Tests/Tutorial/Step5/CMakeLists.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library?
-if(USE_MYMATH)
- add_subdirectory(MathFunctions)
- list(APPEND EXTRA_LIBS MathFunctions)
-endif()
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-enable_testing()
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 11cf4127b..000000000
--- a/Tests/Tutorial/Step5/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-add_library(MathFunctions mysqrt.cxx)
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- )
-
-install(TARGETS MathFunctions DESTINATION lib)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/Step5/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step5/MathFunctions/MathFunctions.h
deleted file mode 100644
index cd36bccff..000000000
--- a/Tests/Tutorial/Step5/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1 +0,0 @@
-double mysqrt(double x);
diff --git a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 7d9379e43..000000000
--- a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- double result = x;
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
- return result;
-}
diff --git a/Tests/Tutorial/Step5/TutorialConfig.h.in b/Tests/Tutorial/Step5/TutorialConfig.h.in
deleted file mode 100644
index 25a06020a..000000000
--- a/Tests/Tutorial/Step5/TutorialConfig.h.in
+++ /dev/null
@@ -1,5 +0,0 @@
-// the configured options and settings for Tutorial
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-#cmakedefine USE_MYMATH
-
diff --git a/Tests/Tutorial/Step5/directions.txt b/Tests/Tutorial/Step5/directions.txt
deleted file mode 100644
index e6f51975c..000000000
--- a/Tests/Tutorial/Step5/directions.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-# Adding System Introspection #
-
-Let us consider adding some code to our project that depends on features the
-target platform may not have. For this example, we will add some code that
-depends on whether or not the target platform has the log and exp functions. Of
-course almost every platform has these functions but for this tutorial assume
-that they are not common.
-
-If the platform has log and exp then we will use them to compute the square
-root in the mysqrt function. We first test for the availability of these
-functions using the CheckSymbolExists.cmake macro in the top-level CMakeLists
-file as follows:
-
- # does this system provide the log and exp functions?
- include(CheckSymbolExists)
- set(CMAKE_REQUIRED_LIBRARIES "m")
- check_symbol_exists(log "math.h" HAVE_LOG)
- check_symbol_exists(exp "math.h" HAVE_EXP)
-
-Now let's add these defines to TutorialConfig.h.in so that we can use them
-from mysqrt.cxx:
-
- // does the platform provide exp and log functions?
- #cmakedefine HAVE_LOG
- #cmakedefine HAVE_EXP
-
-Modify mysqrt.cxx to include math.h. Next, in the mysqrt function we can
-provide an alternate implementation based on log and exp if they are available
-on the system using the following code:
-
- // if we have both log and exp then use them
- #if defined(HAVE_LOG) && defined (HAVE_EXP)
- double result = exp(log(x)*0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result << " using log" << std::endl;
- #else
- ...
-
-Run cmake or cmake-gui to configure the project and then build it with your
-chosen build tool.
-
-You will notice that even though HAVE_LOG and HAVE_EXP are both defined mysqrt
-isn't using them. We should realize quickly that we have forgotten to include
-TutorialConfig.h in mysqrt.cxx. We will also need to update
-MathFunctions/CMakeLists.txt with where it is located.
-
-So let's go ahead and update MathFunctions/CMakeLists.txt to look like:
-
- add_library(MathFunctions mysqrt.cxx)
-
- target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${Tutorial_BINARY_DIR}
- )
-
- install(TARGETS MathFunctions DESTINATION lib)
- install(FILES MathFunctions.h DESTINATION include)
-
-Now all we need to do is include TutorialConfig.h in mysqrt.cxx
-
-At this point you should go ahead and build the project again.
-
-Run the built Tutorial executable. Which function gives better results now,
-Step1’s sqrt or Step5’s mysqrt?
-
-Exercise: Why is it important that we configure TutorialConfig.h.in after the
-checks for HAVE_LOG and HAVE_EXP? What would happen if we inverted the two?
-
-Exercise: Is there a better place for us to save the HAVE_LOG and HAVE_EXP
-values other than in TutorialConfig.h?
diff --git a/Tests/Tutorial/Step5/tutorial.cxx b/Tests/Tutorial/Step5/tutorial.cxx
deleted file mode 100644
index 1d5742d2d..000000000
--- a/Tests/Tutorial/Step5/tutorial.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <string>
-
-#include "TutorialConfig.h"
-
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
-#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
-#else
- double outputValue = sqrt(inputValue);
-#endif
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Tests/Tutorial/Step6/CMakeLists.txt
deleted file mode 100644
index 503a31290..000000000
--- a/Tests/Tutorial/Step6/CMakeLists.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# does this system provide the log and exp functions?
-include(CheckSymbolExists)
-set(CMAKE_REQUIRED_LIBRARIES "m")
-check_symbol_exists(log "math.h" HAVE_LOG)
-check_symbol_exists(exp "math.h" HAVE_EXP)
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library?
-if(USE_MYMATH)
- add_subdirectory(MathFunctions)
- list(APPEND EXTRA_LIBS MathFunctions)
-endif()
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-enable_testing()
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
deleted file mode 100644
index 2946075f1..000000000
--- a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-add_library(MathFunctions mysqrt.cxx)
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
-# TutorialConfig.h include is an implementation detail
-
-target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${Tutorial_BINARY_DIR}
- )
-
-install(TARGETS MathFunctions DESTINATION lib)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/Step6/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step6/MathFunctions/MathFunctions.h
deleted file mode 100644
index cd36bccff..000000000
--- a/Tests/Tutorial/Step6/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1 +0,0 @@
-double mysqrt(double x);
diff --git a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
deleted file mode 100644
index b9ad20a84..000000000
--- a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "MathFunctions.h"
-#include "TutorialConfig.h"
-#include <iostream>
-
-#include <cmath>
-
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = exp(log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
- << std::endl;
-#else
- double result = x;
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-#endif
- return result;
-}
diff --git a/Tests/Tutorial/Step6/TutorialConfig.h.in b/Tests/Tutorial/Step6/TutorialConfig.h.in
deleted file mode 100644
index a0912656a..000000000
--- a/Tests/Tutorial/Step6/TutorialConfig.h.in
+++ /dev/null
@@ -1,9 +0,0 @@
-// the configured options and settings for Tutorial
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-#cmakedefine USE_MYMATH
-
-// does the platform provide exp and log functions?
-#cmakedefine HAVE_LOG
-#cmakedefine HAVE_EXP
-
diff --git a/Tests/Tutorial/Step6/directions.txt b/Tests/Tutorial/Step6/directions.txt
deleted file mode 100644
index 42b9f06df..000000000
--- a/Tests/Tutorial/Step6/directions.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-# Adding a Custom Command and Generated File #
-
-In this section we will show how you can add a generated source file into the
-build process of an application. For this example, we will create a table of
-precomputed square roots as part of the build process, and then compile that
-table into our application.
-
-To accomplish this, we first need a program that will generate the table. In the
-MathFunctions subdirectory a new source file named MakeTable.cxx will do just that.
-
- // A simple program that builds a sqrt table
- #include <iostream>
- #include <fstream>
- #include <cmath>
-
- int main (int argc, char *argv[])
- {
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1],std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if(fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
- }
-
-Note that the table is produced as valid C++ code and that the output filename
-is passed in as an argument.
-
-The next step is to add the appropriate commands to MathFunctions’ CMakeLists
-file to build the MakeTable executable and then run it as part of the build
-process. A few commands are needed to accomplish this, as shown below:
-
- # first we add the executable that generates the table
- add_executable(MakeTable MakeTable.cxx)
-
- # add the command to generate the source code
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
- # add the main library
- add_library(MathFunctions
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
- target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PUBLIC ${Tutorial_BINARY_DIR}
- # add the binary tree directory to the search path for include files
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
- install(TARGETS MathFunctions DESTINATION lib)
- install(FILES MathFunctions.h DESTINATION include)
-
-First, the executable for MakeTable is added as any other executable would be
-added. Then we add a custom command that specifies how to produce Table.h by
-running MakeTable. Next we have to let CMake know that mysqrt.cxx depends on
-the generated file Table.h. This is done by adding the generated Table.h to the
-list of sources for the library MathFunctions. We also have to add the current
-binary directory to the list of include directories so that Table.h can be
-found and included by mysqrt.cxx.
-
-Now let's use the generated table. First, modify mysqrt.cxx to include Table.h.
-Next, we can rewrite the mysqrt function to use the table:
-
- if (x <= 0) {
- return 0;
- }
-
- // use the table to help find an initial value
- double result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result*result);
- result = result + 0.5*delta/result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-
-Run cmake or cmake-gui to configure the project and then build it with your
-chosen build tool. When this project is built it will first build the MakeTable
-executable. It will then run MakeTable to produce Table.h. Finally, it will
-compile mysqrt.cxx which includes Table.h to produce the MathFunctions library.
diff --git a/Tests/Tutorial/Step6/tutorial.cxx b/Tests/Tutorial/Step6/tutorial.cxx
deleted file mode 100644
index 1d5742d2d..000000000
--- a/Tests/Tutorial/Step6/tutorial.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <string>
-
-#include "TutorialConfig.h"
-
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
-#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
-#else
- double outputValue = sqrt(inputValue);
-#endif
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Tests/Tutorial/Step7/CMakeLists.txt
deleted file mode 100644
index f2d3839b7..000000000
--- a/Tests/Tutorial/Step7/CMakeLists.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# does this system provide the log and exp functions?
-include(CheckSymbolExists)
-set(CMAKE_REQUIRED_LIBRARIES "m")
-check_symbol_exists(log "math.h" HAVE_LOG)
-check_symbol_exists(exp "math.h" HAVE_EXP)
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library?
-if(USE_MYMATH)
- add_subdirectory(MathFunctions)
- list(APPEND EXTRA_LIBS MathFunctions)
-endif(USE_MYMATH)
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-enable_testing()
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
diff --git a/Tests/Tutorial/Step7/License.txt b/Tests/Tutorial/Step7/License.txt
deleted file mode 100644
index c62d00b9e..000000000
--- a/Tests/Tutorial/Step7/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
deleted file mode 100644
index dc3eb9822..000000000
--- a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-# first we add the executable that generates the table
-add_executable(MakeTable MakeTable.cxx)
-
-# add the command to generate the source code
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
-# add the main library
-add_library(MathFunctions
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
-# TutorialConfig.h include is an implementation detail
-# state that we depend on our binary dir to find Table.h
-target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${Tutorial_BINARY_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
-install(TARGETS MathFunctions DESTINATION lib)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/Step7/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step7/MathFunctions/MathFunctions.h
deleted file mode 100644
index cd36bccff..000000000
--- a/Tests/Tutorial/Step7/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1 +0,0 @@
-double mysqrt(double x);
diff --git a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 5272f56f2..000000000
--- a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,34 +0,0 @@
-#include "MathFunctions.h"
-#include "TutorialConfig.h"
-#include <iostream>
-
-// include the generated table
-#include "Table.h"
-
-#include <cmath>
-
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- // use the table to help find an initial value
- double result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-
- return result;
-}
diff --git a/Tests/Tutorial/Step7/TutorialConfig.h.in b/Tests/Tutorial/Step7/TutorialConfig.h.in
deleted file mode 100644
index a0912656a..000000000
--- a/Tests/Tutorial/Step7/TutorialConfig.h.in
+++ /dev/null
@@ -1,9 +0,0 @@
-// the configured options and settings for Tutorial
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-#cmakedefine USE_MYMATH
-
-// does the platform provide exp and log functions?
-#cmakedefine HAVE_LOG
-#cmakedefine HAVE_EXP
-
diff --git a/Tests/Tutorial/Step7/build1.cmake b/Tests/Tutorial/Step7/build1.cmake
deleted file mode 100644
index baa475f28..000000000
--- a/Tests/Tutorial/Step7/build1.cmake
+++ /dev/null
@@ -1,5 +0,0 @@
-set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7")
-set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build1")
-
-set(CTEST_CMAKE_COMMAND "cmake")
-set(CTEST_COMMAND "ctest -D Experimental")
diff --git a/Tests/Tutorial/Step7/directions.txt b/Tests/Tutorial/Step7/directions.txt
deleted file mode 100644
index 7d7c2eacd..000000000
--- a/Tests/Tutorial/Step7/directions.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-# Building an Installer #
-
-Next suppose that we want to distribute our project to other people so that they
-can use it. We want to provide both binary and source distributions on a variety
-of platforms. This is a little different from the install we did previously in
-the Installing and Testing section (Step 4), where we were installing the
-binaries that we had built from the source code. In this example we will be
-building installation packages that support binary installations and package
-management features. To accomplish this we will use CPack to create platform
-specific installers. Specifically we need to add a few lines to the bottom of
-our top-level CMakeLists.txt file.
-
- include(InstallRequiredSystemLibraries)
- set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
- set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
- set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
- include(CPack)
-
-That is all there is to it. We start by including InstallRequiredSystemLibraries.
-This module will include any runtime libraries that are needed by the project
-for the current platform. Next we set some CPack variables to where we have
-stored the license and version information for this project. The version
-information makes use of the variables we set earlier in this tutorial. Finally
-we include the CPack module which will use these variables and some other
-properties of the system you are on to setup an installer.
-
-The next step is to build the project in the usual manner and then run CPack
-on it. To build a binary distribution you would run:
-
- cpack
-
-To create a source distribution you would type:
-
- cpack -C CPackSourceConfig.cmake
-
-Alternatively, run “make package” or right click the Package target and
-“Build Project” from an IDE.
-
-Run the installer executable found in the binary directory. Then run the
-installed executable and verify that it works.
diff --git a/Tests/Tutorial/Step7/tutorial.cxx b/Tests/Tutorial/Step7/tutorial.cxx
deleted file mode 100644
index 1d5742d2d..000000000
--- a/Tests/Tutorial/Step7/tutorial.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <string>
-
-#include "TutorialConfig.h"
-
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
-#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
-#else
- double outputValue = sqrt(inputValue);
-#endif
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step8/CMakeLists.txt b/Tests/Tutorial/Step8/CMakeLists.txt
deleted file mode 100644
index c66bf96e3..000000000
--- a/Tests/Tutorial/Step8/CMakeLists.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# does this system provide the log and exp functions?
-include(CheckSymbolExists)
-set(CMAKE_REQUIRED_LIBRARIES "m")
-check_symbol_exists(log "math.h" HAVE_LOG)
-check_symbol_exists(exp "math.h" HAVE_EXP)
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-
-# configure a header file to pass some of the CMake settings
-# to the source code
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library?
-if(USE_MYMATH)
- add_subdirectory(MathFunctions)
- list(APPEND EXTRA_LIBS MathFunctions)
-endif(USE_MYMATH)
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-enable_testing()
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
-add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-include(InstallRequiredSystemLibraries)
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-include(CPack)
diff --git a/Tests/Tutorial/Step8/License.txt b/Tests/Tutorial/Step8/License.txt
deleted file mode 100644
index c62d00b9e..000000000
--- a/Tests/Tutorial/Step8/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt
deleted file mode 100644
index dc3eb9822..000000000
--- a/Tests/Tutorial/Step8/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-# first we add the executable that generates the table
-add_executable(MakeTable MakeTable.cxx)
-
-# add the command to generate the source code
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
-# add the main library
-add_library(MathFunctions
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-# state that we depend on Tutorial_BINARY_DIR but consumers don't, as the
-# TutorialConfig.h include is an implementation detail
-# state that we depend on our binary dir to find Table.h
-target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${Tutorial_BINARY_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
-install(TARGETS MathFunctions DESTINATION lib)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/Step8/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h
deleted file mode 100644
index cd36bccff..000000000
--- a/Tests/Tutorial/Step8/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1 +0,0 @@
-double mysqrt(double x);
diff --git a/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 5b862fbd5..000000000
--- a/Tests/Tutorial/Step8/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "MathFunctions.h"
-#include "TutorialConfig.h"
-#include <iostream>
-
-// include the generated table
-#include "Table.h"
-
-#include <cmath>
-
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = exp(log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
- << std::endl;
-#else
- // use the table to help find an initial value
- double result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
-
- // if we have both log and exp then use them
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-#endif
- return result;
-}
diff --git a/Tests/Tutorial/Step8/TutorialConfig.h.in b/Tests/Tutorial/Step8/TutorialConfig.h.in
deleted file mode 100644
index e97ce24ea..000000000
--- a/Tests/Tutorial/Step8/TutorialConfig.h.in
+++ /dev/null
@@ -1,8 +0,0 @@
-// the configured options and settings for Tutorial
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
-#cmakedefine USE_MYMATH
-
-// does the platform provide exp and log functions?
-#cmakedefine HAVE_LOG
-#cmakedefine HAVE_EXP
diff --git a/Tests/Tutorial/Step8/directions.txt b/Tests/Tutorial/Step8/directions.txt
deleted file mode 100644
index 588d9c679..000000000
--- a/Tests/Tutorial/Step8/directions.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-# Adding Support for a Dashboard #
-
-Adding support for submitting our test results to a dashboard is very easy. We
-already defined a number of tests for our project in the earlier steps of this
-tutorial. We just have to run those tests and submit them to a dashboard. To
-include support for dashboards we include the CTest module in our top-level
-CMakeLists.txt.
-
-Replace:
- # enable testing
- enable_testing()
-
-With:
- # enable dashboard scripting
- include(CTest)
-
-The CTest module will automatically call enable_testing(), so
-we can remove it from our CMake files.
-
-We will also need to create a CTestConfig.cmake file where we can specify the
-name of the project and where to submit the dashboard.
-
- set(CTEST_PROJECT_NAME "CMakeTutorial")
- set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
-
- set(CTEST_DROP_METHOD "http")
- set(CTEST_DROP_SITE "my.cdash.org/")
- set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
- set(CTEST_DROP_SITE_CDASH TRUE)
-
-CTest will read in this file when it runs. To create a simple dashboard you can
-run cmake or cmake-gui to configure the project, but do not build it yet.
-Instead, change directory to the binary tree, and then run:
- 'ctest [-VV] –D Experimental'. On Windows, build the EXPERIMENTAL target.
-
-Ctest will build and test the project and submit results to the Kitware public
-dashboard. The results of your dashboard will be uploaded to Kitware's public
-dashboard here: https://my.cdash.org/index.php?project=CMakeTutorial.
diff --git a/Tests/Tutorial/Step8/tutorial.cxx b/Tests/Tutorial/Step8/tutorial.cxx
deleted file mode 100644
index 1d5742d2d..000000000
--- a/Tests/Tutorial/Step8/tutorial.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <string>
-
-#include "TutorialConfig.h"
-
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
-#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
-#else
- double outputValue = sqrt(inputValue);
-#endif
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/Tutorial/Step9/CMakeLists.txt b/Tests/Tutorial/Step9/CMakeLists.txt
deleted file mode 100644
index 309d513ff..000000000
--- a/Tests/Tutorial/Step9/CMakeLists.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-cmake_minimum_required(VERSION 3.3)
-project(Tutorial)
-
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED True)
-
-# the version number.
-set(Tutorial_VERSION_MAJOR 1)
-set(Tutorial_VERSION_MINOR 0)
-
-# does this system provide the log and exp functions?
-include(CheckSymbolExists)
-set(CMAKE_REQUIRED_LIBRARIES "m")
-check_symbol_exists(log "math.h" HAVE_LOG)
-check_symbol_exists(exp "math.h" HAVE_EXP)
-
-# should we use our own math functions
-option(USE_MYMATH "Use tutorial provided math implementation" ON)
-
-# configure a header file to pass the version number only
-configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
-# add the MathFunctions library?
-if(USE_MYMATH)
- add_subdirectory(MathFunctions)
- list(APPEND EXTRA_LIBS MathFunctions)
-endif()
-
-# add the executable
-add_executable(Tutorial tutorial.cxx)
-target_link_libraries(Tutorial PUBLIC ${EXTRA_LIBS})
-
-# add the binary tree to the search path for include files
-# so that we will find TutorialConfig.h
-target_include_directories(Tutorial PUBLIC
- "${PROJECT_BINARY_DIR}"
- )
-
-# add the install targets
-install(TARGETS Tutorial DESTINATION bin)
-install(FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- DESTINATION include
- )
-
-# enable testing
-include(CTest)
-
-# does the application run
-add_test(NAME Runs COMMAND Tutorial 25)
-
-# does the usage message work?
-add_test(NAME Usage COMMAND Tutorial)
-set_tests_properties(Usage
- PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number"
- )
-
-# define a function to simplify adding tests
-function(do_test target arg result)
- add_test(NAME Comp${arg} COMMAND ${target} ${arg})
- set_tests_properties(Comp${arg}
- PROPERTIES PASS_REGULAR_EXPRESSION ${result}
- )
-endfunction(do_test)
-
-# do a bunch of result based tests
-do_test(Tutorial 4 "4 is 2")
-do_test(Tutorial 9 "9 is 3")
-do_test(Tutorial 5 "5 is 2.236")
-do_test(Tutorial 7 "7 is 2.645")
-do_test(Tutorial 25 "25 is 5")
-do_test(Tutorial -25 "-25 is [-nan|nan|0]")
-do_test(Tutorial 0.0001 "0.0001 is 0.01")
-
-include(InstallRequiredSystemLibraries)
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License.txt")
-set(CPACK_PACKAGE_VERSION_MAJOR "${Tutorial_VERSION_MAJOR}")
-set(CPACK_PACKAGE_VERSION_MINOR "${Tutorial_VERSION_MINOR}")
-include(CPack)
diff --git a/Tests/Tutorial/Step9/CTestConfig.cmake b/Tests/Tutorial/Step9/CTestConfig.cmake
deleted file mode 100644
index 7a927ac94..000000000
--- a/Tests/Tutorial/Step9/CTestConfig.cmake
+++ /dev/null
@@ -1,15 +0,0 @@
-## This file should be placed in the root directory of your project.
-## Then modify the CMakeLists.txt file in the root directory of your
-## project to incorporate the testing dashboard.
-##
-## # The following are required to submit to the CDash dashboard:
-## ENABLE_TESTING()
-## INCLUDE(CTest)
-
-set(CTEST_PROJECT_NAME "CMakeTutorial")
-set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
-
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=CMakeTutorial")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/Tutorial/Step9/License.txt b/Tests/Tutorial/Step9/License.txt
deleted file mode 100644
index c62d00b9e..000000000
--- a/Tests/Tutorial/Step9/License.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-This is the open source License.txt file introduced in
-CMake/Tutorial/Step7...
diff --git a/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt
deleted file mode 100644
index e651a5748..000000000
--- a/Tests/Tutorial/Step9/MathFunctions/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-# first we add the executable that generates the table
-add_executable(MakeTable MakeTable.cxx)
-
-# add the command to generate the source code
-add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
-# add the main library
-add_library(MathFunctions
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
-# state that anybody linking to us needs to include the current source dir
-# to find MathFunctions.h, while we don't.
-# state that we depend on our binary dir to find Table.h
-target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
- )
-
-# use compile definitions to state if we have enabled USE_MYMATH
-# and that anything that links to use will get this define
-target_compile_definitions(MathFunctions INTERFACE "USE_MYMATH")
-
-if(HAVE_LOG AND HAVE_EXP)
- target_compile_definitions(MathFunctions
- PRIVATE "HAVE_LOG" "HAVE_EXP")
-endif()
-
-install(TARGETS MathFunctions DESTINATION lib)
-install(FILES MathFunctions.h DESTINATION include)
diff --git a/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx
deleted file mode 100644
index ee585568c..000000000
--- a/Tests/Tutorial/Step9/MathFunctions/MakeTable.cxx
+++ /dev/null
@@ -1,25 +0,0 @@
-// A simple program that builds a sqrt table
-#include <cmath>
-#include <fstream>
-#include <iostream>
-
-int main(int argc, char* argv[])
-{
- // make sure we have enough arguments
- if (argc < 2) {
- return 1;
- }
-
- std::ofstream fout(argv[1], std::ios_base::out);
- const bool fileOpen = fout.is_open();
- if (fileOpen) {
- fout << "double sqrtTable[] = {" << std::endl;
- for (int i = 0; i < 10; ++i) {
- fout << sqrt(static_cast<double>(i)) << "," << std::endl;
- }
- // close the table with a zero
- fout << "0};" << std::endl;
- fout.close();
- }
- return fileOpen ? 0 : 1; // return 0 if wrote the file
-}
diff --git a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx
deleted file mode 100644
index 5351184be..000000000
--- a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.cxx
+++ /dev/null
@@ -1,18 +0,0 @@
-
-#include "MathFunctions.h"
-#include <cmath>
-
-#ifdef USE_MYMATH
-# include "mysqrt.h"
-#endif
-
-namespace mathfunctions {
-double sqrt(double x)
-{
-#ifdef USE_MYMATH
- return detail::mysqrt(x);
-#else
- return std::sqrt(x);
-#endif
-}
-}
diff --git a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h b/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h
deleted file mode 100644
index cd36bccff..000000000
--- a/Tests/Tutorial/Step9/MathFunctions/MathFunctions.h
+++ /dev/null
@@ -1 +0,0 @@
-double mysqrt(double x);
diff --git a/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx
deleted file mode 100644
index 8b8214151..000000000
--- a/Tests/Tutorial/Step9/MathFunctions/mysqrt.cxx
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "MathFunctions.h"
-#include <iostream>
-
-// include the generated table
-#include "Table.h"
-
-#include <cmath>
-
-// a hack square root calculation using simple operations
-double mysqrt(double x)
-{
- if (x <= 0) {
- return 0;
- }
-
- // if we have both log and exp then use them
-#if defined(HAVE_LOG) && defined(HAVE_EXP)
- double result = exp(log(x) * 0.5);
- std::cout << "Computing sqrt of " << x << " to be " << result << " using log"
- << std::endl;
-#else
- // use the table to help find an initial value
- double result = x;
- if (x >= 1 && x < 10) {
- result = sqrtTable[static_cast<int>(x)];
- }
-
- // if we have both log and exp then use them
-
- // do ten iterations
- for (int i = 0; i < 10; ++i) {
- if (result <= 0) {
- result = 0.1;
- }
- double delta = x - (result * result);
- result = result + 0.5 * delta / result;
- std::cout << "Computing sqrt of " << x << " to be " << result << std::endl;
- }
-#endif
- return result;
-}
diff --git a/Tests/Tutorial/Step9/MathFunctions/mysqrt.h b/Tests/Tutorial/Step9/MathFunctions/mysqrt.h
deleted file mode 100644
index e1c42ef0c..000000000
--- a/Tests/Tutorial/Step9/MathFunctions/mysqrt.h
+++ /dev/null
@@ -1,6 +0,0 @@
-
-namespace mathfunctions {
-namespace detail {
-double mysqrt(double x);
-}
-}
diff --git a/Tests/Tutorial/Step9/TutorialConfig.h.in b/Tests/Tutorial/Step9/TutorialConfig.h.in
deleted file mode 100644
index 8cd2fc9c6..000000000
--- a/Tests/Tutorial/Step9/TutorialConfig.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-// the configured version number
-#define Tutorial_VERSION_MAJOR @Tutorial_VERSION_MAJOR@
-#define Tutorial_VERSION_MINOR @Tutorial_VERSION_MINOR@
diff --git a/Tests/Tutorial/Step9/directions.txt b/Tests/Tutorial/Step9/directions.txt
deleted file mode 100644
index 8771637d2..000000000
--- a/Tests/Tutorial/Step9/directions.txt
+++ /dev/null
@@ -1,166 +0,0 @@
-# Mixing Static and Shared #
-
-In this section we will show how by using the BUILD_SHARED_LIBS variable we can
-control the default behavior of add_library, and allow control over how
-libraries without an explicit type ( STATIC/SHARED/MODULE/OBJECT ) are built.
-
-To accomplish this we need to add BUILD_SHARED_LIBS to the top level
-CMakeLists.txt. We use the option command as it allows users to optionally
-select if the value should be On or Off.
-
-Next we are going to refactor MathFunctions to become a real library that
-encapsulates using mysqrt or sqrt, instead of requiring the calling code
-to do this logic. This will also mean that USE_MYMATH will not control building
-MathFuctions, but instead will control the behavior of this library.
-
-The first step is to update the starting section of the top level CMakeLists.txt
-to look like:
-
- cmake_minimum_required(VERSION 3.3)
- project(Tutorial)
-
- # control where the static and shared libraries are built so that on windows
- # we don't need to tinker with the path to run the executable
- set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}")
-
- set(CMAKE_CXX_STANDARD 11)
- set(CMAKE_CXX_STANDARD_REQUIRED True)
-
- option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
-
- # the version number.
- set(Tutorial_VERSION_MAJOR 1)
- set(Tutorial_VERSION_MINOR 0)
-
- # configure a header file to pass the version number only
- configure_file(
- "${PROJECT_SOURCE_DIR}/TutorialConfig.h.in"
- "${PROJECT_BINARY_DIR}/TutorialConfig.h"
- )
-
- # add the MathFunctions library
- add_subdirectory(MathFunctions)
-
- # add the executable
- add_executable(Tutorial tutorial.cxx)
- target_link_libraries(Tutorial PUBLIC MathFunctions)
-
-Now that we have made MathFunctions always be used, we will need to update
-the logic of that library. So, in MathFunctions/CMakeLists.txt we need to
-create a SqrtLibrary that will conditionally be built when USE_MYMATH is
-enabled. Now, since this is a tutorial, we are going to explicitly require
-that SqrtLibrary is built statically.
-
-The end result is that MathFunctions/CMakeLists.txt should look like:
-
- # add the library that runs
- add_library(MathFunctions MathFunctions.cxx)
-
- # state that anybody linking to us needs to include the current source dir
- # to find MathFunctions.h, while we don't.
- target_include_directories(MathFunctions
- INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}
- )
-
- # should we use our own math functions
- option(USE_MYMATH "Use tutorial provided math implementation" ON)
- if(USE_MYMATH)
-
- # does this system provide the log and exp functions?
- include(CheckSymbolExists)
- set(CMAKE_REQUIRED_LIBRARIES "m")
- check_symbol_exists(log "math.h" HAVE_LOG)
- check_symbol_exists(exp "math.h" HAVE_EXP)
-
- # first we add the executable that generates the table
- add_executable(MakeTable MakeTable.cxx)
-
- # add the command to generate the source code
- add_custom_command(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- COMMAND MakeTable ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- DEPENDS MakeTable
- )
-
- # library that just does sqrt
- add_library(SqrtLibrary STATIC
- mysqrt.cxx
- ${CMAKE_CURRENT_BINARY_DIR}/Table.h
- )
-
- # state that we depend on our binary dir to find Table.h
- target_include_directories(SqrtLibrary PRIVATE
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
- target_compile_definitions(MathFunctions PRIVATE "USE_MYMATH")
- if(HAVE_LOG AND HAVE_EXP)
- target_compile_definitions(SqrtLibrary
- PRIVATE "HAVE_LOG" "HAVE_EXP")
- endif()
-
- target_link_libraries(MathFunctions PRIVATE SqrtLibrary)
- endif()
-
- # define the symbol stating we are using the declspec(dllexport) when
- # building on windows
- target_compile_definitions(MathFunctions PRIVATE "EXPORTING_MYMATH")
-
- install(TARGETS MathFunctions DESTINATION lib)
- install(FILES MathFunctions.h DESTINATION include)
-
-Next, update MathFunctions/mysqrt.cxx to use the mathfunctions and detail namespaces:
-
- #include <iostream>
- #include "MathFunctions.h"
-
- // include the generated table
- #include "Table.h"
-
- #include <cmath>
-
- namespace mathfunctions {
- namespace detail {
- // a hack square root calculation using simple operations
- double mysqrt(double x)
- {
- ...
-
- return result;
- }
- }
- }
-
-We also need to make some changes in tutorial.cxx, so that it no longer uses USE_MYMATH:
-1. Always include MathFunctions.h
-2. Always use mathfunctions::sqrt
-
-Finally, update MathFunctions/MathFunctions.h to use dll export defines:
-
- #if defined(_WIN32)
- #if defined(EXPORTING_MYMATH)
- #define DECLSPEC __declspec(dllexport)
- #else
- #define DECLSPEC __declspec(dllimport)
- #endif
- #else //non windows
- #define DECLSPEC
- #endif
-
- namespace mathfunctions
- {
- double DECLSPEC sqrt(double x);
- }
-
-At this point, if you build everything, you will notice that linking fails
-as we are combining a static library without position enabled code with a
-library that has position enabled code. This solution to this is to explicitly
-set the POSITION_INDEPENDENT_CODE target property of SqrtLibrary to be True no
-matter the build type.
-
-Exercise: We modified MathFunctions.h to use dll export defines. Using CMake
-documentation can you find a helper module to simplify this?
-
-Exercise: Determine what command is enabling PIC for SqrtLibrary.
-What happens if we remove said command?
diff --git a/Tests/Tutorial/Step9/tutorial.cxx b/Tests/Tutorial/Step9/tutorial.cxx
deleted file mode 100644
index 73e67a9c0..000000000
--- a/Tests/Tutorial/Step9/tutorial.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-// A simple program that computes the square root of a number
-#include <cmath>
-#include <iostream>
-#include <sstream>
-#include <string>
-
-#include "TutorialConfig.h"
-
-#ifdef USE_MYMATH
-# include "MathFunctions.h"
-#endif
-
-int main(int argc, char* argv[])
-{
- if (argc < 2) {
- std::cout << argv[0] << " Version " << Tutorial_VERSION_MAJOR << "."
- << Tutorial_VERSION_MAJOR << std::endl;
- std::cout << "Usage: " << argv[0] << " number" << std::endl;
- return 1;
- }
-
- double inputValue = std::stod(argv[1]);
-
-#ifdef USE_MYMATH
- double outputValue = mysqrt(inputValue);
-#else
- double outputValue = sqrt(inputValue);
-#endif
-
- std::cout << "The square root of " << inputValue << " is " << outputValue
- << std::endl;
- return 0;
-}
diff --git a/Tests/VSExternalInclude/Lib2/lib2.cpp b/Tests/VSExternalInclude/Lib2/lib2.cpp
index adc2d29af..37180172b 100644
--- a/Tests/VSExternalInclude/Lib2/lib2.cpp
+++ b/Tests/VSExternalInclude/Lib2/lib2.cpp
@@ -1,5 +1,6 @@
#include "lib2.h"
+
#include "lib1.h"
int add1_and_mult2(int num)
diff --git a/Tests/VSMidl/src/main.cpp b/Tests/VSMidl/src/main.cpp
index 68089adc4..ae114fe09 100644
--- a/Tests/VSMidl/src/main.cpp
+++ b/Tests/VSMidl/src/main.cpp
@@ -1,6 +1,7 @@
+#include <test_i.c>
+
#include <stdio.h>
#include <test.h>
-#include <test_i.c>
int main(int argc, char** argv)
{
diff --git a/Tests/VSNsightTegra/jni/second.c b/Tests/VSNsightTegra/jni/second.c
index 12fcdb6a9..30bdc17b0 100644
--- a/Tests/VSNsightTegra/jni/second.c
+++ b/Tests/VSNsightTegra/jni/second.c
@@ -14,9 +14,10 @@
* limitations under the License.
*
*/
-#include "first.h"
#include <jni.h>
+#include "first.h"
+
jint Java_com_example_twolibs_TwoLibs_add(JNIEnv* env, jobject this, jint x,
jint y)
{
diff --git a/Tests/VSResource/main.cpp b/Tests/VSResource/main.cpp
index b2b5ac99c..6de7adc6e 100644
--- a/Tests/VSResource/main.cpp
+++ b/Tests/VSResource/main.cpp
@@ -1,6 +1,7 @@
-#include <stdio.h>
#include <windows.h>
+#include <stdio.h>
+
extern int lib();
struct x
diff --git a/Tests/VSWinStorePhone/CMakeLists.txt b/Tests/VSWinStorePhone/CMakeLists.txt
index efc77601d..b8e157dae 100644
--- a/Tests/VSWinStorePhone/CMakeLists.txt
+++ b/Tests/VSWinStorePhone/CMakeLists.txt
@@ -9,6 +9,7 @@ elseif(MSVC_VERSION GREATER 1600)
endif()
add_subdirectory(WinRT)
+add_subdirectory(CxxDLL)
set (APP_MANIFEST_NAME Package.appxmanifest)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
@@ -151,4 +152,4 @@ if("${SHORT_VERSION}" STREQUAL "10.0")
set_property(TARGET ${EXE_NAME} PROPERTY VS_SDK_REFERENCES "Microsoft.UniversalCRT.Debug, Version=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}")
endif()
-target_link_libraries(${EXE_NAME} d3d11 JusticeLeagueWinRT)
+target_link_libraries(${EXE_NAME} d3d11 JusticeLeagueWinRT CxxDll)
diff --git a/Tests/VSWinStorePhone/CxxDLL/CMakeLists.txt b/Tests/VSWinStorePhone/CxxDLL/CMakeLists.txt
new file mode 100644
index 000000000..6bd32a20d
--- /dev/null
+++ b/Tests/VSWinStorePhone/CxxDLL/CMakeLists.txt
@@ -0,0 +1,3 @@
+project(CxxDll CXX)
+
+add_library(CxxDll SHARED cxxdll.cpp)
diff --git a/Tests/VSWinStorePhone/CxxDLL/cxxdll.cpp b/Tests/VSWinStorePhone/CxxDLL/cxxdll.cpp
new file mode 100644
index 000000000..1438e8a88
--- /dev/null
+++ b/Tests/VSWinStorePhone/CxxDLL/cxxdll.cpp
@@ -0,0 +1,8 @@
+#include "cxxdll.h"
+
+#include <iostream>
+
+void CxxDllClass::SomeMethod()
+{
+ std::cout << "CxxDllClass::SomeMethod\n";
+}
diff --git a/Tests/VSWinStorePhone/CxxDLL/cxxdll.h b/Tests/VSWinStorePhone/CxxDLL/cxxdll.h
new file mode 100644
index 000000000..86edceb63
--- /dev/null
+++ b/Tests/VSWinStorePhone/CxxDLL/cxxdll.h
@@ -0,0 +1,5 @@
+class __declspec(dllexport) CxxDllClass
+{
+public:
+ static void SomeMethod();
+};
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
index 3ba35fa43..595f55392 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
+++ b/Tests/VSWinStorePhone/Direct3DApp1/CubeRenderer.cpp
@@ -1,6 +1,8 @@
+// clang-format off
#include "pch.h"
#include "CubeRenderer.h"
+// clang-format on
using namespace DirectX;
using namespace Microsoft::WRL;
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.h b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.h
index c3499c708..79b907006 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.h
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DApp1.h
@@ -1,8 +1,10 @@
#pragma once
+// clang-format off
#include "pch.h"
#include "CubeRenderer.h"
+// clang-format on
ref class Direct3DApp1 sealed
: public Windows::ApplicationModel::Core::IFrameworkView
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.cpp b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.cpp
index 0662fbe64..f24ce28f1 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.cpp
+++ b/Tests/VSWinStorePhone/Direct3DApp1/Direct3DBase.cpp
@@ -1,6 +1,8 @@
+// clang-format off
#include "pch.h"
#include "Direct3DBase.h"
+// clang-format on
using namespace DirectX;
using namespace Microsoft::WRL;
diff --git a/Tests/VSWinStorePhone/Direct3DApp1/pch.h b/Tests/VSWinStorePhone/Direct3DApp1/pch.h
index 78ebea347..d80cdb75a 100644
--- a/Tests/VSWinStorePhone/Direct3DApp1/pch.h
+++ b/Tests/VSWinStorePhone/Direct3DApp1/pch.h
@@ -1,7 +1,8 @@
#pragma once
+#include <memory>
+
#include <DirectXMath.h>
#include <agile.h>
#include <d3d11_1.h>
-#include <memory>
#include <wrl/client.h>
diff --git a/Tests/VSWinStorePhone/VerifyAppPackage.cmake b/Tests/VSWinStorePhone/VerifyAppPackage.cmake
new file mode 100644
index 000000000..f9440d75e
--- /dev/null
+++ b/Tests/VSWinStorePhone/VerifyAppPackage.cmake
@@ -0,0 +1,34 @@
+set(APP_PKG_NAME Direct3DApp1)
+
+# List of files that are expected to be present in the generated app package
+set(EXPECTED_APP_PKG_CONTENT
+ ${APP_PKG_NAME}.exe
+ CxxDll.dll
+ JusticeLeagueWinRT.winmd
+ JusticeLeagueWinRT.dll
+)
+
+# Windows app package formats can be either msix, appx or xap
+file(GLOB_RECURSE ALL_APP_PKG_FILES ${APP_PACKAGE_DIR} ${APP_PKG_NAME}*.msix ${APP_PKG_NAME}*.appx ${APP_PKG_NAME}*.xap)
+
+# There can be only one generated app package
+list(LENGTH ALL_APP_PKG_FILES APP_PKG_COUNT)
+if(NOT APP_PKG_COUNT EQUAL 1)
+ message(FATAL_ERROR "Expected 1 generated app package, but detected ${APP_PKG_COUNT}: ${ALL_APP_PKG_FILES}")
+endif()
+
+execute_process(COMMAND ${CMAKE_COMMAND} -E tar tf ${ALL_APP_PKG_FILES}
+ OUTPUT_VARIABLE APP_PKG_CONTENT_OUTPUT
+ ERROR_VARIABLE error
+ RESULT_VARIABLE result)
+
+if(NOT result EQUAL 0)
+ message(FATAL_ERROR "Listing app package content failed with: ${error}")
+endif()
+
+foreach(app_pkg_item ${EXPECTED_APP_PKG_CONTENT})
+ string(FIND ${APP_PKG_CONTENT_OUTPUT} ${app_pkg_item} _found)
+ if(_found EQUAL -1)
+ message(FATAL_ERROR "Generated app package is missing an expected item: ${app_pkg_item}")
+ endif()
+endforeach()
diff --git a/Tests/VSXaml/App.xaml.cpp b/Tests/VSXaml/App.xaml.cpp
index 549b7ef28..f9ae27e60 100644
--- a/Tests/VSXaml/App.xaml.cpp
+++ b/Tests/VSXaml/App.xaml.cpp
@@ -3,9 +3,8 @@
// Implementation of the App class.
//
-#include "pch.h"
-
#include "MainPage.xaml.h"
+#include "pch.h"
using namespace VSXaml;
diff --git a/Tests/VSXaml/MainPage.xaml.cpp b/Tests/VSXaml/MainPage.xaml.cpp
index 51da23770..f372772d4 100644
--- a/Tests/VSXaml/MainPage.xaml.cpp
+++ b/Tests/VSXaml/MainPage.xaml.cpp
@@ -3,10 +3,10 @@
// Implementation of the MainPage class.
//
-#include "pch.h"
-
#include "MainPage.xaml.h"
+#include "pch.h"
+
using namespace VSXaml;
using namespace Platform;
diff --git a/Tests/X11/HelloWorldX11.cxx b/Tests/X11/HelloWorldX11.cxx
index e59248b49..f18f8c84e 100644
--- a/Tests/X11/HelloWorldX11.cxx
+++ b/Tests/X11/HelloWorldX11.cxx
@@ -14,6 +14,7 @@
# define MAIN_H 1
# include <iostream>
+
# include <stdlib.h>
/* include the X library headers */