Introducing new version naming

parent 03ee8864
......@@ -23,6 +23,18 @@ if( NOT DEFINED ITA_VANET_INSTALL_WITH_DLLS )
set( ITA_VANET_INSTALL_WITH_DLLS ON CACHE BOOL "Install VANet with depending DLLs (use this switch with care)" )
endif( NOT DEFINED ITA_VANET_INSTALL_WITH_DLLS )
if( NOT DEFINED ITA_VANET_VERSION_MAJOR )
set( ITA_VANET_VERSION_MAJOR "v2016" CACHE STRING "VANet version major (usually 'v' and year)" )
endif( NOT DEFINED ITA_VANET_VERSION_MAJOR )
if( NOT DEFINED ITA_VANET_VERSION_MINOR )
set( ITA_VANET_VERSION_MINOR "a" CACHE STRING "VANet version minor (usually a,b,c ...)" )
endif( NOT DEFINED ITA_VANET_VERSION_MINOR )
if( NOT DEFINED ITA_VANET_DEFAULT_PORT )
set( ITA_VANET_DEFAULT_PORT 12340 CACHE INT "VANet default TCP port" )
endif( NOT DEFINED ITA_VANET_DEFAULT_PORT )
vista_use_package( VistaCoreLibs REQUIRED COMPONENTS VistaBase VistaInterProcComm FIND_DEPENDENCIES )
vista_use_package( VABase REQUIRED )
......@@ -48,6 +60,11 @@ else( NOT ITA_VA_BUILD_STATIC )
endif( BUILD_SHARED_LIBS )
endif( NOT ITA_VA_BUILD_STATIC )
add_definitions( "-DVANET_VERSION_MAJOR=\"${ITA_VANET_VERSION_MAJOR}\"" )
add_definitions( "-DVANET_VERSION_MINOR=\"${ITA_VANET_VERSION_MINOR}\"" )
add_definitions( "-DVANET_DEFAULT_PORT=${ITA_VANET_DEFAULT_PORT}" )
add_library( VANet "${ProjectSources}" )
target_link_libraries( VANet ${VISTA_USE_PACKAGE_LIBRARIES} )
......
......@@ -29,15 +29,8 @@
#pragma warning(disable: 4251)
#endif
// Default port for servers and clients
#ifndef VANET_DEFAULT_PORT
#define VANET_DEFAULT_PORT 12340
// --= Version =-----------------------------------------------
#define VANET_VERSION_MAJOR 1
#define VANET_VERSION_MINOR 25
#define VANET_SVN_DATE "$Date: 2016-02-11 07:28:54 +0100 (Do, 11 Feb 2016) $"
#define VANET_SVN_REVISION "$Revision: 4530 $"
#endif
#endif // VA_INCLUDE_GUARD_VANET_DEFINITIONS
......@@ -30,7 +30,8 @@
/**
* Diese Datenklasse beschreibt Versionsinformationen ber die VA-Net Bibliothek
*/
class VANET_API CVANetVersionInfo {
class VANET_API CVANetVersionInfo
{
public:
std::string sVersion; // Version als Zeichenkette (z.B. "1.02")
std::string sDate; // Datum der Erstellung bzw. Verffentlichung
......@@ -42,6 +43,6 @@ public:
};
//! Versionsnummer der VA-Net Bibliothek abrufen
void VANET_API GetVANetVersionInfo(CVANetVersionInfo* pVersionInfo);
void VANET_API GetVANetVersionInfo( CVANetVersionInfo* pVersionInfo );
#endif // __VANET_VERSION_H__
......@@ -2,38 +2,28 @@
#include <sstream>
std::string CVANetVersionInfo::ToString() const {
// Ausgabeformat: "VANet revision 1.24 [FLAGS] (COMMENT)"
std::string CVANetVersionInfo::ToString() const
{
// Ausgabeformat: "VANet v2016.a (COMMENT)"
std::stringstream ss;
ss << "VANet " << sVersion;
if (!sFlags.empty()) ss << " [" << sFlags << "]";
if (!sComments.empty()) ss << " (" << sComments << ")";
if( !sComments.empty() )
ss << " (" << sComments << ")";
return ss.str();
}
void GetVANetVersionInfo(CVANetVersionInfo* pVersionInfo) {
if (!pVersionInfo) return;
/* Format
#define VANET_SVN_DATE "$Date: 2012-06-26 15:43:10 +0200 (Di, 26 Jun 2012) $"
#define VANET_SVN_REVISION "$Revision: 2736 $"
*/
std::string sDate(VANET_SVN_DATE);
sDate = sDate.substr(7, 10);
std::string sRevision(VANET_SVN_REVISION);
sRevision = sRevision.substr(11, sRevision.length()-13);
void GetVANetVersionInfo( CVANetVersionInfo* pVersionInfo )
{
if( !pVersionInfo )
return;
std::stringstream ss;
ss << VANET_VERSION_MAJOR << "." << VANET_VERSION_MINOR << " (Rev. " << sRevision << ")";
ss << VANET_VERSION_MAJOR << "." << VANET_VERSION_MINOR;
pVersionInfo->sVersion = ss.str();
pVersionInfo->sDate = sDate;
pVersionInfo->sFlags = "";
#ifdef NDEBUG
pVersionInfo->sComments = "Release build";
pVersionInfo->sComments = "release";
#else
pVersionInfo->sComments = "Debug build";
pVersionInfo->sComments = "debug";
#endif
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment