blob: fe0474b5b2d2d516a171c5d39d6a6c76faa9133c [file] [log] [blame]
Stepan Salenikovich4f9bb982015-06-23 14:26:30 -04001# 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
30FIND_PACKAGE(Git)
31
32IF(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 )
38ENDIF()
39
40IF( "${RING_CLIENT_REVISION}" STREQUAL "")
41 SET(RING_CLIENT_REVISION "unknown")
42ENDIF()
43
44MESSAGE( STATUS "GIT_REVISION_INPUT_FILE: " ${GIT_REVISION_INPUT_FILE} )
45MESSAGE( STATUS "GIT_REVISION_OUTPUT_FILE: " ${GIT_REVISION_OUTPUT_FILE} )
46
47# generate revision.h file
48CONFIGURE_FILE (
49 ${GIT_REVISION_INPUT_FILE}
50 ${GIT_REVISION_OUTPUT_FILE}
51)