diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2018-05-25 09:40:23 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2018-05-30 15:45:01 (GMT) |
commit | 5852acffa4b67a614df3343bcb29e6b9511d0704 (patch) | |
tree | e2ebf4dfe6d6ba3c8b869035019d6c0cee7db52e /Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt | |
parent | 41685c8ba0902cff1241886d966e796cecb82ae3 (diff) | |
download | CMake-5852acffa4b67a614df3343bcb29e6b9511d0704.zip CMake-5852acffa4b67a614df3343bcb29e6b9511d0704.tar.gz CMake-5852acffa4b67a614df3343bcb29e6b9511d0704.tar.bz2 |
Autogen: Add AUTORCC configuration change test
Diffstat (limited to 'Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt')
-rw-r--r-- | Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt new file mode 100644 index 0000000..f09865d --- /dev/null +++ b/Tests/QtAutogen/RerunRccConfigChange/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.11.2) +project(RerunRccConfigChange) +include("../AutogenTest.cmake") + +# Tests rcc rebuilding after a configuration change + +# 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}/RccConfigChange") +set(rccDepBD "${CMAKE_CURRENT_BINARY_DIR}/RccConfigChange") + +# Initial build +try_compile(RCC_DEPENDS + "${rccDepBD}" + "${rccDepSD}" + RccConfigChange + CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}" + "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + OUTPUT_VARIABLE output +) +if (NOT RCC_DEPENDS) + message(SEND_ERROR "Initial build of rccConfigChange failed. Output: ${output}") +endif() + +# - Rebuild Release +message("Rebuilding rccConfigChange in Release configuration") +execute_process(COMMAND "${CMAKE_COMMAND}" --build . --config Release WORKING_DIRECTORY "${rccDepBD}" RESULT_VARIABLE result) +if (result) + message(SEND_ERROR "Release build of rccConfigChange failed.") +endif() + +# - Rebuild Debug +message("Rebuilding rccConfigChange in Debug configuration") +execute_process(COMMAND "${CMAKE_COMMAND}" --build . --config Debug WORKING_DIRECTORY "${rccDepBD}" RESULT_VARIABLE result) +if (result) + message(SEND_ERROR "Debug build of rccConfigChange failed.") +endif() |