<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 11/12/2012 6:59 AM, a.l.e wrote:<br>
</div>
<blockquote cite="mid:50A10EBE.1060708@xox.ch" type="cite">On
11/11/12 10:41 AM, ale rimoldi wrote:
<br>
<blockquote type="cite">hi john,
<br>
<br>
<blockquote type="cite">I've been building Scribus from the high
watermark of SVN (1.5) and
<br>
need to determine what version my currently running edition is
from.
<br>
Using Help-About does not provide me the Subversion version
and gives
<br>
me a date of "1 August 2012" when my system notes I built it
18:33:17
<br>
09/10/12 PDT.
<br>
<br>
Is the Subversion version which Scribus is built from
ascertainable
<br>
from a running instance? If not, is there a file is the
staged tree
<br>
that might reflect it? I built Scribus using Gentoo's portage
<br>
facility which basically pulls whatever is HEAD at the time I
<br>
update. In this case, I think I last successfully built on
18:33:17
<br>
09/10/12 PDT. I'm going to go look at the Subversion
repository (I
<br>
hope there is a websvn (<a class="moz-txt-link-freetext" href="http://websvn.tigris.org/">http://websvn.tigris.org/</a>) interface)
and
<br>
determine what version was HEAD around that time.
<br>
<br>
It seems to me having a Subversion version and date included
in the
<br>
About box might be helpful.
<br>
</blockquote>
this has been discussed a few times already, but (afaik) nobody
brought
<br>
a usable solution.
<br>
<br>
another useful feature, would be to add the git branch, for the
ones
<br>
who compile from gif.
<br>
<br>
the main question is: how can we hack the cmake scripts to
<br>
automatically add such information?
<br>
<br>
</blockquote>
i've done a short google search.
<br>
<br>
here are some links worth to be considered...
<br>
<br>
-
<a class="moz-txt-link-freetext" href="http://stackoverflow.com/questions/657850/cmake-how-to-use-bash-command-in">http://stackoverflow.com/questions/657850/cmake-how-to-use-bash-command-in</a>
-cmakelists-txt
<br>
<br>
-
<a class="moz-txt-link-freetext" href="http://stackoverflow.com/questions/9639449/cmake-how-to-pass-preprocessor-macros">http://stackoverflow.com/questions/9639449/cmake-how-to-pass-preprocessor-macros</a><br>
<br>
-
<a class="moz-txt-link-freetext" href="http://stackoverflow.com/questions/7900661/how-to-read-a-cmake-variable-in-c-source-code">http://stackoverflow.com/questions/7900661/how-to-read-a-cmake-variable-in-c-source-code</a><br>
<br>
if i have some time i will have a look at them...
<br>
<br>
ciao
<br>
a.l.e
<br>
</blockquote>
Referencing
<a class="moz-txt-link-freetext" href="http://stackoverflow.com/questions/3780667/use-cmake-to-get-build-time-svn-revision">http://stackoverflow.com/questions/3780667/use-cmake-to-get-build-time-svn-revision</a><br>
<br>
The above stackoverflow topic deals with calls to the cmake standard
module "FindSubversion" which, in turn, takes the results of svn
info and parses them into various variables. I found a project for
FindSubversion.cmake at
<a class="moz-txt-link-freetext" href="http://code.google.com/p/tombexcavator/source/browse/trunk/cmake/FindSubversion.cmake?r=81">http://code.google.com/p/tombexcavator/source/browse/trunk/cmake/FindSubversion.cmake?r=81</a>.
I'm not sure "svn info" is the way to go; instead the command
"svnversion" seems appropriate. So I'm playing around with adding a
cmake MACRO to a modified version of FindSubversion that invokes
svnversion.<br>
<br>
Using the strategy of the stackoverflow topic above, I'm working on
a method using cmake which invokes "svnversion" and creates a header
file, svnversion.h, that may be used by about.h (I'm assuming in c++
headers may include other headers). The header svnversion.h would
create a variable SVNVERSION assigned the output from running the
svnversion command. The output of a svnversion command is terse,
example:<br>
<br>
themis Scribus # svnversion<br>
17871M<br>
themis Scribus #<br>
<br>
And the additional benefit is that alphabetic characters will
appear, such as the "M" above, if the Subversion tree has been
modified or otherwise not complete.<br>
<br>
I'm gated now because Gentoo copies the Subversion tree over to a
temporary directory, i.e. /var/tmp/portage/app-office/scribus...,
leaving behind the .svn directory. In recent versions of
Subversion, the top most .svn directory contains the database that
manages the entire tree below. So, in a Gentoo emerge, cmake
invokes "svnversion" against its staged "tmp" tree and therefore
fails since it cannot find the .svn subdirectory. The part I'm
focusing on now is to have Gentoo provide a reference back to its
source of the Scribus Subversion tree, i.e.
/usr/portage/distfiles/svn-src/scribus/Scribus, so the svnversion
command is feed that path -- it should work then. This should be
helpful for other Gentoo builds based on Subversion pulls, e.g.
those labeled version "9999".
<p><font face="Verdana" size="2"><font size="2">John</font><br>
</font></p>
</body>
</html>