Stepan Salenikovich | 4f9bb98 | 2015-06-23 14:26:30 -0400 | [diff] [blame^] | 1 | # Copyright (C) 2015 Savoir-faire Linux Inc. |
| 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 | # |
| 18 | # Additional permission under GNU GPL version 3 section 7: |
| 19 | # |
| 20 | # If you modify this program, or any covered work, by linking or |
| 21 | # combining it with the OpenSSL project's OpenSSL library (or a |
| 22 | # modified version of that library), containing parts covered by the |
| 23 | # terms of the OpenSSL or SSLeay licenses, Savoir-faire Linux Inc. |
| 24 | # grants you additional permission to convey the resulting work. |
| 25 | # Corresponding Source for a non-source form of such a combination |
| 26 | # shall include the source code for the parts of OpenSSL used as well |
| 27 | # as that of the covered work. |
| 28 | # |
| 29 | |
| 30 | FIND_PACKAGE(Git) |
| 31 | |
| 32 | IF(GIT_FOUND) |
| 33 | EXECUTE_PROCESS( |
| 34 | COMMAND ${GIT_EXECUTABLE} rev-parse --verify HEAD |
| 35 | OUTPUT_VARIABLE RING_CLIENT_REVISION |
| 36 | OUTPUT_STRIP_TRAILING_WHITESPACE |
| 37 | ) |
| 38 | ENDIF() |
| 39 | |
| 40 | IF( "${RING_CLIENT_REVISION}" STREQUAL "") |
| 41 | SET(RING_CLIENT_REVISION "unknown") |
| 42 | ENDIF() |
| 43 | |
| 44 | MESSAGE( STATUS "GIT_REVISION_INPUT_FILE: " ${GIT_REVISION_INPUT_FILE} ) |
| 45 | MESSAGE( STATUS "GIT_REVISION_OUTPUT_FILE: " ${GIT_REVISION_OUTPUT_FILE} ) |
| 46 | |
| 47 | # generate revision.h file |
| 48 | CONFIGURE_FILE ( |
| 49 | ${GIT_REVISION_INPUT_FILE} |
| 50 | ${GIT_REVISION_OUTPUT_FILE} |
| 51 | ) |