Index: trunk/ppSim/src/Makefile.am
===================================================================
--- trunk/ppSim/src/Makefile.am	(revision 23139)
+++ trunk/ppSim/src/Makefile.am	(revision 23229)
@@ -1,14 +1,14 @@
 bin_PROGRAMS = ppSim ppSimSequence
 
-PPSIM_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
-PPSIM_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi`
-PPSIM_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`
+# PPSIM_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi`
+# PPSIM_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi`
+# PPSIM_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi`
+# 
+# # Force recompilation of ppSimVersion.c, since it gets the version information
+# ppSimVersion.c: FORCE
+# 	touch ppSimVersion.c
+# FORCE: ;
 
-# Force recompilation of ppSimVersion.c, since it gets the version information
-ppSimVersion.c: FORCE
-	touch ppSimVersion.c
-FORCE: ;
-
-ppSim_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $(ppSim_CFLAGS) -DPPSIM_VERSION=\"$(PPSIM_VERSION)\" -DPPSIM_BRANCH=\"$(PPSIM_BRANCH)\" -DPPSIM_SOURCE=\"$(PPSIM_SOURCE)\"
+ppSim_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSPHOT_CFLAGS) $(PSASTRO_CFLAGS) $(ppSim_CFLAGS) -DPPSIM_VERSION=$(SVN_VERSION) -DPPSIM_BRANCH=$(SVN_BRANCH) -DPPSIM_SOURCE=$(SVN_SOURCE)
 ppSim_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSPHOT_LIBS) $(PSASTRO_LIBS)
 ppSim_SOURCES = \
Index: trunk/ppSim/src/ppSimVersion.c
===================================================================
--- trunk/ppSim/src/ppSimVersion.c	(revision 23139)
+++ trunk/ppSim/src/ppSimVersion.c	(revision 23229)
@@ -1,7 +1,4 @@
 #include "ppSim.h"
 
-
-psString ppSimVersion(void)
-{
 #ifndef PPSIM_VERSION
 #error "PPSIM_VERSION is not set"
@@ -10,13 +7,21 @@
 #error "PPSIM_BRANCH is not set"
 #endif
-    return psStringCopy(PPSIM_BRANCH "@" PPSIM_VERSION);
+#ifndef PPSIM_SOURCE
+#error "PPSIM_SOURCE is not set"
+#endif
+
+#define xstr(s) str(s)
+#define str(s) #s
+
+psString ppSimVersion(void)
+{
+    char *value = NULL;
+    psStringAppend(&value, "%s@%s", xstr(PPSIM_BRANCH), xstr(PPSIM_VERSION));
+    return value;
 }
 
 psString ppSimSource(void)
 {
-#ifndef PPSIM_SOURCE
-#error "PPSIM_SOURCE is not set"
-#endif
-    return psStringCopy(PPSIM_SOURCE);
+    return psStringCopy(xstr(PPSIM_SOURCE));
 }
 
