diff options
-rw-r--r-- | Modules/CMakeFortranInformation.cmake | 5 | ||||
-rw-r--r-- | Modules/Compiler/IAR-FindBinUtils.cmake | 4 | ||||
-rw-r--r-- | Modules/FindFLTK.cmake | 357 | ||||
-rw-r--r-- | Modules/FindLibLZMA.cmake | 2 | ||||
-rw-r--r-- | Modules/FindMPI.cmake | 289 | ||||
-rw-r--r-- | Modules/FindPerlLibs.cmake | 212 | ||||
-rw-r--r-- | Modules/FindPkgConfig.cmake | 251 | ||||
-rw-r--r-- | Modules/InstallRequiredSystemLibraries.cmake | 22 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.cxx | 19 | ||||
-rw-r--r-- | Source/CTest/cmCTestBuildAndTestHandler.h | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 3 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 20 | ||||
-rw-r--r-- | Source/CTest/cmCTestScriptHandler.cxx | 11 | ||||
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 17 | ||||
-rw-r--r-- | Source/CTest/cmProcess.cxx | 19 | ||||
-rw-r--r-- | Source/CTest/cmProcess.h | 7 | ||||
-rw-r--r-- | Source/bindexplib.cxx | 75 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 30 | ||||
-rw-r--r-- | Source/cmCTest.h | 2 | ||||
-rw-r--r-- | Source/cmDependsFortran.cxx | 56 | ||||
-rw-r--r-- | Source/cmExtraSublimeTextGenerator.cxx | 20 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 16 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.h | 47 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 28 | ||||
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.h | 3 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 5 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.h | 1 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 29 | ||||
-rw-r--r-- | Source/cmGraphVizWriter.cxx | 41 | ||||
-rw-r--r-- | Source/cmGraphVizWriter.h | 1 | ||||
-rw-r--r-- | Source/cmIDEOptions.cxx | 15 | ||||
-rw-r--r-- | Source/cmIDEOptions.h | 8 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 41 | ||||
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 77 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.h | 3 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 21 | ||||
-rw-r--r-- | Source/cmServerProtocol.cxx | 19 | ||||
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 16 | ||||
-rw-r--r-- | Source/cmVisualStudioGeneratorOptions.cxx | 7 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 13 | ||||
-rw-r--r-- | Source/kwsys/testSystemTools.cxx | 35 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 105 | ||||
-rw-r--r-- | Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/CudaOnly/ResolveDeviceSymbols/main.cu | 11 | ||||
-rw-r--r-- | Tests/GeneratorExpression/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/GeneratorExpression/srcgenex_defs_COMPILE_LANGUAGE.c | 12 | ||||
-rw-r--r-- | Tests/GeneratorExpression/srcgenex_flags_COMPILE_LANGUAGE.c | 12 | ||||
-rw-r--r-- | Tests/Qt4Autogen/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/Qt5Autogen/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/QtAutogen/AutogenTest.cmake | 53 | ||||
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 233 | ||||
-rw-r--r-- | Tests/QtAutogen/CommonTests.cmake | 40 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/Adir/CMakeLists.txt (renamed from Tests/QtAutogen/complex/Adir/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/Adir/libA.cpp (renamed from Tests/QtAutogen/complex/Adir/libA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/Adir/libA.h (renamed from Tests/QtAutogen/complex/Adir/libA.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/Bdir/CMakeLists.txt (renamed from Tests/QtAutogen/complex/Bdir/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/Bdir/libB.cpp (renamed from Tests/QtAutogen/complex/Bdir/libB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/Bdir/libB.h (renamed from Tests/QtAutogen/complex/Bdir/libB.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/CMakeLists.txt (renamed from Tests/QtAutogen/complex/CMakeLists.txt) | 6 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/abc.cpp (renamed from Tests/QtAutogen/complex/abc.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/abc.h (renamed from Tests/QtAutogen/complex/abc.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/abc_p.h (renamed from Tests/QtAutogen/complex/abc_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/bar.cpp (renamed from Tests/QtAutogen/complex/bar.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/blub.cpp (renamed from Tests/QtAutogen/complex/blub.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/blub.h (renamed from Tests/QtAutogen/complex/blub.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/calwidget.cpp (renamed from Tests/QtAutogen/complex/calwidget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/calwidget.h (renamed from Tests/QtAutogen/complex/calwidget.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/calwidget.ui (renamed from Tests/QtAutogen/complex/calwidget.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/codeeditor.cpp (renamed from Tests/QtAutogen/complex/codeeditor.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/codeeditor.h (renamed from Tests/QtAutogen/complex/codeeditor.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/debug_class.cpp (renamed from Tests/QtAutogen/complex/debug_class.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/debug_class.h (renamed from Tests/QtAutogen/complex/debug_class.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/debug_class.ui (renamed from Tests/QtAutogen/complex/debug_class.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/debug_resource.qrc (renamed from Tests/QtAutogen/complex/debug_resource.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/foo.cpp (renamed from Tests/QtAutogen/complex/foo.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/foo.h (renamed from Tests/QtAutogen/complex/foo.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/gadget.cpp (renamed from Tests/QtAutogen/complex/gadget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/gadget.h (renamed from Tests/QtAutogen/complex/gadget.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/generated.cpp (renamed from Tests/QtAutogen/complex/generated.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/generated.h (renamed from Tests/QtAutogen/complex/generated.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/generated.txt.in (renamed from Tests/QtAutogen/complex/generated.txt.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/generated_resource.qrc.in (renamed from Tests/QtAutogen/complex/generated_resource.qrc.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/libC.cpp (renamed from Tests/QtAutogen/complex/libC.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/libC.h (renamed from Tests/QtAutogen/complex/libC.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/main.cpp (renamed from Tests/QtAutogen/complex/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/multiplewidgets.cpp (renamed from Tests/QtAutogen/complex/multiplewidgets.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/multiplewidgets.h (renamed from Tests/QtAutogen/complex/multiplewidgets.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/myinterface.h.in (renamed from Tests/QtAutogen/complex/myinterface.h.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/myotherinterface.h.in (renamed from Tests/QtAutogen/complex/myotherinterface.h.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/private_slot.cpp (renamed from Tests/QtAutogen/complex/private_slot.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/private_slot.h (renamed from Tests/QtAutogen/complex/private_slot.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/resourcetester.cpp (renamed from Tests/QtAutogen/complex/resourcetester.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/resourcetester.h (renamed from Tests/QtAutogen/complex/resourcetester.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/second_resource.qrc (renamed from Tests/QtAutogen/complex/second_resource.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/second_widget.cpp (renamed from Tests/QtAutogen/complex/second_widget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/second_widget.h (renamed from Tests/QtAutogen/complex/second_widget.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/second_widget.ui (renamed from Tests/QtAutogen/complex/second_widget.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/sub/bar.h (renamed from Tests/QtAutogen/complex/sub/bar.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/targetObjectsTest.cpp (renamed from Tests/QtAutogen/complex/targetObjectsTest.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/test.qrc (renamed from Tests/QtAutogen/complex/test.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/widget1.ui (renamed from Tests/QtAutogen/complex/widget1.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/widget2.ui (renamed from Tests/QtAutogen/complex/widget2.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/xyz.cpp (renamed from Tests/QtAutogen/complex/xyz.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/xyz.h (renamed from Tests/QtAutogen/complex/xyz.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/yaf.cpp (renamed from Tests/QtAutogen/complex/yaf.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/yaf.h (renamed from Tests/QtAutogen/complex/yaf.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/Complex/yaf_p.h (renamed from Tests/QtAutogen/complex/yaf_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/DefinesTest/CMakeLists.txt | 13 | ||||
-rw-r--r-- | Tests/QtAutogen/DefinesTest/defines_test.cpp (renamed from Tests/QtAutogenRerun/defines_test/defines_test.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MacOsFW/CMakeLists.txt (renamed from Tests/QtAutogen/macosFW/CMakeLists.txt) | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/MacOsFW/src/CMakeLists.txt (renamed from Tests/QtAutogen/macosFW/src/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MacOsFW/src/macos_fw_lib.cpp (renamed from Tests/QtAutogen/macosFW/src/macos_fw_lib.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MacOsFW/src/macos_fw_lib.h (renamed from Tests/QtAutogen/macosFW/src/macos_fw_lib.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MacOsFW/test/CMakeLists.txt (renamed from Tests/QtAutogen/macosFW/test/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MacOsFW/test/testMacosFWLib.cpp (renamed from Tests/QtAutogen/macosFW/test/testMacosFWLib.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MacOsFW/test/testMacosFWLib.h (renamed from Tests/QtAutogen/macosFW/test/testMacosFWLib.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocCMP0071/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt (renamed from Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt) | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt (renamed from Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt) | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/MocCMP0071/Obj.cpp (renamed from Tests/QtAutogen/mocCMP0071/Obj.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocCMP0071/Obj.hpp (renamed from Tests/QtAutogen/mocCMP0071/Obj.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocCMP0071/Obj_p.h (renamed from Tests/QtAutogen/mocCMP0071/Obj_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocCMP0071/main.cpp (renamed from Tests/QtAutogen/mocCMP0071/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/CMakeLists.txt (renamed from Tests/QtAutogen/mocDepends/CMakeLists.txt) | 30 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/object_invalid.hpp.in (renamed from Tests/QtAutogen/mocDepends/object_invalid.hpp.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/object_valid.hpp.in (renamed from Tests/QtAutogen/mocDepends/object_valid.hpp.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/simpleLib.cpp.in (renamed from Tests/QtAutogen/mocDepends/simpleLib.cpp.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/simpleLib.hpp.in (renamed from Tests/QtAutogen/mocDepends/simpleLib.hpp.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/testATDFile.cpp (renamed from Tests/QtAutogen/mocDepends/testATDFile.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/testATDTarget.cpp (renamed from Tests/QtAutogen/mocDepends/testATDTarget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/testGenFile.cpp (renamed from Tests/QtAutogen/mocDepends/testGenFile.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/testGenLib.cpp (renamed from Tests/QtAutogen/mocDepends/testGenLib.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/testGenLib.hpp (renamed from Tests/QtAutogen/mocDepends/testGenLib.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocDepends/testGenTarget.cpp (renamed from Tests/QtAutogen/mocDepends/testGenTarget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjA.cpp (renamed from Tests/QtAutogen/mocInclude/EObjA.cpp) | 1 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjA.hpp (renamed from Tests/QtAutogen/mocInclude/EObjA.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjAExtra.cpp (renamed from Tests/QtAutogen/mocInclude/EObjAExtra.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjAExtra.hpp (renamed from Tests/QtAutogen/mocInclude/EObjAExtra.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp (renamed from Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjA_p.hpp (renamed from Tests/QtAutogen/mocInclude/EObjA_p.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjB.cpp (renamed from Tests/QtAutogen/mocInclude/EObjB.cpp) | 1 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjB.hpp (renamed from Tests/QtAutogen/mocInclude/EObjB.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/EObjB_p.hpp (renamed from Tests/QtAutogen/mocInclude/EObjB_p.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/LObjA.cpp (renamed from Tests/QtAutogen/mocInclude/LObjA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/LObjA.hpp (renamed from Tests/QtAutogen/mocInclude/LObjA.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/LObjA_p.h (renamed from Tests/QtAutogen/mocInclude/LObjA_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/LObjB.cpp (renamed from Tests/QtAutogen/mocInclude/LObjB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/LObjB.hpp (renamed from Tests/QtAutogen/mocInclude/LObjB.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/LObjB_p.h (renamed from Tests/QtAutogen/mocInclude/LObjB_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/ObjA.cpp (renamed from Tests/QtAutogen/mocInclude/ObjA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/ObjA.hpp (renamed from Tests/QtAutogen/mocInclude/ObjA.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/ObjA_p.h (renamed from Tests/QtAutogen/mocInclude/ObjA_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/ObjB.cpp (renamed from Tests/QtAutogen/mocInclude/ObjB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/ObjB.hpp (renamed from Tests/QtAutogen/mocInclude/ObjB.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/ObjB_p.h (renamed from Tests/QtAutogen/mocInclude/ObjB_p.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjA.cpp (renamed from Tests/QtAutogen/mocInclude/SObjA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjA.hpp (renamed from Tests/QtAutogen/mocInclude/SObjA.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjB.cpp.in (renamed from Tests/QtAutogen/mocInclude/SObjB.cpp.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjB.hpp.in (renamed from Tests/QtAutogen/mocInclude/SObjB.hpp.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjC.cpp (renamed from Tests/QtAutogen/mocInclude/SObjC.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjC.hpp (renamed from Tests/QtAutogen/mocInclude/SObjC.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjCExtra.cpp (renamed from Tests/QtAutogen/mocInclude/SObjCExtra.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjCExtra.hpp (renamed from Tests/QtAutogen/mocInclude/SObjCExtra.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/SObjCExtra.moc.in (renamed from Tests/QtAutogen/mocInclude/SObjCExtra.moc.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/shared.cmake (renamed from Tests/QtAutogen/mocInclude/shared.cmake) | 42 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp (renamed from Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp (renamed from Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp (renamed from Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp (renamed from Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp (renamed from Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp (renamed from Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt (renamed from Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt) | 7 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/RObjA.cpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/RObjA.hpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/RObjB.cpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/RObjB.hpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/RObjBExtra.hpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/RObjC.cpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/RObjC.hpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeRelaxed/main.cpp (renamed from Tests/QtAutogen/mocIncludeStrict/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/QtAutogen/MocIncludeStrict/main.cpp (renamed from Tests/QtAutogen/mocIncludeRelaxed/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/CustomMacros.hpp (renamed from Tests/QtAutogen/mocMacroName/CustomMacros.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/Gadget.cpp (renamed from Tests/QtAutogen/mocMacroName/Gadget.cpp) | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/Gadget.hpp (renamed from Tests/QtAutogen/mocMacroName/Gadget.hpp) | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/Object.cpp (renamed from Tests/QtAutogen/mocMacroName/Object.cpp) | 1 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/Object.hpp (renamed from Tests/QtAutogen/mocMacroName/Object.hpp) | 7 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/Object1Aliased.cpp (renamed from Tests/QtAutogen/mocMacroName/Object1Aliased.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/Object1Aliased.hpp (renamed from Tests/QtAutogen/mocMacroName/Object1Aliased.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/Object2Aliased.cpp (renamed from Tests/QtAutogen/mocMacroName/Object2Aliased.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/Object2Aliased.hpp (renamed from Tests/QtAutogen/mocMacroName/Object2Aliased.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocMacroName/main.cpp (renamed from Tests/QtAutogen/mocMacroName/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/StyleA.cpp (renamed from Tests/QtAutogen/mocOnlySource/StyleA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/StyleA.hpp (renamed from Tests/QtAutogen/mocOnlySource/StyleA.hpp) | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/StyleB.cpp (renamed from Tests/QtAutogen/mocOnlySource/StyleB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/StyleB.hpp (renamed from Tests/QtAutogen/mocOnlySource/StyleB.hpp) | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/main.cpp (renamed from Tests/QtAutogen/mocOnlySource/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOptions/CMakeLists.txt | 9 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOptions/Object.cpp | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOptions/Object.hpp | 13 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOptions/main.cpp | 7 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/CMakeLists.txt | 36 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemA.cpp (renamed from Tests/QtAutogen/skipSource/qItemA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemA.hpp (renamed from Tests/QtAutogen/skipSource/qItemA.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemB.cpp (renamed from Tests/QtAutogen/skipSource/qItemB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemB.hpp (renamed from Tests/QtAutogen/skipSource/qItemB.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemC.cpp (renamed from Tests/QtAutogen/skipSource/qItemC.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemC.hpp (renamed from Tests/QtAutogen/skipSource/qItemC.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemD.cpp (renamed from Tests/QtAutogen/skipSource/qItemD.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/qItemD.hpp (renamed from Tests/QtAutogen/skipSource/qItemD.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/MocSkipSource/skipMoc.cpp (renamed from Tests/QtAutogen/skipMoc.cpp) | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/ObjectLibrary/CMakeLists.txt (renamed from Tests/QtAutogen/objectLibrary/CMakeLists.txt) | 4 | ||||
-rw-r--r-- | Tests/QtAutogen/ObjectLibrary/a/CMakeLists.txt (renamed from Tests/QtAutogen/objectLibrary/a/CMakeLists.txt) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/ObjectLibrary/a/classa.cpp (renamed from Tests/QtAutogen/objectLibrary/a/classa.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/ObjectLibrary/a/classa.h (renamed from Tests/QtAutogen/objectLibrary/a/classa.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/ObjectLibrary/b/classb.cpp (renamed from Tests/QtAutogen/objectLibrary/b/classb.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/ObjectLibrary/b/classb.h (renamed from Tests/QtAutogen/objectLibrary/b/classb.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/ObjectLibrary/main.cpp (renamed from Tests/QtAutogen/objectLibrary/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccEmpty/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/RccEmpty/rccEmpty.cpp (renamed from Tests/QtAutogen/rccEmpty.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccEmpty/rccEmptyRes.qrc (renamed from Tests/QtAutogen/rccEmptyRes.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/QtAutogen/RccOffMocLibrary/empty.cpp (renamed from Tests/QtAutogen/empty.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccOffMocLibrary/empty.h (renamed from Tests/QtAutogen/empty.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccOffMocLibrary/not_generated_file.qrc (renamed from Tests/QtAutogen/not_generated_file.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccOnly/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/RccOnly/rccOnly.cpp (renamed from Tests/QtAutogen/rccOnly.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccOnly/rccOnlyRes.qrc (renamed from Tests/QtAutogen/rccOnlyRes.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccSkipSource/CMakeLists.txt | 23 | ||||
-rw-r--r-- | Tests/QtAutogen/RccSkipSource/skipRcc.cpp (renamed from Tests/QtAutogen/skipRcc.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccSkipSource/skipRccBad1.qrc (renamed from Tests/QtAutogen/skipSource/skipRccBad1.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccSkipSource/skipRccBad2.qrc (renamed from Tests/QtAutogen/skipSource/skipRccBad2.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RccSkipSource/skipRccGood.qrc (renamed from Tests/QtAutogen/skipSource/skipRccGood.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocBasic/CMakeLists.txt | 65 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt | 24 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocBasic/MocBasic/input.txt (renamed from Tests/QtAutogenRerun/mocRerun/input.txt) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocBasic/MocBasic/main.cpp.in (renamed from Tests/QtAutogenRerun/mocRerun/main.cpp.in) | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocBasic/MocBasic/res1.qrc (renamed from Tests/QtAutogenRerun/mocRerun/res1.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocBasic/MocBasic/test1a.h.in (renamed from Tests/QtAutogenRerun/mocRerun/test1a.h.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocBasic/MocBasic/test1b.h.in (renamed from Tests/QtAutogenRerun/mocRerun/test1b.h.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocBasic/dummy.cpp (renamed from Tests/QtAutogenRerun/dummy.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt (renamed from Tests/QtAutogenRerun/mocPlugin.cmake) | 17 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt (renamed from Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt) | 20 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.cpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleA.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleA.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.json (renamed from Tests/QtAutogenRerun/mocPlugin/StyleA.json) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA_Custom.json (renamed from Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.cpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleB.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleB.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.cpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleC.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleC.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.cpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleD.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleD.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.cpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleE.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.hpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleE.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp (renamed from Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/UtilityMacros.hpp (renamed from Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB.json (renamed from Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB_Custom.json (renamed from Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleC.json (renamed from Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleD.json (renamed from Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleE.json (renamed from Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/MocPlugin/main.cpp (renamed from Tests/QtAutogenRerun/mocPlugin/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunMocPlugin/dummy.cpp | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/CMakeLists.txt (renamed from Tests/QtAutogenRerun/rccDepends.cmake) | 20 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt (renamed from Tests/QtAutogenRerun/rccDepends/CMakeLists.txt) | 32 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/main.cpp (renamed from Tests/QtAutogenRerun/rccDepends/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/input.txt.in (renamed from Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/inputAdded.txt.in (renamed from Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/resGenA.qrc.in (renamed from Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/resGenB.qrc.in (renamed from Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/input.txt.in (renamed from Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/inputAdded.txt.in (renamed from Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainA.qrc.in (renamed from Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainB.qrc.in (renamed from Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/RerunRccDepends/dummy.cpp | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/CMakeLists.txt (renamed from Tests/QtAutogen/sameName/CMakeLists.txt) | 7 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/aaa/bbb/data.qrc (renamed from Tests/QtAutogen/sameName/aaa/bbb/data.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/aaa/bbb/item.cpp (renamed from Tests/QtAutogen/sameName/aaa/bbb/item.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/aaa/bbb/item.hpp (renamed from Tests/QtAutogen/sameName/aaa/bbb/item.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/aaa/data.qrc (renamed from Tests/QtAutogen/sameName/aaa/data.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/aaa/item.cpp (renamed from Tests/QtAutogen/sameName/aaa/item.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/aaa/item.hpp (renamed from Tests/QtAutogen/sameName/aaa/item.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/aaa/view.ui (renamed from Tests/QtAutogen/sameName/aaa/view.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/bbb/aaa/data.qrc (renamed from Tests/QtAutogen/sameName/bbb/aaa/data.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/bbb/aaa/item.cpp (renamed from Tests/QtAutogen/sameName/bbb/aaa/item.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/bbb/aaa/item.hpp (renamed from Tests/QtAutogen/sameName/bbb/aaa/item.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/bbb/data.qrc (renamed from Tests/QtAutogen/sameName/bbb/data.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/bbb/item.cpp (renamed from Tests/QtAutogen/sameName/bbb/item.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/bbb/item.hpp (renamed from Tests/QtAutogen/sameName/bbb/item.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/bbb/view.ui (renamed from Tests/QtAutogen/sameName/bbb/view.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/ccc/data.qrc (renamed from Tests/QtAutogen/sameName/ccc/data.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/ccc/item.cpp (renamed from Tests/QtAutogen/sameName/ccc/item.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/ccc/item.hpp (renamed from Tests/QtAutogen/sameName/ccc/item.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/ccc/view.ui (renamed from Tests/QtAutogen/sameName/ccc/view.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/data.qrc (renamed from Tests/QtAutogen/sameName/data.qrc) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/item.cpp (renamed from Tests/QtAutogen/sameName/item.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/item.hpp (renamed from Tests/QtAutogen/sameName/item.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/main.cpp (renamed from Tests/QtAutogen/sameName/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/SameName/view.ui (renamed from Tests/QtAutogen/sameName/view.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt (renamed from Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt) | 7 | ||||
-rw-r--r-- | Tests/QtAutogen/StaticLibraryCycle/a.cpp | 12 | ||||
-rw-r--r-- | Tests/QtAutogen/StaticLibraryCycle/a.h (renamed from Tests/QtAutogen/staticLibraryCycle/a.h) | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/StaticLibraryCycle/b.cpp (renamed from Tests/QtAutogen/staticLibraryCycle/b.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/StaticLibraryCycle/b.h (renamed from Tests/QtAutogen/staticLibraryCycle/b.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/StaticLibraryCycle/c.cpp (renamed from Tests/QtAutogen/staticLibraryCycle/c.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/StaticLibraryCycle/c.h (renamed from Tests/QtAutogen/staticLibraryCycle/c.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/StaticLibraryCycle/main.cpp (renamed from Tests/QtAutogen/staticLibraryCycle/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/TestMacros.cmake | 60 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/CMakeLists.txt (renamed from Tests/QtAutogen/uicInclude/CMakeLists.txt) | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/PageC.ui (renamed from Tests/QtAutogen/uicInclude/PageC.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/PageC2.ui (renamed from Tests/QtAutogen/uicInclude/PageC2.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/dirA/PageA.ui (renamed from Tests/QtAutogen/uicInclude/dirA/PageA.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/dirB/PageB.ui (renamed from Tests/QtAutogen/uicInclude/dirB/PageB.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/dirB/PageB2.ui (renamed from Tests/QtAutogen/uicInclude/dirB/PageB2.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/dirB/subB/PageBsub.ui (renamed from Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/main.cpp (renamed from Tests/QtAutogen/uicInclude/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/main.hpp (renamed from Tests/QtAutogen/uicInclude/main.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInclude/subC/PageCsub.ui (renamed from Tests/QtAutogen/uicInclude/subC/PageCsub.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/CMakeLists.txt (renamed from Tests/QtAutoUicInterface/CMakeLists.txt) | 30 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/klocalizedstring.cpp (renamed from Tests/QtAutoUicInterface/klocalizedstring.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/klocalizedstring.h (renamed from Tests/QtAutoUicInterface/klocalizedstring.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/libwidget.cpp (renamed from Tests/QtAutoUicInterface/libwidget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/libwidget.h (renamed from Tests/QtAutoUicInterface/libwidget.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/libwidget.ui (renamed from Tests/QtAutoUicInterface/libwidget.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/main.cpp (renamed from Tests/QtAutoUicInterface/main.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/mywidget.cpp (renamed from Tests/QtAutoUicInterface/mywidget.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/mywidget.h (renamed from Tests/QtAutoUicInterface/mywidget.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicInterface/mywidget.ui (renamed from Tests/QtAutoUicInterface/mywidget.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicOnly/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/QtAutogen/UicOnly/uiconly.cpp (renamed from Tests/QtAutogen/uicOnlySource/uiconly.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicOnly/uiconly.h (renamed from Tests/QtAutogen/uicOnlySource/uiconly.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicOnly/uiconly.ui (renamed from Tests/QtAutogen/uicOnlySource/uiconly.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/CMakeLists.txt | 22 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/skipUic.cpp (renamed from Tests/QtAutogen/skipUic.cpp) | 6 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/skipUicGen.cpp (renamed from Tests/QtAutogen/skipSource/skipUicGen.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/skipUicGen.hpp (renamed from Tests/QtAutogen/skipSource/skipUicGen.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/skipUicNoGen1.cpp (renamed from Tests/QtAutogen/skipSource/skipUicNoGen1.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/skipUicNoGen1.hpp (renamed from Tests/QtAutogen/skipSource/skipUicNoGen1.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/skipUicNoGen2.cpp (renamed from Tests/QtAutogen/skipSource/skipUicNoGen2.cpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/skipUicNoGen2.hpp (renamed from Tests/QtAutogen/skipSource/skipUicNoGen2.hpp) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/ui_nogen1.h (renamed from Tests/QtAutogen/skipSource/ui_nogen1.h) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/ui_nogen2.h (renamed from Tests/QtAutogen/skipSource/ui_nogen2.h) | 2 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/uigen1.ui (renamed from Tests/QtAutogen/skipSource/uigen1.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/UicSkipSource/uigen2.ui (renamed from Tests/QtAutogen/skipSource/uigen2.ui) | 0 | ||||
-rw-r--r-- | Tests/QtAutogen/defines_test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/QtAutogen/defines_test/defines_test.cpp | 38 | ||||
-rw-r--r-- | Tests/QtAutogen/mocCMP0071/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/QtAutogen/mocMacroName/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/staticLibraryCycle/a.cpp | 7 | ||||
-rw-r--r-- | Tests/QtAutogenRerun/CMakeLists.txt | 52 | ||||
-rw-r--r-- | Tests/QtAutogenRerun/defines_test/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/QtAutogenRerun/mocRerun.cmake | 60 | ||||
-rw-r--r-- | Tests/QtAutogenRerun/mocRerun/CMakeLists.txt | 33 | ||||
-rw-r--r-- | Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-stderr-VS.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-stderr-Xcode.txt | 7 | ||||
-rw-r--r-- | Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/COMPILE_LANGUAGE-genex/RunCMakeTest.cmake | 7 |
367 files changed, 1636 insertions, 1636 deletions
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index b315d33..d422578 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -67,11 +67,6 @@ if(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran) set(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}") endif() - -# Fortran needs cmake to do a requires step during its build process to -# catch any modules -set(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1) - if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC) set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC}) endif() diff --git a/Modules/Compiler/IAR-FindBinUtils.cmake b/Modules/Compiler/IAR-FindBinUtils.cmake index b29ee81..5fecb26 100644 --- a/Modules/Compiler/IAR-FindBinUtils.cmake +++ b/Modules/Compiler/IAR-FindBinUtils.cmake @@ -10,7 +10,7 @@ get_filename_component(__iar_hint_2 "${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPI set(__iar_hints "${__iar_hint_1}" "${__iar_hint_2}") -if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM") +if("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM") # could allow using normal binutils ar, since objects are normal ELF files? find_program(CMAKE_IAR_LINKARM ilinkarm.exe HINTS ${__iar_hints} DOC "The IAR ARM linker") @@ -38,7 +38,7 @@ set(CMAKE_IAR_LINKARM \"${CMAKE_IAR_LINKARM}\") ") -elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR") +elseif("${CMAKE_${_CMAKE_PROCESSING_LANGUAGE}_COMPILER_ARCHITECTURE_ID}" STREQUAL "AVR") # For AVR and AVR32, IAR uses the "xlink" linker and the "xar" archiver: find_program(CMAKE_IAR_LINKER xlink.exe HINTS ${__iar_hints} diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index 1aa52cc..82c63ef 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -5,57 +5,78 @@ # FindFLTK # -------- # -# Find the native FLTK includes and library +# Find the FLTK library # +# Input Variables +# ^^^^^^^^^^^^^^^ # +# By default this module will search for all of the FLTK components and +# add them to the FLTK_LIBRARIES variable. You can limit the components +# which get placed in FLTK_LIBRARIES by defining one or more of the +# following three options: # -# By default FindFLTK.cmake will search for all of the FLTK components -# and add them to the FLTK_LIBRARIES variable. +# ``FLTK_SKIP_OPENGL`` +# Set to true to disable searching for the FLTK GL library # -# :: +# ``FLTK_SKIP_FORMS`` +# Set to true to disable searching for the FLTK Forms library # -# You can limit the components which get placed in FLTK_LIBRARIES by -# defining one or more of the following three options: +# ``FLTK_SKIP_IMAGES`` +# Set to true to disable searching for the FLTK Images library # +# FLTK is composed also by a binary tool. You can set the following option: # +# ``FLTK_SKIP_FLUID`` +# Set to true to not look for the FLUID binary # -# :: +# Result Variables +# ^^^^^^^^^^^^^^^^ # -# FLTK_SKIP_OPENGL, set to true to disable searching for opengl and -# the FLTK GL library -# FLTK_SKIP_FORMS, set to true to disable searching for fltk_forms -# FLTK_SKIP_IMAGES, set to true to disable searching for fltk_images +# The following variables will be defined: # +# ``FLTK_FOUND`` +# True if all components not skipped were found # +# ``FLTK_INCLUDE_DIR`` +# Path to the include directory for FLTK header files # -# :: +# ``FLTK_LIBRARIES`` +# List of the FLTK libraries found # -# FLTK_SKIP_FLUID, set to true if the fluid binary need not be present -# at build time +# ``FLTK_FLUID_EXECUTABLE`` +# Path to the FLUID binary tool # +# ``FLTK_WRAP_UI`` +# True if FLUID is found, used to enable the FLTK_WRAP_UI command # +# Cache Variables +# ^^^^^^^^^^^^^^^ # -# The following variables will be defined: +# The following cache variables are also available to set or use: +# +# ``FLTK_BASE_LIBRARY_RELEASE`` +# The FLTK base library (optimized) # -# :: +# ``FLTK_BASE_LIBRARY_DEBUG`` +# The FLTK base library (debug) # -# FLTK_FOUND, True if all components not skipped were found -# FLTK_INCLUDE_DIR, where to find include files -# FLTK_LIBRARIES, list of fltk libraries you should link against -# FLTK_FLUID_EXECUTABLE, where to find the Fluid tool -# FLTK_WRAP_UI, This enables the FLTK_WRAP_UI command +# ``FLTK_GL_LIBRARY_RELEASE`` +# The FLTK GL library (optimized) # +# ``FLTK_GL_LIBRARY_DEBUG`` +# The FLTK GL library (debug) # +# ``FLTK_FORMS_LIBRARY_RELEASE`` +# The FLTK Forms library (optimized) # -# The following cache variables are assigned but should not be used. -# See the FLTK_LIBRARIES variable instead. +# ``FLTK_FORMS_LIBRARY_DEBUG`` +# The FLTK Forms library (debug) # -# :: +# ``FLTK_IMAGES_LIBRARY_RELEASE`` +# The FLTK Images protobuf library (optimized) # -# FLTK_BASE_LIBRARY = the full path to fltk.lib -# FLTK_GL_LIBRARY = the full path to fltk_gl.lib -# FLTK_FORMS_LIBRARY = the full path to fltk_forms.lib -# FLTK_IMAGES_LIBRARY = the full path to fltk_images.lib +# ``FLTK_IMAGES_LIBRARY_DEBUG`` +# The FLTK Images library (debug) if(NOT FLTK_SKIP_OPENGL) find_package(OpenGL) @@ -125,157 +146,172 @@ if(NOT FLTK_DIR) ) endif() - # Check if FLTK was built using CMake - if(EXISTS ${FLTK_DIR}/FLTKConfig.cmake) - set(FLTK_BUILT_WITH_CMAKE 1) - endif() - - if(FLTK_BUILT_WITH_CMAKE) - set(FLTK_FOUND 1) - include(${FLTK_DIR}/FLTKConfig.cmake) +# Check if FLTK was built using CMake +if(EXISTS ${FLTK_DIR}/FLTKConfig.cmake) + set(FLTK_BUILT_WITH_CMAKE 1) +endif() - # Fluid - if(FLUID_COMMAND) - set(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable") - else() - find_program(FLTK_FLUID_EXECUTABLE fluid PATHS - ${FLTK_EXECUTABLE_DIRS} - ${FLTK_EXECUTABLE_DIRS}/RelWithDebInfo - ${FLTK_EXECUTABLE_DIRS}/Debug - ${FLTK_EXECUTABLE_DIRS}/Release - NO_SYSTEM_PATH) - endif() - # mark_as_advanced(FLTK_FLUID_EXECUTABLE) - - set(FLTK_INCLUDE_DIR ${FLTK_DIR}) - link_directories(${FLTK_LIBRARY_DIRS}) - - set(FLTK_BASE_LIBRARY fltk) - set(FLTK_GL_LIBRARY fltk_gl) - set(FLTK_FORMS_LIBRARY fltk_forms) - set(FLTK_IMAGES_LIBRARY fltk_images) - - # Add the extra libraries - load_cache(${FLTK_DIR} - READ_WITH_PREFIX - FL FLTK_USE_SYSTEM_JPEG - FL FLTK_USE_SYSTEM_PNG - FL FLTK_USE_SYSTEM_ZLIB - ) - - set(FLTK_IMAGES_LIBS "") - if(FLFLTK_USE_SYSTEM_JPEG) - set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_jpeg) - endif() - if(FLFLTK_USE_SYSTEM_PNG) - set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_png) - endif() - if(FLFLTK_USE_SYSTEM_ZLIB) - set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_zlib) - endif() - set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL - "Extra libraries for fltk_images library.") +if(FLTK_BUILT_WITH_CMAKE) + set(FLTK_FOUND 1) + include(${FLTK_DIR}/FLTKConfig.cmake) + # Fluid + if(FLUID_COMMAND) + set(FLTK_FLUID_EXECUTABLE ${FLUID_COMMAND} CACHE FILEPATH "Fluid executable") else() + find_program(FLTK_FLUID_EXECUTABLE fluid PATHS + ${FLTK_EXECUTABLE_DIRS} + ${FLTK_EXECUTABLE_DIRS}/RelWithDebInfo + ${FLTK_EXECUTABLE_DIRS}/Debug + ${FLTK_EXECUTABLE_DIRS}/Release + NO_SYSTEM_PATH) + endif() + # mark_as_advanced(FLTK_FLUID_EXECUTABLE) + + set(FLTK_INCLUDE_DIR ${FLTK_DIR}) + link_directories(${FLTK_LIBRARY_DIRS}) + + set(FLTK_BASE_LIBRARY fltk) + set(FLTK_GL_LIBRARY fltk_gl) + set(FLTK_FORMS_LIBRARY fltk_forms) + set(FLTK_IMAGES_LIBRARY fltk_images) + + # Add the extra libraries + load_cache(${FLTK_DIR} + READ_WITH_PREFIX + FL FLTK_USE_SYSTEM_JPEG + FL FLTK_USE_SYSTEM_PNG + FL FLTK_USE_SYSTEM_ZLIB + ) - # if FLTK was not built using CMake - # Find fluid executable. - find_program(FLTK_FLUID_EXECUTABLE fluid ${FLTK_INCLUDE_DIR}/fluid) - - # Use location of fluid to help find everything else. - set(FLTK_INCLUDE_SEARCH_PATH "") - set(FLTK_LIBRARY_SEARCH_PATH "") - if(FLTK_FLUID_EXECUTABLE) - get_filename_component(FLTK_BIN_DIR "${FLTK_FLUID_EXECUTABLE}" PATH) - set(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH} - ${FLTK_BIN_DIR}/../include ${FLTK_BIN_DIR}/..) - set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH} - ${FLTK_BIN_DIR}/../lib) - set(FLTK_WRAP_UI 1) - endif() + set(FLTK_IMAGES_LIBS "") + if(FLFLTK_USE_SYSTEM_JPEG) + set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_jpeg) + endif() + if(FLFLTK_USE_SYSTEM_PNG) + set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_png) + endif() + if(FLFLTK_USE_SYSTEM_ZLIB) + set(FLTK_IMAGES_LIBS ${FLTK_IMAGES_LIBS} fltk_zlib) + endif() + set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL + "Extra libraries for fltk_images library.") - # - # Try to find FLTK include dir using fltk-config - # - if(UNIX) - # Use fltk-config to generate a list of possible include directories - find_program(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR}) - if(FLTK_CONFIG_SCRIPT) - if(NOT FLTK_INCLUDE_DIR) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS) - if(FLTK_CXXFLAGS) - string(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS}) - string(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}") - foreach(_dir ${_fltk_temp_dirs}) - string(STRIP ${_dir} _output) - list(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output}) - endforeach() - endif() +else() + + # if FLTK was not built using CMake + # Find fluid executable. + find_program(FLTK_FLUID_EXECUTABLE fluid ${FLTK_INCLUDE_DIR}/fluid) + + # Use location of fluid to help find everything else. + set(FLTK_INCLUDE_SEARCH_PATH "") + set(FLTK_LIBRARY_SEARCH_PATH "") + if(FLTK_FLUID_EXECUTABLE) + get_filename_component(FLTK_BIN_DIR "${FLTK_FLUID_EXECUTABLE}" PATH) + set(FLTK_INCLUDE_SEARCH_PATH ${FLTK_INCLUDE_SEARCH_PATH} + ${FLTK_BIN_DIR}/../include ${FLTK_BIN_DIR}/..) + set(FLTK_LIBRARY_SEARCH_PATH ${FLTK_LIBRARY_SEARCH_PATH} + ${FLTK_BIN_DIR}/../lib) + set(FLTK_WRAP_UI 1) + endif() + + # + # Try to find FLTK include dir using fltk-config + # + if(UNIX) + # Use fltk-config to generate a list of possible include directories + find_program(FLTK_CONFIG_SCRIPT fltk-config PATHS ${FLTK_BIN_DIR}) + if(FLTK_CONFIG_SCRIPT) + if(NOT FLTK_INCLUDE_DIR) + exec_program(${FLTK_CONFIG_SCRIPT} ARGS --cxxflags OUTPUT_VARIABLE FLTK_CXXFLAGS) + if(FLTK_CXXFLAGS) + string(REGEX MATCHALL "-I[^ ]*" _fltk_temp_dirs ${FLTK_CXXFLAGS}) + string(REPLACE "-I" "" _fltk_temp_dirs "${_fltk_temp_dirs}") + foreach(_dir ${_fltk_temp_dirs}) + string(STRIP ${_dir} _output) + list(APPEND _FLTK_POSSIBLE_INCLUDE_DIRS ${_output}) + endforeach() endif() endif() endif() + endif() - list(APPEND FLTK_INCLUDE_SEARCH_PATH ${_FLTK_POSSIBLE_INCLUDE_DIRS}) + list(APPEND FLTK_INCLUDE_SEARCH_PATH ${_FLTK_POSSIBLE_INCLUDE_DIRS}) - find_path(FLTK_INCLUDE_DIR - NAMES FL/Fl.h FL/Fl.H # fltk 1.1.9 has Fl.H (#8376) - PATH_SUFFIXES fltk fltk/include - PATHS ${FLTK_INCLUDE_SEARCH_PATH}) + find_path(FLTK_INCLUDE_DIR + NAMES FL/Fl.h FL/Fl.H # fltk 1.1.9 has Fl.H (#8376) + PATH_SUFFIXES fltk fltk/include + PATHS ${FLTK_INCLUDE_SEARCH_PATH}) - # - # Try to find FLTK library - if(UNIX) - if(FLTK_CONFIG_SCRIPT) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS) - if(_FLTK_POSSIBLE_LIBS) - get_filename_component(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH) - endif() + # + # Try to find FLTK library + if(UNIX) + if(FLTK_CONFIG_SCRIPT) + exec_program(${FLTK_CONFIG_SCRIPT} ARGS --libs OUTPUT_VARIABLE _FLTK_POSSIBLE_LIBS) + if(_FLTK_POSSIBLE_LIBS) + get_filename_component(_FLTK_POSSIBLE_LIBRARY_DIR ${_FLTK_POSSIBLE_LIBS} PATH) endif() endif() + endif() - list(APPEND FLTK_LIBRARY_SEARCH_PATH ${FLTK_INCLUDE_DIR}/lib ${_FLTK_POSSIBLE_LIBRARY_DIR}) - - find_library(FLTK_BASE_LIBRARY NAMES fltk fltkd - PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) - find_library(FLTK_GL_LIBRARY NAMES fltkgl fltkgld fltk_gl - PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) - find_library(FLTK_FORMS_LIBRARY NAMES fltkforms fltkformsd fltk_forms - PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) - find_library(FLTK_IMAGES_LIBRARY NAMES fltkimages fltkimagesd fltk_images - PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) - - # Find the extra libraries needed for the fltk_images library. - if(UNIX) - if(FLTK_CONFIG_SCRIPT) - exec_program(${FLTK_CONFIG_SCRIPT} ARGS --use-images --ldflags - OUTPUT_VARIABLE FLTK_IMAGES_LDFLAGS) - set(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*") - if("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}") - string(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${CMAKE_MATCH_1}") - # The EXEC_PROGRAM will not be inherited into subdirectories from - # the file that originally included this module. Save the answer. - set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL - "Extra libraries for fltk_images library.") - endif() - endif() - endif() + list(APPEND FLTK_LIBRARY_SEARCH_PATH ${FLTK_INCLUDE_DIR}/lib ${_FLTK_POSSIBLE_LIBRARY_DIR}) - endif() + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) - # Append all of the required libraries together (by default, everything) - set(FLTK_LIBRARIES) - if(NOT FLTK_SKIP_IMAGES) - list(APPEND FLTK_LIBRARIES ${FLTK_IMAGES_LIBRARY}) + # Allow libraries to be set manually + if(NOT FLTK_BASE_LIBRARY) + find_library(FLTK_BASE_LIBRARY_RELEASE NAMES fltk PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) + find_library(FLTK_BASE_LIBRARY_DEBUG NAMES fltkd PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) + select_library_configurations(FLTK_BASE) + endif() + if(NOT FLTK_GL_LIBRARY) + find_library(FLTK_GL_LIBRARY_RELEASE NAMES fltkgl fltk_gl PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) + find_library(FLTK_GL_LIBRARY_DEBUG NAMES fltkgld fltk_gld PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) + select_library_configurations(FLTK_GL) + endif() + if(NOT FLTK_FORMS_LIBRARY) + find_library(FLTK_FORMS_LIBRARY_RELEASE NAMES fltkforms fltk_forms PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) + find_library(FLTK_FORMS_LIBRARY_DEBUG NAMES fltkformsd fltk_formsd PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) + select_library_configurations(FLTK_FORMS) endif() - if(NOT FLTK_SKIP_FORMS) - list(APPEND FLTK_LIBRARIES ${FLTK_FORMS_LIBRARY}) + if(NOT FLTK_IMAGES_LIBRARY) + find_library(FLTK_IMAGES_LIBRARY_RELEASE NAMES fltkimages fltk_images PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) + find_library(FLTK_IMAGES_LIBRARY_DEBUG NAMES fltkimagesd fltk_imagesd PATHS ${FLTK_LIBRARY_SEARCH_PATH} PATH_SUFFIXES fltk fltk/lib) + select_library_configurations(FLTK_IMAGES) endif() - if(NOT FLTK_SKIP_OPENGL) - list(APPEND FLTK_LIBRARIES ${FLTK_GL_LIBRARY} ${OPENGL_gl_LIBRARY}) - list(APPEND FLTK_INCLUDE_DIR ${OPENGL_INCLUDE_DIR}) - list(REMOVE_DUPLICATES FLTK_INCLUDE_DIR) + + # Find the extra libraries needed for the fltk_images library. + if(UNIX) + if(FLTK_CONFIG_SCRIPT) + exec_program(${FLTK_CONFIG_SCRIPT} ARGS --use-images --ldflags + OUTPUT_VARIABLE FLTK_IMAGES_LDFLAGS) + set(FLTK_LIBS_EXTRACT_REGEX ".*-lfltk_images (.*) -lfltk.*") + if("${FLTK_IMAGES_LDFLAGS}" MATCHES "${FLTK_LIBS_EXTRACT_REGEX}") + string(REGEX REPLACE " +" ";" FLTK_IMAGES_LIBS "${CMAKE_MATCH_1}") + # The EXEC_PROGRAM will not be inherited into subdirectories from + # the file that originally included this module. Save the answer. + set(FLTK_IMAGES_LIBS "${FLTK_IMAGES_LIBS}" CACHE INTERNAL + "Extra libraries for fltk_images library.") + endif() + endif() endif() - list(APPEND FLTK_LIBRARIES ${FLTK_BASE_LIBRARY}) + +endif() + +# Append all of the required libraries together (by default, everything) +set(FLTK_LIBRARIES) +if(NOT FLTK_SKIP_IMAGES) + list(APPEND FLTK_LIBRARIES ${FLTK_IMAGES_LIBRARY}) +endif() +if(NOT FLTK_SKIP_FORMS) + list(APPEND FLTK_LIBRARIES ${FLTK_FORMS_LIBRARY}) +endif() +if(NOT FLTK_SKIP_OPENGL) + list(APPEND FLTK_LIBRARIES ${FLTK_GL_LIBRARY} ${OPENGL_gl_LIBRARY}) + list(APPEND FLTK_INCLUDE_DIR ${OPENGL_INCLUDE_DIR}) + list(REMOVE_DUPLICATES FLTK_INCLUDE_DIR) +endif() +list(APPEND FLTK_LIBRARIES ${FLTK_BASE_LIBRARY}) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) if(FLTK_SKIP_FLUID) @@ -297,4 +333,3 @@ if(FLTK_FOUND) set (FLTK_FLUID_EXE ${FLTK_FLUID_EXECUTABLE}) set (FLTK_LIBRARY ${FLTK_LIBRARIES}) endif() - diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake index 8009bcf..d203eaf 100644 --- a/Modules/FindLibLZMA.cmake +++ b/Modules/FindLibLZMA.cmake @@ -23,7 +23,7 @@ # LIBLZMA_VERSION_STRING - version number as a string (ex: "5.0.3") find_path(LIBLZMA_INCLUDE_DIR lzma.h ) -find_library(LIBLZMA_LIBRARY lzma) +find_library(LIBLZMA_LIBRARY NAMES lzma liblzma) if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h") file(STRINGS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS REGEX "#define LZMA_VERSION_[A-Z]+ [0-9]+") diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 4d9444a..db14a89 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -602,9 +602,6 @@ function (_MPI_interrogate_compiler lang) if(MPI_DIRECT_LIB_NAMES_WORK) set(MPI_PLAIN_LIB_NAMES_WORK "${MPI_DIRECT_LIB_NAMES_WORK};${MPI_PLAIN_LIB_NAMES_WORK}") endif() - if(MPI_${LANG}_EXTRA_LIB_NAMES) - list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") - endif() # MPI might require pthread to work. The above mechanism wouldn't detect it, but we need to # link it in that case. -lpthread is covered by the normal library treatment on the other hand. @@ -617,6 +614,16 @@ function (_MPI_interrogate_compiler lang) endif() endif() + if(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + list(APPEND MPI_COMPILE_DEFINITIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS}") + endif() + if(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + list(APPEND MPI_COMPILE_OPTIONS_WORK "${MPI_${LANG}_EXTRA_COMPILE_OPTIONS}") + endif() + if(MPI_${LANG}_EXTRA_LIB_NAMES) + list(APPEND MPI_PLAIN_LIB_NAMES_WORK "${MPI_${LANG}_EXTRA_LIB_NAMES}") + endif() + # If we found MPI, set up all of the appropriate cache entries if(NOT MPI_${LANG}_COMPILE_OPTIONS) set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_COMPILE_OPTIONS_WORK} CACHE STRING "MPI ${LANG} compilation options" FORCE) @@ -825,33 +832,43 @@ endfunction() macro(_MPI_assemble_libraries LANG) set(MPI_${LANG}_LIBRARIES "") - foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) - list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) - endforeach() + # Only for libraries do we need to check whether the compiler's linking stage is separate. + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS_IMPLICIT) + foreach(mpilib IN LISTS MPI_${LANG}_LIB_NAMES) + list(APPEND MPI_${LANG}_LIBRARIES ${MPI_${mpilib}_LIBRARY}) + endforeach() + endif() endmacro() macro(_MPI_assemble_include_dirs LANG) - set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") - if("${LANG}" MATCHES "(C|CXX)") - if(MPI_${LANG}_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") - endif() - else() # Fortran - if(MPI_${LANG}_F77_HEADER_DIR) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_${LANG}_INCLUDE_DIRS "") + else() + set(MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS}") + if("${LANG}" MATCHES "(C|CXX)") + if(MPI_${LANG}_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_HEADER_DIR}") + endif() + else() # Fortran + if(MPI_${LANG}_F77_HEADER_DIR) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_F77_HEADER_DIR}") + endif() + if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + endif() endif() - if(MPI_${LANG}_MODULE_DIR AND NOT "${MPI_${LANG}_MODULE_DIR}" IN_LIST MPI_${LANG}_INCLUDE_DIRS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${LANG}_MODULE_DIR}") + if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + foreach(MPI_ADDITIONAL_INC_DIR IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) + list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${MPI_ADDITIONAL_INC_DIR}_INCLUDE_DIR}") + endforeach() endif() endif() - if(MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - foreach(mpiadditionalinclude IN LISTS MPI_${LANG}_ADDITIONAL_INCLUDE_VARS) - list(APPEND MPI_${LANG}_INCLUDE_DIRS "${MPI_${mpiadditionalinclude}_INCLUDE_DIR}") - endforeach() - endif() endmacro() function(_MPI_split_include_dirs LANG) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + return() + endif() # Backwards compatibility: Search INCLUDE_PATH if given. if(MPI_${LANG}_INCLUDE_PATH) list(APPEND MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "${MPI_${LANG}_INCLUDE_PATH}") @@ -887,6 +904,13 @@ function(_MPI_split_include_dirs LANG) endif() mark_as_advanced(MPI_${LANG}_F77_HEADER_DIR MPI_${LANG}_MODULE_DIR) endif() + # Remove duplicates and default system directories from the list. + if(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + list(REMOVE_DUPLICATES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS) + foreach(MPI_IMPLICIT_INC_DIR IN LISTS CMAKE_${LANG}_IMPLICIT_LINK_DIRECTORIES) + list(REMOVE_ITEM MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_IMPLICIT_INC_DIR}) + endforeach() + endif() set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories" FORCE) endfunction() @@ -1016,7 +1040,7 @@ elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows") elseif("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "FreeBSD") # FreeBSD ships mpich under the normal system paths - but available openmpi implementations # will be found in /usr/local/mpi/<name> - MPI_search_mpi_prefix_folder("/usr/local/mpi/") + MPI_search_mpi_prefix_folder("/usr/local/mpi") endif() # Most MPI distributions have some form of mpiexec or mpirun which gives us something we can look for. @@ -1052,51 +1076,54 @@ mark_as_advanced(MPIEXEC_EXECUTABLE MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXE # # Once we find the new variables, we translate them back into their old # equivalents below. -foreach (LANG IN ITEMS C CXX) - # Old input variables. - set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) - - # Set new vars based on their old equivalents, if the new versions are not already set. - foreach (var ${_MPI_OLD_INPUT_VARS}) - if (NOT MPI_${LANG}_${var} AND MPI_${var}) - set(MPI_${LANG}_${var} "${MPI_${var}}") - endif() - endforeach() - - # Chop the old compile flags into options and definitions - if(MPI_${LANG}_COMPILE_FLAGS) - unset(MPI_${LANG}_COMPILE_OPTIONS) - unset(MPI_${LANG}_COMPILE_DEFINITIONS) - separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") - foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) - if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") - list(APPEND MPI_${LANG}_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") - else() - list(APPEND MPI_${LANG}_COMPILE_FLAGS "${_MPI_FLAG}") +if(NOT MPI_IGNORE_LEGACY_VARIABLES) + foreach (LANG IN ITEMS C CXX) + # Old input variables. + set(_MPI_OLD_INPUT_VARS COMPILER COMPILE_FLAGS INCLUDE_PATH LINK_FLAGS) + + # Set new vars based on their old equivalents, if the new versions are not already set. + foreach (var ${_MPI_OLD_INPUT_VARS}) + if (NOT MPI_${LANG}_${var} AND MPI_${var}) + set(MPI_${LANG}_${var} "${MPI_${var}}") endif() endforeach() - unset(MPI_SEPARATE_FLAGS) - endif() - # If a list of libraries was given, we'll split it into new-style cache variables - unset(MPI_${LANG}_EXTRA_LIB_NAMES) - if(NOT MPI_${LANG}_LIB_NAMES) - foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) - if(_MPI_LIB) - get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) - get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) - get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) - list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") - find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY - NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" - HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} - DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" - ) - mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) - endif() - endforeach() - endif() -endforeach() + # Chop the old compile flags into options and definitions + + unset(MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS) + unset(MPI_${LANG}_EXTRA_COMPILE_OPTIONS) + if(MPI_${LANG}_COMPILE_FLAGS) + separate_arguments(MPI_SEPARATE_FLAGS NATIVE_COMMAND "${MPI_${LANG}_COMPILE_FLAGS}") + foreach(_MPI_FLAG IN LISTS MPI_SEPARATE_FLAGS) + if("${_MPI_FLAG}" MATCHES "^ *[-/D]([^ ]+)") + list(APPEND MPI_${LANG}_EXTRA_COMPILE_DEFINITIONS "${CMAKE_MATCH_1}") + else() + list(APPEND MPI_${LANG}_EXTRA_COMPILE_OPTIONS "${_MPI_FLAG}") + endif() + endforeach() + unset(MPI_SEPARATE_FLAGS) + endif() + + # If a list of libraries was given, we'll split it into new-style cache variables + unset(MPI_${LANG}_EXTRA_LIB_NAMES) + if(NOT MPI_${LANG}_LIB_NAMES) + foreach(_MPI_LIB IN LISTS MPI_${LANG}_LIBRARIES MPI_LIBRARY MPI_EXTRA_LIBRARY) + if(_MPI_LIB) + get_filename_component(_MPI_PLAIN_LIB_NAME "${_MPI_LIB}" NAME_WE) + get_filename_component(_MPI_LIB_NAME "${_MPI_LIB}" NAME) + get_filename_component(_MPI_LIB_DIR "${_MPI_LIB}" DIRECTORY) + list(APPEND MPI_${LANG}_EXTRA_LIB_NAMES "${_MPI_PLAIN_LIB_NAME}") + find_library(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY + NAMES "${_MPI_LIB_NAME}" "lib${_MPI_LIB_NAME}" + HINTS ${_MPI_LIB_DIR} $ENV{MPI_LIB} + DOC "Location of the ${_MPI_PLAIN_LIB_NAME} library for MPI" + ) + mark_as_advanced(MPI_${_MPI_PLAIN_LIB_NAME}_LIBRARY) + endif() + endforeach() + endif() + endforeach() +endif() #============================================================================= unset(MPI_VERSION) @@ -1105,6 +1132,11 @@ unset(MPI_VERSION_MINOR) unset(_MPI_MIN_VERSION) +# If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. +if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) + set(MPI_SKIP_COMPILER_WRAPPER TRUE) +endif() + # This loop finds the compilers and sends them off for interrogation. foreach(LANG IN ITEMS C CXX Fortran) if(CMAKE_${LANG}_COMPILER_LOADED) @@ -1126,6 +1158,8 @@ foreach(LANG IN ITEMS C CXX Fortran) mark_as_advanced(MPI_CXX_SKIP_MPICXX) endif() if(NOT (MPI_${LANG}_LIB_NAMES AND (MPI_${LANG}_INCLUDE_PATH OR MPI_${LANG}_INCLUDE_DIRS OR MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS))) + set(MPI_${LANG}_TRIED_IMPLICIT FALSE) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) if(NOT MPI_${LANG}_COMPILER AND NOT MPI_ASSUME_NO_BUILTIN_MPI) # Should the imported targets be empty, we effectively try whether the compiler supports MPI on its own, which is the case on e.g. # Cray PrgEnv. @@ -1135,80 +1169,90 @@ foreach(LANG IN ITEMS C CXX Fortran) # If the compiler can build MPI code on its own, it functions as an MPI compiler and we'll set the variable to point to it. if(MPI_${LANG}_WORKS) set(MPI_${LANG}_COMPILER "${CMAKE_${LANG}_COMPILER}" CACHE FILEPATH "MPI compiler for ${LANG}" FORCE) + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) endif() + set(MPI_${LANG}_TRIED_IMPLICIT TRUE) endif() - # If the user specified a library name we assume they prefer that library over a wrapper. If not, they can disable skipping manually. - if(NOT DEFINED MPI_SKIP_COMPILER_WRAPPER AND MPI_GUESS_LIBRARY_NAME) - set(MPI_SKIP_COMPILER_WRAPPER TRUE) - endif() - if(NOT MPI_SKIP_COMPILER_WRAPPER) - if(MPI_${LANG}_COMPILER) - # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. - if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") - # Get rid of our default list of names and just search for the name the user wants. - set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") - unset(MPI_${LANG}_COMPILER CACHE) + if(NOT "${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}" OR NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WRAPPER_FOUND FALSE) + set(MPI_PINNED_COMPILER FALSE) + + if(NOT MPI_SKIP_COMPILER_WRAPPER) + if(MPI_${LANG}_COMPILER) + # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. + if (NOT IS_ABSOLUTE "${MPI_${LANG}_COMPILER}") + # Get rid of our default list of names and just search for the name the user wants. + set(_MPI_${LANG}_COMPILER_NAMES "${MPI_${LANG}_COMPILER}") + unset(MPI_${LANG}_COMPILER CACHE) + endif() + # If the user specifies a compiler, we don't want to try to search libraries either. + set(MPI_PINNED_COMPILER TRUE) + endif() + + # If we have an MPI base directory, we'll try all compiler names in that one first. + # This should prevent mixing different MPI environments + if(_MPI_BASE_DIR) + find_program(MPI_${LANG}_COMPILER + NAMES ${_MPI_${LANG}_COMPILER_NAMES} + PATH_SUFFIXES bin sbin + HINTS ${_MPI_BASE_DIR} + NO_DEFAULT_PATH + DOC "MPI compiler for ${LANG}" + ) endif() - # If the user specifies a compiler, we don't want to try to search libraries either. - set(MPI_PINNED_COMPILER TRUE) - else() - set(MPI_PINNED_COMPILER FALSE) - endif() - # If we have an MPI base directory, we'll try all compiler names in that one first. - # This should prevent mixing different MPI environments - if(_MPI_BASE_DIR) + # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), + # we shall try searching in the default paths. find_program(MPI_${LANG}_COMPILER NAMES ${_MPI_${LANG}_COMPILER_NAMES} PATH_SUFFIXES bin sbin - HINTS ${_MPI_BASE_DIR} - NO_DEFAULT_PATH DOC "MPI compiler for ${LANG}" ) - endif() - # If the base directory did not help (for example because the mpiexec isn't in the same directory as the compilers), - # we shall try searching in the default paths. - find_program(MPI_${LANG}_COMPILER - NAMES ${_MPI_${LANG}_COMPILER_NAMES} - PATH_SUFFIXES bin sbin - DOC "MPI compiler for ${LANG}" - ) - - if(MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - set(MPI_SKIP_GUESSING TRUE) - elseif(MPI_${LANG}_COMPILER) - _MPI_interrogate_compiler(${LANG}) - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) + if("${MPI_${LANG}_COMPILER}" STREQUAL "${CMAKE_${LANG}_COMPILER}") + set(MPI_PINNED_COMPILER TRUE) + + # If we haven't made the implicit compiler test yet, perform it now. + if(NOT MPI_${LANG}_TRIED_IMPLICIT) + _MPI_create_imported_target(${LANG}) + _MPI_check_lang_works(${LANG}) + endif() + + # Should the MPI compiler not work implicitly for MPI, still interrogate it. + # Otherwise, MPI compilers for which CMake has separate linking stages, e.g. Intel MPI on Windows where link.exe is being used + # directly during linkage instead of CMAKE_<LANG>_COMPILER will not work. + if(NOT MPI_${LANG}_WORKS) + set(MPI_${LANG}_WORKS_IMPLICIT FALSE) + _MPI_interrogate_compiler(${LANG}) + else() + set(MPI_${LANG}_WORKS_IMPLICIT TRUE) + endif() + elseif(MPI_${LANG}_COMPILER) + _MPI_interrogate_compiler(${LANG}) + endif() endif() - else() - set(MPI_${LANG}_WRAPPER_FOUND FALSE) - set(MPI_PINNED_COMPILER FALSE) - endif() - if(NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) - # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the - # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. - if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) - set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) - set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) - set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") - set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) - set(MPI_${LANG}_WRAPPER_FOUND TRUE) - elseif(NOT MPI_SKIP_GUESSING) - _MPI_guess_settings(${LANG}) + if(NOT MPI_SKIP_GUESSING AND NOT MPI_${LANG}_WRAPPER_FOUND AND NOT MPI_PINNED_COMPILER) + # For C++, we may use the settings for C. Should a given compiler wrapper for C++ not exist, but one for C does, we copy over the + # settings for C. An MPI distribution that is in this situation would be IBM Platform MPI. + if("${LANG}" STREQUAL "CXX" AND MPI_C_WRAPPER_FOUND) + set(MPI_${LANG}_COMPILE_OPTIONS ${MPI_C_COMPILE_OPTIONS} CACHE STRING "MPI ${LANG} compilation options" ) + set(MPI_${LANG}_COMPILE_DEFINITIONS ${MPI_C_COMPILE_DEFINITIONS} CACHE STRING "MPI ${LANG} compilation definitions" ) + set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS ${MPI_C_INCLUDE_DIRS} CACHE STRING "MPI ${LANG} additional include directories") + set(MPI_${LANG}_LINK_FLAGS ${MPI_C_LINK_FLAGS} CACHE STRING "MPI ${LANG} linker flags" ) + set(MPI_${LANG}_LIB_NAMES ${MPI_C_LIB_NAMES} CACHE STRING "MPI ${LANG} libraries to link against" ) + else() + _MPI_guess_settings(${LANG}) + endif() endif() endif() endif() _MPI_split_include_dirs(${LANG}) - if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) - _MPI_assemble_include_dirs(${LANG}) - _MPI_assemble_libraries(${LANG}) - endif() + _MPI_assemble_include_dirs(${LANG}) + _MPI_assemble_libraries(${LANG}) + _MPI_adjust_compile_definitions(${LANG}) # We always create imported targets even if they're empty _MPI_create_imported_target(${LANG}) @@ -1222,7 +1266,9 @@ foreach(LANG IN ITEMS C CXX Fortran) set(MPI_${LANG}_COMPILE_DEFINITIONS "" CACHE STRING "MPI ${LANG} compilation definitions" ) set(MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS "" CACHE STRING "MPI ${LANG} additional include directories") set(MPI_${LANG}_LINK_FLAGS "" CACHE STRING "MPI ${LANG} linker flags" ) - set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + if(NOT MPI_${LANG}_COMPILER STREQUAL CMAKE_${LANG}_COMPILER) + set(MPI_${LANG}_LIB_NAMES "" CACHE STRING "MPI ${LANG} libraries to link against" ) + endif() mark_as_advanced(MPI_${LANG}_COMPILE_OPTIONS MPI_${LANG}_COMPILE_DEFINITIONS MPI_${LANG}_LINK_FLAGS MPI_${LANG}_LIB_NAMES MPI_${LANG}_ADDITIONAL_INCLUDE_DIRS MPI_${LANG}_COMPILER) @@ -1453,6 +1499,7 @@ if (MPI_NUMLIBS GREATER 1) else() set(MPI_EXTRA_LIBRARY "MPI_EXTRA_LIBRARY-NOTFOUND") endif() +set(MPI_IGNORE_LEGACY_VARIABLES TRUE) #============================================================================= # unset these vars to cleanup namespace diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake index e01e75e..0b902e7 100644 --- a/Modules/FindPerlLibs.cmake +++ b/Modules/FindPerlLibs.cmake @@ -32,193 +32,94 @@ # # :: # -# PERL_SITESEARCH = path to the sitesearch install dir -# PERL_SITELIB = path to the sitelib install directory -# PERL_VENDORARCH = path to the vendor arch install directory -# PERL_VENDORLIB = path to the vendor lib install directory -# PERL_ARCHLIB = path to the arch lib install directory -# PERL_PRIVLIB = path to the priv lib install directory +# PERL_SITESEARCH = path to the sitesearch install dir (-V:installsitesearch) +# PERL_SITEARCH = path to the sitelib install directory (-V:installsitearch) +# PERL_SITELIB = path to the sitelib install directory (-V:installsitelib) +# PERL_VENDORARCH = path to the vendor arch install directory (-V:installvendorarch) +# PERL_VENDORLIB = path to the vendor lib install directory (-V:installvendorlib) +# PERL_ARCHLIB = path to the core arch lib install directory (-V:archlib) +# PERL_PRIVLIB = path to the core priv lib install directory (-V:privlib) +# PERL_UPDATE_ARCHLIB = path to the update arch lib install directory (-V:installarchlib) +# PERL_UPDATE_PRIVLIB = path to the update priv lib install directory (-V:installprivlib) # PERL_EXTRA_C_FLAGS = Compilation flags used to build perl # find the perl executable include(${CMAKE_CURRENT_LIST_DIR}/FindPerl.cmake) if (PERL_EXECUTABLE) - ### PERL_PREFIX - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:prefix - OUTPUT_VARIABLE - PERL_PREFIX_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_PREFIX_RESULT_VARIABLE - ) - if (NOT PERL_PREFIX_RESULT_VARIABLE) - string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE}) - endif () + function (perl_get_info _pgi_info tag) + cmake_parse_arguments(_PGI "IS_PATH" "" "" ${ARGN}) - ### PERL_ARCHNAME - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:archname - OUTPUT_VARIABLE - PERL_ARCHNAME_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_ARCHNAME_RESULT_VARIABLE - ) - if (NOT PERL_ARCHNAME_RESULT_VARIABLE) - string(REGEX REPLACE "archname='([^']+)'.*" "\\1" PERL_ARCHNAME ${PERL_ARCHNAME_OUTPUT_VARIABLE}) - endif () + set (${_pgi_info} NOTFOUND PARENT_SCOPE) + + execute_process(COMMAND "${PERL_EXECUTABLE}" -V:${tag} + OUTPUT_VARIABLE result + RESULT_VARIABLE status) + + if (NOT status) + string(REGEX REPLACE "${tag}='([^']*)'.*" "\\1" result "${result}") + if (_PGI_IS_PATH) + file(TO_CMAKE_PATH "${result}" result) + endif() + set (${_pgi_info} "${result}" PARENT_SCOPE) + endif () + endfunction() + ### PERL_PREFIX + perl_get_info(PERL_PREFIX prefix IS_PATH) + ### PERL_ARCHNAME + perl_get_info(PERL_ARCHNAME archname) ### PERL_EXTRA_C_FLAGS - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:cppflags - OUTPUT_VARIABLE - PERL_CPPFLAGS_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_CPPFLAGS_RESULT_VARIABLE - ) - if (NOT PERL_CPPFLAGS_RESULT_VARIABLE) - string(REGEX REPLACE "cppflags='([^']+)'.*" "\\1" PERL_EXTRA_C_FLAGS ${PERL_CPPFLAGS_OUTPUT_VARIABLE}) - endif () + perl_get_info(PERL_EXTRA_C_FLAGS cppflags) ### PERL_SITESEARCH - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:installsitesearch - OUTPUT_VARIABLE - PERL_SITESEARCH_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_SITESEARCH_RESULT_VARIABLE - ) - if (NOT PERL_SITESEARCH_RESULT_VARIABLE) - string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE}) - file(TO_CMAKE_PATH "${PERL_SITESEARCH}" PERL_SITESEARCH) - endif () + perl_get_info(PERL_SITESEARCH installsitesearch IS_PATH) + + ### PERL_SITEARCH + perl_get_info(PERL_SITEARCH installsitearch IS_PATH) ### PERL_SITELIB - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:installsitelib - OUTPUT_VARIABLE - PERL_SITELIB_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_SITELIB_RESULT_VARIABLE - ) - if (NOT PERL_SITELIB_RESULT_VARIABLE) - string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE}) - file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB) - endif () + perl_get_info(PERL_SITELIB installsitelib IS_PATH) ### PERL_VENDORARCH - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:installvendorarch - OUTPUT_VARIABLE - PERL_VENDORARCH_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_VENDORARCH_RESULT_VARIABLE - ) - if (NOT PERL_VENDORARCH_RESULT_VARIABLE) - string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE}) - file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH) - endif () + perl_get_info(PERL_VENDORARCH installvendorarch IS_PATH) ### PERL_VENDORLIB - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:installvendorlib - OUTPUT_VARIABLE - PERL_VENDORLIB_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_VENDORLIB_RESULT_VARIABLE - ) - if (NOT PERL_VENDORLIB_RESULT_VARIABLE) - string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE}) - file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB) - endif () - - macro(perl_adjust_darwin_lib_variable varname) - string( TOUPPER PERL_${varname} FINDPERL_VARNAME ) - string( TOLOWER install${varname} PERL_VARNAME ) - - if (NOT PERL_MINUSV_OUTPUT_VARIABLE) - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V - OUTPUT_VARIABLE - PERL_MINUSV_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_MINUSV_RESULT_VARIABLE - ) - endif() - - if (NOT PERL_MINUSV_RESULT_VARIABLE) - string(REGEX MATCH "(${PERL_VARNAME}.*points? to the Updates directory)" - PERL_NEEDS_ADJUSTMENT ${PERL_MINUSV_OUTPUT_VARIABLE}) - - if (PERL_NEEDS_ADJUSTMENT) - string(REGEX REPLACE "(.*)/Updates/" "/System/\\1/" ${FINDPERL_VARNAME} ${${FINDPERL_VARNAME}}) - endif () - - endif () - endmacro() + perl_get_info(PERL_VENDORLIB installvendorlib IS_PATH) ### PERL_ARCHLIB - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:installarchlib - OUTPUT_VARIABLE - PERL_ARCHLIB_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_ARCHLIB_RESULT_VARIABLE - ) - if (NOT PERL_ARCHLIB_RESULT_VARIABLE) - string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE}) - perl_adjust_darwin_lib_variable( ARCHLIB ) - file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB) - endif () + perl_get_info(PERL_ARCHLIB archlib IS_PATH) ### PERL_PRIVLIB - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:installprivlib - OUTPUT_VARIABLE - PERL_PRIVLIB_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_PRIVLIB_RESULT_VARIABLE - ) - if (NOT PERL_PRIVLIB_RESULT_VARIABLE) - string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE}) - perl_adjust_darwin_lib_variable( PRIVLIB ) - file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB) - endif () + perl_get_info(PERL_PRIVLIB privlib IS_PATH) + + ### PERL_UPDATE_ARCHLIB + perl_get_info(PERL_UPDATE_ARCHLIB installarchlib IS_PATH) + + ### PERL_UPDATE_PRIVLIB + perl_get_info(PERL_UPDATE_PRIVLIB installprivlib IS_PATH) ### PERL_POSSIBLE_LIBRARY_NAMES - execute_process( - COMMAND - ${PERL_EXECUTABLE} -V:libperl - OUTPUT_VARIABLE - PERL_LIBRARY_OUTPUT_VARIABLE - RESULT_VARIABLE - PERL_LIBRARY_RESULT_VARIABLE - ) - if (NOT PERL_LIBRARY_RESULT_VARIABLE) - string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE}) - else () + perl_get_info(PERL_POSSIBLE_LIBRARY_NAMES libperl) + if (NOT PERL_POSSIBLE_LIBRARY_NAMES) set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl) - endif () + endif() + if (CMAKE_SYSTEM_NAME MATCHES "MSYS|CYGWIN") + # on MSYS and CYGWIN environments, current perl -V:libperl gives shared library name + # rather than the import library. So, extends possible library names + list (APPEND PERL_POSSIBLE_LIBRARY_NAMES perl) + endif() ### PERL_INCLUDE_PATH find_path(PERL_INCLUDE_PATH NAMES perl.h PATHS - ${PERL_ARCHLIB}/CORE + "${PERL_UPDATE_ARCHLIB}/CORE" + "${PERL_ARCHLIB}/CORE" /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE /usr/lib/perl5/${PERL_VERSION_STRING}/CORE @@ -230,7 +131,8 @@ if (PERL_EXECUTABLE) NAMES ${PERL_POSSIBLE_LIBRARY_NAMES} PATHS - ${PERL_ARCHLIB}/CORE + "${PERL_UPDATE_ARCHLIB}/CORE" + "${PERL_ARCHLIB}/CORE" /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE /usr/lib/perl5/${PERL_VERSION_STRING}/CORE diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index 76afa8a..aad3b74 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -1,19 +1,22 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -#.rst: -# FindPkgConfig -# ------------- -# -# A `pkg-config` module for CMake. -# -# Finds the ``pkg-config`` executable and add the -# :command:`pkg_check_modules` and :command:`pkg_search_module` -# commands. -# -# In order to find the ``pkg-config`` executable, it uses the -# :variable:`PKG_CONFIG_EXECUTABLE` variable or the ``PKG_CONFIG`` -# environment variable first. +#[========================================[.rst: +FindPkgConfig +------------- + +A ``pkg-config`` module for CMake. + +Finds the ``pkg-config`` executable and adds the :command:`pkg_get_variable`, +:command:`pkg_check_modules` and :command:`pkg_search_module` commands. The +following variables will also be set:: + + PKG_CONFIG_FOUND ... if pkg-config executable was found + PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program + PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found + (since CMake 2.8.8) + +#]========================================] ### Common stuff #### set(PKG_CONFIG_VERSION 1) @@ -82,12 +85,13 @@ endmacro() #[========================================[.rst: .. command:: pkg_get_variable - Retrieves the value of a variable from a package:: + Retrieves the value of a pkg-config variable ``varName`` and stores it in the + result variable ``resultVar`` in the calling scope. :: - pkg_get_variable(<RESULT> <MODULE> <VARIABLE>) + pkg_get_variable(<resultVar> <moduleName> <varName>) - If multiple values are returned variable will contain a - :ref:`;-list <CMake Language Lists>`. + If ``pkg-config`` returns multiple values for the specified variable, + ``resultVar`` will contain a :ref:`;-list <CMake Language Lists>`. For example: @@ -472,117 +476,106 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma endif() endmacro() -### -### User visible macros start here -### #[========================================[.rst: .. command:: pkg_check_modules - Checks for all the given modules. :: + Checks for all the given modules, setting a variety of result variables in + the calling scope. :: - pkg_check_modules(<PREFIX> [REQUIRED] [QUIET] - [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH] + pkg_check_modules(<prefix> + [REQUIRED] [QUIET] + [NO_CMAKE_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] [IMPORTED_TARGET] - <MODULE> [<MODULE>]*) - - - When the ``REQUIRED`` argument was set, macros will fail with an error - when module(s) could not be found. - - When the ``QUIET`` argument is set, no status messages will be printed. - - By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or - later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set, the - :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH`, and - :variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables will - be added to ``pkg-config`` search path. - The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments - disable this behavior for the cache variables and the environment - variables, respectively. - The ``IMPORTED_TARGET`` argument will create an imported target named - PkgConfig::<PREFIX>> that can be passed directly as an argument to - :command:`target_link_libraries`. - - It sets the following variables: :: - - PKG_CONFIG_FOUND ... if pkg-config executable was found - PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program - PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found - (since CMake 2.8.8) - - For the following variables two sets of values exist; first one is the - common one and has the given PREFIX. The second set contains flags - which are given out when ``pkg-config`` was called with the ``--static`` - option. :: - - <XPREFIX>_FOUND ... set to 1 if module(s) exist - <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l') - <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') - <XPREFIX>_LDFLAGS ... all required linker flags - <XPREFIX>_LDFLAGS_OTHER ... all other linker flags - <XPREFIX>_INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I') - <XPREFIX>_CFLAGS ... all required cflags - <XPREFIX>_CFLAGS_OTHER ... the other compiler flags + <moduleSpec> [<moduleSpec>...]) + + When the ``REQUIRED`` argument is given, the command will fail with an error + if module(s) could not be found. + + When the ``QUIET`` argument is given, no status messages will be printed. + + By default, if :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or + later, or if :variable:`PKG_CONFIG_USE_CMAKE_PREFIX_PATH` is set to a + boolean ``True`` value, then the :variable:`CMAKE_PREFIX_PATH`, + :variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH` cache + and environment variables will be added to the ``pkg-config`` search path. + The ``NO_CMAKE_PATH`` and ``NO_CMAKE_ENVIRONMENT_PATH`` arguments + disable this behavior for the cache variables and environment variables + respectively. + + The ``IMPORTED_TARGET`` argument will create an imported target named + ``PkgConfig::<prefix>`` that can be passed directly as an argument to + :command:`target_link_libraries`. + + Each ``<moduleSpec>`` must be in one of the following formats:: + + {moduleName} ... matches any version + {moduleName}>={version} ... at least version <version> is required + {moduleName}={version} ... exactly version <version> is required + {moduleName}<={version} ... modules must not be newer than <version> + + The following variables may be set upon return. Two sets of values exist, + one for the common case (``<XXX> = <prefix>``) and another for the + information ``pkg-config`` provides when it is called with the ``--static`` + option (``<XXX> = <prefix>_STATIC``):: + + <XXX>_FOUND ... set to 1 if module(s) exist + <XXX>_LIBRARIES ... only the libraries (without the '-l') + <XXX>_LIBRARY_DIRS ... the paths of the libraries (without the '-L') + <XXX>_LDFLAGS ... all required linker flags + <XXX>_LDFLAGS_OTHER ... all other linker flags + <XXX>_INCLUDE_DIRS ... the '-I' preprocessor flags (without the '-I') + <XXX>_CFLAGS ... all required cflags + <XXX>_CFLAGS_OTHER ... the other compiler flags + + All but ``<XXX>_FOUND`` may be a :ref:`;-list <CMake Language Lists>` if the + associated variable returned from ``pkg-config`` has multiple values. + + There are some special variables whose prefix depends on the number of + ``<moduleSpec>`` given. When there is only one ``<moduleSpec>``, + ``<YYY>`` will simply be ``<prefix>``, but if two or more ``<moduleSpec>`` + items are given, ``<YYY>`` will be ``<prefix>_<moduleName>``:: + + <YYY>_VERSION ... version of the module + <YYY>_PREFIX ... prefix directory of the module + <YYY>_INCLUDEDIR ... include directory of the module + <YYY>_LIBDIR ... lib directory of the module + + Examples - :: - - <XPREFIX> = <PREFIX> for common case - <XPREFIX> = <PREFIX>_STATIC for static linking - - Every variable containing multiple values will be a - :ref:`;-list <CMake Language Lists>`. - - There are some special variables whose prefix depends on the count of - given modules. When there is only one module, <PREFIX> stays - unchanged. When there are multiple modules, the prefix will be - changed to <PREFIX>_<MODNAME>: :: - - <XPREFIX>_VERSION ... version of the module - <XPREFIX>_PREFIX ... prefix-directory of the module - <XPREFIX>_INCLUDEDIR ... include-dir of the module - <XPREFIX>_LIBDIR ... lib-dir of the module - - :: - - <XPREFIX> = <PREFIX> when |MODULES| == 1, else - <XPREFIX> = <PREFIX>_<MODNAME> - - A <MODULE> parameter can have the following formats: :: - - {MODNAME} ... matches any version - {MODNAME}>={VERSION} ... at least version <VERSION> is required - {MODNAME}={VERSION} ... exactly version <VERSION> is required - {MODNAME}<={VERSION} ... modules must not be newer than <VERSION> - - Examples + .. code-block:: cmake - .. code-block:: cmake + pkg_check_modules (GLIB2 glib-2.0) - pkg_check_modules (GLIB2 glib-2.0) + Looks for any version of glib2. If found, the output variable + ``GLIB2_VERSION`` will hold the actual version found. - .. code-block:: cmake + .. code-block:: cmake - pkg_check_modules (GLIB2 glib-2.0>=2.10) + pkg_check_modules (GLIB2 glib-2.0>=2.10) - Requires at least version 2.10 of glib2 and defines e.g. - ``GLIB2_VERSION=2.10.3`` + Looks for at least version 2.10 of glib2. If found, the output variable + ``GLIB2_VERSION`` will hold the actual version found. - .. code-block:: cmake + .. code-block:: cmake - pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0) + pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0) - Requires both glib2 and gtk2, and defines e.g. - ``FOO_glib-2.0_VERSION=2.10.3`` and ``FOO_gtk+-2.0_VERSION=2.8.20`` + Looks for both glib2-2.0 (at least version 2.10) and any version of + gtk2+-2.0. Only if both are found will ``FOO`` be considered found. + The ``FOO_glib-2.0_VERSION`` and ``FOO_gtk+-2.0_VERSION`` variables will be + set to their respective found module versions. - .. code-block:: cmake + .. code-block:: cmake pkg_check_modules (XRENDER REQUIRED xrender) - Defines for example:: + Requires any version of ``xrender``. Example output variables set by a + successful call:: - XRENDER_LIBRARIES=Xrender;X11`` - XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp + XRENDER_LIBRARIES=Xrender;X11 + XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp #]========================================] macro(pkg_check_modules _prefix _module0) _pkgconfig_parse_options(_pkg_modules _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target "${_module0}" ${ARGN}) @@ -605,19 +598,22 @@ endmacro() #[========================================[.rst: .. command:: pkg_search_module - Same as :command:`pkg_check_modules`, but instead it checks for given - modules and uses the first working one. :: + The behavior of this command is the same as :command:`pkg_check_modules`, + except that rather than checking for all the specified modules, it searches + for just the first successful match. :: - pkg_search_module(<PREFIX> [REQUIRED] [QUIET] - [NO_CMAKE_PATH] [NO_CMAKE_ENVIRONMENT_PATH] + pkg_search_module(<prefix> + [REQUIRED] [QUIET] + [NO_CMAKE_PATH] + [NO_CMAKE_ENVIRONMENT_PATH] [IMPORTED_TARGET] - <MODULE> [<MODULE>]*) + <moduleSpec> [<moduleSpec>...]) - Examples + Examples - .. code-block:: cmake + .. code-block:: cmake - pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2) + pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2) #]========================================] macro(pkg_search_module _prefix _module0) _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required _pkg_is_silent _no_cmake_path _no_cmake_environment_path _imp_target "${_module0}" ${ARGN}) @@ -654,21 +650,26 @@ endmacro() #[========================================[.rst: -.. variable:: PKG_CONFIG_EXECUTABLE +Variables Affecting Behavior +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - Path to the pkg-config executable. +.. variable:: PKG_CONFIG_EXECUTABLE + This can be set to the path of the pkg-config executable. If not provided, + it will be set by the module as a result of calling :command:`find_program` + internally. The ``PKG_CONFIG`` environment variable can be used as a hint. .. variable:: PKG_CONFIG_USE_CMAKE_PREFIX_PATH - Whether :command:`pkg_check_modules` and :command:`pkg_search_module` - should add the paths in :variable:`CMAKE_PREFIX_PATH`, - :variable:`CMAKE_FRAMEWORK_PATH`, and :variable:`CMAKE_APPBUNDLE_PATH` - cache and environment variables to ``pkg-config`` search path. + Specifies whether :command:`pkg_check_modules` and + :command:`pkg_search_module` should add the paths in the + :variable:`CMAKE_PREFIX_PATH`, :variable:`CMAKE_FRAMEWORK_PATH` and + :variable:`CMAKE_APPBUNDLE_PATH` cache and environment variables to the + ``pkg-config`` search path. - If this variable is not set, this behavior is enabled by default if - :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled - otherwise. + If this variable is not set, this behavior is enabled by default if + :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` is 3.1 or later, disabled + otherwise. #]========================================] diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake index 38e0861..797f9e4 100644 --- a/Modules/InstallRequiredSystemLibraries.cmake +++ b/Modules/InstallRequiredSystemLibraries.cmake @@ -56,10 +56,13 @@ # Specify the :command:`install(PROGRAMS)` command ``COMPONENT`` # option. If not specified, no such option will be used. +cmake_policy(PUSH) +cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced + set(_IRSL_HAVE_Intel FALSE) set(_IRSL_HAVE_MSVC FALSE) foreach(LANG IN ITEMS C CXX Fortran) - if(CMAKE_${LANG}_COMPILER_ID STREQUAL Intel) + if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel") if(NOT _IRSL_HAVE_Intel) get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH) if(CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -81,7 +84,7 @@ foreach(LANG IN ITEMS C CXX Fortran) endif() set(_IRSL_HAVE_Intel TRUE) endif() - elseif(CMAKE_${LANG}_COMPILER_ID STREQUAL MSVC) + elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC") set(_IRSL_HAVE_MSVC TRUE) endif() endforeach() @@ -600,11 +603,14 @@ if(_IRSL_HAVE_Intel) if(_Intel_compiler_ver VERSION_LESS 18) list(APPEND __install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c") endif() - foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libgfxoffload.dll libioffload_host.dll libirngmd.dll + foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libioffload_host.dll libirngmd.dll libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll) list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") endforeach() + if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) + list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.dll") + endif() if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel) foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll) @@ -637,10 +643,10 @@ if(_IRSL_HAVE_Intel) endforeach() endif() if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15) - foreach(__Intel_lib IN ITEMS libgfxoffload.so libistrconv.so) - - list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}") - endforeach() + list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so") + if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel) + list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.so") + endif() endif() if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16) foreach(__Intel_lib IN ITEMS libioffload_host.so libioffload_host.so.5 libioffload_target.so libioffload_target.so.5 libmpx.so offload_main) @@ -743,3 +749,5 @@ if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS) ) endif() endif() + +cmake_policy(POP) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 0ee6fb1..9697bd5 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 10) -set(CMake_VERSION_PATCH 20171211) +set(CMake_VERSION_PATCH 20171220) #set(CMake_VERSION_RC 1) diff --git a/Source/CTest/cmCTestBuildAndTestHandler.cxx b/Source/CTest/cmCTestBuildAndTestHandler.cxx index 672087d..85d98d0 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.cxx +++ b/Source/CTest/cmCTestBuildAndTestHandler.cxx @@ -11,6 +11,7 @@ #include "cmsys/Process.h" #include <chrono> +#include <ratio> #include <stdlib.h> cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() @@ -18,7 +19,7 @@ cmCTestBuildAndTestHandler::cmCTestBuildAndTestHandler() this->BuildTwoConfig = false; this->BuildNoClean = false; this->BuildNoCMake = false; - this->Timeout = 0; + this->Timeout = std::chrono::duration<double>::zero(); } void cmCTestBuildAndTestHandler::Initialize() @@ -224,10 +225,9 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) } for (std::string const& tar : this->BuildTargets) { std::chrono::duration<double> remainingTime = std::chrono::seconds(0); - if (this->Timeout > 0) { - remainingTime = std::chrono::duration<double>(this->Timeout) - - std::chrono::duration_cast<std::chrono::seconds>( - std::chrono::steady_clock::now() - clock_start); + if (this->Timeout > std::chrono::duration<double>::zero()) { + remainingTime = + this->Timeout - (std::chrono::steady_clock::now() - clock_start); if (remainingTime <= std::chrono::seconds(0)) { if (outstring) { *outstring = "--build-and-test timeout exceeded. "; @@ -324,10 +324,9 @@ int cmCTestBuildAndTestHandler::RunCMakeAndTest(std::string* outstring) // how much time is remaining std::chrono::duration<double> remainingTime = std::chrono::seconds(0); - if (this->Timeout > 0) { - remainingTime = std::chrono::duration<double>(this->Timeout) - - std::chrono::duration_cast<std::chrono::seconds>( - std::chrono::steady_clock::now() - clock_start); + if (this->Timeout > std::chrono::duration<double>::zero()) { + remainingTime = + this->Timeout - (std::chrono::steady_clock::now() - clock_start); if (remainingTime <= std::chrono::seconds(0)) { if (outstring) { *outstring = "--build-and-test timeout exceeded. "; @@ -396,7 +395,7 @@ int cmCTestBuildAndTestHandler::ProcessCommandLineArguments( } if (currentArg.find("--test-timeout", 0) == 0 && idx < allArgs.size() - 1) { idx++; - this->Timeout = atof(allArgs[idx].c_str()); + this->Timeout = std::chrono::duration<double>(atof(allArgs[idx].c_str())); } if (currentArg == "--build-generator" && idx < allArgs.size() - 1) { idx++; diff --git a/Source/CTest/cmCTestBuildAndTestHandler.h b/Source/CTest/cmCTestBuildAndTestHandler.h index f19cb67..f8a9ed7 100644 --- a/Source/CTest/cmCTestBuildAndTestHandler.h +++ b/Source/CTest/cmCTestBuildAndTestHandler.h @@ -7,6 +7,7 @@ #include "cmCTestGenericHandler.h" +#include <chrono> #include <sstream> #include <stddef.h> #include <string> @@ -67,7 +68,7 @@ protected: std::vector<std::string> TestCommandArgs; std::vector<std::string> BuildTargets; bool BuildNoCMake; - double Timeout; + std::chrono::duration<double> Timeout; }; #endif diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index 39b90d8..2a9fd72 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -11,7 +11,6 @@ #include "cmParseGTMCoverage.h" #include "cmParseJacocoCoverage.h" #include "cmParsePHPCoverage.h" -#include "cmProcess.h" #include "cmSystemTools.h" #include "cmWorkingDirectory.h" #include "cmXMLWriter.h" @@ -81,7 +80,7 @@ public: cmsysProcess_SetOption(this->Process, cmsysProcess_Option_HideWindow, 1); if (this->TimeOut >= std::chrono::duration<double>::zero()) { - cmsysProcess_SetTimeout(this->Process, this->TimeOut); + cmsysProcess_SetTimeout(this->Process, this->TimeOut.count()); } cmsysProcess_Execute(this->Process); this->PipeState = cmsysProcess_GetState(this->Process); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 7013db3..dbdefae 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -1,9 +1,5 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifdef _WIN32 -/* windows.h defines min() and max() macros that interfere. */ -#define NOMINMAX -#endif #include "cmCTestRunTest.h" #include "cmCTest.h" @@ -265,11 +261,7 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) passed = this->TestResult.Status == cmCTestTestHandler::COMPLETED; char buf[1024]; - sprintf(buf, "%6.2f sec", - double(std::chrono::duration_cast<std::chrono::milliseconds>( - this->TestProcess->GetTotalTime()) - .count()) / - 1000.0); + sprintf(buf, "%6.2f sec", this->TestProcess->GetTotalTime().count()); cmCTestLog(this->CTest, HANDLER_OUTPUT, buf << "\n"); if (outputTestErrorsToConsole) { @@ -394,11 +386,7 @@ void cmCTestRunTest::ComputeWeightedCost() { double prev = static_cast<double>(this->TestProperties->PreviousRuns); double avgcost = static_cast<double>(this->TestProperties->Cost); - double current = - double(std::chrono::duration_cast<std::chrono::milliseconds>( - this->TestResult.ExecutionTime) - .count()) / - 1000.0; + double current = this->TestResult.ExecutionTime.count(); if (this->TestResult.Status == cmCTestTestHandler::COMPLETED) { this->TestProperties->Cost = @@ -690,7 +678,7 @@ bool cmCTestRunTest::ForkProcess(std::chrono::duration<double> testTimeOut, // determine how much time we have std::chrono::duration<double> timeout = this->CTest->GetRemainingTimeAllowed(); - if (timeout != std::chrono::duration<double>::max()) { + if (timeout != cmCTest::MaxDuration()) { timeout -= std::chrono::minutes(2); } if (this->CTest->GetTimeOut() > std::chrono::duration<double>::zero() && @@ -714,7 +702,7 @@ bool cmCTestRunTest::ForkProcess(std::chrono::duration<double> testTimeOut, this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": " << "Test timeout computed to be: " - << (timeout == std::chrono::duration<double>::max() + << (timeout == cmCTest::MaxDuration() ? std::string("infinite") : std::to_string( std::chrono::duration_cast<std::chrono::seconds>(timeout) diff --git a/Source/CTest/cmCTestScriptHandler.cxx b/Source/CTest/cmCTestScriptHandler.cxx index 922f5c7..716ea10 100644 --- a/Source/CTest/cmCTestScriptHandler.cxx +++ b/Source/CTest/cmCTestScriptHandler.cxx @@ -1,12 +1,5 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ - -#ifdef _WIN32 -/* windows.h defines min() and max() macros, unless told to otherwise. This - * interferes with std::min() and std::max() at the very least. */ -#define NOMINMAX -#endif - #include "cmCTestScriptHandler.h" #include "cmsys/Directory.hxx" @@ -970,13 +963,13 @@ bool cmCTestScriptHandler::TryToRemoveBinaryDirectoryOnce( std::chrono::duration<double> cmCTestScriptHandler::GetRemainingTimeAllowed() { if (!this->Makefile) { - return std::chrono::duration<double>::max(); + return cmCTest::MaxDuration(); } const char* timelimitS = this->Makefile->GetDefinition("CTEST_TIME_LIMIT"); if (!timelimitS) { - return std::chrono::duration<double>::max(); + return cmCTest::MaxDuration(); } auto timelimit = std::chrono::duration<double>(atof(timelimitS)); diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index 9819899..4c7cefb 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -539,10 +539,8 @@ int cmCTestTestHandler::ProcessHandler() this->PrintLabelOrSubprojectSummary(false); } char realBuf[1024]; - auto durationInMs = std::chrono::duration_cast<std::chrono::milliseconds>( - clock_finish - clock_start) - .count(); - sprintf(realBuf, "%6.2f sec", static_cast<double>(durationInMs) / 1000.0); + std::chrono::duration<double> durationInSecs = clock_finish - clock_start; + sprintf(realBuf, "%6.2f sec", durationInSecs.count()); cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, "\nTotal Test time (real) = " << realBuf << "\n", this->Quiet); @@ -653,10 +651,7 @@ void cmCTestTestHandler::PrintLabelOrSubprojectSummary(bool doSubProject) // only use labels found in labels if (labels.find(l) != labels.end()) { labelTimes[l] += - double(std::chrono::duration_cast<std::chrono::milliseconds>( - result.ExecutionTime) - .count()) / - 1000.0 * result.Properties->Processors; + result.ExecutionTime.count() * result.Properties->Processors; ++labelCounts[l]; } } @@ -1324,11 +1319,7 @@ void cmCTestTestHandler::GenerateDartOutput(cmXMLWriter& xml) xml.StartElement("NamedMeasurement"); xml.Attribute("type", "numeric/double"); xml.Attribute("name", "Execution Time"); - xml.Element("Value", - double(std::chrono::duration_cast<std::chrono::milliseconds>( - result.ExecutionTime) - .count()) / - 1000.0); + xml.Element("Value", result.ExecutionTime.count()); xml.EndElement(); // NamedMeasurement if (!result.Reason.empty()) { const char* reasonType = "Pass Reason"; diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx index 69ffb33..0db66c3 100644 --- a/Source/CTest/cmProcess.cxx +++ b/Source/CTest/cmProcess.cxx @@ -5,16 +5,6 @@ #include "cmProcessOutput.h" #include <iostream> -void cmsysProcess_SetTimeout(cmsysProcess* process, - std::chrono::duration<double> timeout) -{ - cmsysProcess_SetTimeout( - process, - double( - std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count()) / - 1000.0); -}; - cmProcess::cmProcess() { this->Process = nullptr; @@ -59,7 +49,7 @@ bool cmProcess::StartProcess() cmsysProcess_SetWorkingDirectory(this->Process, this->WorkingDirectory.c_str()); } - cmsysProcess_SetTimeout(this->Process, this->Timeout); + cmsysProcess_SetTimeout(this->Process, this->Timeout.count()); cmsysProcess_SetOption(this->Process, cmsysProcess_Option_MergeOutput, 1); cmsysProcess_Execute(this->Process); return (cmsysProcess_GetState(this->Process) == @@ -115,10 +105,7 @@ int cmProcess::GetNextOutputLine(std::string& line, { cmProcessOutput processOutput(cmProcessOutput::UTF8); std::string strdata; - double waitTimeout = - double( - std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count()) / - 1000.0; + double waitTimeout = timeout.count(); for (;;) { // Look for lines already buffered. if (this->Output.GetLine(line)) { @@ -240,7 +227,7 @@ int cmProcess::ReportStatus() void cmProcess::ChangeTimeout(std::chrono::duration<double> t) { this->Timeout = t; - cmsysProcess_SetTimeout(this->Process, this->Timeout); + cmsysProcess_SetTimeout(this->Process, this->Timeout.count()); } void cmProcess::ResetStartTime() diff --git a/Source/CTest/cmProcess.h b/Source/CTest/cmProcess.h index cbb611d..f3b0bd7 100644 --- a/Source/CTest/cmProcess.h +++ b/Source/CTest/cmProcess.h @@ -10,13 +10,6 @@ #include <string> #include <vector> -/* - * A wrapper function for cmsysProcess_SetTimeout that takes an - * std::chrono::duration. For convenience only. - */ -void cmsysProcess_SetTimeout(cmsysProcess* process, - std::chrono::duration<double> timeout); - /** \class cmProcess * \brief run a process with c++ * diff --git a/Source/bindexplib.cxx b/Source/bindexplib.cxx index 2eb47f3..9ec9624 100644 --- a/Source/bindexplib.cxx +++ b/Source/bindexplib.cxx @@ -31,7 +31,7 @@ * Extension (Axel 2006-03-15) * As soon as an object file contains an /EXPORT directive (which * is generated by the compiler when a symbol is declared as - * declspec(dllexport)) no to-be-exported symbols are printed, + * __declspec(dllexport) no to-be-exported symbols are printed, * as the linker will see these directives, and if those directives * are present we only export selectively (i.e. we trust the * programmer). @@ -50,12 +50,12 @@ * * It created a wrong EXPORTS for the global pointers and constants. * The Section Header has been involved to discover the missing information -* Now the pointers are correctly supplied supplied with "DATA" descriptor +* Now the pointers are correctly supplied with "DATA" descriptor * the constants with no extra descriptor. * * Corrections (Valery Fine 16/09/96): * -* It didn't work for C++ code with global variables and class definitons +* It didn't work for C++ code with global variables and class definitions * The DumpExternalObject function has been introduced to generate .DEF file * * Author: Valery Fine 16/09/96 (E-mail: fine@vxcern.cern.ch) @@ -68,8 +68,20 @@ #include <iostream> #include <windows.h> +#ifndef IMAGE_FILE_MACHINE_ARM +#define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian +#endif + +#ifndef IMAGE_FILE_MACHINE_THUMB +#define IMAGE_FILE_MACHINE_THUMB 0x01c2 // ARM Thumb/Thumb-2 Little-Endian +#endif + #ifndef IMAGE_FILE_MACHINE_ARMNT -#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 +#define IMAGE_FILE_MACHINE_ARMNT 0x01c4 // ARM Thumb-2 Little-Endian +#endif + +#ifndef IMAGE_FILE_MACHINE_ARM64 +#define IMAGE_FILE_MACHINE_ARM64 0xaa64 // ARM64 Little-Endian #endif typedef struct cmANON_OBJECT_HEADER_BIGOBJ @@ -294,7 +306,6 @@ bool DumpFile(const char* filename, std::set<std::string>& symbols, HANDLE hFile; HANDLE hFileMapping; LPVOID lpFileBase; - PIMAGE_DOS_HEADER dosHeader; hFile = CreateFileW(cmsys::Encoding::ToWide(filename).c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, @@ -320,36 +331,42 @@ bool DumpFile(const char* filename, std::set<std::string>& symbols, return false; } - dosHeader = (PIMAGE_DOS_HEADER)lpFileBase; + const PIMAGE_DOS_HEADER dosHeader = (PIMAGE_DOS_HEADER)lpFileBase; if (dosHeader->e_magic == IMAGE_DOS_SIGNATURE) { fprintf(stderr, "File is an executable. I don't dump those.\n"); return false; - } - /* Does it look like a COFF OBJ file??? */ - else if (((dosHeader->e_magic == IMAGE_FILE_MACHINE_I386) || - (dosHeader->e_magic == IMAGE_FILE_MACHINE_AMD64) || - (dosHeader->e_magic == IMAGE_FILE_MACHINE_ARMNT)) && - (dosHeader->e_sp == 0)) { - /* - * The two tests above aren't what they look like. They're - * really checking for IMAGE_FILE_HEADER.Machine == i386 (0x14C) - * and IMAGE_FILE_HEADER.SizeOfOptionalHeader == 0; - */ - DumpSymbols<IMAGE_FILE_HEADER, IMAGE_SYMBOL> symbolDumper( - (PIMAGE_FILE_HEADER)lpFileBase, symbols, dataSymbols, - (dosHeader->e_magic == IMAGE_FILE_MACHINE_I386)); - symbolDumper.DumpObjFile(); } else { - // check for /bigobj format - cmANON_OBJECT_HEADER_BIGOBJ* h = (cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase; - if (h->Sig1 == 0x0 && h->Sig2 == 0xffff) { - DumpSymbols<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX> symbolDumper( - (cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase, symbols, dataSymbols, - (h->Machine == IMAGE_FILE_MACHINE_I386)); + const PIMAGE_FILE_HEADER imageHeader = (PIMAGE_FILE_HEADER)lpFileBase; + /* Does it look like a COFF OBJ file??? */ + if (((imageHeader->Machine == IMAGE_FILE_MACHINE_I386) || + (imageHeader->Machine == IMAGE_FILE_MACHINE_AMD64) || + (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM) || + (imageHeader->Machine == IMAGE_FILE_MACHINE_ARMNT) || + (imageHeader->Machine == IMAGE_FILE_MACHINE_ARM64)) && + (imageHeader->Characteristics == 0)) { + /* + * The tests above are checking for IMAGE_FILE_HEADER.Machine + * if it contains supported machine formats (currently ARM and x86) + * and IMAGE_FILE_HEADER.Characteristics == 0 indicating that + * this is not linked COFF OBJ file; + */ + DumpSymbols<IMAGE_FILE_HEADER, IMAGE_SYMBOL> symbolDumper( + (PIMAGE_FILE_HEADER)lpFileBase, symbols, dataSymbols, + (imageHeader->Machine == IMAGE_FILE_MACHINE_I386)); symbolDumper.DumpObjFile(); } else { - printf("unrecognized file format in '%s'\n", filename); - return false; + // check for /bigobj format + cmANON_OBJECT_HEADER_BIGOBJ* h = + (cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase; + if (h->Sig1 == 0x0 && h->Sig2 == 0xffff) { + DumpSymbols<cmANON_OBJECT_HEADER_BIGOBJ, cmIMAGE_SYMBOL_EX> + symbolDumper((cmANON_OBJECT_HEADER_BIGOBJ*)lpFileBase, symbols, + dataSymbols, (h->Machine == IMAGE_FILE_MACHINE_I386)); + symbolDumper.DumpObjFile(); + } else { + printf("unrecognized file format in '%s'\n", filename); + return false; + } } } UnmapViewOfFile(lpFileBase); diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index f5ddc23..26e1dcb 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -1,11 +1,5 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifdef _WIN32 -/* windows.h defines min() and max() macros by default. This interferes with - * C++ functions names. - */ -#define NOMINMAX -#endif #include "cmCTest.h" #include "cm_curl.h" @@ -50,7 +44,6 @@ #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" #include "cmMakefile.h" -#include "cmProcess.h" #include "cmProcessOutput.h" #include "cmState.h" #include "cmStateSnapshot.h" @@ -997,7 +990,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output, cmsysProcess_SetCommand(cp, &*argv.begin()); cmsysProcess_SetWorkingDirectory(cp, dir); cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); - cmsysProcess_SetTimeout(cp, timeout); + cmsysProcess_SetTimeout(cp, timeout.count()); cmsysProcess_Execute(cp); // Initialize tick's @@ -1088,9 +1081,10 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, bool modifyEnv = (environment && !environment->empty()); // determine how much time we have - std::chrono::duration<double> timeout = - std::min<std::chrono::duration<double>>(this->GetRemainingTimeAllowed(), - std::chrono::minutes(2)); + std::chrono::duration<double> timeout = this->GetRemainingTimeAllowed(); + if (timeout != cmCTest::MaxDuration()) { + timeout -= std::chrono::minutes(2); + } if (this->TimeOut > std::chrono::duration<double>::zero() && this->TimeOut < timeout) { timeout = this->TimeOut; @@ -1106,7 +1100,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, } cmCTestLog( this, HANDLER_VERBOSE_OUTPUT, "Test timeout computed to be: " - << (timeout == std::chrono::duration<double>::max() + << (timeout == cmCTest::MaxDuration() ? std::string("infinite") : std::to_string( std::chrono::duration_cast<std::chrono::seconds>(timeout) @@ -1129,6 +1123,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, // invocations. Since --build-generator is required this is a // good place to check for it, and to add the arguments in if (strcmp(i, "--build-generator") == 0 && + timeout != cmCTest::MaxDuration() && timeout > std::chrono::duration<double>::zero()) { args.push_back("--test-timeout"); std::ostringstream msg; @@ -1183,7 +1178,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output, cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); } - cmsysProcess_SetTimeout(cp, timeout); + cmsysProcess_SetTimeout(cp, timeout.count()); cmsysProcess_Execute(cp); char* data; @@ -2604,7 +2599,7 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args, if (cmSystemTools::GetRunCommandHideConsole()) { cmsysProcess_SetOption(cp, cmsysProcess_Option_HideWindow, 1); } - cmsysProcess_SetTimeout(cp, timeout); + cmsysProcess_SetTimeout(cp, timeout.count()); cmsysProcess_Execute(cp); std::vector<char> tempOutput; @@ -2800,7 +2795,7 @@ void cmCTest::Log(int logType, const char* file, int line, const char* msg, std::chrono::duration<double> cmCTest::GetRemainingTimeAllowed() { if (!this->GetHandler("script")) { - return std::chrono::duration<double>::max(); + return cmCTest::MaxDuration(); } cmCTestScriptHandler* ch = @@ -2809,6 +2804,11 @@ std::chrono::duration<double> cmCTest::GetRemainingTimeAllowed() return ch->GetRemainingTimeAllowed(); } +std::chrono::duration<double> cmCTest::MaxDuration() +{ + return std::chrono::duration<double>(1.0e7); +} + void cmCTest::OutputTestErrors(std::vector<char> const& process_output) { std::string test_outputs("\n*** Test Failed:\n"); diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 44a6350..23d71cb 100644 --- a/Source/cmCTest.h +++ b/Source/cmCTest.h @@ -208,6 +208,8 @@ public: */ std::chrono::duration<double> GetRemainingTimeAllowed(); + static std::chrono::duration<double> MaxDuration(); + /** * Open file in the output directory and set the stream */ diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index fdbc086..23f622b 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -331,24 +331,6 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, continue; } - // If the module is provided in this target special handling is - // needed. - if (this->Internal->TargetProvides.find(i) != - this->Internal->TargetProvides.end()) { - // The module is provided by a different source in the same - // target. Add the proxy dependency to make sure the other - // source builds first. - std::string proxy = stamp_dir; - proxy += "/"; - proxy += i; - proxy += ".mod.proxy"; - proxy = cmSystemTools::ConvertToOutputPath( - this->MaybeConvertToRelativePath(binDir, proxy).c_str()); - - // since we require some things add them to our list of requirements - makeDepends << obj_m << ".requires: " << proxy << std::endl; - } - // The object file should depend on timestamped files for the // modules it uses. TargetRequiresMap::const_iterator required = @@ -373,22 +355,10 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, } } - // Write provided modules to the output stream. - for (std::string const& i : info.Provides) { - std::string proxy = stamp_dir; - proxy += "/"; - proxy += i; - proxy += ".mod.proxy"; - proxy = cmSystemTools::ConvertToOutputPath( - this->MaybeConvertToRelativePath(binDir, proxy).c_str()); - makeDepends << proxy << ": " << obj_m << ".provides" << std::endl; - } - // If any modules are provided then they must be converted to stamp files. if (!info.Provides.empty()) { // Create a target to copy the module after the object file // changes. - makeDepends << obj_m << ".provides.build:\n"; for (std::string const& i : info.Provides) { // Include this module in the set provided by this target. this->Internal->TargetProvides.insert(i); @@ -407,11 +377,25 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, stampFile += "/"; stampFile += m; stampFile += ".mod.stamp"; - stampFile = this->LocalGenerator->ConvertToOutputFormat( - this->MaybeConvertToRelativePath(binDir, stampFile), - cmOutputConverter::SHELL); + stampFile = this->MaybeConvertToRelativePath(binDir, stampFile); + std::string const stampFileForShell = + this->LocalGenerator->ConvertToOutputFormat(stampFile, + cmOutputConverter::SHELL); + std::string const stampFileForMake = + cmSystemTools::ConvertToOutputPath(stampFile.c_str()); + + makeDepends << obj_m << ".provides.build" + << ": " << stampFileForMake << "\n"; + // Note that when cmake_copy_f90_mod finds that a module file + // and the corresponding stamp file have no differences, the stamp + // file is not updated. In such case the stamp file will be always + // older than its prerequisite and trigger cmake_copy_f90_mod + // on each new build. This is expected behavior for incremental + // builds and can not be changed without preforming recursive make + // calls that would considerably slow down the building process. + makeDepends << stampFileForMake << ": " << obj_m << "\n"; makeDepends << "\t$(CMAKE_COMMAND) -E cmake_copy_f90_mod " << modFile - << " " << stampFile; + << " " << stampFileForShell; cmMakefile* mf = this->LocalGenerator->GetMakefile(); const char* cid = mf->GetDefinition("CMAKE_Fortran_COMPILER_ID"); if (cid && *cid) { @@ -419,8 +403,8 @@ bool cmDependsFortran::WriteDependenciesReal(const char* obj, } makeDepends << "\n"; } - // After copying the modules update the timestamp file so that - // copying will not be done again until the source rebuilds. + makeDepends << obj_m << ".provides.build:\n"; + // After copying the modules update the timestamp file. makeDepends << "\t$(CMAKE_COMMAND) -E touch " << obj_m << ".provides.build\n"; diff --git a/Source/cmExtraSublimeTextGenerator.cxx b/Source/cmExtraSublimeTextGenerator.cxx index bd1b6bb..c7197f2 100644 --- a/Source/cmExtraSublimeTextGenerator.cxx +++ b/Source/cmExtraSublimeTextGenerator.cxx @@ -361,9 +361,11 @@ std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject( } // Add source file specific flags. - if (const char* cflags = source->GetProperty("COMPILE_FLAGS")) { - cmGeneratorExpressionInterpreter genexInterpreter(lg, gtgt, config); - lg->AppendFlags(flags, genexInterpreter.Evaluate(cflags)); + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = source->GetProperty(COMPILE_FLAGS)) { + cmGeneratorExpressionInterpreter genexInterpreter( + lg, gtgt, config, gtgt->GetName(), language); + lg->AppendFlags(flags, genexInterpreter.Evaluate(cflags, COMPILE_FLAGS)); } return flags; @@ -379,7 +381,8 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines( cmMakefile* makefile = lg->GetMakefile(); const std::string& language = source->GetLanguage(); const std::string& config = makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); - cmGeneratorExpressionInterpreter genexInterpreter(lg, target, config); + cmGeneratorExpressionInterpreter genexInterpreter( + lg, target, config, target->GetName(), language); // Add the export symbol definition for shared library objects. if (const char* exportMacro = target->GetExportMacro()) { @@ -388,14 +391,17 @@ std::string cmExtraSublimeTextGenerator::ComputeDefines( // Add preprocessor definitions for this target and configuration. lg->AddCompileDefinitions(defines, target, config, language); - if (const char* compile_defs = source->GetProperty("COMPILE_DEFINITIONS")) { - lg->AppendDefines(defines, genexInterpreter.Evaluate(compile_defs)); + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); + if (const char* compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) { + lg->AppendDefines( + defines, genexInterpreter.Evaluate(compile_defs, COMPILE_DEFINITIONS)); } std::string defPropName = "COMPILE_DEFINITIONS_"; defPropName += cmSystemTools::UpperCase(config); if (const char* config_compile_defs = source->GetProperty(defPropName)) { - lg->AppendDefines(defines, genexInterpreter.Evaluate(config_compile_defs)); + lg->AppendDefines(defines, genexInterpreter.Evaluate(config_compile_defs, + COMPILE_DEFINITIONS)); } std::string definesString; diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index 86991c1..6979b38 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -9,6 +9,7 @@ #include "assert.h" #include "cmAlgorithms.h" #include "cmGeneratorExpressionContext.h" +#include "cmGeneratorExpressionDAGChecker.h" #include "cmGeneratorExpressionEvaluator.h" #include "cmGeneratorExpressionLexer.h" #include "cmGeneratorExpressionParser.h" @@ -385,3 +386,18 @@ void cmCompiledGeneratorExpression::GetMaxLanguageStandard( mapping = it->second; } } + +const char* cmGeneratorExpressionInterpreter::Evaluate( + const char* expression, const std::string& property) +{ + if (this->Target.empty()) { + return this->EvaluateExpression(expression); + } + + // Specify COMPILE_OPTIONS to DAGchecker, same semantic as COMPILE_FLAGS + cmGeneratorExpressionDAGChecker dagChecker( + this->Target, property == "COMPILE_FLAGS" ? "COMPILE_OPTIONS" : property, + nullptr, nullptr); + + return this->EvaluateExpression(expression, &dagChecker); +} diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h index 611fbf8..9fd53c6 100644 --- a/Source/cmGeneratorExpression.h +++ b/Source/cmGeneratorExpression.h @@ -160,25 +160,38 @@ class cmGeneratorExpressionInterpreter public: cmGeneratorExpressionInterpreter(cmLocalGenerator* localGenerator, cmGeneratorTarget* generatorTarget, - const std::string& config) + const std::string& config, + const std::string& target, + const std::string& lang) : LocalGenerator(localGenerator) , GeneratorTarget(generatorTarget) , Config(config) + , Target(target) + , Language(lang) + { + } + cmGeneratorExpressionInterpreter(cmLocalGenerator* localGenerator, + cmGeneratorTarget* generatorTarget, + const std::string& config) + : cmGeneratorExpressionInterpreter(localGenerator, generatorTarget, config, + std::string(), std::string()) { } const char* Evaluate(const char* expression) { - this->CompiledGeneratorExpression = - this->GeneratorExpression.Parse(expression); - - return this->CompiledGeneratorExpression->Evaluate( - this->LocalGenerator, this->Config, false, this->GeneratorTarget); + return this->EvaluateExpression(expression); } const char* Evaluate(const std::string& expression) { return this->Evaluate(expression.c_str()); } + const char* Evaluate(const char* expression, const std::string& property); + const char* Evaluate(const std::string& expression, + const std::string& property) + { + return this->Evaluate(expression.c_str(), property); + } protected: cmGeneratorExpression& GetGeneratorExpression() @@ -195,12 +208,34 @@ protected: cmGeneratorTarget* GetGeneratorTarget() { return this->GeneratorTarget; } + const std::string& GetTargetName() const { return this->Target; } + const std::string& GetLanguage() const { return this->Language; } + + const char* EvaluateExpression( + const char* expression, + cmGeneratorExpressionDAGChecker* dagChecker = nullptr) + { + this->CompiledGeneratorExpression = + this->GeneratorExpression.Parse(expression); + + if (dagChecker == nullptr) { + return this->CompiledGeneratorExpression->Evaluate( + this->LocalGenerator, this->Config, false, this->GeneratorTarget); + } + + return this->CompiledGeneratorExpression->Evaluate( + this->LocalGenerator, this->Config, false, this->GeneratorTarget, + dagChecker, this->Language); + } + private: cmGeneratorExpression GeneratorExpression; std::unique_ptr<cmCompiledGeneratorExpression> CompiledGeneratorExpression; cmLocalGenerator* LocalGenerator = nullptr; cmGeneratorTarget* GeneratorTarget = nullptr; std::string Config; + std::string Target; + std::string Language; }; #endif diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index be40126..236bb3d 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -21,7 +21,6 @@ #include "cmStateDirectory.h" #include "cmStateTypes.h" #include "cmSystemTools.h" -#include "cmTarget.h" #include "cmTargetDepend.h" #include "cmake.h" @@ -630,8 +629,6 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( makefileName = localName; makefileName += "/build.make"; - bool needRequiresStep = this->NeedRequiresStep(gtarget); - lg->WriteDivider(ruleFileStream); ruleFileStream << "# Target rules for target " << localName << "\n\n"; @@ -641,13 +638,6 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( commands.push_back( lg->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName)); - // add requires if we need it for this generator - if (needRequiresStep) { - makeTargetName = localName; - makeTargetName += "/requires"; - commands.push_back( - lg->GetRecursiveMakeCall(makefileName.c_str(), makeTargetName)); - } makeTargetName = localName; makeTargetName += "/build"; commands.push_back( @@ -952,21 +942,3 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule( commands, true); ruleFileStream << "\n\n"; } - -bool cmGlobalUnixMakefileGenerator3::NeedRequiresStep( - const cmGeneratorTarget* target) -{ - std::set<std::string> languages; - target->GetLanguages( - languages, - target->Target->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE")); - for (std::string const& l : languages) { - std::string var = "CMAKE_NEEDS_REQUIRES_STEP_"; - var += l; - var += "_FLAG"; - if (target->Target->GetMakefile()->GetDefinition(var)) { - return true; - } - } - return false; -} diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h index d601f88..f9ce88c 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.h +++ b/Source/cmGlobalUnixMakefileGenerator3.h @@ -174,9 +174,6 @@ protected: void AppendGlobalTargetDepends(std::vector<std::string>& depends, cmGeneratorTarget* target); - // does this generator need a requires step for any of its targets - bool NeedRequiresStep(cmGeneratorTarget const*); - // Target name hooks for superclass. const char* GetAllTargetName() const override { return "all"; } const char* GetInstallTargetName() const override { return "install"; } diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 8c9e461..4c4c62c 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -951,6 +951,11 @@ void cmGlobalVisualStudio10Generator::PathTooLong(cmGeneratorTarget* target, } } +std::string cmGlobalVisualStudio10Generator::Encoding() +{ + return "utf-8"; +} + bool cmGlobalVisualStudio10Generator::IsNsightTegra() const { return !this->NsightTegraVersion.empty(); diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h index 5f80c73..fc21193 100644 --- a/Source/cmGlobalVisualStudio10Generator.h +++ b/Source/cmGlobalVisualStudio10Generator.h @@ -96,6 +96,7 @@ public: void PathTooLong(cmGeneratorTarget* target, cmSourceFile const* sf, std::string const& sfRel); + std::string Encoding() override; virtual const char* GetToolsVersion() { return "4.0"; } bool FindMakeProgram(cmMakefile* mf) override; diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index bbf4175..6223be8 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -684,18 +684,21 @@ class XCodeGeneratorExpressionInterpreter public: XCodeGeneratorExpressionInterpreter(cmSourceFile* sourceFile, cmLocalGenerator* localGenerator, - cmGeneratorTarget* generatorTarget) + cmGeneratorTarget* generatorTarget, + const std::string& lang) : cmGeneratorExpressionInterpreter(localGenerator, generatorTarget, - "NO-PER-CONFIG-SUPPORT-IN-XCODE") + "NO-PER-CONFIG-SUPPORT-IN-XCODE", + generatorTarget->GetName(), lang) , SourceFile(sourceFile) { } using cmGeneratorExpressionInterpreter::Evaluate; - const char* Evaluate(const char* expression, const char* property) + const char* Evaluate(const char* expression, const std::string& property) { - const char* processed = this->Evaluate(expression); + const char* processed = + this->cmGeneratorExpressionInterpreter::Evaluate(expression, property); if (this->GetCompiledGeneratorExpression() .GetHadContextSensitiveCondition()) { std::ostringstream e; @@ -719,7 +722,9 @@ private: cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( cmLocalGenerator* lg, cmSourceFile* sf, cmGeneratorTarget* gtgt) { - XCodeGeneratorExpressionInterpreter genexInterpreter(sf, lg, gtgt); + std::string lang = this->CurrentLocalGenerator->GetSourceFileLanguage(*sf); + + XCodeGeneratorExpressionInterpreter genexInterpreter(sf, lg, gtgt, lang); // Add flags from target and source file properties. std::string flags; @@ -734,16 +739,18 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( default: break; } - if (const char* cflags = sf->GetProperty("COMPILE_FLAGS")) { - lg->AppendFlags(flags, genexInterpreter.Evaluate(cflags, "COMPILE_FLAGS")); + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = sf->GetProperty(COMPILE_FLAGS)) { + lg->AppendFlags(flags, genexInterpreter.Evaluate(cflags, COMPILE_FLAGS)); } // Add per-source definitions. BuildObjectListOrString flagsBuild(this, false); - if (const char* compile_defs = sf->GetProperty("COMPILE_DEFINITIONS")) { + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); + if (const char* compile_defs = sf->GetProperty(COMPILE_DEFINITIONS)) { this->AppendDefines( - flagsBuild, - genexInterpreter.Evaluate(compile_defs, "COMPILE_DEFINITIONS"), true); + flagsBuild, genexInterpreter.Evaluate(compile_defs, COMPILE_DEFINITIONS), + true); } if (!flagsBuild.IsEmpty()) { if (!flags.empty()) { @@ -752,8 +759,6 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateXCodeSourceFile( flags += flagsBuild.GetString(); } - std::string lang = this->CurrentLocalGenerator->GetSourceFileLanguage(*sf); - cmXCodeObject* buildFile = this->CreateXCodeSourceFileFromPath(sf->GetFullPath(), gtgt, lang, sf); diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx index dd2993d..e684f5e 100644 --- a/Source/cmGraphVizWriter.cxx +++ b/Source/cmGraphVizWriter.cxx @@ -29,6 +29,22 @@ enum LinkLibraryScopeType const char* const GRAPHVIZ_PRIVATE_EDEGE_STYLE = "dashed"; const char* const GRAPHVIZ_INTERFACE_EDEGE_STYLE = "dotted"; +std::string getLinkLibraryStyle(const LinkLibraryScopeType& type) +{ + std::string style; + switch (type) { + case LLT_SCOPE_PRIVATE: + style = "[style = " + std::string(GRAPHVIZ_PRIVATE_EDEGE_STYLE) + "]"; + break; + case LLT_SCOPE_INTERFACE: + style = "[style = " + std::string(GRAPHVIZ_INTERFACE_EDEGE_STYLE) + "]"; + break; + default: + break; + } + return style; +} + const char* getShapeForTarget(const cmGeneratorTarget* target) { if (!target) { @@ -132,6 +148,7 @@ cmGraphVizWriter::cmGraphVizWriter( , GenerateForStaticLibs(true) , GenerateForSharedLibs(true) , GenerateForModuleLibs(true) + , GenerateForInterface(true) , GenerateForExternals(true) , GeneratePerTarget(true) , GenerateDependers(true) @@ -192,6 +209,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName, __set_bool_if_set(this->GenerateForStaticLibs, "GRAPHVIZ_STATIC_LIBS"); __set_bool_if_set(this->GenerateForSharedLibs, "GRAPHVIZ_SHARED_LIBS"); __set_bool_if_set(this->GenerateForModuleLibs, "GRAPHVIZ_MODULE_LIBS"); + __set_bool_if_set(this->GenerateForInterface, "GRAPHVIZ_INTERFACE"); __set_bool_if_set(this->GenerateForExternals, "GRAPHVIZ_EXTERNAL_LIBS"); __set_bool_if_set(this->GeneratePerTarget, "GRAPHVIZ_GENERATE_PER_TARGET"); __set_bool_if_set(this->GenerateDependers, "GRAPHVIZ_GENERATE_DEPENDERS"); @@ -379,16 +397,7 @@ void cmGraphVizWriter::WriteConnections( str << " \"" << myNodeName << "\" -> \"" << libNameIt->second << "\""; - switch (llit.second) { - case LLT_SCOPE_PRIVATE: - str << "[style = " << GRAPHVIZ_PRIVATE_EDEGE_STYLE << "]"; - break; - case LLT_SCOPE_INTERFACE: - str << "[style = " << GRAPHVIZ_INTERFACE_EDEGE_STYLE << "]"; - break; - default: - break; - } + str << getLinkLibraryStyle(llit.second); str << " // " << targetName << " -> " << libName << std::endl; this->WriteConnections(libName, insertedNodes, insertedConnections, str); @@ -429,12 +438,11 @@ void cmGraphVizWriter::WriteDependerConnections( // Now we have a target, check whether it links against targetName. // If so, draw a connection, and then continue with dependers on that one. - const cmTarget::LinkLibraryVectorType* ll = - &(tptr.second->Target->GetOriginalLinkLibraries()); + std::map<std::string, LinkLibraryScopeType> ll = + getScopedLinkLibrariesFromTarget(tptr.second->Target); - for (auto const& llit : *ll) { - std::string libName = llit.first; - if (libName == targetName) { + for (auto const& llit : ll) { + if (llit.first == targetName) { // So this target links against targetName. std::map<std::string, std::string>::const_iterator dependerNodeNameIt = this->TargetNamesNodes.find(tptr.first); @@ -452,6 +460,7 @@ void cmGraphVizWriter::WriteDependerConnections( str << " \"" << dependerNodeNameIt->second << "\" -> \"" << myNodeName << "\""; str << " // " << targetName << " -> " << tptr.first << std::endl; + str << getLinkLibraryStyle(llit.second); this->WriteDependerConnections(tptr.first, insertedNodes, insertedConnections, str); } @@ -572,6 +581,8 @@ bool cmGraphVizWriter::GenerateForTargetType( return this->GenerateForSharedLibs; case cmStateEnums::MODULE_LIBRARY: return this->GenerateForModuleLibs; + case cmStateEnums::INTERFACE_LIBRARY: + return this->GenerateForInterface; default: break; } diff --git a/Source/cmGraphVizWriter.h b/Source/cmGraphVizWriter.h index 824999b..ac20da9 100644 --- a/Source/cmGraphVizWriter.h +++ b/Source/cmGraphVizWriter.h @@ -79,6 +79,7 @@ protected: bool GenerateForStaticLibs; bool GenerateForSharedLibs; bool GenerateForModuleLibs; + bool GenerateForInterface; bool GenerateForExternals; bool GeneratePerTarget; bool GenerateDependers; diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index 5e872d2..4b59f44 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -155,12 +155,12 @@ std::vector<std::string> const& cmIDEOptions::GetDefines() const return this->Defines; } -void cmIDEOptions::AddFlag(const char* flag, const char* value) +void cmIDEOptions::AddFlag(std::string const& flag, std::string const& value) { this->FlagMap[flag] = value; } -void cmIDEOptions::AddFlag(const char* flag, +void cmIDEOptions::AddFlag(std::string const& flag, std::vector<std::string> const& value) { this->FlagMap[flag] = value; @@ -185,7 +185,7 @@ void cmIDEOptions::AppendFlagString(std::string const& flag, this->FlagMap[flag].append_with_space(value); } -void cmIDEOptions::RemoveFlag(const char* flag) +void cmIDEOptions::RemoveFlag(std::string const& flag) { this->FlagMap.erase(flag); } @@ -195,12 +195,13 @@ bool cmIDEOptions::HasFlag(std::string const& flag) const return this->FlagMap.find(flag) != this->FlagMap.end(); } -const char* cmIDEOptions::GetFlag(const char* flag) +const char* cmIDEOptions::GetFlag(std::string const& flag) const { // This method works only for single-valued flags! - std::map<std::string, FlagValue>::iterator i = this->FlagMap.find(flag); - if (i != this->FlagMap.end() && i->second.size() == 1) { + std::map<std::string, FlagValue>::const_iterator i = + this->FlagMap.find(flag); + if (i != this->FlagMap.cend() && i->second.size() == 1) { return i->second[0].c_str(); } - return 0; + return nullptr; } diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index af03128..ded92ca 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -26,15 +26,15 @@ public: void AddDefines(const std::vector<std::string>& defines); std::vector<std::string> const& GetDefines() const; - void AddFlag(const char* flag, const char* value); - void AddFlag(const char* flag, std::vector<std::string> const& value); + void AddFlag(std::string const& flag, std::string const& value); + void AddFlag(std::string const& flag, std::vector<std::string> const& value); void AppendFlag(std::string const& flag, std::string const& value); void AppendFlag(std::string const& flag, std::vector<std::string> const& value); void AppendFlagString(std::string const& flag, std::string const& value); - void RemoveFlag(const char* flag); + void RemoveFlag(std::string const& flag); bool HasFlag(std::string const& flag) const; - const char* GetFlag(const char* flag); + const char* GetFlag(std::string const& flag) const; protected: // create a map of xml tags to the values they should have in the output diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index e26182a..a389ad0 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1444,6 +1444,8 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies( } #ifdef CMAKE_BUILD_WITH_CMAKE else if (lang == "Fortran") { + ruleFileStream << "# Note that incremental build could trigger " + << "a call to cmake_copy_f90_mod on each re-build\n"; scanner = new cmDependsFortran(this); } else if (lang == "Java") { scanner = new cmDependsJava(); diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 53966cd..1b96ef4 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -701,7 +701,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration( Options targetOptions(this, t, table, gg->ExtraFlagTable); targetOptions.FixExceptionHandlingDefault(); std::string asmLocation = configName + "/"; - targetOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str()); + targetOptions.AddFlag("AssemblerListingLocation", asmLocation); targetOptions.Parse(flags.c_str()); targetOptions.Parse(defineFlags.c_str()); targetOptions.ParseFinish(); @@ -1007,7 +1007,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool( if (mdi && !mdi->DefFile.empty()) { std::string defFile = this->ConvertToOutputFormat(mdi->DefFile, cmOutputConverter::SHELL); - linkOptions.AddFlag("ModuleDefinitionFile", defFile.c_str()); + linkOptions.AddFlag("ModuleDefinitionFile", defFile); } switch (target->GetType()) { @@ -1458,14 +1458,28 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( i != configs.end(); ++i, ++ci) { std::string configUpper = cmSystemTools::UpperCase(*i); cmLVS7GFileConfig fc; - cmGeneratorExpressionInterpreter genexInterpreter(lg, gt, *i); + + std::string lang = + lg->GlobalGenerator->GetLanguageFromExtension(sf.GetExtension().c_str()); + const std::string& sourceLang = lg->GetSourceFileLanguage(sf); + bool needForceLang = false; + // source file does not match its extension language + if (lang != sourceLang) { + needForceLang = true; + lang = sourceLang; + } + + cmGeneratorExpressionInterpreter genexInterpreter(lg, gt, *i, + gt->GetName(), lang); + bool needfc = false; if (!objectName.empty()) { fc.ObjectName = objectName; needfc = true; } - if (const char* cflags = sf.GetProperty("COMPILE_FLAGS")) { - fc.CompileFlags = genexInterpreter.Evaluate(cflags); + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = sf.GetProperty(COMPILE_FLAGS)) { + fc.CompileFlags = genexInterpreter.Evaluate(cflags, COMPILE_FLAGS); needfc = true; } if (lg->FortranProject) { @@ -1483,14 +1497,16 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( break; } } - if (const char* cdefs = sf.GetProperty("COMPILE_DEFINITIONS")) { - fc.CompileDefs = genexInterpreter.Evaluate(cdefs); + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); + if (const char* cdefs = sf.GetProperty(COMPILE_DEFINITIONS)) { + fc.CompileDefs = genexInterpreter.Evaluate(cdefs, COMPILE_DEFINITIONS); needfc = true; } std::string defPropName = "COMPILE_DEFINITIONS_"; defPropName += configUpper; if (const char* ccdefs = sf.GetProperty(defPropName)) { - fc.CompileDefsConfig = genexInterpreter.Evaluate(ccdefs); + fc.CompileDefsConfig = + genexInterpreter.Evaluate(ccdefs, COMPILE_DEFINITIONS); needfc = true; } @@ -1508,16 +1524,7 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo( } } - std::string lang = - lg->GlobalGenerator->GetLanguageFromExtension(sf.GetExtension().c_str()); - const std::string& sourceLang = lg->GetSourceFileLanguage(sf); const std::string& linkLanguage = gt->GetLinkerLanguage(i->c_str()); - bool needForceLang = false; - // source file does not match its extension language - if (lang != sourceLang) { - needForceLang = true; - lang = sourceLang; - } // If HEADER_FILE_ONLY is set, we must suppress this generation in // the project file fc.ExcludedFromBuild = sf.GetPropertyAsBool("HEADER_FILE_ONLY") || diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 801f72a..90d8c7f 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -69,9 +69,6 @@ void cmMakefileExecutableTargetGenerator::WriteRuleFiles() this->WriteExecutableRule(true); } - // Write the requires target. - this->WriteTargetRequiresRules(); - // Write clean target this->WriteTargetCleanRules(); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 80c62d1..ab15daf 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -89,9 +89,6 @@ void cmMakefileLibraryTargetGenerator::WriteRuleFiles() break; } - // Write the requires target. - this->WriteTargetRequiresRules(); - // Write clean target this->WriteTargetCleanRules(); diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 5e0c582..850b8b2 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -426,7 +426,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::string config = this->LocalGenerator->GetConfigName(); std::string configUpper = cmSystemTools::UpperCase(config); cmGeneratorExpressionInterpreter genexInterpreter( - this->LocalGenerator, this->GeneratorTarget, config); + this->LocalGenerator, this->GeneratorTarget, config, + this->GeneratorTarget->GetName(), lang); // Add Fortran format flags. if (lang == "Fortran") { @@ -434,8 +435,10 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( } // Add flags from source file properties. - if (const char* cflags = source.GetProperty("COMPILE_FLAGS")) { - const char* evaluatedFlags = genexInterpreter.Evaluate(cflags); + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = source.GetProperty(COMPILE_FLAGS)) { + const char* evaluatedFlags = + genexInterpreter.Evaluate(cflags, COMPILE_FLAGS); this->LocalGenerator->AppendFlags(flags, evaluatedFlags); *this->FlagFileStream << "# Custom flags: " << relativeObj << "_FLAGS = " << evaluatedFlags << "\n" @@ -446,8 +449,10 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::set<std::string> defines; // Add source-sepcific preprocessor definitions. - if (const char* compile_defs = source.GetProperty("COMPILE_DEFINITIONS")) { - const char* evaluatedDefs = genexInterpreter.Evaluate(compile_defs); + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); + if (const char* compile_defs = source.GetProperty(COMPILE_DEFINITIONS)) { + const char* evaluatedDefs = + genexInterpreter.Evaluate(compile_defs, COMPILE_DEFINITIONS); this->LocalGenerator->AppendDefines(defines, evaluatedDefs); *this->FlagFileStream << "# Custom defines: " << relativeObj << "_DEFINES = " << evaluatedDefs << "\n" @@ -456,7 +461,8 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( std::string defPropName = "COMPILE_DEFINITIONS_"; defPropName += configUpper; if (const char* config_compile_defs = source.GetProperty(defPropName)) { - const char* evaluatedDefs = genexInterpreter.Evaluate(config_compile_defs); + const char* evaluatedDefs = + genexInterpreter.Evaluate(config_compile_defs, COMPILE_DEFINITIONS); this->LocalGenerator->AppendDefines(defines, evaluatedDefs); *this->FlagFileStream << "# Custom defines: " << relativeObj << "_DEFINES_" << configUpper << " = " << evaluatedDefs << "\n" @@ -818,65 +824,6 @@ void cmMakefileTargetGenerator::WriteObjectBuildFile( commands, false); } } - - // If the language needs provides-requires mode, create the - // corresponding targets. - std::string objectRequires = relativeObj; - objectRequires += ".requires"; - std::vector<std::string> p_depends; - // always provide an empty requires target - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, - objectRequires, p_depends, no_commands, - true); - - // write a build rule to recursively build what this obj provides - std::string objectProvides = relativeObj; - objectProvides += ".provides"; - std::string temp = relativeObj; - temp += ".provides.build"; - std::vector<std::string> r_commands; - std::string tgtMakefileName = - this->LocalGenerator->GetRelativeTargetDirectory(this->GeneratorTarget); - tgtMakefileName += "/build.make"; - r_commands.push_back( - this->LocalGenerator->GetRecursiveMakeCall(tgtMakefileName.c_str(), temp)); - - p_depends.clear(); - p_depends.push_back(objectRequires); - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, - objectProvides, p_depends, r_commands, - true); - - // write the provides.build rule dependency on the obj file - p_depends.clear(); - p_depends.push_back(relativeObj); - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, temp, - p_depends, no_commands, false); -} - -void cmMakefileTargetGenerator::WriteTargetRequiresRules() -{ - std::vector<std::string> depends; - std::vector<std::string> no_commands; - - // Construct the name of the dependency generation target. - std::string depTarget = - this->LocalGenerator->GetRelativeTargetDirectory(this->GeneratorTarget); - depTarget += "/requires"; - - // This target drives dependency generation for all object files. - std::string relPath = this->LocalGenerator->GetHomeRelativeOutputPath(); - std::string objTarget; - for (std::string const& obj : this->Objects) { - objTarget = relPath; - objTarget += obj; - objTarget += ".requires"; - depends.push_back(objTarget); - } - - // Write the rule. - this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, nullptr, - depTarget, depends, no_commands, true); } void cmMakefileTargetGenerator::WriteTargetCleanRules() diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 5ab7e36..7af3cf3 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -63,9 +63,6 @@ protected: void WriteCommonCodeRules(); void WriteTargetLanguageFlags(); - // write the provide require rules for this target - void WriteTargetRequiresRules(); - // write the clean rules for this target void WriteTargetCleanRules(); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 1036977..f967168 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -135,12 +135,14 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject( } // Add source file specific flags. - if (const char* cflags = source->GetProperty("COMPILE_FLAGS")) { + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = source->GetProperty(COMPILE_FLAGS)) { cmGeneratorExpressionInterpreter genexInterpreter( this->LocalGenerator, this->GeneratorTarget, - this->LocalGenerator->GetConfigName()); - this->LocalGenerator->AppendFlags(flags, - genexInterpreter.Evaluate(cflags)); + this->LocalGenerator->GetConfigName(), this->GeneratorTarget->GetName(), + language); + this->LocalGenerator->AppendFlags( + flags, genexInterpreter.Evaluate(cflags, COMPILE_FLAGS)); } return flags; @@ -179,18 +181,21 @@ std::string cmNinjaTargetGenerator::ComputeDefines(cmSourceFile const* source, std::set<std::string> defines; const std::string config = this->LocalGenerator->GetConfigName(); cmGeneratorExpressionInterpreter genexInterpreter( - this->LocalGenerator, this->GeneratorTarget, config); + this->LocalGenerator, this->GeneratorTarget, config, + this->GeneratorTarget->GetName(), language); - if (const char* compile_defs = source->GetProperty("COMPILE_DEFINITIONS")) { + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); + if (const char* compile_defs = source->GetProperty(COMPILE_DEFINITIONS)) { this->LocalGenerator->AppendDefines( - defines, genexInterpreter.Evaluate(compile_defs)); + defines, genexInterpreter.Evaluate(compile_defs, COMPILE_DEFINITIONS)); } std::string defPropName = "COMPILE_DEFINITIONS_"; defPropName += cmSystemTools::UpperCase(config); if (const char* config_compile_defs = source->GetProperty(defPropName)) { this->LocalGenerator->AppendDefines( - defines, genexInterpreter.Evaluate(config_compile_defs)); + defines, + genexInterpreter.Evaluate(config_compile_defs, COMPILE_DEFINITIONS)); } std::string definesString = this->GetDefines(language); diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index ad66467..d745c49 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -691,8 +691,6 @@ static Json::Value DumpSourceFilesList( std::vector<cmSourceFile*> files; target->GetSourceFiles(files, config); - cmGeneratorExpressionInterpreter genexInterpreter( - target->GetLocalGenerator(), target, config); std::unordered_map<LanguageData, std::vector<std::string>> fileGroups; for (cmSourceFile* file : files) { @@ -701,24 +699,31 @@ static Json::Value DumpSourceFilesList( if (!fileData.Language.empty()) { const LanguageData& ld = languageDataMap.at(fileData.Language); cmLocalGenerator* lg = target->GetLocalGenerator(); + cmGeneratorExpressionInterpreter genexInterpreter( + lg, target, config, target->GetName(), fileData.Language); std::string compileFlags = ld.Flags; - if (const char* cflags = file->GetProperty("COMPILE_FLAGS")) { - lg->AppendFlags(compileFlags, genexInterpreter.Evaluate(cflags)); + const std::string COMPILE_FLAGS("COMPILE_FLAGS"); + if (const char* cflags = file->GetProperty(COMPILE_FLAGS)) { + lg->AppendFlags(compileFlags, + genexInterpreter.Evaluate(cflags, COMPILE_FLAGS)); } fileData.Flags = compileFlags; fileData.IncludePathList = ld.IncludePathList; + const std::string COMPILE_DEFINITIONS("COMPILE_DEFINITIONS"); std::set<std::string> defines; - if (const char* defs = file->GetProperty("COMPILE_DEFINITIONS")) { - lg->AppendDefines(defines, genexInterpreter.Evaluate(defs)); + if (const char* defs = file->GetProperty(COMPILE_DEFINITIONS)) { + lg->AppendDefines( + defines, genexInterpreter.Evaluate(defs, COMPILE_DEFINITIONS)); } const std::string defPropName = "COMPILE_DEFINITIONS_" + cmSystemTools::UpperCase(config); if (const char* config_defs = file->GetProperty(defPropName)) { - lg->AppendDefines(defines, genexInterpreter.Evaluate(config_defs)); + lg->AppendDefines(defines, genexInterpreter.Evaluate( + config_defs, COMPILE_DEFINITIONS)); } defines.insert(ld.Defines.begin(), ld.Defines.end()); diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 8589a96..9154dca 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2152,7 +2152,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( flagtable = gg->GetCSharpFlagTable(); } cmGeneratorExpressionInterpreter genexInterpreter( - this->LocalGenerator, this->GeneratorTarget, *config); + this->LocalGenerator, this->GeneratorTarget, *config, + this->GeneratorTarget->GetName(), lang); cmVisualStudioGeneratorOptions clOptions( this->LocalGenerator, cmVisualStudioGeneratorOptions::Compiler, flagtable, 0, this); @@ -2163,7 +2164,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( clOptions.AddFlag("CompileAsWinRT", "false"); } if (configDependentFlags) { - clOptions.Parse(genexInterpreter.Evaluate(flags)); + clOptions.Parse(genexInterpreter.Evaluate(flags, "COMPILE_FLAGS")); } else { clOptions.Parse(flags.c_str()); } @@ -2176,7 +2177,8 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( "%(DisableSpecificWarnings)"); } if (configDependentDefines) { - clOptions.AddDefines(genexInterpreter.Evaluate(configDefines)); + clOptions.AddDefines( + genexInterpreter.Evaluate(configDefines, "COMPILE_DEFINITIONS")); } else { clOptions.AddDefines(configDefines.c_str()); } @@ -2448,7 +2450,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions( clOptions.FixExceptionHandlingDefault(); clOptions.AddFlag("PrecompiledHeader", "NotUsing"); std::string asmLocation = configName + "/"; - clOptions.AddFlag("AssemblerListingLocation", asmLocation.c_str()); + clOptions.AddFlag("AssemblerListingLocation", asmLocation); } } clOptions.Parse(flags.c_str()); @@ -3315,8 +3317,8 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( imLib += "/"; imLib += targetNameImport; - linkOptions.AddFlag("ImportLibrary", imLib.c_str()); - linkOptions.AddFlag("ProgramDataBaseFile", pdb.c_str()); + linkOptions.AddFlag("ImportLibrary", imLib); + linkOptions.AddFlag("ProgramDataBaseFile", pdb); // A Windows Runtime component uses internal .NET metadata, // so does not have an import library. @@ -3337,7 +3339,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions( linkOptions.AppendFlag("IgnoreSpecificDefaultLibraries", "ole32.lib"); } } else if (this->NsightTegra) { - linkOptions.AddFlag("SoName", targetNameSO.c_str()); + linkOptions.AddFlag("SoName", targetNameSO); } linkOptions.Parse(flags.c_str()); diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx index b1686be..4f3d737 100644 --- a/Source/cmVisualStudioGeneratorOptions.cxx +++ b/Source/cmVisualStudioGeneratorOptions.cxx @@ -258,7 +258,7 @@ void cmVisualStudioGeneratorOptions::FixCudaCodeGeneration() void cmVisualStudioGeneratorOptions::FixManifestUACFlags() { - static const char* ENABLE_UAC = "EnableUAC"; + static std::string const ENABLE_UAC = "EnableUAC"; if (!HasFlag(ENABLE_UAC)) { return; } @@ -304,8 +304,7 @@ void cmVisualStudioGeneratorOptions::FixManifestUACFlags() continue; } - AddFlag(uacMap[keyValue[0]].c_str(), - uacExecuteLevelMap[keyValue[1]].c_str()); + AddFlag(uacMap[keyValue[0]], uacExecuteLevelMap[keyValue[1]]); continue; } @@ -314,7 +313,7 @@ void cmVisualStudioGeneratorOptions::FixManifestUACFlags() // unknown uiAccess value continue; } - AddFlag(uacMap[keyValue[0]].c_str(), keyValue[1].c_str()); + AddFlag(uacMap[keyValue[0]], keyValue[1]); continue; } diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 50aa857..649f30b 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -4234,11 +4234,16 @@ bool SystemTools::IsSubDirectory(const std::string& cSubdir, std::string dir = cDir; SystemTools::ConvertToUnixSlashes(subdir); SystemTools::ConvertToUnixSlashes(dir); - if (subdir.size() > dir.size() && subdir[dir.size()] == '/') { - std::string s = subdir.substr(0, dir.size()); - return SystemTools::ComparePath(s, dir); + if (subdir.size() <= dir.size() || dir.empty()) { + return false; } - return false; + bool isRootPath = *dir.rbegin() == '/'; // like "/" or "C:/" + size_t expectedSlashPosition = isRootPath ? dir.size() - 1u : dir.size(); + if (subdir[expectedSlashPosition] != '/') { + return false; + } + std::string s = subdir.substr(0, dir.size()); + return SystemTools::ComparePath(s, dir); } void SystemTools::Delay(unsigned int msec) diff --git a/Source/kwsys/testSystemTools.cxx b/Source/kwsys/testSystemTools.cxx index 3b694c9..a6af9cc 100644 --- a/Source/kwsys/testSystemTools.cxx +++ b/Source/kwsys/testSystemTools.cxx @@ -813,6 +813,39 @@ static bool CheckFind() return res; } +static bool CheckIsSubDirectory() +{ + bool res = true; + + if (kwsys::SystemTools::IsSubDirectory("/foo", "/") == false) { + std::cerr << "Problem with IsSubDirectory (root - unix): " << std::endl; + res = false; + } + if (kwsys::SystemTools::IsSubDirectory("c:/foo", "c:/") == false) { + std::cerr << "Problem with IsSubDirectory (root - dos): " << std::endl; + res = false; + } + if (kwsys::SystemTools::IsSubDirectory("/foo/bar", "/foo") == false) { + std::cerr << "Problem with IsSubDirectory (deep): " << std::endl; + res = false; + } + if (kwsys::SystemTools::IsSubDirectory("/foo", "/foo") == true) { + std::cerr << "Problem with IsSubDirectory (identity): " << std::endl; + res = false; + } + if (kwsys::SystemTools::IsSubDirectory("/fooo", "/foo") == true) { + std::cerr << "Problem with IsSubDirectory (substring): " << std::endl; + res = false; + } + if (kwsys::SystemTools::IsSubDirectory("/foo/", "/foo") == true) { + std::cerr << "Problem with IsSubDirectory (prepended slash): " + << std::endl; + res = false; + } + + return res; +} + static bool CheckGetLineFromStream() { const std::string fileWithFiveCharsOnFirstLine(TEST_SYSTEMTOOLS_SOURCE_DIR @@ -897,6 +930,8 @@ int testSystemTools(int, char* []) res &= CheckFind(); + res &= CheckIsSubDirectory(); + res &= CheckGetLineFromStream(); res &= CheckGetFilenameName(); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 1d13f1c..5d8c2fe 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1242,20 +1242,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release ) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomocNoQt") - # On Windows there is no RPATH, so while Qt might be available for building, - # the required dlls may not be in the PATH, so we can't run the executables - # on that platform. - if(WIN32) - set(run_autogen_test ${CMAKE_CTEST_COMMAND} -V) - set(run_autouic_test ${CMAKE_CTEST_COMMAND} -V) - else() - set(run_autogen_test complex/QtAutogen) - set(run_autouic_test QtAutoUicInterface) - endif() - if(NOT CMAKE_CONFIGURATION_TYPES) - set(QtAutogen_BUILD_OPTIONS -DCMAKE_BUILD_TYPE=$<CONFIGURATION>) - endif() - if(NOT DEFINED CMake_TEST_Qt5) set(CMake_TEST_Qt5 1) endif() @@ -1263,97 +1249,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release find_package(Qt5Widgets QUIET NO_MODULE) endif() if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND) - add_test(NAME Qt5Autogen COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutogen" - "${CMake_BINARY_DIR}/Tests/Qt5Autogen" - ${build_generator_args} - --build-project QtAutogen - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5Autogen" - --force-new-ctest-process - --build-options ${build_options} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} - -DQT_TEST_VERSION=5 - ${QtAutogen_BUILD_OPTIONS} - --test-command ${run_autogen_test} - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5Autogen") - - add_test(NAME Qt5AutogenRerun COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutogenRerun" - "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun" - ${build_generator_args} - --build-project QtAutogenRerun - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun" - --force-new-ctest-process - --build-options ${build_options} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} - -DQT_TEST_VERSION=5 - ${QtAutogen_BUILD_OPTIONS} - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun") - - add_test(Qt5AutoUicInterface ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface" - "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface" - ${build_generator_args} - --build-project QtAutoUicInterface - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface" - --force-new-ctest-process - --build-options ${build_options} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} -DQT_TEST_VERSION=5 - --test-command ${run_autouic_test} - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5AutoUicInterface") + add_subdirectory(Qt5Autogen) endif() if(QT4_WORKS AND QT_QTGUI_FOUND) - add_test(NAME Qt4Autogen COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutogen" - "${CMake_BINARY_DIR}/Tests/Qt4Autogen" - ${build_generator_args} - --build-project QtAutogen - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4Autogen" - --force-new-ctest-process - --build-options ${build_options} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} - -DQT_TEST_VERSION=4 - ${QtAutogen_BUILD_OPTIONS} - --test-command ${run_autogen_test} - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Autogen") - - add_test(NAME Qt4AutogenRerun COMMAND ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutogenRerun" - "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun" - ${build_generator_args} - --build-project QtAutogenRerun - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun" - --force-new-ctest-process - --build-options ${build_options} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} - -DQT_TEST_VERSION=4 - ${QtAutogen_BUILD_OPTIONS} - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun") - - add_test(Qt4AutoUicInterface ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface" - "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface" - ${build_generator_args} - --build-project QtAutoUicInterface - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface" - --force-new-ctest-process - --build-options ${build_options} - -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} - -DQT_TEST_VERSION=4 - --test-command ${run_autouic_test} - ) - list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4AutoUicInterface") + add_subdirectory(Qt4Autogen) add_test(Qt4Targets ${CMAKE_CTEST_COMMAND} --build-and-test diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt index 8d6551b..83473ae 100644 --- a/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt +++ b/Tests/CudaOnly/ResolveDeviceSymbols/CMakeLists.txt @@ -16,11 +16,11 @@ else() endif() #Goal for this example: -#Build a static library that defines multiple methods and kernels that -#use each other. -#Use a custom command to build an executable that uses this static library -#We do these together to verify that we can get a static library to do -#device symbol linking, and not have it done when the executable is made +# 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 +# to the static library string(APPEND CMAKE_CUDA_FLAGS " -gencode arch=compute_30,code=compute_30") set(CMAKE_CXX_STANDARD 11) set(CMAKE_CUDA_STANDARD 11) @@ -43,6 +43,10 @@ add_custom_command(TARGET CUDAResolveDeviceLib POST_BUILD endif() add_executable(CudaOnlyResolveDeviceSymbols main.cu) +set_target_properties(CudaOnlyResolveDeviceSymbols + PROPERTIES + CUDA_SEPARABLE_COMPILATION ON) + target_link_libraries(CudaOnlyResolveDeviceSymbols PRIVATE CUDAResolveDeviceLib) if(APPLE) diff --git a/Tests/CudaOnly/ResolveDeviceSymbols/main.cu b/Tests/CudaOnly/ResolveDeviceSymbols/main.cu index b4b5b9e..d464f96 100644 --- a/Tests/CudaOnly/ResolveDeviceSymbols/main.cu +++ b/Tests/CudaOnly/ResolveDeviceSymbols/main.cu @@ -62,17 +62,8 @@ int main(int argc, char** argv) return 0; } - cudaError_t err; - file2_launch_kernel(42); - err = cudaGetLastError(); - if (err != cudaSuccess) { - std::cerr << "file2_launch_kernel: kernel launch failed: " - << cudaGetErrorString(err) << std::endl; - return 1; - } - main_launch_kernel(1); - err = cudaGetLastError(); + 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 diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt index 5165970..0585d0c 100644 --- a/Tests/GeneratorExpression/CMakeLists.txt +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -263,9 +263,17 @@ add_custom_target(check-part4 ALL add_executable(srcgenex_flags srcgenex_flags.c) set_property(SOURCE srcgenex_flags.c PROPERTY COMPILE_FLAGS "-DNAME=$<TARGET_PROPERTY:NAME>") +add_executable(srcgenex_flags_COMPILE_LANGUAGE srcgenex_flags_COMPILE_LANGUAGE.c) +set_property(SOURCE srcgenex_flags_COMPILE_LANGUAGE.c PROPERTY COMPILE_FLAGS "$<$<COMPILE_LANGUAGE:C>:-DNAME=$<TARGET_PROPERTY:NAME>>") + add_executable(srcgenex_defs srcgenex_defs.c) set_property(SOURCE srcgenex_defs.c PROPERTY COMPILE_DEFINITIONS NAME=$<TARGET_PROPERTY:NAME>) +if (CMAKE_GENERATOR MATCHES "Makefiles|Ninja|Watcom WMake") + add_executable(srcgenex_defs_COMPILE_LANGUAGE srcgenex_defs_COMPILE_LANGUAGE.c) + set_property(SOURCE srcgenex_defs_COMPILE_LANGUAGE.c PROPERTY COMPILE_DEFINITIONS $<$<COMPILE_LANGUAGE:C>:NAME=$<TARGET_PROPERTY:NAME>>) +endif() + #----------------------------------------------------------------------------- # Cover test properties with generator expressions. add_executable(echo echo.c) diff --git a/Tests/GeneratorExpression/srcgenex_defs_COMPILE_LANGUAGE.c b/Tests/GeneratorExpression/srcgenex_defs_COMPILE_LANGUAGE.c new file mode 100644 index 0000000..421b55b --- /dev/null +++ b/Tests/GeneratorExpression/srcgenex_defs_COMPILE_LANGUAGE.c @@ -0,0 +1,12 @@ +int srcgenex_defs_COMPILE_LANGUAGE(void) +{ + return 0; +} + +int main(int argc, char* argv[]) +{ +#ifndef NAME +#error NAME not defined +#endif + return NAME(); +} diff --git a/Tests/GeneratorExpression/srcgenex_flags_COMPILE_LANGUAGE.c b/Tests/GeneratorExpression/srcgenex_flags_COMPILE_LANGUAGE.c new file mode 100644 index 0000000..4e80d6e --- /dev/null +++ b/Tests/GeneratorExpression/srcgenex_flags_COMPILE_LANGUAGE.c @@ -0,0 +1,12 @@ +int srcgenex_flags_COMPILE_LANGUAGE(void) +{ + return 0; +} + +int main(int argc, char* argv[]) +{ +#ifndef NAME +#error NAME not defined +#endif + return NAME(); +} diff --git a/Tests/Qt4Autogen/CMakeLists.txt b/Tests/Qt4Autogen/CMakeLists.txt new file mode 100644 index 0000000..818e888 --- /dev/null +++ b/Tests/Qt4Autogen/CMakeLists.txt @@ -0,0 +1,9 @@ +# Set Qt test version and include the Autogen test macros +set(QT_TEST_VERSION 4) +include("../QtAutogen/TestMacros.cmake") + +# Qt4 only tests +ADD_AUTOGEN_TEST(DefinesTest) + +# Common tests +include("../QtAutogen/CommonTests.cmake") diff --git a/Tests/Qt5Autogen/CMakeLists.txt b/Tests/Qt5Autogen/CMakeLists.txt new file mode 100644 index 0000000..527e5ff --- /dev/null +++ b/Tests/Qt5Autogen/CMakeLists.txt @@ -0,0 +1,6 @@ +# Set Qt test version and include the Autogen test macros +set(QT_TEST_VERSION 5) +include("../QtAutogen/TestMacros.cmake") + +# Common tests +include("../QtAutogen/CommonTests.cmake") diff --git a/Tests/QtAutogen/AutogenTest.cmake b/Tests/QtAutogen/AutogenTest.cmake new file mode 100644 index 0000000..8c0a14f --- /dev/null +++ b/Tests/QtAutogen/AutogenTest.cmake @@ -0,0 +1,53 @@ + +# Tell find_package(Qt5) where to find Qt. +if(QT_QMAKE_EXECUTABLE) + get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH) + get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH) + list(APPEND CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR}) +endif() + +if (QT_TEST_VERSION STREQUAL 4) + find_package(Qt4 REQUIRED) + include(UseQt4) + + set(QT_QTCORE_TARGET Qt4::QtCore) + set(QT_QTGUI_TARGET Qt4::QtGui) + + # Qt macros + macro(qtx_wrap_cpp) + qt4_wrap_cpp(${ARGN}) + endmacro() + macro(qtx_generate_moc) + qt4_generate_moc(${ARGN}) + endmacro() + +elseif(QT_TEST_VERSION STREQUAL 5) + find_package(Qt5Widgets REQUIRED) + + set(QT_QTCORE_TARGET Qt5::Core) + set(QT_QTGUI_TARGET Qt5::Widgets) + + include_directories(${Qt5Widgets_INCLUDE_DIRS}) + set(QT_LIBRARIES Qt5::Widgets) + + if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) + add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) + endif() + + # Qt macros + macro(qtx_wrap_cpp) + qt5_wrap_cpp(${ARGN}) + endmacro() + macro(qtx_generate_moc) + qt5_generate_moc(${ARGN}) + endmacro() + +else() + message(SEND_ERROR "Invalid Qt version specified: ${QT_TEST_VERSION}") +endif() + +# Get Qt compile features +get_property(QT_COMPILE_FEATURES + TARGET ${QT_QTCORE_TARGET} + PROPERTY INTERFACE_COMPILE_FEATURES +) diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt deleted file mode 100644 index dff9d0c..0000000 --- a/Tests/QtAutogen/CMakeLists.txt +++ /dev/null @@ -1,233 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -cmake_policy(SET CMP0071 NEW) -project(QtAutogen) - -if (QT_TEST_VERSION STREQUAL 4) - find_package(Qt4 REQUIRED) - - # Include this directory before using the UseQt4 file. - add_subdirectory(defines_test) - - include(UseQt4) - - set(QT_QTCORE_TARGET Qt4::QtCore) - - macro(qtx_wrap_cpp) - qt4_wrap_cpp(${ARGN}) - endmacro() - macro(qtx_generate_moc) - qt4_generate_moc(${ARGN}) - endmacro() - -else() - if (NOT QT_TEST_VERSION STREQUAL 5) - message(SEND_ERROR "Invalid Qt version specified.") - endif() - find_package(Qt5Widgets REQUIRED) - - set(QT_QTCORE_TARGET Qt5::Core) - - include_directories(${Qt5Widgets_INCLUDE_DIRS}) - set(QT_LIBRARIES Qt5::Widgets) - - if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) - add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) - endif() - - macro(qtx_wrap_cpp) - qt5_wrap_cpp(${ARGN}) - endmacro() - macro(qtx_generate_moc) - qt5_generate_moc(${ARGN}) - endmacro() - -endif() - -get_property(QT_COMPILE_FEATURES TARGET ${QT_QTCORE_TARGET} PROPERTY INTERFACE_COMPILE_FEATURES) - -# Qt4 moc does not support utf8 paths in _parameter files generated by -# qtx_wrap_cpp -# https://bugreports.qt.io/browse/QTBUG-35480 -# Do a simple check if there is are non ASCII character in the build path -string(REGEX MATCH "[^ -~]+" NON_ASCII_BDIR ${CMAKE_CURRENT_BINARY_DIR}) -if((NOT NON_ASCII_BDIR) OR (NOT QT_TEST_VERSION STREQUAL 4)) - set(ALLOW_WRAP_CPP TRUE) -endif() -# On windows qtx_wrap_cpp also fails in Qt5 when used on a path that -# contains non ASCII characters -if(NON_ASCII_BDIR AND WIN32) - set(ALLOW_WRAP_CPP FALSE) -endif() - -# -- Test -# MOC only -add_executable(mocOnly mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySource/StyleB.cpp) -set_property(TARGET mocOnly PROPERTY AUTOMOC ON) -target_link_libraries(mocOnly ${QT_LIBRARIES}) - -add_executable(mocOnlyOpts mocOnlySource/main.cpp mocOnlySource/StyleA.cpp mocOnlySource/StyleB.cpp) -set_property(TARGET mocOnlyOpts PROPERTY AUTOMOC ON) -set_property(TARGET mocOnlyOpts PROPERTY AUTOMOC_MOC_OPTIONS "-nw") -target_link_libraries(mocOnlyOpts ${QT_LIBRARIES}) - -# -- Test -# UIC only -if(ALLOW_WRAP_CPP) - qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h) - add_executable(uicOnly uicOnlySource/uiconly.cpp ${uicOnlyMoc}) - set_property(TARGET uicOnly PROPERTY AUTOUIC ON) - target_link_libraries(uicOnly ${QT_LIBRARIES}) -endif() - -# -- Test -# RCC only -add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) -set_property(TARGET rccOnly PROPERTY AUTORCC ON) -target_link_libraries(rccOnly ${QT_QTCORE_TARGET}) - -# -- Test -# RCC empty -add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc) -set_property(TARGET rccEmpty PROPERTY AUTORCC ON) -target_link_libraries(rccEmpty ${QT_QTCORE_TARGET}) - -# -- Test -# Add not_generated_file.qrc to the source list to get the file-level -# dependency, but don't generate a c++ file from it. Disable the AUTORCC -# feature for this target. This tests that qrc files in the sources don't -# have an effect on generation if AUTORCC is off. -add_library(empty STATIC empty.cpp not_generated_file.qrc) -set_target_properties(empty PROPERTIES AUTORCC OFF) -set_target_properties(empty PROPERTIES AUTOMOC TRUE) -target_link_libraries(empty no_link_language) -add_library(no_link_language STATIC empty.h) -set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE) -# Pass Qt compiler features to targets that don't link against Qt -target_compile_features(no_link_language PRIVATE ${QT_COMPILE_FEATURES}) -target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES}) - - -# -- Test -# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target -if(ALLOW_WRAP_CPP) - # Generate header mocs manually - qtx_wrap_cpp(skipMocWrapMoc - skipSource/qItemA.hpp - skipSource/qItemB.hpp - skipSource/qItemC.hpp - skipSource/qItemD.hpp - ) - set(skipMocSources - skipMoc.cpp - skipSource/qItemA.cpp - skipSource/qItemB.cpp - skipSource/qItemC.cpp - skipSource/qItemD.cpp - ) - # When cpp files are skipped, the hpp won't be processed either, - # unless they are mentioned in the sources - which they aren't. - set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON) - set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON) - # When hpp files are skipped, the cpp still get processed. - set_property(SOURCE skipSource/qItemC.hpp PROPERTY SKIP_AUTOMOC ON) - set_property(SOURCE skipSource/qItemD.hpp PROPERTY SKIP_AUTOGEN ON) - # AUTOMOC enabled only - add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc}) - set_property(TARGET skipMocA PROPERTY AUTOMOC ON) - target_link_libraries(skipMocA ${QT_LIBRARIES}) - # AUTOMOC and AUTOUIC enabled - add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc}) - set_property(TARGET skipMocB PROPERTY AUTOMOC ON) - set_property(TARGET skipMocB PROPERTY AUTOUIC ON) - target_link_libraries(skipMocB ${QT_LIBRARIES}) -endif() - -# -- Test -# Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target -set(skipUicSources - skipUic.cpp - skipSource/skipUicGen.cpp - skipSource/skipUicNoGen1.cpp - skipSource/skipUicNoGen2.cpp -) -set_property(SOURCE skipSource/skipUicNoGen1.cpp PROPERTY SKIP_AUTOUIC ON) -set_property(SOURCE skipSource/skipUicNoGen2.cpp PROPERTY SKIP_AUTOGEN ON) -# AUTOUIC enabled -add_executable(skipUicA ${skipUicSources}) -set_property(TARGET skipUicA PROPERTY AUTOUIC ON) -target_link_libraries(skipUicA ${QT_LIBRARIES}) -# AUTOUIC and AUTOMOC enabled -add_executable(skipUicB ${skipUicSources}) -set_property(TARGET skipUicB PROPERTY AUTOUIC ON) -set_property(TARGET skipUicB PROPERTY AUTOMOC ON) -target_link_libraries(skipUicB ${QT_LIBRARIES}) - -# -- Test -# Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target -set(skipRccSources - skipRcc.cpp - skipSource/skipRccBad1.qrc - skipSource/skipRccBad2.qrc - skipSource/skipRccGood.qrc -) -set_property(SOURCE skipSource/skipRccBad1.qrc PROPERTY SKIP_AUTORCC ON) -set_property(SOURCE skipSource/skipRccBad2.qrc PROPERTY SKIP_AUTOGEN ON) -# AUTORCC enabled -add_executable(skipRccA ${skipRccSources}) -set_property(TARGET skipRccA PROPERTY AUTORCC ON) -target_link_libraries(skipRccA ${QT_LIBRARIES}) -# AUTORCC, AUTOUIC and AUTOMOC enabled -add_executable(skipRccB ${skipRccSources}) -set_property(TARGET skipRccB PROPERTY AUTORCC ON) -set_property(TARGET skipRccB PROPERTY AUTOUIC ON) -set_property(TARGET skipRccB PROPERTY AUTOMOC ON) -target_link_libraries(skipRccB ${QT_LIBRARIES}) - -# -- Test -# MOC AUTOMOC_MACRO_NAMES -if (NOT QT_TEST_VERSION STREQUAL 4) - add_subdirectory(mocMacroName) -endif() - -# -- Test -# Tests AUTOMOC with generated sources -add_subdirectory(mocDepends) - -# -- Test -# Tests various include moc patterns -if(ALLOW_WRAP_CPP) - add_subdirectory(mocIncludeStrict) - add_subdirectory(mocIncludeRelaxed) -endif() - -# -- Test -# Tests policy 0071 -if(ALLOW_WRAP_CPP) - add_subdirectory(mocCMP0071) -endif() - -# -- Test -# Tests various .ui include directories -add_subdirectory(uicInclude) - -# -- Test -# OBJECT libraries -add_subdirectory(objectLibrary) - -# -- Test -# MacOS Framework -if(APPLE AND (NOT QT_TEST_VERSION STREQUAL 4)) - add_subdirectory(macosFW) -endif() - -# -- Test -# Source files with the same basename in different subdirectories -add_subdirectory(sameName) - -# -- Test -# Tests static library cycles -add_subdirectory(staticLibraryCycle) - -# -- Test -# Complex test case -add_subdirectory(complex) diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake new file mode 100644 index 0000000..c56780e --- /dev/null +++ b/Tests/QtAutogen/CommonTests.cmake @@ -0,0 +1,40 @@ +# Autogen tests common for Qt4 and Qt5 +ADD_AUTOGEN_TEST(MocOnly mocOnly) +ADD_AUTOGEN_TEST(MocOptions mocOptions) +if(QT_TEST_ALLOW_QT_MACROS) + ADD_AUTOGEN_TEST(UicOnly uicOnly) +endif() +ADD_AUTOGEN_TEST(RccOnly rccOnly) +ADD_AUTOGEN_TEST(RccEmpty rccEmpty) +ADD_AUTOGEN_TEST(RccOffMocLibrary) +if(QT_TEST_ALLOW_QT_MACROS) + ADD_AUTOGEN_TEST(MocSkipSource) +endif() +ADD_AUTOGEN_TEST(UicSkipSource) +ADD_AUTOGEN_TEST(RccSkipSource) +if(NOT QT_TEST_VERSION STREQUAL 4) + ADD_AUTOGEN_TEST(MocMacroName mocMacroName) +endif() +ADD_AUTOGEN_TEST(MocDepends) +if(QT_TEST_ALLOW_QT_MACROS) + ADD_AUTOGEN_TEST(MocIncludeStrict mocIncludeStrict) + ADD_AUTOGEN_TEST(MocIncludeRelaxed mocIncludeRelaxed) +endif() +if(QT_TEST_ALLOW_QT_MACROS) + ADD_AUTOGEN_TEST(MocCMP0071) +endif() +ADD_AUTOGEN_TEST(UicInclude uicInclude) +ADD_AUTOGEN_TEST(UicInterface QtAutoUicInterface) +ADD_AUTOGEN_TEST(ObjectLibrary someProgram) +if(APPLE AND (NOT QT_TEST_VERSION STREQUAL 4)) + ADD_AUTOGEN_TEST(MacOsFW) +endif() +ADD_AUTOGEN_TEST(SameName sameName) +ADD_AUTOGEN_TEST(StaticLibraryCycle slc) +ADD_AUTOGEN_TEST(Complex QtAutogen) +# Rerun tests +ADD_AUTOGEN_TEST(RerunMocBasic) +if(NOT QT_TEST_VERSION STREQUAL 4) + ADD_AUTOGEN_TEST(RerunMocPlugin) +endif() +ADD_AUTOGEN_TEST(RerunRccDepends) diff --git a/Tests/QtAutogen/complex/Adir/CMakeLists.txt b/Tests/QtAutogen/Complex/Adir/CMakeLists.txt index a1c36ff..a1c36ff 100644 --- a/Tests/QtAutogen/complex/Adir/CMakeLists.txt +++ b/Tests/QtAutogen/Complex/Adir/CMakeLists.txt diff --git a/Tests/QtAutogen/complex/Adir/libA.cpp b/Tests/QtAutogen/Complex/Adir/libA.cpp index f79f24a..f79f24a 100644 --- a/Tests/QtAutogen/complex/Adir/libA.cpp +++ b/Tests/QtAutogen/Complex/Adir/libA.cpp diff --git a/Tests/QtAutogen/complex/Adir/libA.h b/Tests/QtAutogen/Complex/Adir/libA.h index c4eb9f7..c4eb9f7 100644 --- a/Tests/QtAutogen/complex/Adir/libA.h +++ b/Tests/QtAutogen/Complex/Adir/libA.h diff --git a/Tests/QtAutogen/complex/Bdir/CMakeLists.txt b/Tests/QtAutogen/Complex/Bdir/CMakeLists.txt index d338763..d338763 100644 --- a/Tests/QtAutogen/complex/Bdir/CMakeLists.txt +++ b/Tests/QtAutogen/Complex/Bdir/CMakeLists.txt diff --git a/Tests/QtAutogen/complex/Bdir/libB.cpp b/Tests/QtAutogen/Complex/Bdir/libB.cpp index d3b6753..d3b6753 100644 --- a/Tests/QtAutogen/complex/Bdir/libB.cpp +++ b/Tests/QtAutogen/Complex/Bdir/libB.cpp diff --git a/Tests/QtAutogen/complex/Bdir/libB.h b/Tests/QtAutogen/Complex/Bdir/libB.h index e4ab788..e4ab788 100644 --- a/Tests/QtAutogen/complex/Bdir/libB.h +++ b/Tests/QtAutogen/Complex/Bdir/libB.h diff --git a/Tests/QtAutogen/complex/CMakeLists.txt b/Tests/QtAutogen/Complex/CMakeLists.txt index 2043ccf..e9feea0 100644 --- a/Tests/QtAutogen/complex/CMakeLists.txt +++ b/Tests/QtAutogen/Complex/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.10) +project(Complex) +include("../AutogenTest.cmake") # -- Test: AUTOMOC AUTORCC AUTOUIC add_definitions(-DFOO -DSomeDefine="Barx") @@ -20,7 +22,7 @@ add_custom_command( OUTPUT generated.txt COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" "${CMAKE_CURRENT_BINARY_DIR}/generated.txt" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/generated.txt.in" - ) +) add_custom_target(generate_moc_input DEPENDS generated.txt diff --git a/Tests/QtAutogen/complex/abc.cpp b/Tests/QtAutogen/Complex/abc.cpp index 2929b92..2929b92 100644 --- a/Tests/QtAutogen/complex/abc.cpp +++ b/Tests/QtAutogen/Complex/abc.cpp diff --git a/Tests/QtAutogen/complex/abc.h b/Tests/QtAutogen/Complex/abc.h index ec5f411..ec5f411 100644 --- a/Tests/QtAutogen/complex/abc.h +++ b/Tests/QtAutogen/Complex/abc.h diff --git a/Tests/QtAutogen/complex/abc_p.h b/Tests/QtAutogen/Complex/abc_p.h index be98487..be98487 100644 --- a/Tests/QtAutogen/complex/abc_p.h +++ b/Tests/QtAutogen/Complex/abc_p.h diff --git a/Tests/QtAutogen/complex/bar.cpp b/Tests/QtAutogen/Complex/bar.cpp index 734bd7a..734bd7a 100644 --- a/Tests/QtAutogen/complex/bar.cpp +++ b/Tests/QtAutogen/Complex/bar.cpp diff --git a/Tests/QtAutogen/complex/blub.cpp b/Tests/QtAutogen/Complex/blub.cpp index 1c497e0..1c497e0 100644 --- a/Tests/QtAutogen/complex/blub.cpp +++ b/Tests/QtAutogen/Complex/blub.cpp diff --git a/Tests/QtAutogen/complex/blub.h b/Tests/QtAutogen/Complex/blub.h index ff79878..ff79878 100644 --- a/Tests/QtAutogen/complex/blub.h +++ b/Tests/QtAutogen/Complex/blub.h diff --git a/Tests/QtAutogen/complex/calwidget.cpp b/Tests/QtAutogen/Complex/calwidget.cpp index 380e982..380e982 100644 --- a/Tests/QtAutogen/complex/calwidget.cpp +++ b/Tests/QtAutogen/Complex/calwidget.cpp diff --git a/Tests/QtAutogen/complex/calwidget.h b/Tests/QtAutogen/Complex/calwidget.h index 084d959..084d959 100644 --- a/Tests/QtAutogen/complex/calwidget.h +++ b/Tests/QtAutogen/Complex/calwidget.h diff --git a/Tests/QtAutogen/complex/calwidget.ui b/Tests/QtAutogen/Complex/calwidget.ui index 1c245ca..1c245ca 100644 --- a/Tests/QtAutogen/complex/calwidget.ui +++ b/Tests/QtAutogen/Complex/calwidget.ui diff --git a/Tests/QtAutogen/complex/codeeditor.cpp b/Tests/QtAutogen/Complex/codeeditor.cpp index 0caf8a7..0caf8a7 100644 --- a/Tests/QtAutogen/complex/codeeditor.cpp +++ b/Tests/QtAutogen/Complex/codeeditor.cpp diff --git a/Tests/QtAutogen/complex/codeeditor.h b/Tests/QtAutogen/Complex/codeeditor.h index b410bd4..b410bd4 100644 --- a/Tests/QtAutogen/complex/codeeditor.h +++ b/Tests/QtAutogen/Complex/codeeditor.h diff --git a/Tests/QtAutogen/complex/debug_class.cpp b/Tests/QtAutogen/Complex/debug_class.cpp index 46b09e7..46b09e7 100644 --- a/Tests/QtAutogen/complex/debug_class.cpp +++ b/Tests/QtAutogen/Complex/debug_class.cpp diff --git a/Tests/QtAutogen/complex/debug_class.h b/Tests/QtAutogen/Complex/debug_class.h index c02f0ed..c02f0ed 100644 --- a/Tests/QtAutogen/complex/debug_class.h +++ b/Tests/QtAutogen/Complex/debug_class.h diff --git a/Tests/QtAutogen/complex/debug_class.ui b/Tests/QtAutogen/Complex/debug_class.ui index dc2e1ac..dc2e1ac 100644 --- a/Tests/QtAutogen/complex/debug_class.ui +++ b/Tests/QtAutogen/Complex/debug_class.ui diff --git a/Tests/QtAutogen/complex/debug_resource.qrc b/Tests/QtAutogen/Complex/debug_resource.qrc index db98b9b..db98b9b 100644 --- a/Tests/QtAutogen/complex/debug_resource.qrc +++ b/Tests/QtAutogen/Complex/debug_resource.qrc diff --git a/Tests/QtAutogen/complex/foo.cpp b/Tests/QtAutogen/Complex/foo.cpp index f665eee..f665eee 100644 --- a/Tests/QtAutogen/complex/foo.cpp +++ b/Tests/QtAutogen/Complex/foo.cpp diff --git a/Tests/QtAutogen/complex/foo.h b/Tests/QtAutogen/Complex/foo.h index 3e03fe6..3e03fe6 100644 --- a/Tests/QtAutogen/complex/foo.h +++ b/Tests/QtAutogen/Complex/foo.h diff --git a/Tests/QtAutogen/complex/gadget.cpp b/Tests/QtAutogen/Complex/gadget.cpp index 23d95fa..23d95fa 100644 --- a/Tests/QtAutogen/complex/gadget.cpp +++ b/Tests/QtAutogen/Complex/gadget.cpp diff --git a/Tests/QtAutogen/complex/gadget.h b/Tests/QtAutogen/Complex/gadget.h index 3253e31..3253e31 100644 --- a/Tests/QtAutogen/complex/gadget.h +++ b/Tests/QtAutogen/Complex/gadget.h diff --git a/Tests/QtAutogen/complex/generated.cpp b/Tests/QtAutogen/Complex/generated.cpp index d514c61..d514c61 100644 --- a/Tests/QtAutogen/complex/generated.cpp +++ b/Tests/QtAutogen/Complex/generated.cpp diff --git a/Tests/QtAutogen/complex/generated.h b/Tests/QtAutogen/Complex/generated.h index 62e1607..62e1607 100644 --- a/Tests/QtAutogen/complex/generated.h +++ b/Tests/QtAutogen/Complex/generated.h diff --git a/Tests/QtAutogen/complex/generated.txt.in b/Tests/QtAutogen/Complex/generated.txt.in index 77507bb..77507bb 100644 --- a/Tests/QtAutogen/complex/generated.txt.in +++ b/Tests/QtAutogen/Complex/generated.txt.in diff --git a/Tests/QtAutogen/complex/generated_resource.qrc.in b/Tests/QtAutogen/Complex/generated_resource.qrc.in index da5fa62..da5fa62 100644 --- a/Tests/QtAutogen/complex/generated_resource.qrc.in +++ b/Tests/QtAutogen/Complex/generated_resource.qrc.in diff --git a/Tests/QtAutogen/complex/libC.cpp b/Tests/QtAutogen/Complex/libC.cpp index a3acff1..a3acff1 100644 --- a/Tests/QtAutogen/complex/libC.cpp +++ b/Tests/QtAutogen/Complex/libC.cpp diff --git a/Tests/QtAutogen/complex/libC.h b/Tests/QtAutogen/Complex/libC.h index 3bc2bad..3bc2bad 100644 --- a/Tests/QtAutogen/complex/libC.h +++ b/Tests/QtAutogen/Complex/libC.h diff --git a/Tests/QtAutogen/complex/main.cpp b/Tests/QtAutogen/Complex/main.cpp index d557c70..d557c70 100644 --- a/Tests/QtAutogen/complex/main.cpp +++ b/Tests/QtAutogen/Complex/main.cpp diff --git a/Tests/QtAutogen/complex/multiplewidgets.cpp b/Tests/QtAutogen/Complex/multiplewidgets.cpp index fda36ea..fda36ea 100644 --- a/Tests/QtAutogen/complex/multiplewidgets.cpp +++ b/Tests/QtAutogen/Complex/multiplewidgets.cpp diff --git a/Tests/QtAutogen/complex/multiplewidgets.h b/Tests/QtAutogen/Complex/multiplewidgets.h index a4d0a50..a4d0a50 100644 --- a/Tests/QtAutogen/complex/multiplewidgets.h +++ b/Tests/QtAutogen/Complex/multiplewidgets.h diff --git a/Tests/QtAutogen/complex/myinterface.h.in b/Tests/QtAutogen/Complex/myinterface.h.in index c6c0ba1..c6c0ba1 100644 --- a/Tests/QtAutogen/complex/myinterface.h.in +++ b/Tests/QtAutogen/Complex/myinterface.h.in diff --git a/Tests/QtAutogen/complex/myotherinterface.h.in b/Tests/QtAutogen/Complex/myotherinterface.h.in index d21e7af..d21e7af 100644 --- a/Tests/QtAutogen/complex/myotherinterface.h.in +++ b/Tests/QtAutogen/Complex/myotherinterface.h.in diff --git a/Tests/QtAutogen/complex/private_slot.cpp b/Tests/QtAutogen/Complex/private_slot.cpp index ab1682a..ab1682a 100644 --- a/Tests/QtAutogen/complex/private_slot.cpp +++ b/Tests/QtAutogen/Complex/private_slot.cpp diff --git a/Tests/QtAutogen/complex/private_slot.h b/Tests/QtAutogen/Complex/private_slot.h index 8041eb2..8041eb2 100644 --- a/Tests/QtAutogen/complex/private_slot.h +++ b/Tests/QtAutogen/Complex/private_slot.h diff --git a/Tests/QtAutogen/complex/resourcetester.cpp b/Tests/QtAutogen/Complex/resourcetester.cpp index 4ecb6b4..4ecb6b4 100644 --- a/Tests/QtAutogen/complex/resourcetester.cpp +++ b/Tests/QtAutogen/Complex/resourcetester.cpp diff --git a/Tests/QtAutogen/complex/resourcetester.h b/Tests/QtAutogen/Complex/resourcetester.h index dbdb3ad..dbdb3ad 100644 --- a/Tests/QtAutogen/complex/resourcetester.h +++ b/Tests/QtAutogen/Complex/resourcetester.h diff --git a/Tests/QtAutogen/complex/second_resource.qrc b/Tests/QtAutogen/Complex/second_resource.qrc index 27bfb14..27bfb14 100644 --- a/Tests/QtAutogen/complex/second_resource.qrc +++ b/Tests/QtAutogen/Complex/second_resource.qrc diff --git a/Tests/QtAutogen/complex/second_widget.cpp b/Tests/QtAutogen/Complex/second_widget.cpp index c575f10..c575f10 100644 --- a/Tests/QtAutogen/complex/second_widget.cpp +++ b/Tests/QtAutogen/Complex/second_widget.cpp diff --git a/Tests/QtAutogen/complex/second_widget.h b/Tests/QtAutogen/Complex/second_widget.h index c7929c4..c7929c4 100644 --- a/Tests/QtAutogen/complex/second_widget.h +++ b/Tests/QtAutogen/Complex/second_widget.h diff --git a/Tests/QtAutogen/complex/second_widget.ui b/Tests/QtAutogen/Complex/second_widget.ui index 4effa58..4effa58 100644 --- a/Tests/QtAutogen/complex/second_widget.ui +++ b/Tests/QtAutogen/Complex/second_widget.ui diff --git a/Tests/QtAutogen/complex/sub/bar.h b/Tests/QtAutogen/Complex/sub/bar.h index e4093f6..e4093f6 100644 --- a/Tests/QtAutogen/complex/sub/bar.h +++ b/Tests/QtAutogen/Complex/sub/bar.h diff --git a/Tests/QtAutogen/complex/targetObjectsTest.cpp b/Tests/QtAutogen/Complex/targetObjectsTest.cpp index 766b775..766b775 100644 --- a/Tests/QtAutogen/complex/targetObjectsTest.cpp +++ b/Tests/QtAutogen/Complex/targetObjectsTest.cpp diff --git a/Tests/QtAutogen/complex/test.qrc b/Tests/QtAutogen/Complex/test.qrc index c3d4e3c..c3d4e3c 100644 --- a/Tests/QtAutogen/complex/test.qrc +++ b/Tests/QtAutogen/Complex/test.qrc diff --git a/Tests/QtAutogen/complex/widget1.ui b/Tests/QtAutogen/Complex/widget1.ui index 8fce81a..8fce81a 100644 --- a/Tests/QtAutogen/complex/widget1.ui +++ b/Tests/QtAutogen/Complex/widget1.ui diff --git a/Tests/QtAutogen/complex/widget2.ui b/Tests/QtAutogen/Complex/widget2.ui index 1f411b9..1f411b9 100644 --- a/Tests/QtAutogen/complex/widget2.ui +++ b/Tests/QtAutogen/Complex/widget2.ui diff --git a/Tests/QtAutogen/complex/xyz.cpp b/Tests/QtAutogen/Complex/xyz.cpp index e46c9d3..e46c9d3 100644 --- a/Tests/QtAutogen/complex/xyz.cpp +++ b/Tests/QtAutogen/Complex/xyz.cpp diff --git a/Tests/QtAutogen/complex/xyz.h b/Tests/QtAutogen/Complex/xyz.h index 8b813fd..8b813fd 100644 --- a/Tests/QtAutogen/complex/xyz.h +++ b/Tests/QtAutogen/Complex/xyz.h diff --git a/Tests/QtAutogen/complex/yaf.cpp b/Tests/QtAutogen/Complex/yaf.cpp index 70e26aa..70e26aa 100644 --- a/Tests/QtAutogen/complex/yaf.cpp +++ b/Tests/QtAutogen/Complex/yaf.cpp diff --git a/Tests/QtAutogen/complex/yaf.h b/Tests/QtAutogen/Complex/yaf.h index f271061..f271061 100644 --- a/Tests/QtAutogen/complex/yaf.h +++ b/Tests/QtAutogen/Complex/yaf.h diff --git a/Tests/QtAutogen/complex/yaf_p.h b/Tests/QtAutogen/Complex/yaf_p.h index ea5eed6..ea5eed6 100644 --- a/Tests/QtAutogen/complex/yaf_p.h +++ b/Tests/QtAutogen/Complex/yaf_p.h diff --git a/Tests/QtAutogen/DefinesTest/CMakeLists.txt b/Tests/QtAutogen/DefinesTest/CMakeLists.txt new file mode 100644 index 0000000..de22845 --- /dev/null +++ b/Tests/QtAutogen/DefinesTest/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.10) +project(DefinesTest) + +# Qt4 only definitions test +if(NOT QT_TEST_VERSION STREQUAL 4) + message(ERROR "Invalid Qt test version. This test is for Qt4 only.") +endif() + +find_package(Qt4 REQUIRED) + +add_executable(DefinesTest defines_test.cpp) +set_target_properties(DefinesTest PROPERTIES AUTOMOC TRUE) +target_link_libraries(DefinesTest Qt4::QtGui) diff --git a/Tests/QtAutogenRerun/defines_test/defines_test.cpp b/Tests/QtAutogen/DefinesTest/defines_test.cpp index cf4e9cb..cf4e9cb 100644 --- a/Tests/QtAutogenRerun/defines_test/defines_test.cpp +++ b/Tests/QtAutogen/DefinesTest/defines_test.cpp diff --git a/Tests/QtAutogen/macosFW/CMakeLists.txt b/Tests/QtAutogen/MacOsFW/CMakeLists.txt index 114d9ba..26d2019 100644 --- a/Tests/QtAutogen/macosFW/CMakeLists.txt +++ b/Tests/QtAutogen/MacOsFW/CMakeLists.txt @@ -1,5 +1,6 @@ -cmake_minimum_required(VERSION 3.8) -project(macos-fw-test) +cmake_minimum_required(VERSION 3.10) +project(MacOsFW) +include("../AutogenTest.cmake") find_package(Qt5Test REQUIRED) diff --git a/Tests/QtAutogen/macosFW/src/CMakeLists.txt b/Tests/QtAutogen/MacOsFW/src/CMakeLists.txt index a02be00..a02be00 100644 --- a/Tests/QtAutogen/macosFW/src/CMakeLists.txt +++ b/Tests/QtAutogen/MacOsFW/src/CMakeLists.txt diff --git a/Tests/QtAutogen/macosFW/src/macos_fw_lib.cpp b/Tests/QtAutogen/MacOsFW/src/macos_fw_lib.cpp index 881a8c9..881a8c9 100644 --- a/Tests/QtAutogen/macosFW/src/macos_fw_lib.cpp +++ b/Tests/QtAutogen/MacOsFW/src/macos_fw_lib.cpp diff --git a/Tests/QtAutogen/macosFW/src/macos_fw_lib.h b/Tests/QtAutogen/MacOsFW/src/macos_fw_lib.h index e66e0ea..e66e0ea 100644 --- a/Tests/QtAutogen/macosFW/src/macos_fw_lib.h +++ b/Tests/QtAutogen/MacOsFW/src/macos_fw_lib.h diff --git a/Tests/QtAutogen/macosFW/test/CMakeLists.txt b/Tests/QtAutogen/MacOsFW/test/CMakeLists.txt index 521c184..521c184 100644 --- a/Tests/QtAutogen/macosFW/test/CMakeLists.txt +++ b/Tests/QtAutogen/MacOsFW/test/CMakeLists.txt diff --git a/Tests/QtAutogen/macosFW/test/testMacosFWLib.cpp b/Tests/QtAutogen/MacOsFW/test/testMacosFWLib.cpp index 3476d61..3476d61 100644 --- a/Tests/QtAutogen/macosFW/test/testMacosFWLib.cpp +++ b/Tests/QtAutogen/MacOsFW/test/testMacosFWLib.cpp diff --git a/Tests/QtAutogen/macosFW/test/testMacosFWLib.h b/Tests/QtAutogen/MacOsFW/test/testMacosFWLib.h index 1fe8dae..1fe8dae 100644 --- a/Tests/QtAutogen/macosFW/test/testMacosFWLib.h +++ b/Tests/QtAutogen/MacOsFW/test/testMacosFWLib.h diff --git a/Tests/QtAutogen/MocCMP0071/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt new file mode 100644 index 0000000..a79f36e --- /dev/null +++ b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.10) +project(MocCMP0071) +include("../AutogenTest.cmake") + +add_subdirectory(OLD) +add_subdirectory(NEW) diff --git a/Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt index 0237afc..954fe3d 100644 --- a/Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt +++ b/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.10) cmake_policy(SET CMP0071 NEW) # *Generate* files diff --git a/Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt index 5699433..68fa067 100644 --- a/Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt +++ b/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.10) cmake_policy(SET CMP0071 OLD) # *Generate* files diff --git a/Tests/QtAutogen/mocCMP0071/Obj.cpp b/Tests/QtAutogen/MocCMP0071/Obj.cpp index 1ae50ed..1ae50ed 100644 --- a/Tests/QtAutogen/mocCMP0071/Obj.cpp +++ b/Tests/QtAutogen/MocCMP0071/Obj.cpp diff --git a/Tests/QtAutogen/mocCMP0071/Obj.hpp b/Tests/QtAutogen/MocCMP0071/Obj.hpp index f064e47..f064e47 100644 --- a/Tests/QtAutogen/mocCMP0071/Obj.hpp +++ b/Tests/QtAutogen/MocCMP0071/Obj.hpp diff --git a/Tests/QtAutogen/mocCMP0071/Obj_p.h b/Tests/QtAutogen/MocCMP0071/Obj_p.h index cb1e5df..cb1e5df 100644 --- a/Tests/QtAutogen/mocCMP0071/Obj_p.h +++ b/Tests/QtAutogen/MocCMP0071/Obj_p.h diff --git a/Tests/QtAutogen/mocCMP0071/main.cpp b/Tests/QtAutogen/MocCMP0071/main.cpp index 3887840..3887840 100644 --- a/Tests/QtAutogen/mocCMP0071/main.cpp +++ b/Tests/QtAutogen/MocCMP0071/main.cpp diff --git a/Tests/QtAutogen/mocDepends/CMakeLists.txt b/Tests/QtAutogen/MocDepends/CMakeLists.txt index 8217b8d..6ea72be 100644 --- a/Tests/QtAutogen/mocDepends/CMakeLists.txt +++ b/Tests/QtAutogen/MocDepends/CMakeLists.txt @@ -1,18 +1,6 @@ -cmake_minimum_required(VERSION 3.9) -cmake_policy(SET CMP0071 NEW) -project(mocDepends CXX) - -if (QT_TEST_VERSION STREQUAL 4) - find_package(Qt4 REQUIRED) - set(QT_CORE_TARGET Qt4::QtCore) -else() - if (NOT QT_TEST_VERSION STREQUAL 5) - message(SEND_ERROR "Invalid Qt version specified.") - endif() - - find_package(Qt5Core REQUIRED) - set(QT_CORE_TARGET Qt5::Core) -endif() +cmake_minimum_required(VERSION 3.10) +project(MocDepends) +include("../AutogenTest.cmake") include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) @@ -42,7 +30,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/GenFile.hpp) add_executable(mocDepGenFile testGenFile.cpp ${CBD}/GenFile.hpp) -target_link_libraries(mocDepGenFile ${QT_CORE_TARGET}) +target_link_libraries(mocDepGenFile ${QT_QTCORE_TARGET}) set_target_properties(mocDepGenFile PROPERTIES AUTOMOC TRUE) @@ -69,7 +57,7 @@ add_custom_target(mocDepTargetUtil COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/GenTarget.hpp) add_executable(mocDepTarget testGenTarget.cpp) -target_link_libraries(mocDepTarget ${QT_CORE_TARGET}) +target_link_libraries(mocDepTarget ${QT_QTCORE_TARGET}) set_target_properties(mocDepTarget PROPERTIES AUTOMOC TRUE) add_dependencies(mocDepTarget mocDepTargetUtil) @@ -96,10 +84,10 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/simpleLib.hpp.in ${CBD}/simpleLib.hpp COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/simpleLib.cpp.in ${CBD}/simpleLib.cpp) add_library(SimpleLib STATIC ${CBD}/simpleLib.hpp ${CBD}/simpleLib.cpp) -target_link_libraries(SimpleLib ${QT_CORE_TARGET}) +target_link_libraries(SimpleLib ${QT_QTCORE_TARGET}) add_executable(mocDepGenLib testGenLib.cpp) -target_link_libraries(mocDepGenLib SimpleLib ${QT_CORE_TARGET}) +target_link_libraries(mocDepGenLib SimpleLib ${QT_QTCORE_TARGET}) set_target_properties(mocDepGenLib PROPERTIES AUTOMOC TRUE) @@ -122,7 +110,7 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDFile.hpp) add_executable(mocDepATDFile testATDFile.cpp) -target_link_libraries(mocDepATDFile ${QT_CORE_TARGET}) +target_link_libraries(mocDepATDFile ${QT_QTCORE_TARGET}) set_target_properties(mocDepATDFile PROPERTIES AUTOMOC TRUE) set_target_properties(mocDepATDFile PROPERTIES AUTOGEN_TARGET_DEPENDS ${CBD}/ATDFile.hpp) @@ -146,6 +134,6 @@ add_custom_target(mocDepATDTargetUtil COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/object_valid.hpp.in ${CBD}/ATDTarget.hpp) add_executable(mocDepATDTarget testATDTarget.cpp) -target_link_libraries(mocDepATDTarget ${QT_CORE_TARGET}) +target_link_libraries(mocDepATDTarget ${QT_QTCORE_TARGET}) set_target_properties(mocDepATDTarget PROPERTIES AUTOMOC TRUE) set_target_properties(mocDepATDTarget PROPERTIES AUTOGEN_TARGET_DEPENDS mocDepATDTargetUtil) diff --git a/Tests/QtAutogen/mocDepends/object_invalid.hpp.in b/Tests/QtAutogen/MocDepends/object_invalid.hpp.in index 854d9a1..854d9a1 100644 --- a/Tests/QtAutogen/mocDepends/object_invalid.hpp.in +++ b/Tests/QtAutogen/MocDepends/object_invalid.hpp.in diff --git a/Tests/QtAutogen/mocDepends/object_valid.hpp.in b/Tests/QtAutogen/MocDepends/object_valid.hpp.in index f364f7c..f364f7c 100644 --- a/Tests/QtAutogen/mocDepends/object_valid.hpp.in +++ b/Tests/QtAutogen/MocDepends/object_valid.hpp.in diff --git a/Tests/QtAutogen/mocDepends/simpleLib.cpp.in b/Tests/QtAutogen/MocDepends/simpleLib.cpp.in index fa33bd3..fa33bd3 100644 --- a/Tests/QtAutogen/mocDepends/simpleLib.cpp.in +++ b/Tests/QtAutogen/MocDepends/simpleLib.cpp.in diff --git a/Tests/QtAutogen/mocDepends/simpleLib.hpp.in b/Tests/QtAutogen/MocDepends/simpleLib.hpp.in index b65b0cb..b65b0cb 100644 --- a/Tests/QtAutogen/mocDepends/simpleLib.hpp.in +++ b/Tests/QtAutogen/MocDepends/simpleLib.hpp.in diff --git a/Tests/QtAutogen/mocDepends/testATDFile.cpp b/Tests/QtAutogen/MocDepends/testATDFile.cpp index 6bddfcd..6bddfcd 100644 --- a/Tests/QtAutogen/mocDepends/testATDFile.cpp +++ b/Tests/QtAutogen/MocDepends/testATDFile.cpp diff --git a/Tests/QtAutogen/mocDepends/testATDTarget.cpp b/Tests/QtAutogen/MocDepends/testATDTarget.cpp index 831fc26..831fc26 100644 --- a/Tests/QtAutogen/mocDepends/testATDTarget.cpp +++ b/Tests/QtAutogen/MocDepends/testATDTarget.cpp diff --git a/Tests/QtAutogen/mocDepends/testGenFile.cpp b/Tests/QtAutogen/MocDepends/testGenFile.cpp index 7df6e13..7df6e13 100644 --- a/Tests/QtAutogen/mocDepends/testGenFile.cpp +++ b/Tests/QtAutogen/MocDepends/testGenFile.cpp diff --git a/Tests/QtAutogen/mocDepends/testGenLib.cpp b/Tests/QtAutogen/MocDepends/testGenLib.cpp index c14e159..c14e159 100644 --- a/Tests/QtAutogen/mocDepends/testGenLib.cpp +++ b/Tests/QtAutogen/MocDepends/testGenLib.cpp diff --git a/Tests/QtAutogen/mocDepends/testGenLib.hpp b/Tests/QtAutogen/MocDepends/testGenLib.hpp index 408335b..408335b 100644 --- a/Tests/QtAutogen/mocDepends/testGenLib.hpp +++ b/Tests/QtAutogen/MocDepends/testGenLib.hpp diff --git a/Tests/QtAutogen/mocDepends/testGenTarget.cpp b/Tests/QtAutogen/MocDepends/testGenTarget.cpp index 911076e..911076e 100644 --- a/Tests/QtAutogen/mocDepends/testGenTarget.cpp +++ b/Tests/QtAutogen/MocDepends/testGenTarget.cpp diff --git a/Tests/QtAutogen/mocInclude/EObjA.cpp b/Tests/QtAutogen/MocInclude/EObjA.cpp index ca713b2..7681c29 100644 --- a/Tests/QtAutogen/mocInclude/EObjA.cpp +++ b/Tests/QtAutogen/MocInclude/EObjA.cpp @@ -35,6 +35,7 @@ EObjA::EObjA() EObjA::~EObjA() { + delete d; } // For EObjALocal diff --git a/Tests/QtAutogen/mocInclude/EObjA.hpp b/Tests/QtAutogen/MocInclude/EObjA.hpp index 0939ab6..0939ab6 100644 --- a/Tests/QtAutogen/mocInclude/EObjA.hpp +++ b/Tests/QtAutogen/MocInclude/EObjA.hpp diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra.cpp b/Tests/QtAutogen/MocInclude/EObjAExtra.cpp index 369ca8f..369ca8f 100644 --- a/Tests/QtAutogen/mocInclude/EObjAExtra.cpp +++ b/Tests/QtAutogen/MocInclude/EObjAExtra.cpp diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra.hpp b/Tests/QtAutogen/MocInclude/EObjAExtra.hpp index b10681d..b10681d 100644 --- a/Tests/QtAutogen/mocInclude/EObjAExtra.hpp +++ b/Tests/QtAutogen/MocInclude/EObjAExtra.hpp diff --git a/Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp b/Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp index dea6cb5..dea6cb5 100644 --- a/Tests/QtAutogen/mocInclude/EObjAExtra_p.hpp +++ b/Tests/QtAutogen/MocInclude/EObjAExtra_p.hpp diff --git a/Tests/QtAutogen/mocInclude/EObjA_p.hpp b/Tests/QtAutogen/MocInclude/EObjA_p.hpp index 1e0d7e1..1e0d7e1 100644 --- a/Tests/QtAutogen/mocInclude/EObjA_p.hpp +++ b/Tests/QtAutogen/MocInclude/EObjA_p.hpp diff --git a/Tests/QtAutogen/mocInclude/EObjB.cpp b/Tests/QtAutogen/MocInclude/EObjB.cpp index d19fbfa..3068c68 100644 --- a/Tests/QtAutogen/mocInclude/EObjB.cpp +++ b/Tests/QtAutogen/MocInclude/EObjB.cpp @@ -35,6 +35,7 @@ EObjB::EObjB() EObjB::~EObjB() { + delete d; } // For EObjBLocal diff --git a/Tests/QtAutogen/mocInclude/EObjB.hpp b/Tests/QtAutogen/MocInclude/EObjB.hpp index 6632bdb..6632bdb 100644 --- a/Tests/QtAutogen/mocInclude/EObjB.hpp +++ b/Tests/QtAutogen/MocInclude/EObjB.hpp diff --git a/Tests/QtAutogen/mocInclude/EObjB_p.hpp b/Tests/QtAutogen/MocInclude/EObjB_p.hpp index 2905f28..2905f28 100644 --- a/Tests/QtAutogen/mocInclude/EObjB_p.hpp +++ b/Tests/QtAutogen/MocInclude/EObjB_p.hpp diff --git a/Tests/QtAutogen/mocInclude/LObjA.cpp b/Tests/QtAutogen/MocInclude/LObjA.cpp index 9aae991..9aae991 100644 --- a/Tests/QtAutogen/mocInclude/LObjA.cpp +++ b/Tests/QtAutogen/MocInclude/LObjA.cpp diff --git a/Tests/QtAutogen/mocInclude/LObjA.hpp b/Tests/QtAutogen/MocInclude/LObjA.hpp index aac670c..aac670c 100644 --- a/Tests/QtAutogen/mocInclude/LObjA.hpp +++ b/Tests/QtAutogen/MocInclude/LObjA.hpp diff --git a/Tests/QtAutogen/mocInclude/LObjA_p.h b/Tests/QtAutogen/MocInclude/LObjA_p.h index ebe8395..ebe8395 100644 --- a/Tests/QtAutogen/mocInclude/LObjA_p.h +++ b/Tests/QtAutogen/MocInclude/LObjA_p.h diff --git a/Tests/QtAutogen/mocInclude/LObjB.cpp b/Tests/QtAutogen/MocInclude/LObjB.cpp index 7485d8f..7485d8f 100644 --- a/Tests/QtAutogen/mocInclude/LObjB.cpp +++ b/Tests/QtAutogen/MocInclude/LObjB.cpp diff --git a/Tests/QtAutogen/mocInclude/LObjB.hpp b/Tests/QtAutogen/MocInclude/LObjB.hpp index eb4e58d..eb4e58d 100644 --- a/Tests/QtAutogen/mocInclude/LObjB.hpp +++ b/Tests/QtAutogen/MocInclude/LObjB.hpp diff --git a/Tests/QtAutogen/mocInclude/LObjB_p.h b/Tests/QtAutogen/MocInclude/LObjB_p.h index b871f2d..b871f2d 100644 --- a/Tests/QtAutogen/mocInclude/LObjB_p.h +++ b/Tests/QtAutogen/MocInclude/LObjB_p.h diff --git a/Tests/QtAutogen/mocInclude/ObjA.cpp b/Tests/QtAutogen/MocInclude/ObjA.cpp index 6f6b90e..6f6b90e 100644 --- a/Tests/QtAutogen/mocInclude/ObjA.cpp +++ b/Tests/QtAutogen/MocInclude/ObjA.cpp diff --git a/Tests/QtAutogen/mocInclude/ObjA.hpp b/Tests/QtAutogen/MocInclude/ObjA.hpp index f16c924..f16c924 100644 --- a/Tests/QtAutogen/mocInclude/ObjA.hpp +++ b/Tests/QtAutogen/MocInclude/ObjA.hpp diff --git a/Tests/QtAutogen/mocInclude/ObjA_p.h b/Tests/QtAutogen/MocInclude/ObjA_p.h index eb60c98..eb60c98 100644 --- a/Tests/QtAutogen/mocInclude/ObjA_p.h +++ b/Tests/QtAutogen/MocInclude/ObjA_p.h diff --git a/Tests/QtAutogen/mocInclude/ObjB.cpp b/Tests/QtAutogen/MocInclude/ObjB.cpp index a6f2509..a6f2509 100644 --- a/Tests/QtAutogen/mocInclude/ObjB.cpp +++ b/Tests/QtAutogen/MocInclude/ObjB.cpp diff --git a/Tests/QtAutogen/mocInclude/ObjB.hpp b/Tests/QtAutogen/MocInclude/ObjB.hpp index 2ac8d17..2ac8d17 100644 --- a/Tests/QtAutogen/mocInclude/ObjB.hpp +++ b/Tests/QtAutogen/MocInclude/ObjB.hpp diff --git a/Tests/QtAutogen/mocInclude/ObjB_p.h b/Tests/QtAutogen/MocInclude/ObjB_p.h index 418da65..418da65 100644 --- a/Tests/QtAutogen/mocInclude/ObjB_p.h +++ b/Tests/QtAutogen/MocInclude/ObjB_p.h diff --git a/Tests/QtAutogen/mocInclude/SObjA.cpp b/Tests/QtAutogen/MocInclude/SObjA.cpp index 7e75bf9..7e75bf9 100644 --- a/Tests/QtAutogen/mocInclude/SObjA.cpp +++ b/Tests/QtAutogen/MocInclude/SObjA.cpp diff --git a/Tests/QtAutogen/mocInclude/SObjA.hpp b/Tests/QtAutogen/MocInclude/SObjA.hpp index 1436abc..1436abc 100644 --- a/Tests/QtAutogen/mocInclude/SObjA.hpp +++ b/Tests/QtAutogen/MocInclude/SObjA.hpp diff --git a/Tests/QtAutogen/mocInclude/SObjB.cpp.in b/Tests/QtAutogen/MocInclude/SObjB.cpp.in index b1cc12a..b1cc12a 100644 --- a/Tests/QtAutogen/mocInclude/SObjB.cpp.in +++ b/Tests/QtAutogen/MocInclude/SObjB.cpp.in diff --git a/Tests/QtAutogen/mocInclude/SObjB.hpp.in b/Tests/QtAutogen/MocInclude/SObjB.hpp.in index 5e396ae..5e396ae 100644 --- a/Tests/QtAutogen/mocInclude/SObjB.hpp.in +++ b/Tests/QtAutogen/MocInclude/SObjB.hpp.in diff --git a/Tests/QtAutogen/mocInclude/SObjC.cpp b/Tests/QtAutogen/MocInclude/SObjC.cpp index 1e8d397..1e8d397 100644 --- a/Tests/QtAutogen/mocInclude/SObjC.cpp +++ b/Tests/QtAutogen/MocInclude/SObjC.cpp diff --git a/Tests/QtAutogen/mocInclude/SObjC.hpp b/Tests/QtAutogen/MocInclude/SObjC.hpp index def0f9d..def0f9d 100644 --- a/Tests/QtAutogen/mocInclude/SObjC.hpp +++ b/Tests/QtAutogen/MocInclude/SObjC.hpp diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.cpp b/Tests/QtAutogen/MocInclude/SObjCExtra.cpp index 55dd1c3..55dd1c3 100644 --- a/Tests/QtAutogen/mocInclude/SObjCExtra.cpp +++ b/Tests/QtAutogen/MocInclude/SObjCExtra.cpp diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.hpp b/Tests/QtAutogen/MocInclude/SObjCExtra.hpp index 08545ac..08545ac 100644 --- a/Tests/QtAutogen/mocInclude/SObjCExtra.hpp +++ b/Tests/QtAutogen/MocInclude/SObjCExtra.hpp diff --git a/Tests/QtAutogen/mocInclude/SObjCExtra.moc.in b/Tests/QtAutogen/MocInclude/SObjCExtra.moc.in index 00fc4aa..00fc4aa 100644 --- a/Tests/QtAutogen/mocInclude/SObjCExtra.moc.in +++ b/Tests/QtAutogen/MocInclude/SObjCExtra.moc.in diff --git a/Tests/QtAutogen/mocInclude/shared.cmake b/Tests/QtAutogen/MocInclude/shared.cmake index d05f27c..2ca2841 100644 --- a/Tests/QtAutogen/mocInclude/shared.cmake +++ b/Tests/QtAutogen/MocInclude/shared.cmake @@ -1,24 +1,24 @@ # Test moc include patterns -include_directories("../mocInclude") +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_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) +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_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_SOURCE_DIR}/../MocInclude/SObjB.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp) qtx_generate_moc( ${CMAKE_CURRENT_BINARY_DIR}/SObjB.hpp @@ -27,10 +27,10 @@ set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/SObjB.cpp PROPERTY SKIP_AUTOMOC # Generate moc file externally and enabled SKIP_AUTOMOC on the header qtx_generate_moc( - ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjCExtra.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/SObjCExtra.hpp ${CMAKE_CURRENT_BINARY_DIR}/SObjCExtra_extMoc.cpp) set_property( - SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/SObjCExtra.hpp + 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) @@ -38,32 +38,32 @@ 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 + ${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/ObjA.cpp + ../MocInclude/ObjB.cpp - ../mocInclude/LObjA.cpp - ../mocInclude/LObjB.cpp + ../MocInclude/LObjA.cpp + ../MocInclude/LObjB.cpp - ../mocInclude/EObjA.cpp - ../mocInclude/EObjAExtra.cpp - ../mocInclude/EObjB.cpp - ../mocInclude/subExtra/EObjBExtra.cpp + ../MocInclude/EObjA.cpp + ../MocInclude/EObjAExtra.cpp + ../MocInclude/EObjB.cpp + ../MocInclude/subExtra/EObjBExtra.cpp - ../mocInclude/SObjA.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/SObjC.cpp + ../MocInclude/SObjCExtra.hpp + ../MocInclude/SObjCExtra.cpp - ../mocInclude/subGlobal/GObj.cpp + ../MocInclude/subGlobal/GObj.cpp main.cpp ) add_dependencies(${MOC_INCLUDE_NAME} "${MOC_INCLUDE_NAME}_SOBJC") diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp index c697866..c697866 100644 --- a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.cpp +++ b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.cpp diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp index 3798d7f..3798d7f 100644 --- a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra.hpp +++ b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra.hpp diff --git a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp index db8a096..db8a096 100644 --- a/Tests/QtAutogen/mocInclude/subExtra/EObjBExtra_p.hpp +++ b/Tests/QtAutogen/MocInclude/subExtra/EObjBExtra_p.hpp diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp b/Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp index 6b92f21..6b92f21 100644 --- a/Tests/QtAutogen/mocInclude/subGlobal/GObj.cpp +++ b/Tests/QtAutogen/MocInclude/subGlobal/GObj.cpp diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp b/Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp index 2f9ee82..2f9ee82 100644 --- a/Tests/QtAutogen/mocInclude/subGlobal/GObj.hpp +++ b/Tests/QtAutogen/MocInclude/subGlobal/GObj.hpp diff --git a/Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp b/Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp index 7b37dfd..7b37dfd 100644 --- a/Tests/QtAutogen/mocInclude/subGlobal/GObj_p.hpp +++ b/Tests/QtAutogen/MocInclude/subGlobal/GObj_p.hpp diff --git a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt index 97ba1df..b1c4fc3 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/CMakeLists.txt +++ b/Tests/QtAutogen/MocIncludeRelaxed/CMakeLists.txt @@ -1,10 +1,13 @@ -# Test moc include patterns +cmake_minimum_required(VERSION 3.10) +project(MocIncludeRelaxed) +include("../AutogenTest.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) +include(${CMAKE_CURRENT_SOURCE_DIR}/../MocInclude/shared.cmake) # Relaxed ony executable add_executable(mocIncludeRelaxedOnly diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp b/Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp index 5b2c070..5b2c070 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/RMain.cpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/RMain.cpp diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjA.cpp index 2e2cf6a..2e2cf6a 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.cpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/RObjA.cpp diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjA.hpp index 5974187..5974187 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/RObjA.hpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/RObjA.hpp diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjB.cpp index c56d10f..c56d10f 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.cpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/RObjB.cpp diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjB.hpp index d6d0474..d6d0474 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/RObjB.hpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/RObjB.hpp diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjBExtra.hpp index 5d6be75..5d6be75 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/RObjBExtra.hpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/RObjBExtra.hpp diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjC.cpp index 4ba32f5..4ba32f5 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.cpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/RObjC.cpp diff --git a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp b/Tests/QtAutogen/MocIncludeRelaxed/RObjC.hpp index 5552ede..5552ede 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/RObjC.hpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/RObjC.hpp diff --git a/Tests/QtAutogen/mocIncludeStrict/main.cpp b/Tests/QtAutogen/MocIncludeRelaxed/main.cpp index 5a3148d..5a3148d 100644 --- a/Tests/QtAutogen/mocIncludeStrict/main.cpp +++ b/Tests/QtAutogen/MocIncludeRelaxed/main.cpp diff --git a/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt b/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt new file mode 100644 index 0000000..2cf0fed --- /dev/null +++ b/Tests/QtAutogen/MocIncludeStrict/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(MocIncludeStrict) +include("../AutogenTest.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/mocIncludeRelaxed/main.cpp b/Tests/QtAutogen/MocIncludeStrict/main.cpp index 5a3148d..5a3148d 100644 --- a/Tests/QtAutogen/mocIncludeRelaxed/main.cpp +++ b/Tests/QtAutogen/MocIncludeStrict/main.cpp diff --git a/Tests/QtAutogen/MocMacroName/CMakeLists.txt b/Tests/QtAutogen/MocMacroName/CMakeLists.txt new file mode 100644 index 0000000..f0251a2 --- /dev/null +++ b/Tests/QtAutogen/MocMacroName/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.10) +project(MocMacroName) +include("../AutogenTest.cmake") + +# Test CMAKE_AUTOMOC_MACRO_NAMES and AUTOMOC_MACRO_NAMES +list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS") + +add_executable(mocMacroName + main.cpp + Gadget.cpp + Object.cpp + Object1Aliased.cpp + Object2Aliased.cpp +) +set_property(TARGET mocMacroName PROPERTY AUTOMOC ON) +set_property(TARGET mocMacroName APPEND PROPERTY AUTOMOC_MACRO_NAMES "QO2_ALIAS") +target_link_libraries(mocMacroName ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/mocMacroName/CustomMacros.hpp b/Tests/QtAutogen/MocMacroName/CustomMacros.hpp index 93e5bfd..93e5bfd 100644 --- a/Tests/QtAutogen/mocMacroName/CustomMacros.hpp +++ b/Tests/QtAutogen/MocMacroName/CustomMacros.hpp diff --git a/Tests/QtAutogen/mocMacroName/Gadget.cpp b/Tests/QtAutogen/MocMacroName/Gadget.cpp index 167faeb..d7cb515 100644 --- a/Tests/QtAutogen/mocMacroName/Gadget.cpp +++ b/Tests/QtAutogen/MocMacroName/Gadget.cpp @@ -1,6 +1,6 @@ #include "Gadget.hpp" Gadget::Gadget() - : test(0) + : _test(0) { } diff --git a/Tests/QtAutogen/mocMacroName/Gadget.hpp b/Tests/QtAutogen/MocMacroName/Gadget.hpp index 2587ed2..cab792e 100644 --- a/Tests/QtAutogen/mocMacroName/Gadget.hpp +++ b/Tests/QtAutogen/MocMacroName/Gadget.hpp @@ -6,10 +6,14 @@ class Gadget { Q_GADGET - Q_PROPERTY(int test MEMBER test) + Q_PROPERTY(int test READ getTest) public: Gadget(); - int test; + + int getTest() { return _test; } + +private: + int _test; }; #endif diff --git a/Tests/QtAutogen/mocMacroName/Object.cpp b/Tests/QtAutogen/MocMacroName/Object.cpp index c0b4f33..800ebf3 100644 --- a/Tests/QtAutogen/mocMacroName/Object.cpp +++ b/Tests/QtAutogen/MocMacroName/Object.cpp @@ -1,6 +1,7 @@ #include "Object.hpp" Object::Object() + : _test(0) { } diff --git a/Tests/QtAutogen/mocMacroName/Object.hpp b/Tests/QtAutogen/MocMacroName/Object.hpp index 0c40824..aadae1f 100644 --- a/Tests/QtAutogen/mocMacroName/Object.hpp +++ b/Tests/QtAutogen/MocMacroName/Object.hpp @@ -6,14 +6,17 @@ class Object : public QObject { Q_OBJECT - Q_PROPERTY(int test MEMBER test) + Q_PROPERTY(int test READ getTest) public: Object(); + int getTest() { return _test; } + Q_SLOT void aSlot(); - int test; +private: + int _test; }; #endif diff --git a/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp b/Tests/QtAutogen/MocMacroName/Object1Aliased.cpp index b8b4806..b8b4806 100644 --- a/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp +++ b/Tests/QtAutogen/MocMacroName/Object1Aliased.cpp diff --git a/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp b/Tests/QtAutogen/MocMacroName/Object1Aliased.hpp index 6c6bb40..6c6bb40 100644 --- a/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp +++ b/Tests/QtAutogen/MocMacroName/Object1Aliased.hpp diff --git a/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp b/Tests/QtAutogen/MocMacroName/Object2Aliased.cpp index 4b09dd1..4b09dd1 100644 --- a/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp +++ b/Tests/QtAutogen/MocMacroName/Object2Aliased.cpp diff --git a/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp b/Tests/QtAutogen/MocMacroName/Object2Aliased.hpp index b9bdc12..b9bdc12 100644 --- a/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp +++ b/Tests/QtAutogen/MocMacroName/Object2Aliased.hpp diff --git a/Tests/QtAutogen/mocMacroName/main.cpp b/Tests/QtAutogen/MocMacroName/main.cpp index 3b45d04..3b45d04 100644 --- a/Tests/QtAutogen/mocMacroName/main.cpp +++ b/Tests/QtAutogen/MocMacroName/main.cpp diff --git a/Tests/QtAutogen/MocOnly/CMakeLists.txt b/Tests/QtAutogen/MocOnly/CMakeLists.txt new file mode 100644 index 0000000..33feadf --- /dev/null +++ b/Tests/QtAutogen/MocOnly/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10) +project(MocOnly) +include("../AutogenTest.cmake") + +# Test different Q_OBJECT position styles +add_executable(mocOnly StyleA.cpp StyleB.cpp main.cpp) +set_property(TARGET mocOnly PROPERTY AUTOMOC ON) +target_link_libraries(mocOnly ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/mocOnlySource/StyleA.cpp b/Tests/QtAutogen/MocOnly/StyleA.cpp index ced1dd1..ced1dd1 100644 --- a/Tests/QtAutogen/mocOnlySource/StyleA.cpp +++ b/Tests/QtAutogen/MocOnly/StyleA.cpp diff --git a/Tests/QtAutogen/mocOnlySource/StyleA.hpp b/Tests/QtAutogen/MocOnly/StyleA.hpp index 66735b6..5ba0a87 100644 --- a/Tests/QtAutogen/mocOnlySource/StyleA.hpp +++ b/Tests/QtAutogen/MocOnly/StyleA.hpp @@ -3,6 +3,7 @@ #include <QObject> +/* clang-format off */ /// Q_OBJECT on a single new line /// class StyleA : public QObject @@ -11,5 +12,6 @@ class StyleA : public QObject public: StyleA(); }; +/* clang-format on */ #endif diff --git a/Tests/QtAutogen/mocOnlySource/StyleB.cpp b/Tests/QtAutogen/MocOnly/StyleB.cpp index bec6c1c..bec6c1c 100644 --- a/Tests/QtAutogen/mocOnlySource/StyleB.cpp +++ b/Tests/QtAutogen/MocOnly/StyleB.cpp diff --git a/Tests/QtAutogen/mocOnlySource/StyleB.hpp b/Tests/QtAutogen/MocOnly/StyleB.hpp index 425daf8..86abaa8 100644 --- a/Tests/QtAutogen/mocOnlySource/StyleB.hpp +++ b/Tests/QtAutogen/MocOnly/StyleB.hpp @@ -4,7 +4,7 @@ #include <QObject> /* clang-format off */ -/// Q_OBJECT behind a brace +/// Q_OBJECT behind a brace on a new line /// class StyleB : public QObject { Q_OBJECT diff --git a/Tests/QtAutogen/mocOnlySource/main.cpp b/Tests/QtAutogen/MocOnly/main.cpp index 06f8d81..06f8d81 100644 --- a/Tests/QtAutogen/mocOnlySource/main.cpp +++ b/Tests/QtAutogen/MocOnly/main.cpp diff --git a/Tests/QtAutogen/MocOptions/CMakeLists.txt b/Tests/QtAutogen/MocOptions/CMakeLists.txt new file mode 100644 index 0000000..f64b37b --- /dev/null +++ b/Tests/QtAutogen/MocOptions/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.10) +project(MocOptions) +include("../AutogenTest.cmake") + +# Test extra options passed to moc via AUTOMOC_MOC_OPTIONS +add_executable(mocOptions Object.cpp main.cpp) +set_property(TARGET mocOptions PROPERTY AUTOMOC ON) +set_property(TARGET mocOptions PROPERTY AUTOMOC_MOC_OPTIONS "-nw") +target_link_libraries(mocOptions ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/MocOptions/Object.cpp b/Tests/QtAutogen/MocOptions/Object.cpp new file mode 100644 index 0000000..ad109f1 --- /dev/null +++ b/Tests/QtAutogen/MocOptions/Object.cpp @@ -0,0 +1,5 @@ +#include "Object.hpp" + +Object::Object() +{ +} diff --git a/Tests/QtAutogen/MocOptions/Object.hpp b/Tests/QtAutogen/MocOptions/Object.hpp new file mode 100644 index 0000000..e7a6142 --- /dev/null +++ b/Tests/QtAutogen/MocOptions/Object.hpp @@ -0,0 +1,13 @@ +#ifndef Object_HPP +#define Object_HPP + +#include <QObject> + +class Object : public QObject +{ + Q_OBJECT +public: + Object(); +}; + +#endif diff --git a/Tests/QtAutogen/MocOptions/main.cpp b/Tests/QtAutogen/MocOptions/main.cpp new file mode 100644 index 0000000..7aeab1a --- /dev/null +++ b/Tests/QtAutogen/MocOptions/main.cpp @@ -0,0 +1,7 @@ +#include "Object.hpp" + +int main(int argv, char** args) +{ + Object object; + return 0; +} diff --git a/Tests/QtAutogen/MocSkipSource/CMakeLists.txt b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt new file mode 100644 index 0000000..8d1fa6a --- /dev/null +++ b/Tests/QtAutogen/MocSkipSource/CMakeLists.txt @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.10) +project(MocSkipSource) +include("../AutogenTest.cmake") + +# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target + +# Generate header mocs manually +qtx_wrap_cpp(skipMocWrapMoc + qItemA.hpp + qItemB.hpp + qItemC.hpp + qItemD.hpp +) +set(skipMocSources + skipMoc.cpp + qItemA.cpp + qItemB.cpp + qItemC.cpp + qItemD.cpp +) +# When cpp files are skipped, the hpp won't be processed either, +# unless they are mentioned in the sources - which they aren't. +set_property(SOURCE qItemA.cpp PROPERTY SKIP_AUTOMOC ON) +set_property(SOURCE qItemB.cpp PROPERTY SKIP_AUTOGEN ON) +# When hpp files are skipped, the cpp still get processed. +set_property(SOURCE qItemC.hpp PROPERTY SKIP_AUTOMOC ON) +set_property(SOURCE qItemD.hpp PROPERTY SKIP_AUTOGEN ON) +# AUTOMOC enabled only +add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc}) +set_property(TARGET skipMocA PROPERTY AUTOMOC ON) +target_link_libraries(skipMocA ${QT_LIBRARIES}) +# AUTOMOC and AUTOUIC enabled +add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc}) +set_property(TARGET skipMocB PROPERTY AUTOMOC ON) +set_property(TARGET skipMocB PROPERTY AUTOUIC ON) +target_link_libraries(skipMocB ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/skipSource/qItemA.cpp b/Tests/QtAutogen/MocSkipSource/qItemA.cpp index 522c2c7..522c2c7 100644 --- a/Tests/QtAutogen/skipSource/qItemA.cpp +++ b/Tests/QtAutogen/MocSkipSource/qItemA.cpp diff --git a/Tests/QtAutogen/skipSource/qItemA.hpp b/Tests/QtAutogen/MocSkipSource/qItemA.hpp index d295faf..d295faf 100644 --- a/Tests/QtAutogen/skipSource/qItemA.hpp +++ b/Tests/QtAutogen/MocSkipSource/qItemA.hpp diff --git a/Tests/QtAutogen/skipSource/qItemB.cpp b/Tests/QtAutogen/MocSkipSource/qItemB.cpp index 636e15d..636e15d 100644 --- a/Tests/QtAutogen/skipSource/qItemB.cpp +++ b/Tests/QtAutogen/MocSkipSource/qItemB.cpp diff --git a/Tests/QtAutogen/skipSource/qItemB.hpp b/Tests/QtAutogen/MocSkipSource/qItemB.hpp index 1775915..1775915 100644 --- a/Tests/QtAutogen/skipSource/qItemB.hpp +++ b/Tests/QtAutogen/MocSkipSource/qItemB.hpp diff --git a/Tests/QtAutogen/skipSource/qItemC.cpp b/Tests/QtAutogen/MocSkipSource/qItemC.cpp index 622f282..622f282 100644 --- a/Tests/QtAutogen/skipSource/qItemC.cpp +++ b/Tests/QtAutogen/MocSkipSource/qItemC.cpp diff --git a/Tests/QtAutogen/skipSource/qItemC.hpp b/Tests/QtAutogen/MocSkipSource/qItemC.hpp index f06bda2..f06bda2 100644 --- a/Tests/QtAutogen/skipSource/qItemC.hpp +++ b/Tests/QtAutogen/MocSkipSource/qItemC.hpp diff --git a/Tests/QtAutogen/skipSource/qItemD.cpp b/Tests/QtAutogen/MocSkipSource/qItemD.cpp index fe0f4e4..fe0f4e4 100644 --- a/Tests/QtAutogen/skipSource/qItemD.cpp +++ b/Tests/QtAutogen/MocSkipSource/qItemD.cpp diff --git a/Tests/QtAutogen/skipSource/qItemD.hpp b/Tests/QtAutogen/MocSkipSource/qItemD.hpp index 99e0acb..99e0acb 100644 --- a/Tests/QtAutogen/skipSource/qItemD.hpp +++ b/Tests/QtAutogen/MocSkipSource/qItemD.hpp diff --git a/Tests/QtAutogen/skipMoc.cpp b/Tests/QtAutogen/MocSkipSource/skipMoc.cpp index d6b292f..c915334 100644 --- a/Tests/QtAutogen/skipMoc.cpp +++ b/Tests/QtAutogen/MocSkipSource/skipMoc.cpp @@ -1,8 +1,8 @@ -#include "skipSource/qItemA.hpp" -#include "skipSource/qItemB.hpp" -#include "skipSource/qItemC.hpp" -#include "skipSource/qItemD.hpp" +#include "qItemA.hpp" +#include "qItemB.hpp" +#include "qItemC.hpp" +#include "qItemD.hpp" int main(int, char**) { diff --git a/Tests/QtAutogen/objectLibrary/CMakeLists.txt b/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt index 9b29a40..088a24c 100644 --- a/Tests/QtAutogen/objectLibrary/CMakeLists.txt +++ b/Tests/QtAutogen/ObjectLibrary/CMakeLists.txt @@ -1,3 +1,7 @@ +cmake_minimum_required(VERSION 3.10) +project(ObjectLibrary) +include("../AutogenTest.cmake") + set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) diff --git a/Tests/QtAutogen/objectLibrary/a/CMakeLists.txt b/Tests/QtAutogen/ObjectLibrary/a/CMakeLists.txt index fe76ac3..fe76ac3 100644 --- a/Tests/QtAutogen/objectLibrary/a/CMakeLists.txt +++ b/Tests/QtAutogen/ObjectLibrary/a/CMakeLists.txt diff --git a/Tests/QtAutogen/objectLibrary/a/classa.cpp b/Tests/QtAutogen/ObjectLibrary/a/classa.cpp index 4f08fda..4f08fda 100644 --- a/Tests/QtAutogen/objectLibrary/a/classa.cpp +++ b/Tests/QtAutogen/ObjectLibrary/a/classa.cpp diff --git a/Tests/QtAutogen/objectLibrary/a/classa.h b/Tests/QtAutogen/ObjectLibrary/a/classa.h index fa5fed9..fa5fed9 100644 --- a/Tests/QtAutogen/objectLibrary/a/classa.h +++ b/Tests/QtAutogen/ObjectLibrary/a/classa.h diff --git a/Tests/QtAutogen/objectLibrary/b/classb.cpp b/Tests/QtAutogen/ObjectLibrary/b/classb.cpp index 26e0926..26e0926 100644 --- a/Tests/QtAutogen/objectLibrary/b/classb.cpp +++ b/Tests/QtAutogen/ObjectLibrary/b/classb.cpp diff --git a/Tests/QtAutogen/objectLibrary/b/classb.h b/Tests/QtAutogen/ObjectLibrary/b/classb.h index 783bb48..783bb48 100644 --- a/Tests/QtAutogen/objectLibrary/b/classb.h +++ b/Tests/QtAutogen/ObjectLibrary/b/classb.h diff --git a/Tests/QtAutogen/objectLibrary/main.cpp b/Tests/QtAutogen/ObjectLibrary/main.cpp index cacf0fd..cacf0fd 100644 --- a/Tests/QtAutogen/objectLibrary/main.cpp +++ b/Tests/QtAutogen/ObjectLibrary/main.cpp diff --git a/Tests/QtAutogen/RccEmpty/CMakeLists.txt b/Tests/QtAutogen/RccEmpty/CMakeLists.txt new file mode 100644 index 0000000..3b16edc --- /dev/null +++ b/Tests/QtAutogen/RccEmpty/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10) +project(RccEmpty) +include("../AutogenTest.cmake") + +# Test AUTORCC on a .qrc file with no resource files +add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc) +set_property(TARGET rccEmpty PROPERTY AUTORCC ON) +target_link_libraries(rccEmpty ${QT_QTCORE_TARGET}) diff --git a/Tests/QtAutogen/rccEmpty.cpp b/Tests/QtAutogen/RccEmpty/rccEmpty.cpp index 7f2c527..7f2c527 100644 --- a/Tests/QtAutogen/rccEmpty.cpp +++ b/Tests/QtAutogen/RccEmpty/rccEmpty.cpp diff --git a/Tests/QtAutogen/rccEmptyRes.qrc b/Tests/QtAutogen/RccEmpty/rccEmptyRes.qrc index 4ca9cd5..4ca9cd5 100644 --- a/Tests/QtAutogen/rccEmptyRes.qrc +++ b/Tests/QtAutogen/RccEmpty/rccEmptyRes.qrc diff --git a/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt new file mode 100644 index 0000000..7f7432e --- /dev/null +++ b/Tests/QtAutogen/RccOffMocLibrary/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.10) +project(RccOffMocLibrary) +include("../AutogenTest.cmake") + +# Add not_generated_file.qrc to the source list to get the file-level +# dependency, but don't generate a c++ file from it. Disable the AUTORCC +# feature for this target. This tests that qrc files in the sources don't +# have an effect on generation if AUTORCC is off. +add_library(empty STATIC empty.cpp not_generated_file.qrc) +set_target_properties(empty PROPERTIES AUTORCC OFF) +set_target_properties(empty PROPERTIES AUTOMOC TRUE) +target_link_libraries(empty no_link_language) +add_library(no_link_language STATIC empty.h) +set_target_properties(no_link_language PROPERTIES AUTOMOC TRUE) +# Pass Qt compiler features to targets that don't link against Qt +target_compile_features(no_link_language PRIVATE ${QT_COMPILE_FEATURES}) +target_compile_features(empty PRIVATE ${QT_COMPILE_FEATURES}) diff --git a/Tests/QtAutogen/empty.cpp b/Tests/QtAutogen/RccOffMocLibrary/empty.cpp index ab32cf6..ab32cf6 100644 --- a/Tests/QtAutogen/empty.cpp +++ b/Tests/QtAutogen/RccOffMocLibrary/empty.cpp diff --git a/Tests/QtAutogen/empty.h b/Tests/QtAutogen/RccOffMocLibrary/empty.h index 6bdd2ac..6bdd2ac 100644 --- a/Tests/QtAutogen/empty.h +++ b/Tests/QtAutogen/RccOffMocLibrary/empty.h diff --git a/Tests/QtAutogen/not_generated_file.qrc b/Tests/QtAutogen/RccOffMocLibrary/not_generated_file.qrc index c769834..c769834 100644 --- a/Tests/QtAutogen/not_generated_file.qrc +++ b/Tests/QtAutogen/RccOffMocLibrary/not_generated_file.qrc diff --git a/Tests/QtAutogen/RccOnly/CMakeLists.txt b/Tests/QtAutogen/RccOnly/CMakeLists.txt new file mode 100644 index 0000000..a65dee4 --- /dev/null +++ b/Tests/QtAutogen/RccOnly/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10) +project(RccOnly) +include("../AutogenTest.cmake") + +# Test AUTORCC being enabled only +add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) +set_property(TARGET rccOnly PROPERTY AUTORCC ON) +target_link_libraries(rccOnly ${QT_QTCORE_TARGET}) diff --git a/Tests/QtAutogen/rccOnly.cpp b/Tests/QtAutogen/RccOnly/rccOnly.cpp index 61c7bf4..61c7bf4 100644 --- a/Tests/QtAutogen/rccOnly.cpp +++ b/Tests/QtAutogen/RccOnly/rccOnly.cpp diff --git a/Tests/QtAutogen/rccOnlyRes.qrc b/Tests/QtAutogen/RccOnly/rccOnlyRes.qrc index 5551348..5551348 100644 --- a/Tests/QtAutogen/rccOnlyRes.qrc +++ b/Tests/QtAutogen/RccOnly/rccOnlyRes.qrc diff --git a/Tests/QtAutogen/RccSkipSource/CMakeLists.txt b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt new file mode 100644 index 0000000..f8a8032 --- /dev/null +++ b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.10) +project(RccSkipSource) +include("../AutogenTest.cmake") + +# Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target +set(skipRccSources + skipRcc.cpp + skipRccBad1.qrc + skipRccBad2.qrc + skipRccGood.qrc +) +set_property(SOURCE skipRccBad1.qrc PROPERTY SKIP_AUTORCC ON) +set_property(SOURCE skipRccBad2.qrc PROPERTY SKIP_AUTOGEN ON) +# AUTORCC enabled +add_executable(skipRccA ${skipRccSources}) +set_property(TARGET skipRccA PROPERTY AUTORCC ON) +target_link_libraries(skipRccA ${QT_LIBRARIES}) +# AUTORCC, AUTOUIC and AUTOMOC enabled +add_executable(skipRccB ${skipRccSources}) +set_property(TARGET skipRccB PROPERTY AUTORCC ON) +set_property(TARGET skipRccB PROPERTY AUTOUIC ON) +set_property(TARGET skipRccB PROPERTY AUTOMOC ON) +target_link_libraries(skipRccB ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/skipRcc.cpp b/Tests/QtAutogen/RccSkipSource/skipRcc.cpp index ec57110..ec57110 100644 --- a/Tests/QtAutogen/skipRcc.cpp +++ b/Tests/QtAutogen/RccSkipSource/skipRcc.cpp diff --git a/Tests/QtAutogen/skipSource/skipRccBad1.qrc b/Tests/QtAutogen/RccSkipSource/skipRccBad1.qrc index 6cbd9ed..6cbd9ed 100644 --- a/Tests/QtAutogen/skipSource/skipRccBad1.qrc +++ b/Tests/QtAutogen/RccSkipSource/skipRccBad1.qrc diff --git a/Tests/QtAutogen/skipSource/skipRccBad2.qrc b/Tests/QtAutogen/RccSkipSource/skipRccBad2.qrc index b32c589..b32c589 100644 --- a/Tests/QtAutogen/skipSource/skipRccBad2.qrc +++ b/Tests/QtAutogen/RccSkipSource/skipRccBad2.qrc diff --git a/Tests/QtAutogen/skipSource/skipRccGood.qrc b/Tests/QtAutogen/RccSkipSource/skipRccGood.qrc index 21a94b0..21a94b0 100644 --- a/Tests/QtAutogen/skipSource/skipRccGood.qrc +++ b/Tests/QtAutogen/RccSkipSource/skipRccGood.qrc diff --git a/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt new file mode 100644 index 0000000..0bb0339 --- /dev/null +++ b/Tests/QtAutogen/RerunMocBasic/CMakeLists.txt @@ -0,0 +1,65 @@ +cmake_minimum_required(VERSION 3.10) +project(RerunMocBasic) +include("../AutogenTest.cmake") + +# Dummy executable to generate a clean target +add_executable(dummy dummy.cpp) + +set(timeformat "%Y%j%H%M%S") +set(mocBasicSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/MocBasic") +set(mocBasicBinDir "${CMAKE_CURRENT_BINARY_DIR}/MocBasic") + +# Initial build +configure_file("${mocBasicSrcDir}/test1a.h.in" "${mocBasicBinDir}/test1.h" COPYONLY) +try_compile(MOC_RERUN + "${mocBasicBinDir}" + "${mocBasicSrcDir}" + MocBasic + CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}" + "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + OUTPUT_VARIABLE output +) +if (NOT MOC_RERUN) + message(SEND_ERROR "Initial build of mocBasic failed. Output: ${output}") +endif() +# Get name of the output binary +file(STRINGS "${mocBasicBinDir}/mocBasic.txt" mocBasicList ENCODING UTF-8) +list(GET mocBasicList 0 mocBasicBin) + +message("Changing the header content for a MOC rerun") +# - Acquire binary timestamps before the build +file(TIMESTAMP "${mocBasicBin}" timeBefore "${timeformat}") +# - Ensure that the timestamp will change +# - Change header file content and rebuild +# - Rebuild +execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) +configure_file("${mocBasicSrcDir}/test1b.h.in" "${mocBasicBinDir}/test1.h" COPYONLY) +execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocBasicBinDir}" RESULT_VARIABLE result ) +if (result) + message(SEND_ERROR "Second build of mocBasic failed.") +endif() +# - Acquire binary timestamps after the build +file(TIMESTAMP "${mocBasicBin}" timeAfter "${timeformat}") +# - Test if timestamps changed +if (NOT timeAfter GREATER timeBefore) + message(SEND_ERROR "File (${mocBasicBin}) should have changed!") +endif() + + +message("Changing nothing for a MOC rerun") +# - Acquire binary timestamps before the build +file(TIMESTAMP "${mocBasicBin}" timeBefore "${timeformat}") +# - Ensure that the timestamp would change +# - Change nothing +# - Rebuild +execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) +execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocBasicBinDir}" RESULT_VARIABLE result ) +if (result) + message(SEND_ERROR "Third build of mocBasic failed.") +endif() +# - Acquire binary timestamps after the build +file(TIMESTAMP "${mocBasicBin}" timeAfter "${timeformat}") +# - Test if timestamps changed +if (timeAfter GREATER timeBefore) + message(SEND_ERROR "File (${mocBasicBin}) should not have changed!") +endif() diff --git a/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt new file mode 100644 index 0000000..cec60a4 --- /dev/null +++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.10) +project(MocBasic) +include("../../AutogenTest.cmake") + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) + +# Generated source file +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/main.cpp + COMMAND ${CMAKE_COMMAND} -E sleep 2 + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/main.cpp +) + +add_executable(mocBasic + ${CMAKE_CURRENT_BINARY_DIR}/test1.h + ${CMAKE_CURRENT_BINARY_DIR}/main.cpp + res1.qrc +) +target_include_directories(mocBasic PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries(mocBasic ${QT_QTCORE_TARGET}) +# Write target name to text file +add_custom_command(TARGET mocBasic POST_BUILD COMMAND + ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:mocBasic>" > mocBasic.txt +) diff --git a/Tests/QtAutogenRerun/mocRerun/input.txt b/Tests/QtAutogen/RerunMocBasic/MocBasic/input.txt index da62762..da62762 100644 --- a/Tests/QtAutogenRerun/mocRerun/input.txt +++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/input.txt diff --git a/Tests/QtAutogenRerun/mocRerun/main.cpp.in b/Tests/QtAutogen/RerunMocBasic/MocBasic/main.cpp.in index b37ff61..9d7ea37 100644 --- a/Tests/QtAutogenRerun/mocRerun/main.cpp.in +++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/main.cpp.in @@ -1,5 +1,7 @@ #include "test1.h" +extern int qInitResources_res1(); + class Test2 : public QObject { Q_OBJECT @@ -9,6 +11,9 @@ public slots: int main() { + // Fails to link if the rcc generated symbol is not present. + qInitResources_res1(); + Test1 test1; Test2 test2; diff --git a/Tests/QtAutogenRerun/mocRerun/res1.qrc b/Tests/QtAutogen/RerunMocBasic/MocBasic/res1.qrc index fb804b5..fb804b5 100644 --- a/Tests/QtAutogenRerun/mocRerun/res1.qrc +++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/res1.qrc diff --git a/Tests/QtAutogenRerun/mocRerun/test1a.h.in b/Tests/QtAutogen/RerunMocBasic/MocBasic/test1a.h.in index a335046..a335046 100644 --- a/Tests/QtAutogenRerun/mocRerun/test1a.h.in +++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/test1a.h.in diff --git a/Tests/QtAutogenRerun/mocRerun/test1b.h.in b/Tests/QtAutogen/RerunMocBasic/MocBasic/test1b.h.in index 6128eeb..6128eeb 100644 --- a/Tests/QtAutogenRerun/mocRerun/test1b.h.in +++ b/Tests/QtAutogen/RerunMocBasic/MocBasic/test1b.h.in diff --git a/Tests/QtAutogenRerun/dummy.cpp b/Tests/QtAutogen/RerunMocBasic/dummy.cpp index 4837a76..4837a76 100644 --- a/Tests/QtAutogenRerun/dummy.cpp +++ b/Tests/QtAutogen/RerunMocBasic/dummy.cpp diff --git a/Tests/QtAutogenRerun/mocPlugin.cmake b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt index 7ad5ccb..076de8b 100644 --- a/Tests/QtAutogenRerun/mocPlugin.cmake +++ b/Tests/QtAutogen/RerunMocPlugin/CMakeLists.txt @@ -1,16 +1,25 @@ +cmake_minimum_required(VERSION 3.10) +project(RerunMocPlugin) +include("../AutogenTest.cmake") + +# Tests Q_PLUGIN_METADATA and CMAKE_AUTOMOC_DEPEND_FILTERS +# json file change detection + +# Dummy executable to generate a clean target +add_executable(dummy dummy.cpp) # Utility variables set(timeformat "%Y%j%H%M%S") -set(mocPlugSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin") -set(mocPlugBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin") +set(mocPlugSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/MocPlugin") +set(mocPlugBinDir "${CMAKE_CURRENT_BINARY_DIR}/MocPlugin") # Initial buid try_compile(MOC_PLUGIN "${mocPlugBinDir}" "${mocPlugSrcDir}" - mocPlugin + MocPlugin CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}" - "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}" + "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" OUTPUT_VARIABLE output ) if (NOT MOC_PLUGIN) diff --git a/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt index b7cc5e9..bc0085f 100644 --- a/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/CMakeLists.txt @@ -1,19 +1,15 @@ -cmake_minimum_required(VERSION 3.9) -project(mocPlugin CXX) - -set(CMAKE_AUTOMOC_DEPEND_FILTERS - "A_CUSTOM_MACRO" - "[\n][ \t]*A_CUSTOM_MACRO[ \t\r\n]*\\([^,]+,[ \t\r\n]*\"([^\"]+)\"" - ) +cmake_minimum_required(VERSION 3.10) +project(MocPlugin) +include("../../AutogenTest.cmake") if (NOT QT_TEST_VERSION STREQUAL 5) message(SEND_ERROR "Invalid Qt version specified.") endif() -find_package(Qt5Widgets REQUIRED) -if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) - add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) -endif() +set(CMAKE_AUTOMOC_DEPEND_FILTERS + "A_CUSTOM_MACRO" + "[\n][ \t]*A_CUSTOM_MACRO[ \t\r\n]*\\([^,]+,[ \t\r\n]*\"([^\"]+)\"" +) configure_file(jsonIn/StyleC.json jsonFiles/StyleC.json) configure_file(jsonIn/StyleC.json jsonFiles/StyleC_Custom.json) @@ -22,7 +18,7 @@ configure_file(jsonIn/StyleD.json jsonFiles/sub/StyleD_Custom.json) configure_file(jsonIn/StyleE.json jsonFiles/StyleE.json) configure_file(jsonIn/StyleE.json jsonFiles/StyleE_Custom.json) -# Enable automoc +# Enable AUTOMOC set(CMAKE_AUTOMOC TRUE) include_directories("${CMAKE_CURRENT_BINARY_DIR}/jsonFiles") diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.cpp index b5e8753..b5e8753 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleA.cpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.cpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp index 35158a4..35158a4 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.hpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.json index cc33953..cc33953 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleA.json +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA.json diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA_Custom.json index cc33953..cc33953 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleA_Custom.json diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleB.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.cpp index 17d4400..17d4400 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleB.cpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.cpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp index 15b79c5..15b79c5 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleB.hpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleC.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.cpp index 37e7564..37e7564 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleC.cpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.cpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp index b0a4115..b0a4115 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleC.hpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleD.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.cpp index 7e4b121..7e4b121 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleD.cpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.cpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp index 9696aaa..9696aaa 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleD.hpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.cpp index 3448319..3448319 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.cpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.hpp index a069034..a069034 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleE.hpp diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp index f9734db..f9734db 100644 --- a/Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/StyleEInclude.hpp diff --git a/Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/UtilityMacros.hpp index 53a4284..53a4284 100644 --- a/Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/UtilityMacros.hpp diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB.json index cd155dc..cd155dc 100644 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB.json diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB_Custom.json index 129cac4..129cac4 100644 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleB_Custom.json diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleC.json index 119aaa4..119aaa4 100644 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleC.json diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleD.json index 732c547..732c547 100644 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleD.json diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleE.json index 5412c94..5412c94 100644 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/jsonIn/StyleE.json diff --git a/Tests/QtAutogenRerun/mocPlugin/main.cpp b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/main.cpp index 3ba2ddc..3ba2ddc 100644 --- a/Tests/QtAutogenRerun/mocPlugin/main.cpp +++ b/Tests/QtAutogen/RerunMocPlugin/MocPlugin/main.cpp diff --git a/Tests/QtAutogen/RerunMocPlugin/dummy.cpp b/Tests/QtAutogen/RerunMocPlugin/dummy.cpp new file mode 100644 index 0000000..4837a76 --- /dev/null +++ b/Tests/QtAutogen/RerunMocPlugin/dummy.cpp @@ -0,0 +1,5 @@ + +int main(int argv, char** args) +{ + return 0; +} diff --git a/Tests/QtAutogenRerun/rccDepends.cmake b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt index 68e1482..2e6a5bd 100644 --- a/Tests/QtAutogenRerun/rccDepends.cmake +++ b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt @@ -1,8 +1,17 @@ +cmake_minimum_required(VERSION 3.10) +project(RerunRccDepends) +include("../AutogenTest.cmake") + +# Tests rcc rebuilding when a resource file changes + +# Dummy executable to generate a clean target +add_executable(dummy dummy.cpp) + # When a .qrc or a file listed in a .qrc file changes, # the target must be rebuilt set(timeformat "%Y%j%H%M%S") -set(rccDepSD "${CMAKE_CURRENT_SOURCE_DIR}/rccDepends") -set(rccDepBD "${CMAKE_CURRENT_BINARY_DIR}/rccDepends") +set(rccDepSD "${CMAKE_CURRENT_SOURCE_DIR}/RccDepends") +set(rccDepBD "${CMAKE_CURRENT_BINARY_DIR}/RccDepends") # Initial build configure_file(${rccDepSD}/resPlainA.qrc.in ${rccDepBD}/resPlain.qrc COPYONLY) @@ -10,10 +19,9 @@ configure_file(${rccDepSD}/resGenA.qrc.in ${rccDepBD}/resGen.qrc.in COPYONLY) try_compile(RCC_DEPENDS "${rccDepBD}" "${rccDepSD}" - rccDepends - CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" - "-DQT_TEST_VERSION=${QT_TEST_VERSION}" - "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}" + RccDepends + CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}" + "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" OUTPUT_VARIABLE output ) if (NOT RCC_DEPENDS) diff --git a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt index 291592e..0507e61 100644 --- a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt @@ -1,17 +1,6 @@ -cmake_minimum_required(VERSION 3.9) -project(rccDepends CXX) - -if (QT_TEST_VERSION STREQUAL 4) - find_package(Qt4 REQUIRED) - set(QT_CORE_TARGET Qt4::QtCore) -else() - if (NOT QT_TEST_VERSION STREQUAL 5) - message(SEND_ERROR "Invalid Qt version specified.") - endif() - - find_package(Qt5Core REQUIRED) - set(QT_CORE_TARGET Qt5::Core) -endif() +cmake_minimum_required(VERSION 3.10) +project(RccDepends) +include("../../AutogenTest.cmake") # Enable AUTORCC for all targets set(CMAKE_AUTORCC ON) @@ -23,19 +12,22 @@ configure_file(resGen/input.txt.in resGen/input.txt COPYONLY) configure_file(resGen/input.txt.in resGen/inputAdded.txt COPYONLY) # Generated qrc file with dependency -add_custom_command(OUTPUT resGen.qrc +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc.in COMMAND ${CMAKE_COMMAND} -E sleep 2 - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc) + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc +) # Target that uses a plain .qrc file add_executable(rccDependsPlain main.cpp ${CMAKE_CURRENT_BINARY_DIR}/resPlain.qrc) -target_link_libraries(rccDependsPlain ${QT_CORE_TARGET}) +target_link_libraries(rccDependsPlain ${QT_QTCORE_TARGET}) add_custom_command(TARGET rccDependsPlain POST_BUILD COMMAND - ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsPlain>" > targetPlain.txt) + ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsPlain>" > targetPlain.txt +) # Target that uses a GENERATED .qrc file add_executable(rccDependsGen main.cpp ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc ) -target_link_libraries(rccDependsGen ${QT_CORE_TARGET}) +target_link_libraries(rccDependsGen ${QT_QTCORE_TARGET}) add_custom_command(TARGET rccDependsGen POST_BUILD COMMAND - ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsGen>" > targetGen.txt) + ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsGen>" > targetGen.txt +) diff --git a/Tests/QtAutogenRerun/rccDepends/main.cpp b/Tests/QtAutogen/RerunRccDepends/RccDepends/main.cpp index 766b775..766b775 100644 --- a/Tests/QtAutogenRerun/rccDepends/main.cpp +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/main.cpp diff --git a/Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/input.txt.in index 4f24589..4f24589 100644 --- a/Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/input.txt.in diff --git a/Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/inputAdded.txt.in index 4f24589..4f24589 100644 --- a/Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/inputAdded.txt.in diff --git a/Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGenA.qrc.in index c131a34..c131a34 100644 --- a/Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGenA.qrc.in diff --git a/Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGenB.qrc.in index 8c7e643..8c7e643 100644 --- a/Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGenB.qrc.in diff --git a/Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/input.txt.in index a5e407a..a5e407a 100644 --- a/Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/input.txt.in diff --git a/Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/inputAdded.txt.in index a5e407a..a5e407a 100644 --- a/Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/inputAdded.txt.in diff --git a/Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainA.qrc.in index c135d85..c135d85 100644 --- a/Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainA.qrc.in diff --git a/Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainB.qrc.in index 186b653..186b653 100644 --- a/Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in +++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainB.qrc.in diff --git a/Tests/QtAutogen/RerunRccDepends/dummy.cpp b/Tests/QtAutogen/RerunRccDepends/dummy.cpp new file mode 100644 index 0000000..4837a76 --- /dev/null +++ b/Tests/QtAutogen/RerunRccDepends/dummy.cpp @@ -0,0 +1,5 @@ + +int main(int argv, char** args) +{ + return 0; +} diff --git a/Tests/QtAutogen/sameName/CMakeLists.txt b/Tests/QtAutogen/SameName/CMakeLists.txt index f695875..c7d6e52 100644 --- a/Tests/QtAutogen/sameName/CMakeLists.txt +++ b/Tests/QtAutogen/SameName/CMakeLists.txt @@ -1,3 +1,7 @@ +cmake_minimum_required(VERSION 3.10) +project(SameName) +include("../AutogenTest.cmake") + # Test AUTOMOC and AUTORCC on source files with the same name # but in different subdirectories @@ -20,7 +24,8 @@ target_link_libraries(sameName ${QT_LIBRARIES}) set_target_properties(sameName PROPERTIES AUTOMOC TRUE AUTOUIC TRUE - AUTORCC TRUE) + AUTORCC TRUE +) # Set different compression levels if (QT_TEST_VERSION STREQUAL 4) diff --git a/Tests/QtAutogen/sameName/aaa/bbb/data.qrc b/Tests/QtAutogen/SameName/aaa/bbb/data.qrc index 0ea3537..0ea3537 100644 --- a/Tests/QtAutogen/sameName/aaa/bbb/data.qrc +++ b/Tests/QtAutogen/SameName/aaa/bbb/data.qrc diff --git a/Tests/QtAutogen/sameName/aaa/bbb/item.cpp b/Tests/QtAutogen/SameName/aaa/bbb/item.cpp index 850206f..850206f 100644 --- a/Tests/QtAutogen/sameName/aaa/bbb/item.cpp +++ b/Tests/QtAutogen/SameName/aaa/bbb/item.cpp diff --git a/Tests/QtAutogen/sameName/aaa/bbb/item.hpp b/Tests/QtAutogen/SameName/aaa/bbb/item.hpp index 0855043..0855043 100644 --- a/Tests/QtAutogen/sameName/aaa/bbb/item.hpp +++ b/Tests/QtAutogen/SameName/aaa/bbb/item.hpp diff --git a/Tests/QtAutogen/sameName/aaa/data.qrc b/Tests/QtAutogen/SameName/aaa/data.qrc index 379af60..379af60 100644 --- a/Tests/QtAutogen/sameName/aaa/data.qrc +++ b/Tests/QtAutogen/SameName/aaa/data.qrc diff --git a/Tests/QtAutogen/sameName/aaa/item.cpp b/Tests/QtAutogen/SameName/aaa/item.cpp index e35d3d1..e35d3d1 100644 --- a/Tests/QtAutogen/sameName/aaa/item.cpp +++ b/Tests/QtAutogen/SameName/aaa/item.cpp diff --git a/Tests/QtAutogen/sameName/aaa/item.hpp b/Tests/QtAutogen/SameName/aaa/item.hpp index 875f72f..875f72f 100644 --- a/Tests/QtAutogen/sameName/aaa/item.hpp +++ b/Tests/QtAutogen/SameName/aaa/item.hpp diff --git a/Tests/QtAutogen/sameName/aaa/view.ui b/Tests/QtAutogen/SameName/aaa/view.ui index 0f09980..0f09980 100644 --- a/Tests/QtAutogen/sameName/aaa/view.ui +++ b/Tests/QtAutogen/SameName/aaa/view.ui diff --git a/Tests/QtAutogen/sameName/bbb/aaa/data.qrc b/Tests/QtAutogen/SameName/bbb/aaa/data.qrc index da98009..da98009 100644 --- a/Tests/QtAutogen/sameName/bbb/aaa/data.qrc +++ b/Tests/QtAutogen/SameName/bbb/aaa/data.qrc diff --git a/Tests/QtAutogen/sameName/bbb/aaa/item.cpp b/Tests/QtAutogen/SameName/bbb/aaa/item.cpp index 7ad01c3..7ad01c3 100644 --- a/Tests/QtAutogen/sameName/bbb/aaa/item.cpp +++ b/Tests/QtAutogen/SameName/bbb/aaa/item.cpp diff --git a/Tests/QtAutogen/sameName/bbb/aaa/item.hpp b/Tests/QtAutogen/SameName/bbb/aaa/item.hpp index be07ca8..be07ca8 100644 --- a/Tests/QtAutogen/sameName/bbb/aaa/item.hpp +++ b/Tests/QtAutogen/SameName/bbb/aaa/item.hpp diff --git a/Tests/QtAutogen/sameName/bbb/data.qrc b/Tests/QtAutogen/SameName/bbb/data.qrc index 5b080f5..5b080f5 100644 --- a/Tests/QtAutogen/sameName/bbb/data.qrc +++ b/Tests/QtAutogen/SameName/bbb/data.qrc diff --git a/Tests/QtAutogen/sameName/bbb/item.cpp b/Tests/QtAutogen/SameName/bbb/item.cpp index 9ef128e..9ef128e 100644 --- a/Tests/QtAutogen/sameName/bbb/item.cpp +++ b/Tests/QtAutogen/SameName/bbb/item.cpp diff --git a/Tests/QtAutogen/sameName/bbb/item.hpp b/Tests/QtAutogen/SameName/bbb/item.hpp index d39a9d7..d39a9d7 100644 --- a/Tests/QtAutogen/sameName/bbb/item.hpp +++ b/Tests/QtAutogen/SameName/bbb/item.hpp diff --git a/Tests/QtAutogen/sameName/bbb/view.ui b/Tests/QtAutogen/SameName/bbb/view.ui index a8f506e..a8f506e 100644 --- a/Tests/QtAutogen/sameName/bbb/view.ui +++ b/Tests/QtAutogen/SameName/bbb/view.ui diff --git a/Tests/QtAutogen/sameName/ccc/data.qrc b/Tests/QtAutogen/SameName/ccc/data.qrc index f934c39..f934c39 100644 --- a/Tests/QtAutogen/sameName/ccc/data.qrc +++ b/Tests/QtAutogen/SameName/ccc/data.qrc diff --git a/Tests/QtAutogen/sameName/ccc/item.cpp b/Tests/QtAutogen/SameName/ccc/item.cpp index ab8a281..ab8a281 100644 --- a/Tests/QtAutogen/sameName/ccc/item.cpp +++ b/Tests/QtAutogen/SameName/ccc/item.cpp diff --git a/Tests/QtAutogen/sameName/ccc/item.hpp b/Tests/QtAutogen/SameName/ccc/item.hpp index 20d9dd9..20d9dd9 100644 --- a/Tests/QtAutogen/sameName/ccc/item.hpp +++ b/Tests/QtAutogen/SameName/ccc/item.hpp diff --git a/Tests/QtAutogen/sameName/ccc/view.ui b/Tests/QtAutogen/SameName/ccc/view.ui index 7989c69..7989c69 100644 --- a/Tests/QtAutogen/sameName/ccc/view.ui +++ b/Tests/QtAutogen/SameName/ccc/view.ui diff --git a/Tests/QtAutogen/sameName/data.qrc b/Tests/QtAutogen/SameName/data.qrc index 4ce0b4e..4ce0b4e 100644 --- a/Tests/QtAutogen/sameName/data.qrc +++ b/Tests/QtAutogen/SameName/data.qrc diff --git a/Tests/QtAutogen/sameName/item.cpp b/Tests/QtAutogen/SameName/item.cpp index 3d1fbe7..3d1fbe7 100644 --- a/Tests/QtAutogen/sameName/item.cpp +++ b/Tests/QtAutogen/SameName/item.cpp diff --git a/Tests/QtAutogen/sameName/item.hpp b/Tests/QtAutogen/SameName/item.hpp index 75e83f4..75e83f4 100644 --- a/Tests/QtAutogen/sameName/item.hpp +++ b/Tests/QtAutogen/SameName/item.hpp diff --git a/Tests/QtAutogen/sameName/main.cpp b/Tests/QtAutogen/SameName/main.cpp index a4ffcb3..a4ffcb3 100644 --- a/Tests/QtAutogen/sameName/main.cpp +++ b/Tests/QtAutogen/SameName/main.cpp diff --git a/Tests/QtAutogen/sameName/view.ui b/Tests/QtAutogen/SameName/view.ui index 2ffe734..2ffe734 100644 --- a/Tests/QtAutogen/sameName/view.ui +++ b/Tests/QtAutogen/SameName/view.ui diff --git a/Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt index 144a435..0c2f987 100644 --- a/Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt +++ b/Tests/QtAutogen/StaticLibraryCycle/CMakeLists.txt @@ -1,5 +1,8 @@ -# Test AUTOMOC and AUTORCC on source files with the same name -# but in different subdirectories +cmake_minimum_required(VERSION 3.10) +project(StaticLibraryCycle) +include("../AutogenTest.cmake") + +# Test AUTOMOC on cyclic static libraries set(CMAKE_AUTOMOC ON) diff --git a/Tests/QtAutogen/StaticLibraryCycle/a.cpp b/Tests/QtAutogen/StaticLibraryCycle/a.cpp new file mode 100644 index 0000000..faa52e6 --- /dev/null +++ b/Tests/QtAutogen/StaticLibraryCycle/a.cpp @@ -0,0 +1,12 @@ +#include "a.h" +#include "b.h" + +bool A::recursed = false; + +A::A() +{ + if (!A::recursed) { + A::recursed = true; + B b; + } +} diff --git a/Tests/QtAutogen/staticLibraryCycle/a.h b/Tests/QtAutogen/StaticLibraryCycle/a.h index 7176170..f24398e 100644 --- a/Tests/QtAutogen/staticLibraryCycle/a.h +++ b/Tests/QtAutogen/StaticLibraryCycle/a.h @@ -6,6 +6,8 @@ class A : public QObject { Q_OBJECT + static bool recursed; + public: A(); }; diff --git a/Tests/QtAutogen/staticLibraryCycle/b.cpp b/Tests/QtAutogen/StaticLibraryCycle/b.cpp index a807d89..a807d89 100644 --- a/Tests/QtAutogen/staticLibraryCycle/b.cpp +++ b/Tests/QtAutogen/StaticLibraryCycle/b.cpp diff --git a/Tests/QtAutogen/staticLibraryCycle/b.h b/Tests/QtAutogen/StaticLibraryCycle/b.h index ededbd8..ededbd8 100644 --- a/Tests/QtAutogen/staticLibraryCycle/b.h +++ b/Tests/QtAutogen/StaticLibraryCycle/b.h diff --git a/Tests/QtAutogen/staticLibraryCycle/c.cpp b/Tests/QtAutogen/StaticLibraryCycle/c.cpp index 7d427c2..7d427c2 100644 --- a/Tests/QtAutogen/staticLibraryCycle/c.cpp +++ b/Tests/QtAutogen/StaticLibraryCycle/c.cpp diff --git a/Tests/QtAutogen/staticLibraryCycle/c.h b/Tests/QtAutogen/StaticLibraryCycle/c.h index 20f3725..20f3725 100644 --- a/Tests/QtAutogen/staticLibraryCycle/c.h +++ b/Tests/QtAutogen/StaticLibraryCycle/c.h diff --git a/Tests/QtAutogen/staticLibraryCycle/main.cpp b/Tests/QtAutogen/StaticLibraryCycle/main.cpp index f5b7fd2..f5b7fd2 100644 --- a/Tests/QtAutogen/staticLibraryCycle/main.cpp +++ b/Tests/QtAutogen/StaticLibraryCycle/main.cpp diff --git a/Tests/QtAutogen/TestMacros.cmake b/Tests/QtAutogen/TestMacros.cmake new file mode 100644 index 0000000..966f3b8 --- /dev/null +++ b/Tests/QtAutogen/TestMacros.cmake @@ -0,0 +1,60 @@ +# Autogen build options +set(Autogen_BUILD_OPTIONS "-DQT_TEST_VERSION=${QT_TEST_VERSION}") +if(NOT CMAKE_CONFIGURATION_TYPES) + list(APPEND Autogen_BUILD_OPTIONS "-DCMAKE_BUILD_TYPE=$<CONFIGURATION>") +endif() +list(APPEND Autogen_BUILD_OPTIONS + "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" +) + +# A macro to add a QtAutogen test +macro(ADD_AUTOGEN_TEST NAME) + if(${ARGC} GREATER 1) + # On Windows there is no RPATH, so while Qt might be available for building, + # the required dlls may not be in the PATH, so we can't run the executables + # on that platform. + if(WIN32) + set(_TestCommand --test-command ${CMAKE_CTEST_COMMAND} -V) + else() + set(_TestCommand --test-command ${ARGN}) + endif() + endif() + + set(_QtXAutogen "Qt${QT_TEST_VERSION}Autogen") + set(_SourceDir "${CMake_SOURCE_DIR}/Tests/QtAutogen/${NAME}") + set(_BuildDir "${CMake_BINARY_DIR}/Tests/${_QtXAutogen}/${NAME}") + add_test(NAME "${_QtXAutogen}.${NAME}" COMMAND "${CMAKE_CTEST_COMMAND}" + --build-and-test + "${_SourceDir}" + "${_BuildDir}" + ${build_generator_args} + --build-project ${NAME} + --build-exe-dir "${_BuildDir}" + --force-new-ctest-process + --build-options ${build_options} ${Autogen_BUILD_OPTIONS} + ${_TestCommand} + ) + list(APPEND TEST_BUILD_DIRS "${_BuildDir}") + unset(_TestCommand) + unset(_QtXAutogen) + unset(_SourceDir) + unset(_BuildDir) +endmacro() + +# Allow using qtx_wrap_cpp and qtx_generate_moc or not +set(QT_TEST_ALLOW_QT_MACROS TRUE) +# Do a simple check if there is are non ASCII character in the build path +string(REGEX MATCH "[^ -~]+" NON_ASCII_BDIR ${CMAKE_CURRENT_BINARY_DIR}) +if(NON_ASCII_BDIR) + # Qt4 moc does not support utf8 paths in _parameter files generated by + # qtx_wrap_cpp + # https://bugreports.qt.io/browse/QTBUG-35480 + if(QT_TEST_VERSION STREQUAL 4) + set(QT_TEST_ALLOW_QT_MACROS FALSE) + endif() + # On windows qtx_wrap_cpp also fails in Qt5 when used on a path that + # contains non ASCII characters + if(WIN32) + set(QT_TEST_ALLOW_QT_MACROS FALSE) + endif() +endif() diff --git a/Tests/QtAutogen/uicInclude/CMakeLists.txt b/Tests/QtAutogen/UicInclude/CMakeLists.txt index f62ebb0..56f76fb 100644 --- a/Tests/QtAutogen/uicInclude/CMakeLists.txt +++ b/Tests/QtAutogen/UicInclude/CMakeLists.txt @@ -1,5 +1,8 @@ -# Test moc include patterns +cmake_minimum_required(VERSION 3.10) +project(UicInclude) +include("../AutogenTest.cmake") +# Test uic include patterns set(CMAKE_AUTOUIC_SEARCH_PATHS "dirA") add_executable(uicInclude main.cpp) diff --git a/Tests/QtAutogen/uicInclude/PageC.ui b/Tests/QtAutogen/UicInclude/PageC.ui index bb2fb5e..bb2fb5e 100644 --- a/Tests/QtAutogen/uicInclude/PageC.ui +++ b/Tests/QtAutogen/UicInclude/PageC.ui diff --git a/Tests/QtAutogen/uicInclude/PageC2.ui b/Tests/QtAutogen/UicInclude/PageC2.ui index daab868..daab868 100644 --- a/Tests/QtAutogen/uicInclude/PageC2.ui +++ b/Tests/QtAutogen/UicInclude/PageC2.ui diff --git a/Tests/QtAutogen/uicInclude/dirA/PageA.ui b/Tests/QtAutogen/UicInclude/dirA/PageA.ui index dd81802..dd81802 100644 --- a/Tests/QtAutogen/uicInclude/dirA/PageA.ui +++ b/Tests/QtAutogen/UicInclude/dirA/PageA.ui diff --git a/Tests/QtAutogen/uicInclude/dirB/PageB.ui b/Tests/QtAutogen/UicInclude/dirB/PageB.ui index fa6dfa6..fa6dfa6 100644 --- a/Tests/QtAutogen/uicInclude/dirB/PageB.ui +++ b/Tests/QtAutogen/UicInclude/dirB/PageB.ui diff --git a/Tests/QtAutogen/uicInclude/dirB/PageB2.ui b/Tests/QtAutogen/UicInclude/dirB/PageB2.ui index 2225150..2225150 100644 --- a/Tests/QtAutogen/uicInclude/dirB/PageB2.ui +++ b/Tests/QtAutogen/UicInclude/dirB/PageB2.ui diff --git a/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui b/Tests/QtAutogen/UicInclude/dirB/subB/PageBsub.ui index 873016e..873016e 100644 --- a/Tests/QtAutogen/uicInclude/dirB/subB/PageBsub.ui +++ b/Tests/QtAutogen/UicInclude/dirB/subB/PageBsub.ui diff --git a/Tests/QtAutogen/uicInclude/main.cpp b/Tests/QtAutogen/UicInclude/main.cpp index c8e7609..c8e7609 100644 --- a/Tests/QtAutogen/uicInclude/main.cpp +++ b/Tests/QtAutogen/UicInclude/main.cpp diff --git a/Tests/QtAutogen/uicInclude/main.hpp b/Tests/QtAutogen/UicInclude/main.hpp index 58ddc26..58ddc26 100644 --- a/Tests/QtAutogen/uicInclude/main.hpp +++ b/Tests/QtAutogen/UicInclude/main.hpp diff --git a/Tests/QtAutogen/uicInclude/subC/PageCsub.ui b/Tests/QtAutogen/UicInclude/subC/PageCsub.ui index 0268326..0268326 100644 --- a/Tests/QtAutogen/uicInclude/subC/PageCsub.ui +++ b/Tests/QtAutogen/UicInclude/subC/PageCsub.ui diff --git a/Tests/QtAutoUicInterface/CMakeLists.txt b/Tests/QtAutogen/UicInterface/CMakeLists.txt index a5c2d99..a216aff 100644 --- a/Tests/QtAutoUicInterface/CMakeLists.txt +++ b/Tests/QtAutogen/UicInterface/CMakeLists.txt @@ -1,24 +1,6 @@ - -cmake_minimum_required(VERSION 3.7) - -project(QtAutoUicInterface) - -if (QT_TEST_VERSION STREQUAL 4) - find_package(Qt4 REQUIRED) - - include(UseQt4) - - set(QT_CORE_TARGET Qt4::QtCore) - set(QT_GUI_TARGET Qt4::QtGui) -else() - if (NOT QT_TEST_VERSION STREQUAL 5) - message(SEND_ERROR "Invalid Qt version specified.") - endif() - find_package(Qt5Widgets REQUIRED) - - set(QT_CORE_TARGET Qt5::Core) - set(QT_GUI_TARGET Qt5::Widgets) -endif() +cmake_minimum_required(VERSION 3.10) +project(UicInterface) +include("../AutogenTest.cmake") set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) set(CMAKE_AUTOMOC ON) @@ -29,7 +11,7 @@ set(CMAKE_AUTOUIC ON) set(CMAKE_VERBOSE_MAKEFILE ON) add_library(KI18n klocalizedstring.cpp) -target_link_libraries(KI18n ${QT_CORE_TARGET}) +target_link_libraries(KI18n ${QT_QTCORE_TARGET}) set(autouic_options -tr tr2$<$<NOT:$<BOOL:$<TARGET_PROPERTY:NO_KUIT_SEMANTIC>>>:x>i18n @@ -61,12 +43,12 @@ set(INC_DIR "include" ) endif() add_library(LibWidget libwidget.cpp) -target_link_libraries(LibWidget KI18n ${QT_GUI_TARGET}) +target_link_libraries(LibWidget KI18n ${QT_QTGUI_TARGET}) set_property(TARGET LibWidget PROPERTY NO_KUIT_SEMANTIC ON) set_property(TARGET LibWidget PROPERTY TRANSLATION_DOMAIN customdomain) add_library(MyWidget mywidget.cpp) -target_link_libraries(MyWidget KI18n ${QT_GUI_TARGET}) +target_link_libraries(MyWidget KI18n ${QT_QTGUI_TARGET}) add_executable(QtAutoUicInterface main.cpp) target_compile_definitions(QtAutoUicInterface diff --git a/Tests/QtAutoUicInterface/klocalizedstring.cpp b/Tests/QtAutogen/UicInterface/klocalizedstring.cpp index b629cd1..b629cd1 100644 --- a/Tests/QtAutoUicInterface/klocalizedstring.cpp +++ b/Tests/QtAutogen/UicInterface/klocalizedstring.cpp diff --git a/Tests/QtAutoUicInterface/klocalizedstring.h b/Tests/QtAutogen/UicInterface/klocalizedstring.h index 6129599..6129599 100644 --- a/Tests/QtAutoUicInterface/klocalizedstring.h +++ b/Tests/QtAutogen/UicInterface/klocalizedstring.h diff --git a/Tests/QtAutoUicInterface/libwidget.cpp b/Tests/QtAutogen/UicInterface/libwidget.cpp index 008c22a..008c22a 100644 --- a/Tests/QtAutoUicInterface/libwidget.cpp +++ b/Tests/QtAutogen/UicInterface/libwidget.cpp diff --git a/Tests/QtAutoUicInterface/libwidget.h b/Tests/QtAutogen/UicInterface/libwidget.h index b6f3e82..b6f3e82 100644 --- a/Tests/QtAutoUicInterface/libwidget.h +++ b/Tests/QtAutogen/UicInterface/libwidget.h diff --git a/Tests/QtAutoUicInterface/libwidget.ui b/Tests/QtAutogen/UicInterface/libwidget.ui index 897371e..897371e 100644 --- a/Tests/QtAutoUicInterface/libwidget.ui +++ b/Tests/QtAutogen/UicInterface/libwidget.ui diff --git a/Tests/QtAutoUicInterface/main.cpp b/Tests/QtAutogen/UicInterface/main.cpp index 68bd843..68bd843 100644 --- a/Tests/QtAutoUicInterface/main.cpp +++ b/Tests/QtAutogen/UicInterface/main.cpp diff --git a/Tests/QtAutoUicInterface/mywidget.cpp b/Tests/QtAutogen/UicInterface/mywidget.cpp index 7cf1a13..7cf1a13 100644 --- a/Tests/QtAutoUicInterface/mywidget.cpp +++ b/Tests/QtAutogen/UicInterface/mywidget.cpp diff --git a/Tests/QtAutoUicInterface/mywidget.h b/Tests/QtAutogen/UicInterface/mywidget.h index c23e55d..c23e55d 100644 --- a/Tests/QtAutoUicInterface/mywidget.h +++ b/Tests/QtAutogen/UicInterface/mywidget.h diff --git a/Tests/QtAutoUicInterface/mywidget.ui b/Tests/QtAutogen/UicInterface/mywidget.ui index b2b9cc5..b2b9cc5 100644 --- a/Tests/QtAutoUicInterface/mywidget.ui +++ b/Tests/QtAutogen/UicInterface/mywidget.ui diff --git a/Tests/QtAutogen/UicOnly/CMakeLists.txt b/Tests/QtAutogen/UicOnly/CMakeLists.txt new file mode 100644 index 0000000..89a9a1b --- /dev/null +++ b/Tests/QtAutogen/UicOnly/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.10) +project(UicOnly) +include("../AutogenTest.cmake") + +# Test AUTOUIC being enabled only +# The moc is provided by the Qt macro +qtx_wrap_cpp(uicOnlyMoc uiconly.h) +add_executable(uicOnly uiconly.cpp ${uicOnlyMoc}) +set_property(TARGET uicOnly PROPERTY AUTOUIC ON) +target_link_libraries(uicOnly ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/uicOnlySource/uiconly.cpp b/Tests/QtAutogen/UicOnly/uiconly.cpp index 7b91b25..7b91b25 100644 --- a/Tests/QtAutogen/uicOnlySource/uiconly.cpp +++ b/Tests/QtAutogen/UicOnly/uiconly.cpp diff --git a/Tests/QtAutogen/uicOnlySource/uiconly.h b/Tests/QtAutogen/UicOnly/uiconly.h index 8f4eebe..8f4eebe 100644 --- a/Tests/QtAutogen/uicOnlySource/uiconly.h +++ b/Tests/QtAutogen/UicOnly/uiconly.h diff --git a/Tests/QtAutogen/uicOnlySource/uiconly.ui b/Tests/QtAutogen/UicOnly/uiconly.ui index 13fb832..13fb832 100644 --- a/Tests/QtAutogen/uicOnlySource/uiconly.ui +++ b/Tests/QtAutogen/UicOnly/uiconly.ui diff --git a/Tests/QtAutogen/UicSkipSource/CMakeLists.txt b/Tests/QtAutogen/UicSkipSource/CMakeLists.txt new file mode 100644 index 0000000..e94864d --- /dev/null +++ b/Tests/QtAutogen/UicSkipSource/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.10) +project(UicSkipSource) +include("../AutogenTest.cmake") + +# Test for SKIP_AUTOUIC and SKIP_AUTOGEN on an AUTOUIC enabled target +set(skipUicSources + skipUic.cpp + skipUicGen.cpp + skipUicNoGen1.cpp + skipUicNoGen2.cpp +) +set_property(SOURCE skipUicNoGen1.cpp PROPERTY SKIP_AUTOUIC ON) +set_property(SOURCE skipUicNoGen2.cpp PROPERTY SKIP_AUTOGEN ON) +# AUTOUIC enabled +add_executable(skipUicA ${skipUicSources}) +set_property(TARGET skipUicA PROPERTY AUTOUIC ON) +target_link_libraries(skipUicA ${QT_LIBRARIES}) +# AUTOUIC and AUTOMOC enabled +add_executable(skipUicB ${skipUicSources}) +set_property(TARGET skipUicB PROPERTY AUTOUIC ON) +set_property(TARGET skipUicB PROPERTY AUTOMOC ON) +target_link_libraries(skipUicB ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/skipUic.cpp b/Tests/QtAutogen/UicSkipSource/skipUic.cpp index 0adf011..c4a7ce9 100644 --- a/Tests/QtAutogen/skipUic.cpp +++ b/Tests/QtAutogen/UicSkipSource/skipUic.cpp @@ -1,7 +1,7 @@ -#include "skipSource/skipUicGen.hpp" -#include "skipSource/skipUicNoGen1.hpp" -#include "skipSource/skipUicNoGen2.hpp" +#include "skipUicGen.hpp" +#include "skipUicNoGen1.hpp" +#include "skipUicNoGen2.hpp" int main(int, char**) { diff --git a/Tests/QtAutogen/skipSource/skipUicGen.cpp b/Tests/QtAutogen/UicSkipSource/skipUicGen.cpp index d2a55a6..d2a55a6 100644 --- a/Tests/QtAutogen/skipSource/skipUicGen.cpp +++ b/Tests/QtAutogen/UicSkipSource/skipUicGen.cpp diff --git a/Tests/QtAutogen/skipSource/skipUicGen.hpp b/Tests/QtAutogen/UicSkipSource/skipUicGen.hpp index 3669f0e..3669f0e 100644 --- a/Tests/QtAutogen/skipSource/skipUicGen.hpp +++ b/Tests/QtAutogen/UicSkipSource/skipUicGen.hpp diff --git a/Tests/QtAutogen/skipSource/skipUicNoGen1.cpp b/Tests/QtAutogen/UicSkipSource/skipUicNoGen1.cpp index f591a42..f591a42 100644 --- a/Tests/QtAutogen/skipSource/skipUicNoGen1.cpp +++ b/Tests/QtAutogen/UicSkipSource/skipUicNoGen1.cpp diff --git a/Tests/QtAutogen/skipSource/skipUicNoGen1.hpp b/Tests/QtAutogen/UicSkipSource/skipUicNoGen1.hpp index 2864695..2864695 100644 --- a/Tests/QtAutogen/skipSource/skipUicNoGen1.hpp +++ b/Tests/QtAutogen/UicSkipSource/skipUicNoGen1.hpp diff --git a/Tests/QtAutogen/skipSource/skipUicNoGen2.cpp b/Tests/QtAutogen/UicSkipSource/skipUicNoGen2.cpp index 8c1c324..8c1c324 100644 --- a/Tests/QtAutogen/skipSource/skipUicNoGen2.cpp +++ b/Tests/QtAutogen/UicSkipSource/skipUicNoGen2.cpp diff --git a/Tests/QtAutogen/skipSource/skipUicNoGen2.hpp b/Tests/QtAutogen/UicSkipSource/skipUicNoGen2.hpp index 7c38193..7c38193 100644 --- a/Tests/QtAutogen/skipSource/skipUicNoGen2.hpp +++ b/Tests/QtAutogen/UicSkipSource/skipUicNoGen2.hpp diff --git a/Tests/QtAutogen/skipSource/ui_nogen1.h b/Tests/QtAutogen/UicSkipSource/ui_nogen1.h index a7be52b..a7be52b 100644 --- a/Tests/QtAutogen/skipSource/ui_nogen1.h +++ b/Tests/QtAutogen/UicSkipSource/ui_nogen1.h diff --git a/Tests/QtAutogen/skipSource/ui_nogen2.h b/Tests/QtAutogen/UicSkipSource/ui_nogen2.h index 5d547d4..4e500a4 100644 --- a/Tests/QtAutogen/skipSource/ui_nogen2.h +++ b/Tests/QtAutogen/UicSkipSource/ui_nogen2.h @@ -3,4 +3,4 @@ void ui_nogen2(); -#endif
\ No newline at end of file +#endif diff --git a/Tests/QtAutogen/skipSource/uigen1.ui b/Tests/QtAutogen/UicSkipSource/uigen1.ui index fc7cb82..fc7cb82 100644 --- a/Tests/QtAutogen/skipSource/uigen1.ui +++ b/Tests/QtAutogen/UicSkipSource/uigen1.ui diff --git a/Tests/QtAutogen/skipSource/uigen2.ui b/Tests/QtAutogen/UicSkipSource/uigen2.ui index 01f08d2..01f08d2 100644 --- a/Tests/QtAutogen/skipSource/uigen2.ui +++ b/Tests/QtAutogen/UicSkipSource/uigen2.ui diff --git a/Tests/QtAutogen/defines_test/CMakeLists.txt b/Tests/QtAutogen/defines_test/CMakeLists.txt deleted file mode 100644 index 9ee9a22..0000000 --- a/Tests/QtAutogen/defines_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ - -add_executable(defines_test defines_test.cpp) -set_target_properties(defines_test PROPERTIES AUTOMOC TRUE) -target_link_libraries(defines_test Qt4::QtGui) diff --git a/Tests/QtAutogen/defines_test/defines_test.cpp b/Tests/QtAutogen/defines_test/defines_test.cpp deleted file mode 100644 index cf4e9cb..0000000 --- a/Tests/QtAutogen/defines_test/defines_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ - -#include <QObject> - -#ifdef QT_GUI_LIB -#include <QTextDocument> - -class SomeDocument : public QTextDocument -{ - Q_OBJECT - -Q_SIGNALS: - void someSig(); -}; -#endif - -#ifdef QT_CORE_LIB -class SomeObject : public QObject -{ - Q_OBJECT - -Q_SIGNALS: - void someSig(); -}; -#endif - -int main(int argc, char** argv) -{ -#ifdef QT_CORE_LIB - QMetaObject sosmo = SomeObject::staticMetaObject; -#endif -#ifdef QT_GUI_LIB - QMetaObject sdsmo = SomeDocument::staticMetaObject; -#endif - - return 0; -} - -#include "defines_test.moc" diff --git a/Tests/QtAutogen/mocCMP0071/CMakeLists.txt b/Tests/QtAutogen/mocCMP0071/CMakeLists.txt deleted file mode 100644 index 003fa08..0000000 --- a/Tests/QtAutogen/mocCMP0071/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(mocCMP0071 CXX) -add_subdirectory(OLD) -add_subdirectory(NEW) diff --git a/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt b/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt deleted file mode 100644 index 789354a..0000000 --- a/Tests/QtAutogen/mocIncludeStrict/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# Test moc include patterns - -set(CMAKE_AUTOMOC_RELAXED_MODE FALSE) -set(MOC_INCLUDE_NAME "mocIncludeStrict") - -include(${CMAKE_CURRENT_SOURCE_DIR}/../mocInclude/shared.cmake) diff --git a/Tests/QtAutogen/mocMacroName/CMakeLists.txt b/Tests/QtAutogen/mocMacroName/CMakeLists.txt deleted file mode 100644 index 08e6803..0000000 --- a/Tests/QtAutogen/mocMacroName/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -cmake_minimum_required(VERSION 3.9) - -list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS") - -add_executable(mmn main.cpp Gadget.cpp Object.cpp Object1Aliased.cpp Object2Aliased.cpp) -set_property(TARGET mmn PROPERTY AUTOMOC ON) -set_property(TARGET mmn APPEND PROPERTY AUTOMOC_MACRO_NAMES "QO2_ALIAS") -target_link_libraries(mmn ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/staticLibraryCycle/a.cpp b/Tests/QtAutogen/staticLibraryCycle/a.cpp deleted file mode 100644 index 97cc66e..0000000 --- a/Tests/QtAutogen/staticLibraryCycle/a.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "a.h" -#include "b.h" - -A::A() -{ - B b; -} diff --git a/Tests/QtAutogenRerun/CMakeLists.txt b/Tests/QtAutogenRerun/CMakeLists.txt deleted file mode 100644 index e72c191..0000000 --- a/Tests/QtAutogenRerun/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -cmake_policy(SET CMP0071 NEW) -project(QtAutogenRerun) - -# Tell find_package(Qt5) where to find Qt. -if(QT_QMAKE_EXECUTABLE) - get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH) - get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH) - set(CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR}) -endif() - -if (QT_TEST_VERSION STREQUAL 4) - find_package(Qt4 REQUIRED) - - # Include this directory before using the UseQt4 file. - add_subdirectory(defines_test) - - include(UseQt4) - - set(QT_QTCORE_TARGET Qt4::QtCore) - -else() - if (NOT QT_TEST_VERSION STREQUAL 5) - message(SEND_ERROR "Invalid Qt version specified.") - endif() - find_package(Qt5Widgets REQUIRED) - - set(QT_QTCORE_TARGET Qt5::Core) - - include_directories(${Qt5Widgets_INCLUDE_DIRS}) - set(QT_LIBRARIES Qt5::Widgets) - - if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) - add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) - endif() - -endif() - -# Dummy executable to generate clean target -add_executable(dummy dummy.cpp) - -# -- Test -include("mocRerun.cmake") - -# -- Test -# Tests Q_PLUGIN_METADATA json file change detection -if (NOT QT_TEST_VERSION STREQUAL 4) - include("mocPlugin.cmake") -endif() - -# -- Test -include("rccDepends.cmake") diff --git a/Tests/QtAutogenRerun/defines_test/CMakeLists.txt b/Tests/QtAutogenRerun/defines_test/CMakeLists.txt deleted file mode 100644 index 9ee9a22..0000000 --- a/Tests/QtAutogenRerun/defines_test/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ - -add_executable(defines_test defines_test.cpp) -set_target_properties(defines_test PROPERTIES AUTOMOC TRUE) -target_link_libraries(defines_test Qt4::QtGui) diff --git a/Tests/QtAutogenRerun/mocRerun.cmake b/Tests/QtAutogenRerun/mocRerun.cmake deleted file mode 100644 index a92912b..0000000 --- a/Tests/QtAutogenRerun/mocRerun.cmake +++ /dev/null @@ -1,60 +0,0 @@ - -set(timeformat "%Y%j%H%M%S") -set(mocRerunSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/mocRerun") -set(mocRerunBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocRerun") - -# Initial build -configure_file("${mocRerunSrcDir}/test1a.h.in" "${mocRerunBinDir}/test1.h" COPYONLY) -try_compile(MOC_RERUN - "${mocRerunBinDir}" - "${mocRerunSrcDir}" - mocRerun - CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" - "-DQT_TEST_VERSION=${QT_TEST_VERSION}" - "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}" - OUTPUT_VARIABLE output -) -if (NOT MOC_RERUN) - message(SEND_ERROR "Initial build of mocRerun failed. Output: ${output}") -endif() -# Get name of the output binary -file(STRINGS "${mocRerunBinDir}/mocRerun.txt" mocRerunList ENCODING UTF-8) -list(GET mocRerunList 0 mocRerunBin) - -message("Changing the header content for a MOC rerun") -# - Acquire binary timestamps before the build -file(TIMESTAMP "${mocRerunBin}" timeBefore "${timeformat}") -# - Ensure that the timestamp will change -# - Change header file content and rebuild -# - Rebuild -execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) -configure_file("${mocRerunSrcDir}/test1b.h.in" "${mocRerunBinDir}/test1.h" COPYONLY) -execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocRerunBinDir}" RESULT_VARIABLE result ) -if (result) - message(SEND_ERROR "Second build of mocRerun failed.") -endif() -# - Acquire binary timestamps after the build -file(TIMESTAMP "${mocRerunBin}" timeAfter "${timeformat}") -# - Test if timestamps changed -if (NOT timeAfter GREATER timeBefore) - message(SEND_ERROR "File (${mocRerunBin}) should have changed!") -endif() - - -message("Changing nothing for a MOC rerun") -# - Acquire binary timestamps before the build -file(TIMESTAMP "${mocRerunBin}" timeBefore "${timeformat}") -# - Ensure that the timestamp would change -# - Change nothing -# - Rebuild -execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) -execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocRerunBinDir}" RESULT_VARIABLE result ) -if (result) - message(SEND_ERROR "Third build of mocRerun failed.") -endif() -# - Acquire binary timestamps after the build -file(TIMESTAMP "${mocRerunBin}" timeAfter "${timeformat}") -# - Test if timestamps changed -if (timeAfter GREATER timeBefore) - message(SEND_ERROR "File (${mocRerunBin}) should not have changed!") -endif() diff --git a/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt b/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt deleted file mode 100644 index bafd9cf..0000000 --- a/Tests/QtAutogenRerun/mocRerun/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -cmake_policy(SET CMP0071 NEW) -project(mocRerun CXX) - -if (QT_TEST_VERSION STREQUAL 4) - find_package(Qt4 REQUIRED) - set(QT_CORE_TARGET Qt4::QtCore) -else() - if (NOT QT_TEST_VERSION STREQUAL 5) - message(SEND_ERROR "Invalid Qt version specified.") - endif() - - find_package(Qt5Core REQUIRED) - set(QT_CORE_TARGET Qt5::Core) -endif() - -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) - -# Generated source file -add_custom_command(OUTPUT main.cpp - COMMAND ${CMAKE_COMMAND} -E sleep 2 - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/main.cpp) - -add_executable(mocRerun - ${CMAKE_CURRENT_BINARY_DIR}/test1.h - ${CMAKE_CURRENT_BINARY_DIR}/main.cpp - res1.qrc) -target_include_directories(mocRerun PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(mocRerun ${QT_CORE_TARGET}) -# Write target name to text file -add_custom_command(TARGET mocRerun POST_BUILD COMMAND - ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:mocRerun>" > mocRerun.txt) diff --git a/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-result.txt b/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-stderr-VS.txt b/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-stderr-VS.txt new file mode 100644 index 0000000..5d19153 --- /dev/null +++ b/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-stderr-VS.txt @@ -0,0 +1,7 @@ +CMake Error: + Error evaluating generator expression: + + \$<COMPILE_LANGUAGE:CXX> + + \$<COMPILE_LANGUAGE:...> may only be used for COMPILE_OPTIONS and + file\(GENERATE\) with the Visual Studio generator. diff --git a/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-stderr-Xcode.txt b/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-stderr-Xcode.txt new file mode 100644 index 0000000..4a4564e --- /dev/null +++ b/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions-stderr-Xcode.txt @@ -0,0 +1,7 @@ +CMake Error: + Error evaluating generator expression: + + \$<COMPILE_LANGUAGE:CXX> + + \$<COMPILE_LANGUAGE:...> may only be used for COMPILE_OPTIONS and + file\(GENERATE\) with the Xcode generator. diff --git a/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions.cmake b/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions.cmake new file mode 100644 index 0000000..3a07d7d --- /dev/null +++ b/Tests/RunCMake/COMPILE_LANGUAGE-genex/PerSourceCompileDefinitions.cmake @@ -0,0 +1,5 @@ + +enable_language(CXX) + +add_executable(main main.cpp) +set_property(SOURCE main.cpp PROPERTY COMPILE_DEFINITIONS $<$<COMPILE_LANGUAGE:CXX>:ANYTHING>) diff --git a/Tests/RunCMake/COMPILE_LANGUAGE-genex/RunCMakeTest.cmake b/Tests/RunCMake/COMPILE_LANGUAGE-genex/RunCMakeTest.cmake index 421fa73..1a93dcd 100644 --- a/Tests/RunCMake/COMPILE_LANGUAGE-genex/RunCMakeTest.cmake +++ b/Tests/RunCMake/COMPILE_LANGUAGE-genex/RunCMakeTest.cmake @@ -14,3 +14,10 @@ elseif (RunCMake_GENERATOR MATCHES "Visual Studio") set(RunCMake-stderr-file IncludeDirectories-stderr-VS.txt) run_cmake(IncludeDirectories) endif() +if (RunCMake_GENERATOR STREQUAL "Xcode") + set(RunCMake-stderr-file PerSourceCompileDefinitions-stderr-Xcode.txt) + run_cmake(PerSourceCompileDefinitions) +elseif (RunCMake_GENERATOR MATCHES "Visual Studio") + set(RunCMake-stderr-file PerSourceCompileDefinitions-stderr-VS.txt) + run_cmake(PerSourceCompileDefinitions) +endif() |