PageRenderTime 191ms CodeModel.GetById 71ms app.highlight 1ms RepoModel.GetById 89ms app.codeStats 0ms

/CMakeModules/CMakeDateStamp.cmake

http://github.com/tomahawk-player/tomahawk
CMake | 23 lines | 22 code | 1 blank | 0 comment | 1 complexity | 0ca74645134ac375f41fa125db6e7d56 MD5 | raw file
 1find_program(DATE_EXECUTABLE NAMES date)
 2mark_as_advanced(DATE_EXECUTABLE)
 3
 4if(DATE_EXECUTABLE)
 5  execute_process(
 6    COMMAND ${DATE_EXECUTABLE} +%Y
 7    OUTPUT_VARIABLE CMAKE_DATESTAMP_YEAR
 8    OUTPUT_STRIP_TRAILING_WHITESPACE
 9    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
10  )
11  execute_process(
12    COMMAND ${DATE_EXECUTABLE} +%m
13    OUTPUT_VARIABLE CMAKE_DATESTAMP_MONTH
14    OUTPUT_STRIP_TRAILING_WHITESPACE
15    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
16  )
17  execute_process(
18    COMMAND ${DATE_EXECUTABLE} +%d
19    OUTPUT_VARIABLE CMAKE_DATESTAMP_DAY
20    OUTPUT_STRIP_TRAILING_WHITESPACE
21    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
22  )
23endif()