blob: eff05e3271cd4801c9f3bdadb10e0de315fafcda [file] [log] [blame]
Stepan Salenikovichbe87d2c2016-01-25 14:14:34 -05001# Copyright (C) 2015-2016 Savoir-faire Linux Inc.
Stepan Salenikovich4f9bb982015-06-23 14:26:30 -04002# 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 Salenikovich4f9bb982015-06-23 14:26:30 -040018
19FIND_PACKAGE(Git)
20
21IF(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 )
27ENDIF()
28
29IF( "${RING_CLIENT_REVISION}" STREQUAL "")
30 SET(RING_CLIENT_REVISION "unknown")
31ENDIF()
32
33MESSAGE( STATUS "GIT_REVISION_INPUT_FILE: " ${GIT_REVISION_INPUT_FILE} )
34MESSAGE( STATUS "GIT_REVISION_OUTPUT_FILE: " ${GIT_REVISION_OUTPUT_FILE} )
35
36# generate revision.h file
37CONFIGURE_FILE (
38 ${GIT_REVISION_INPUT_FILE}
39 ${GIT_REVISION_OUTPUT_FILE}
40)