Use the STRING(timestamp ...) command introduced in CMake 2.8.11 to get rid of our today macro and in particular the wmic dependency.
wmic requires administrator privileges on NT 5.x

svn path=/trunk/; revision=66480
This commit is contained in:
Colin Finck 2015-02-28 00:36:49 +00:00
parent 49bb368ddc
commit d3ee77adf9

View file

@ -1,18 +1,3 @@
macro(today RESULT)
if(CMAKE_HOST_WIN32)
execute_process(COMMAND wmic os get LocalDateTime OUTPUT_VARIABLE RAWDATE)
string(REPLACE "\n" ";" RAWDATE ${RAWDATE})
LIST(GET RAWDATE 1 RAWDATE)
string(SUBSTRING ${RAWDATE} 0 8 ${RESULT})
elseif(CMAKE_HOST_UNIX)
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE ${RESULT})
string(STRIP ${${RESULT}} ${RESULT})
else()
message(SEND_ERROR "date not implemented")
set(${RESULT} 00000000)
endif()
endmacro()
macro(inttohex INTVALUE OUTPUT_VARIABLE)
list(APPEND HEXLIST 0 1 2 3 4 5 6 7 8 9 a b c d e f)
list(GET HEXLIST ${INTVALUE} ${OUTPUT_VARIABLE})
@ -29,7 +14,7 @@ macro(converttohex INTVALUE OUTPUT_VARIABLE)
endwhile()
endmacro()
today(KERNEL_VERSION_BUILD)
string(TIMESTAMP KERNEL_VERSION_BUILD %Y%m%d UTC)
set(KERNEL_VERSION_MAJOR "0")
set(KERNEL_VERSION_MINOR "4")