diff options
author | Brad King <brad.king@kitware.com> | 2021-07-26 13:34:23 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-26 13:34:52 (GMT) |
commit | 00cbc4cff78a2fdf84c6fafe97b5b0ed66ec20c9 (patch) | |
tree | 7cc35e0cf4c959972604569a536e02956d899898 /Tests | |
parent | d31f0f56828cf1ca5a207c9f5dd8dee11d527e45 (diff) | |
parent | e5ec0e52f4f15f78bb973cdb03a61ef9c707c2fa (diff) | |
download | CMake-00cbc4cff78a2fdf84c6fafe97b5b0ed66ec20c9.zip CMake-00cbc4cff78a2fdf84c6fafe97b5b0ed66ec20c9.tar.gz CMake-00cbc4cff78a2fdf84c6fafe97b5b0ed66ec20c9.tar.bz2 |
Merge topic 'autouic-header-depends'
e5ec0e52f4 AUTOUIC: Fix generating of dependency rules for UI header files
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6380
Diffstat (limited to 'Tests')
5 files changed, 25 insertions, 2 deletions
diff --git a/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt b/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt index 1f636af..a9ccece 100644 --- a/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt +++ b/Tests/QtAutogen/RerunUicOnFileChange/CMakeLists.txt @@ -27,10 +27,12 @@ endmacro() configure_file("${testProjectTemplateDir}/mocwidget.h" "${testProjectSrc}/mocwidget.h" COPYONLY) configure_file("${testProjectTemplateDir}/main.cpp" "${testProjectSrc}/main.cpp" COPYONLY) +configure_file("${testProjectTemplateDir}/subdir/subdircheck.cpp" "${testProjectSrc}/subdir/subdircheck.cpp" COPYONLY) configure_file("${testProjectTemplateDir}/CMakeLists.txt.in" "${testProjectSrc}/CMakeLists.txt" @ONLY) set(Num 1) configure_file("${testProjectTemplateDir}/mainwindow.ui.in" "${testProjectSrc}/mainwindow.ui" @ONLY) +configure_file("${testProjectTemplateDir}/subdir/mainwindowsubdir.ui.in" "${testProjectSrc}/subdir/mainwindowsubdir.ui" @ONLY) if(CMAKE_GENERATOR_INSTANCE) set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE=${CMAKE_GENERATOR_INSTANCE}") @@ -94,6 +96,7 @@ sleep() set(Num 2) configure_file("${testProjectTemplateDir}/mainwindow.ui.in" "${testProjectSrc}/mainwindow.ui" @ONLY) +configure_file("${testProjectTemplateDir}/subdir/mainwindowsubdir.ui.in" "${testProjectSrc}/subdir/mainwindowsubdir.ui" @ONLY) rebuild(2) execute_process(COMMAND "${testProjectBinDir}/${extra_bin_path}UicOnFileChange" RESULT_VARIABLE result) diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in index fa9dd6b..2a1998d 100644 --- a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in +++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/CMakeLists.txt.in @@ -6,6 +6,8 @@ include("@CMAKE_CURRENT_LIST_DIR@/../AutogenGuiTest.cmake") # Enable CMAKE_AUTOUIC for all targets set(CMAKE_AUTOUIC ON) -add_executable(UicOnFileChange main.cpp mainwindow.ui) +add_executable(UicOnFileChange main.cpp mainwindow.ui + subdir/subdircheck.cpp subdir/mainwindowsubdir.ui +) target_include_directories(UicOnFileChange PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(UicOnFileChange ${QT_QTCORE_TARGET} ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp index fd810fa..3981268 100644 --- a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp +++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/main.cpp @@ -1,9 +1,11 @@ #include "ui_mainwindow.h" +extern bool subdircheck(); + int main(int argc, char* argv[]) { MocWidget mw; Ui::Widget mwUi; mwUi.setupUi(&mw); - return mw.objectName() == "Widget2" ? 0 : 1; + return mw.objectName() == "Widget2" && subdircheck() ? 0 : 1; } diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/mainwindowsubdir.ui.in b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/mainwindowsubdir.ui.in new file mode 100644 index 0000000..a6a31f6 --- /dev/null +++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/mainwindowsubdir.ui.in @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>WidgetSubdir</class> + <widget class="MocWidget" name="WidgetSubdir@Num@"/> + <resources/> + <connections/> +</ui> diff --git a/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/subdircheck.cpp b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/subdircheck.cpp new file mode 100644 index 0000000..3b36a10 --- /dev/null +++ b/Tests/QtAutogen/RerunUicOnFileChange/UicOnFileChange/subdir/subdircheck.cpp @@ -0,0 +1,9 @@ +#include "ui_mainwindowsubdir.h" + +bool subdircheck() +{ + MocWidget mw; + Ui::WidgetSubdir mwUi; + mwUi.setupUi(&mw); + return mw.objectName() == "WidgetSubdir2"; +} |