Commit 875a2f85 authored by lassoan's avatar lassoan

ENH: Allow forced setting of working copy modification date

Slicer_FORCED_WC_REVISION was already available, but now added Slicer_FORCED_WC_LAST_CHANGED_DATE variable as well.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@26505 3bd1e089-480b-0410-8dfb-8563597acbee
parent 06bbb505
......@@ -37,6 +37,7 @@
#
# Optionally, these variable can also be set:
# Slicer_FORCED_WC_REVISION (default "")
# Slicer_FORCED_WC_LAST_CHANGED_DATE (default ""): Format YYYY-MM-DD
#
# --------------------------------------------------------------------------
......@@ -75,10 +76,14 @@ if(NOT SLICER_CONFIGURE_VERSION_HEADER)
if(NOT DEFINED Slicer_FORCED_WC_REVISION)
set(Slicer_FORCED_WC_REVISION "")
endif()
if(NOT DEFINED Slicer_FORCED_WC_LAST_CHANGED_DATE)
set(Slicer_FORCED_WC_LAST_CHANGED_DATE "")
endif()
add_custom_target(SlicerConfigureVersionHeader ALL
COMMAND ${CMAKE_COMMAND}
${script_args}
-DSlicer_FORCED_WC_REVISION:STRING=${Slicer_FORCED_WC_REVISION}
-DSlicer_FORCED_WC_LAST_CHANGED_DATE:STRING=${Slicer_FORCED_WC_LAST_CHANGED_DATE}
-DSLICER_CONFIGURE_VERSION_HEADER=1
-P ${CMAKE_CURRENT_LIST_FILE}
COMMENT "Configuring vtkSlicerVersionConfigure.h"
......
......@@ -57,6 +57,10 @@ SlicerMacroExtractRepositoryInfo(
VAR_PREFIX Slicer
SOURCE_DIR ${Slicer_SOURCE_DIR}
)
if(NOT Slicer_FORCED_WC_LAST_CHANGED_DATE STREQUAL "")
set(Slicer_WC_LAST_CHANGED_DATE "${Slicer_FORCED_WC_LAST_CHANGED_DATE}")
endif()
string(REGEX REPLACE ".*([0-9][0-9][0-9][0-9]\\-[0-9][0-9]\\-[0-9][0-9]).*" "\\1"
Slicer_BUILDDATE "${Slicer_WC_LAST_CHANGED_DATE}")
......
......@@ -269,6 +269,9 @@ CMAKE_DEPENDENT_OPTION(Slicer_UPDATE_TRANSLATION "update translation" OFF "Slice
mark_as_advanced(Slicer_UPDATE_TRANSLATION)
mark_as_superbuild(Slicer_UPDATE_TRANSLATION)
set(Slicer_FORCED_WC_LAST_CHANGED_DATE "" CACHE STRING "Overwrite value of auto-discovered Slicer_WC_LAST_CHANGED_DATE (format: YYYY-MM-DD)")
mark_as_advanced(Slicer_FORCED_WC_LAST_CHANGED_DATE)
set(Slicer_FORCED_WC_REVISION "" CACHE STRING "Overwrite value of auto-discovered Slicer_WC_REVISION")
mark_as_advanced(Slicer_FORCED_WC_REVISION)
......
......@@ -433,6 +433,8 @@ ExternalProject_Add(${proj}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MAJOR:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MAJOR}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MINOR:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_MINOR}
-D${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_PATCH:STRING=${${Slicer_MAIN_PROJECT_APPLICATION_NAME}_VERSION_PATCH}
-DSlicer_FORCED_WC_LAST_CHANGED_DATE:STRING=${Slicer_FORCED_WC_LAST_CHANGED_DATE}
-DSlicer_FORCED_WC_REVISION:STRING=${Slicer_FORCED_WC_REVISION}
-DSlicer_APPLICATIONS_DIR:PATH=${Slicer_APPLICATIONS_DIR}
-DSlicer_EXTENSION_SOURCE_DIRS:STRING=${Slicer_EXTENSION_SOURCE_DIRS}
-DSlicer_EXTENSION_INSTALL_DIRS:STRING=${Slicer_EXTENSION_INSTALL_DIRS}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment