|
|
@@ -95,25 +95,27 @@ if (NOT RCC_DEPENDS)
|
|
|
message(SEND_ERROR "Initial build of rccDepends failed. Output: ${output}")
|
|
|
endif()
|
|
|
|
|
|
-file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/rccDepends/info_file.txt" qrc_files)
|
|
|
-
|
|
|
-list(GET qrc_files 0 qrc_file1)
|
|
|
-
|
|
|
+# Get name and timestamp of the output binary
|
|
|
+file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/rccDepends/target1.txt" target1List)
|
|
|
+list(GET target1List 0 binFile)
|
|
|
set(timeformat "%Y%j%H%M%S")
|
|
|
+file(TIMESTAMP "${binFile}" timeBegin "${timeformat}")
|
|
|
|
|
|
-file(TIMESTAMP "${qrc_file1}" file1_before "${timeformat}")
|
|
|
-
|
|
|
+# Touch qrc input file and rebuild
|
|
|
execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) # Ensure that the timestamp will change.
|
|
|
execute_process(COMMAND "${CMAKE_COMMAND}" -E touch "${CMAKE_CURRENT_BINARY_DIR}/rccDepends/res1/input.txt")
|
|
|
-
|
|
|
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/rccDepends"
|
|
|
+ RESULT_VARIABLE rccDepends_result
|
|
|
)
|
|
|
+if (rccDepends_result)
|
|
|
+ message(SEND_ERROR "Second build of rccDepends failed.")
|
|
|
+endif()
|
|
|
|
|
|
-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!")
|
|
|
+# Compare timestamps
|
|
|
+file(TIMESTAMP "${binFile}" timeStep1 "${timeformat}")
|
|
|
+if (NOT timeStep1 GREATER timeBegin)
|
|
|
+ message(SEND_ERROR "file1 (${binFile}) should have changed in the first step!")
|
|
|
endif()
|
|
|
|
|
|
# -- Test
|
|
|
@@ -131,16 +133,29 @@ if (NOT MOC_RERUN)
|
|
|
message(SEND_ERROR "Initial build of mocRerun failed. Output: ${output}")
|
|
|
endif()
|
|
|
|
|
|
-configure_file(mocRerun/test1b.h.in mocRerun/test1.h COPYONLY)
|
|
|
+# Get name and timestamp of the output binary
|
|
|
+file(STRINGS "${CMAKE_CURRENT_BINARY_DIR}/mocRerun/target1.txt" target1List)
|
|
|
+list(GET target1List 0 binFile)
|
|
|
+set(timeformat "%Y%j%H%M%S")
|
|
|
+file(TIMESTAMP "${binFile}" timeBegin "${timeformat}")
|
|
|
|
|
|
+# Change file content and rebuild
|
|
|
+execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1)
|
|
|
+configure_file(mocRerun/test1b.h.in mocRerun/test1.h COPYONLY)
|
|
|
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
|
|
|
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mocRerun"
|
|
|
- RESULT_VARIABLE automoc_rerun_result
|
|
|
+ RESULT_VARIABLE mocRerun_result
|
|
|
)
|
|
|
-if (automoc_rerun_result)
|
|
|
+if (mocRerun_result)
|
|
|
message(SEND_ERROR "Second build of mocRerun failed.")
|
|
|
endif()
|
|
|
|
|
|
+# Compare timestamps
|
|
|
+file(TIMESTAMP "${binFile}" timeStep1 "${timeformat}")
|
|
|
+if (NOT timeStep1 GREATER timeBegin)
|
|
|
+ message(SEND_ERROR "File (${binFile}) should have changed in the first step!")
|
|
|
+endif()
|
|
|
+
|
|
|
# -- Test
|
|
|
# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
|
|
|
qtx_wrap_cpp(skipMocWrapMoc
|