Skip to content

Commit 3e45795

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
1 parent 84ee4d7 commit 3e45795

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -917,11 +917,15 @@ endif()
917917
# ========================== build platform ==========================
918918
status("")
919919
status(" Platform:")
920-
if(NOT CMAKE_VERSION VERSION_LESS 2.8.11 AND NOT BUILD_INFO_SKIP_TIMESTAMP)
921-
string(TIMESTAMP TIMESTAMP "" UTC)
922-
if(TIMESTAMP)
923-
status(" Timestamp:" ${TIMESTAMP})
924-
endif()
920+
if(NOT DEFINED OPENCV_TIMESTAMP
921+
AND NOT CMAKE_VERSION VERSION_LESS 2.8.11
922+
AND NOT BUILD_INFO_SKIP_TIMESTAMP
923+
)
924+
string(TIMESTAMP OPENCV_TIMESTAMP "" UTC)
925+
set(OPENCV_TIMESTAMP "${OPENCV_TIMESTAMP}" CACHE STRING "Timestamp of OpenCV build configuration" FORCE)
926+
endif()
927+
if(OPENCV_TIMESTAMP)
928+
status(" Timestamp:" ${OPENCV_TIMESTAMP})
925929
endif()
926930
status(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
927931
if(CMAKE_CROSSCOMPILING)

0 commit comments

Comments
 (0)