Browse Source

cosmetic improvement: show git version in ua node space

Stasik0 8 years ago
parent
commit
c4fe867742
3 changed files with 6 additions and 6 deletions
  1. 0 1
      CMakeLists.txt
  2. 2 1
      include/ua_config.h.in
  3. 4 4
      plugins/ua_config_standard.c

+ 0 - 1
CMakeLists.txt

@@ -26,7 +26,6 @@ else()
     set(GIT_COMMIT_ID "unknown--no-git-found")
     message(STATUS "Git not found. Build will not contain git revision info." )
 endif()
-add_definitions("-DVERSION=${GIT_COMMIT_ID}")
 
 message(STATUS "Git version: "  ${GIT_COMMIT_ID})
 

+ 2 - 1
include/ua_config.h.in

@@ -23,11 +23,12 @@ extern "C" {
 #ifndef _XOPEN_SOURCE
 # define _XOPEN_SOURCE 500
 #endif
-#ifndef _DEFAULT_SOURCE
+#ifndef _DEFAULT_SOURCEAMALGAMA
 # define _DEFAULT_SOURCE
 #endif
 
 #define UA_LOGLEVEL ${UA_LOGLEVEL}
+#define GIT_COMMIT_ID "${GIT_COMMIT_ID}"
 #cmakedefine UA_ENABLE_MULTITHREADING
 #cmakedefine UA_ENABLE_METHODCALLS
 #cmakedefine UA_ENABLE_SUBSCRIPTIONS

+ 4 - 4
plugins/ua_config_standard.c

@@ -1,8 +1,8 @@
 #include "ua_config_standard.h"
 
-#define MANUFACTURER_NAME "open62541.org"
+#define MANUFACTURER_NAME "open62541"
 #define PRODUCT_NAME "open62541 OPC UA Server"
-#define PRODUCT_URI "urn:unconfigured:open62541"
+#define PRODUCT_URI "http://open62541.org"
 #define APPLICATION_NAME "open62541-based OPC UA Application"
 #define APPLICATION_URI "urn:unconfigured:application"
 
@@ -22,8 +22,8 @@ const UA_ServerConfig UA_ServerConfig_standard = {
         .productUri = UA_STRING_STATIC(PRODUCT_URI),
         .manufacturerName = UA_STRING_STATIC(MANUFACTURER_NAME),
         .productName = UA_STRING_STATIC(PRODUCT_NAME),
-        .softwareVersion = UA_STRING_STATIC("0"),
-        .buildNumber = UA_STRING_STATIC("0"),
+        .softwareVersion = UA_STRING_STATIC(GIT_COMMIT_ID),
+        .buildNumber = UA_STRING_STATIC(__DATE__ " " __TIME__),
         .buildDate = 0 },
     .applicationDescription = {
         .applicationUri = UA_STRING_STATIC(APPLICATION_URI),