diff options
author | Brad King <brad.king@kitware.com> | 2015-06-19 13:38:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-06-19 14:29:38 (GMT) |
commit | 0e346427a254024b8eafe52956e8f4ba05d856ed (patch) | |
tree | f06b08f0da74c6088b46d0ac61f511e0321e7f77 /Tests/QtAutogen/CMakeLists.txt | |
parent | 664156c2314302ad94c684561fdf56c847613de9 (diff) | |
download | CMake-0e346427a254024b8eafe52956e8f4ba05d856ed.zip CMake-0e346427a254024b8eafe52956e8f4ba05d856ed.tar.gz CMake-0e346427a254024b8eafe52956e8f4ba05d856ed.tar.bz2 |
QtAutogen: Always run autogen step even when rcc is enabled (#15608)
In commit v3.2.0-rc1~480^2 (QtAutogen: Regenerate qrc files if their input
changes, 2014-09-17) the "cmake -E cmake_autogen" rule was switched from
always running to running as a custom command with dependencies if rcc
is enabled. This is not correct because automoc always needs to re-run.
Switch back to always running the command.
Diffstat (limited to 'Tests/QtAutogen/CMakeLists.txt')
-rw-r--r-- | Tests/QtAutogen/CMakeLists.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 60b44fd..1dfa648 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -167,3 +167,26 @@ file(TIMESTAMP "${qrc_file1}" file1_step1 "${timeformat}") if (NOT file1_step1 GREATER file1_before) message(SEND_ERROR "file1 (${qrc_file1}) should have changed in the first step!") endif() + +#----------------------------------------------------------------------------- +try_compile(MOC_RERUN + "${CMAKE_CURRENT_BINARY_DIR}/automoc_rerun" + "${CMAKE_CURRENT_SOURCE_DIR}/automoc_rerun" + automoc_rerun + 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 automoc_rerun failed. Output: ${output}") +endif() + +configure_file(automoc_rerun/test1.h.in2 automoc_rerun/test1.h COPYONLY) + +execute_process(COMMAND "${CMAKE_COMMAND}" --build . + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/automoc_rerun" + RESULT_VARIABLE automoc_rerun_result + ) +if (automoc_rerun_result) + message(SEND_ERROR "Second build of automoc_rerun failed.") +endif() |