Commit 601f7e1a authored by jcfr's avatar jcfr
Browse files

COMP: Change SlicerMacroToday into SlicerFunctionToday

git-svn-id: http://svn.slicer.org/Slicer4/trunk@16328 3bd1e089-480b-0410-8dfb-8563597acbee
parent 9db3319d
...@@ -6,30 +6,33 @@ ...@@ -6,30 +6,33 @@
# #
MACRO (TODAY RESULT) FUNCTION (TODAY RESULT_VAR)
set(today_date)
IF (WIN32) IF (WIN32)
EXECUTE_PROCESS(COMMAND cmd /c "date /T" EXECUTE_PROCESS(COMMAND cmd /c "date /T"
ERROR_VARIABLE getdate_error ERROR_VARIABLE getdate_error
RESULT_VARIABLE getdate_result RESULT_VARIABLE getdate_result
OUTPUT_VARIABLE ${RESULT} OUTPUT_VARIABLE today_date
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
#MESSAGE(STATUS "getdate_error:${getdate_error}") #MESSAGE(STATUS "getdate_error:${getdate_error}")
#MESSAGE(STATUS "getdate_result:${getdate_result}") #MESSAGE(STATUS "getdate_result:${getdate_result}")
#MESSAGE(STATUS "${RESULT}:${${RESULT}}") #MESSAGE(STATUS "today_date:${today_date}")
string(REGEX REPLACE ".*(..)/(..)/(....)" string(REGEX REPLACE ".*(..)/(..)/(....)"
"\\3-\\1-\\2" "\\3-\\1-\\2"
${RESULT} today_date
${${RESULT}}) ${today_date})
ELSEIF(UNIX) ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND date "+%Y-%m-%d" EXECUTE_PROCESS(COMMAND date "+%Y-%m-%d"
OUTPUT_VARIABLE ${RESULT} OUTPUT_VARIABLE today_date
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
ELSE (WIN32) ELSE (WIN32)
MESSAGE(SEND_ERROR "error: Failed to obtain today date - ${RESULT} set to 0000-00-00") MESSAGE(SEND_ERROR "error: Failed to obtain today date - ${RESULT_VAR} set to 0000-00-00")
SET(${RESULT} 0000-00-00) SET(today_date "0000-00-00")
ENDIF (WIN32) ENDIF (WIN32)
ENDMACRO (TODAY) SET(${RESULT_VAR} ${today_date} PARENT_SCOPE)
ENDFUNCTION (TODAY)
...@@ -270,6 +270,12 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/bin) ...@@ -270,6 +270,12 @@ SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/bin)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/bin) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/bin)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/lib) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/lib)
#-----------------------------------------------------------------------------
# Today date
#-----------------------------------------------------------------------------
INCLUDE(CMake/SlicerFunctionToday.cmake)
TODAY(Slicer_BUILDDATE)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Slicer version number. # Slicer version number.
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
...@@ -277,16 +283,10 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/lib) ...@@ -277,16 +283,10 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Slicer_BINARY_DIR}/lib)
SET(Slicer_VERSION_MAJOR "4") SET(Slicer_VERSION_MAJOR "4")
SET(Slicer_VERSION_MINOR "0") SET(Slicer_VERSION_MINOR "0")
INCLUDE(CMake/SlicerMacroToday.cmake)
# Get build time
TODAY(Slicer_BUILDDATE)
IF(NOT Slicer_VERSION_PATCH) IF(NOT Slicer_VERSION_PATCH)
SET(Slicer_VERSION_PATCH "gamma-${Slicer_BUILDDATE}") SET(Slicer_VERSION_PATCH "gamma-${Slicer_BUILDDATE}")
ENDIF() ENDIF()
SET(Slicer_VERSION "${Slicer_VERSION_MAJOR}.${Slicer_VERSION_MINOR}") SET(Slicer_VERSION "${Slicer_VERSION_MAJOR}.${Slicer_VERSION_MINOR}")
SET(Slicer_VERSION_FULL "${Slicer_VERSION}.${Slicer_VERSION_PATCH}") SET(Slicer_VERSION_FULL "${Slicer_VERSION}.${Slicer_VERSION_PATCH}")
......
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