🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #309641

Re: Automatyczna informacja o wersji

#309641
From: Bartłomiej Golenko
Date: Thu, 01 Feb 2018 16:17
20 lines
1534 bytes
Borneq <borneq@antyspam.hidden.pl> wrote:
> Teraz robimy w CMakeLists.txt :
> include(GetGitRevisionDescription.cmake)
> get_git_head_revision(GIT_REFSPEC GIT_SHA1)
> a dalej
> add_definitions("-DGIT_SHA1=${GIT_SHA1}")

Ja to robię tak:

gitversion.cpp.in:
const char * g_GIT_SHA1 __attribute__((used)) = "@GIT_REFSPEC@ @GIT_SHA1@";

CMakeLists.txt
include ( GetGitRevisionDescription )
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_describe(GIT_REFSPEC --all --dirty=-dirty)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/gitversion.cpp.in"
"${CMAKE_CURRENT_BINARY_DIR}/src/gitversion.cpp" @ONLY)

B.
Technical Details
Message-ID: <slrnp76fd4.fvc.bartek@kts.pwr.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!pwr.wroc.pl!news.wcss.wroc.pl!not-for-mail
References: <p4qnqo$kp4$1@node2.news.atman.pl> <p4sehh$1qv$1$gof@news.chmurka.net> <p4sfnm$8lk$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed.pionier.net.pl!pwr.wroc.pl!news.wcss.wroc.pl!not-for-mail
From: Bartłomiej Golenko <bartek@zts.invalid>
Newsgroups: pl.comp.lang.c
Subject: Re: Automatyczna informacja o wersji
Date: Thu, 1 Feb 2018 16:17:40 +0000 (UTC)
Organization: Politechnika Wroclawska
Lines: 20
Message-ID: <slrnp76fd4.fvc.bartek@kts.pwr.edu.pl>
References: <p4qnqo$kp4$1@node2.news.atman.pl> <p4sehh$1qv$1$gof@news.chmurka.net> <p4sfnm$8lk$1@node2.news.atman.pl>
Reply-To: pisz_na_newsy@albo.wcale.pl
NNTP-Posting-Host: zts.ita.pwr.wroc.pl
Mime-Version: 1.0
X-Trace: z-news.wcss.wroc.pl 1517501860 19951 156.17.38.22 (1 Feb 2018 16:17:40 GMT)
X-Complaints-To: abuse@news.pwr.wroc.pl
NNTP-Posting-Date: Thu, 1 Feb 2018 16:17:40 +0000 (UTC)
User-Agent: slrn/1.0.3 (Linux)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit