From 7c585699304ac071cdf7c1b8d7677d38b859e70f Mon Sep 17 00:00:00 2001 From: Justin Borodinsky Date: Thu, 1 Jan 2015 14:20:14 -0500 Subject: QtAutoUic: Restore source file AUTOUIC_OPTIONS settings The "." in the extension was dropped by commit v3.1.0-rc1~556^2~2 (cmSourceFile: Cache the isUiFile check, 2014-02-08) by mistake. This caused the options to not be set. --- Source/cmSourceFile.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index b833d3f..12eb411 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -24,7 +24,7 @@ cmSourceFile::cmSourceFile(cmMakefile* mf, const std::string& name): this->CustomCommand = 0; this->Properties.SetCMakeInstance(mf->GetCMakeInstance()); this->FindFullPathFailed = false; - this->IsUiFile = ("ui" == + this->IsUiFile = (".ui" == cmSystemTools::GetFilenameLastExtension(this->Location.GetName())); } -- cgit v0.12 From 9a673737163a3474c83c8100c57454318344ef1c Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 12 Jan 2015 01:22:11 +0100 Subject: QtAutoUic: Add a test for the regression in the parent commit. --- Tests/QtAutogen/CMakeLists.txt | 6 ++++++ Tests/QtAutogen/calwidget.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 3fd00b8..de4d0d2 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -73,6 +73,12 @@ if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" AND NOT CMAKE_CONFIGURATION_ add_definitions(-DTEST_DEBUG_CLASS) endif() +# The -no-protection option disables the generation of include guards. Verify +# that setting the source file property has an effect by using this and +# issue an error in the preprocessor in calwidget.cpp if the include guard +# is defined. +set_source_files_properties(calwidget.ui PROPERTIES AUTOUIC_OPTIONS "-no-protection") + add_executable(QtAutogen main.cpp calwidget.cpp second_widget.cpp foo.cpp blub.cpp bar.cpp abc.cpp multiplewidgets.cpp xyz.cpp yaf.cpp gadget.cpp $ diff --git a/Tests/QtAutogen/calwidget.cpp b/Tests/QtAutogen/calwidget.cpp index defde20..5f59994 100644 --- a/Tests/QtAutogen/calwidget.cpp +++ b/Tests/QtAutogen/calwidget.cpp @@ -50,6 +50,9 @@ #include "calwidget.h" #include "ui_calwidget.h" + #ifdef UI_CALWIDGET_H + #error Definition of UI_CALWIDGET_H should be disabled by file option. + #endif Window::Window() : ui(new Ui::Window) -- cgit v0.12