![]() |
![]() |
![]()
Post
#1
|
|
![]() Group: Members Posts: 2,342 Joined: 30-July 06 Member No.: 10,575 ![]() |
I've been working on some stuff, and have it in a local subversion repo. Since I've got a client and a server, I'd like to have my code check to ensure that both are using the same version. I thought that, for at least testing, using the revision number would be a good way to go (I could throw in some compile-time options to have an actual number if stuff ever gets to that point).
My problem is that I have yet to figure out a way to find the revision number. I've got a script that builds binaries, and thought it would be as easy as doing something like: CODE g++ -o mytestprogram src/*.cpp -DVERSION=`cat .svn/version` -lMYLIBS (sorry about the likely poor syntax with the "-D..." part. I've never tried to actually define something as a string, just as existing or not, plus it's been a long day) Anyway, I didn't see the revision anywhere in the .svn dirs. Could somebody help me out (once again, sorry if this is obvious, I'm tired)? Thanks. |
|
|
![]() |
![]()
Post
#2
|
|
![]() Group: Members Posts: 2,342 Joined: 30-July 06 Member No.: 10,575 ![]() |
I don't want to rename anything, just get a version number into the build. I'm guessing that most autotools apps create a "config.h" file that has all of the options in it, as it appears to be impossible to do
CODE g++ -o foobar foo.cpp -DBAR="BAR" Anyway, thanks for the help (I'm currently just echoing CODE #define VERSION x.y.z to a file called version.hpp and then deleting it upon cleanup, FWIW. |
|
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 26th April 2018 - 02:12 AM |