File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -519,16 +519,29 @@ endmacro()
519
519
520
520
if (NOT DEFINED CMAKE_ARGC ) # Guard CMake standalone invocations
521
521
522
- set (OPENCV_BUILD_INFO_FILE "${CMAKE_BINARY_DIR} /version_string.tmp" )
523
- file (REMOVE "${OPENCV_BUILD_INFO_FILE} " )
522
+ set (OPENCV_BUILD_INFO_STR "" CACHE INTERNAL "" )
524
523
function (ocv_output_status msg )
525
524
message (STATUS "${msg} " )
526
525
string (REPLACE "\\ " "\\\\ " msg "${msg} " )
527
526
string (REPLACE "\" " "\\\" " msg "${msg} " )
528
- file ( APPEND "${OPENCV_BUILD_INFO_FILE} " " \" ${msg} \\ n\"\n " )
527
+ set ( OPENCV_BUILD_INFO_STR "${OPENCV_BUILD_INFO_STR} \" ${msg} \\ n\"\n " CACHE INTERNAL " " )
529
528
endfunction ()
530
529
531
530
macro (ocv_finalize_status )
531
+ set (OPENCV_BUILD_INFO_FILE "${CMAKE_BINARY_DIR} /version_string.tmp" )
532
+ if (EXISTS "${OPENCV_BUILD_INFO_FILE} " )
533
+ file (READ "${OPENCV_BUILD_INFO_FILE} " __content )
534
+ else ()
535
+ set (__content "" )
536
+ endif ()
537
+ if ("${__content} " STREQUAL "${OPENCV_BUILD_INFO_STR} " )
538
+ #message(STATUS "${OPENCV_BUILD_INFO_FILE} contains the same content")
539
+ else ()
540
+ file (WRITE "${OPENCV_BUILD_INFO_FILE} " "${OPENCV_BUILD_INFO_STR} " )
541
+ endif ()
542
+ unset (__content )
543
+ unset (OPENCV_BUILD_INFO_STR CACHE )
544
+
532
545
if (NOT OPENCV_SKIP_STATUS_FINALIZATION )
533
546
if (DEFINED OPENCV_MODULE_opencv_core_BINARY_DIR )
534
547
execute_process (COMMAND ${CMAKE_COMMAND} -E copy_if_different "${OPENCV_BUILD_INFO_FILE} " "${OPENCV_MODULE_opencv_core_BINARY_DIR} /version_string.inc" OUTPUT_QUIET )
You can’t perform that action at this time.
0 commit comments