Stepan Salenikovich | be87d2c | 2016-01-25 14:14:34 -0500 | [diff] [blame] | 1 | # Copyright (C) 2015-2016 Savoir-faire Linux Inc. |
Stepan Salenikovich | 4f9bb98 | 2015-06-23 14:26:30 -0400 | [diff] [blame] | 2 | # Author: Stepan Salenikovich <stepan.salenikovich@savoirfairelinux.com> |
| 3 | # |
| 4 | # This program is free software; you can redistribute it and/or modify |
| 5 | # it under the terms of the GNU General Public License as published by |
| 6 | # the Free Software Foundation; either version 3 of the License, or |
| 7 | # (at your option) any later version. |
| 8 | # |
| 9 | # This program is distributed in the hope that it will be useful, |
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | # GNU General Public License for more details. |
| 13 | # |
| 14 | # You should have received a copy of the GNU General Public License |
| 15 | # along with this program; if not, write to the Free Software |
| 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 17 | # |
Stepan Salenikovich | 4f9bb98 | 2015-06-23 14:26:30 -0400 | [diff] [blame] | 18 | |
| 19 | FIND_PACKAGE(Git) |
| 20 | |
| 21 | IF(GIT_FOUND) |
| 22 | EXECUTE_PROCESS( |
| 23 | COMMAND ${GIT_EXECUTABLE} rev-parse --verify HEAD |
| 24 | OUTPUT_VARIABLE RING_CLIENT_REVISION |
| 25 | OUTPUT_STRIP_TRAILING_WHITESPACE |
| 26 | ) |
| 27 | ENDIF() |
| 28 | |
| 29 | IF( "${RING_CLIENT_REVISION}" STREQUAL "") |
| 30 | SET(RING_CLIENT_REVISION "unknown") |
| 31 | ENDIF() |
| 32 | |
| 33 | MESSAGE( STATUS "GIT_REVISION_INPUT_FILE: " ${GIT_REVISION_INPUT_FILE} ) |
| 34 | MESSAGE( STATUS "GIT_REVISION_OUTPUT_FILE: " ${GIT_REVISION_OUTPUT_FILE} ) |
| 35 | |
| 36 | # generate revision.h file |
| 37 | CONFIGURE_FILE ( |
| 38 | ${GIT_REVISION_INPUT_FILE} |
| 39 | ${GIT_REVISION_OUTPUT_FILE} |
| 40 | ) |