Skip to content

Commit 7459388

Browse files
committed
cmake: update timestamp status
- avoid unnecessary rebuilding of OpenCV libraries - use timestamp of the first launch of CMake - to return to previous behavior use `-UOPENCV_TIMESTAMP` CMake option original commit: 3e45795
1 parent 00cc4aa commit 7459388

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,16 @@ endif()
683683
# ========================== build platform ==========================
684684
status("")
685685
status(" Platform:")
686+
if(NOT DEFINED OPENCV_TIMESTAMP
687+
AND NOT CMAKE_VERSION VERSION_LESS 2.8.11
688+
AND NOT BUILD_INFO_SKIP_TIMESTAMP
689+
)
690+
string(TIMESTAMP OPENCV_TIMESTAMP "" UTC)
691+
set(OPENCV_TIMESTAMP "${OPENCV_TIMESTAMP}" CACHE STRING "Timestamp of OpenCV build configuration" FORCE)
692+
endif()
693+
if(OPENCV_TIMESTAMP)
694+
status(" Timestamp:" ${OPENCV_TIMESTAMP})
695+
endif()
686696
status(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
687697
if(CMAKE_CROSSCOMPILING)
688698
status(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})

0 commit comments

Comments
 (0)