source: calamares/trunk/fuentes/CMakeModules/CMakeDateStamp.cmake @ 7538

Last change on this file since 7538 was 7538, checked in by kbut, 13 months ago

sync with github

File size: 638 bytes
Line 
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()
Note: See TracBrowser for help on using the repository browser.