forked from BlueQuartzSoftware/simplnx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Additions to nxrunner for detailed version information. (BlueQua…
…rtzSoftware#752) * ENH: additions to nxrunner for detailed version information. Signed-off-by: Michael Jackson <[email protected]> * Fix QString usages. Signed-off-by: Michael Jackson <[email protected]> * Update cmake/ComplexVersion.hpp Co-authored-by: Nathan Young <[email protected]> * Address Code Review Feedback Signed-off-by: Michael Jackson <[email protected]> * Fix failing unit test Signed-off-by: Michael Jackson <[email protected]> * Export out the ComplexVersion namespace symbols Signed-off-by: Michael Jackson <[email protected]> --------- Signed-off-by: Michael Jackson <[email protected]> Co-authored-by: Nathan Young <[email protected]>
- Loading branch information
1 parent
8c0c279
commit 6a32bc6
Showing
8 changed files
with
452 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
/*-------------------------------------------------------------------------- | ||
* This file is autogenerated from: | ||
* @CMAKE_CURRENT_LIST_DIR@/ComplexVersion.cpp.in | ||
* during the cmake configuration of your project. If you need to make changes, | ||
* edit the original file NOT THIS FILE. | ||
* --------------------------------------------------------------------------*/ | ||
|
||
#include "ComplexVersion.hpp" | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::ApplicationName() | ||
{ | ||
return {"@PROJECT_PREFIX@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::Complete() | ||
{ | ||
return {"@VERSION_GEN_VER_MAJOR@.@VERSION_GEN_VER_MINOR@.@VERSION_GEN_VER_PATCH@@VERSION_GEN_VER_SUFFIX@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::Major() | ||
{ | ||
return {"@VERSION_GEN_VER_MAJOR@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::Minor() | ||
{ | ||
return {"@VERSION_GEN_VER_MINOR@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::Patch() | ||
{ | ||
return {"@VERSION_GEN_VER_PATCH@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::Suffix() | ||
{ | ||
return {"@VERSION_GEN_VER_SUFFIX@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::Package() | ||
{ | ||
return {"@VERSION_GEN_VER_MAJOR@.@VERSION_GEN_VER_MINOR@.@VERSION_GEN_VER_PATCH@@VERSION_GEN_VER_SUFFIX@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::PackageComplete() | ||
{ | ||
return {"@PROJECT_PREFIX@ Version @VERSION_GEN_VER_MAJOR@.@VERSION_GEN_VER_MINOR@.@VERSION_GEN_VER_PATCH@@VERSION_GEN_VER_SUFFIX@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::BuildDate() | ||
{ | ||
return {"@VERSION_BUILD_DATE@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::GitHashShort() | ||
{ | ||
return {"@VERSION_GEN_GIT_HASH_SHORT@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@GVS_STRING_CLASS@ @VERSION_GEN_NAMESPACE@::Version::GitHash() | ||
{ | ||
return {"@GVS_GIT_HASH@"}; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@VERSION_GEN_NAMESPACE@::Version::AppVersion::AppVersion() = default; | ||
|
||
// ----------------------------------------------------------------------------- | ||
@VERSION_GEN_NAMESPACE@::Version::AppVersion::AppVersion(int majorNum, int minorNum, int patchNum) | ||
{ | ||
m_MajorNum = majorNum; | ||
m_MinorNum = minorNum; | ||
m_PatchNum = patchNum; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@VERSION_GEN_NAMESPACE@::Version::AppVersion::~AppVersion() = default; | ||
|
||
// ----------------------------------------------------------------------------- | ||
@VERSION_GEN_NAMESPACE@::Version::AppVersion::AppVersion(const @VERSION_GEN_NAMESPACE@::Version::AppVersion& rhs) | ||
{ | ||
m_MajorNum = rhs.m_MajorNum; | ||
m_MinorNum = rhs.m_MinorNum; | ||
m_PatchNum = rhs.m_PatchNum; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
@VERSION_GEN_NAMESPACE@::Version::AppVersion& @VERSION_GEN_NAMESPACE@::Version::AppVersion::operator=(const AppVersion& rhs) = default; | ||
|
||
// ----------------------------------------------------------------------------- | ||
bool @VERSION_GEN_NAMESPACE@::Version::AppVersion::operator==(const @VERSION_GEN_NAMESPACE@::Version::AppVersion& rhs) | ||
{ | ||
return (m_MajorNum == rhs.m_MajorNum && m_MinorNum == rhs.m_MinorNum && m_PatchNum == rhs.m_PatchNum); | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
bool @VERSION_GEN_NAMESPACE@::Version::AppVersion::operator>(const @VERSION_GEN_NAMESPACE@::Version::AppVersion& rhs) | ||
{ | ||
if(m_MajorNum > rhs.m_MajorNum) | ||
{ | ||
return true; | ||
} | ||
|
||
if(m_MajorNum == rhs.m_MajorNum) | ||
{ | ||
if(m_MinorNum > rhs.m_MinorNum) | ||
{ | ||
return true; | ||
} | ||
|
||
if(m_MinorNum == rhs.m_MinorNum) | ||
{ | ||
return m_PatchNum > rhs.m_PatchNum; | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
bool @VERSION_GEN_NAMESPACE@::Version::AppVersion::operator<(const @VERSION_GEN_NAMESPACE@::Version::AppVersion& rhs) | ||
{ | ||
if(m_MajorNum < rhs.m_MajorNum) | ||
{ | ||
return true; | ||
} | ||
|
||
if(m_MajorNum == rhs.m_MajorNum) | ||
{ | ||
if(m_MinorNum < rhs.m_MinorNum) | ||
{ | ||
return true; | ||
} | ||
|
||
if(m_MinorNum == rhs.m_MinorNum) | ||
{ | ||
return m_PatchNum < rhs.m_PatchNum; | ||
} | ||
return false; | ||
} | ||
return false; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
int @VERSION_GEN_NAMESPACE@::Version::AppVersion::getMajorNum() | ||
{ | ||
return m_MajorNum; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
int @VERSION_GEN_NAMESPACE@::Version::AppVersion::getMinorNum() | ||
{ | ||
return m_MinorNum; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
int @VERSION_GEN_NAMESPACE@::Version::AppVersion::getPatchNum() | ||
{ | ||
return m_PatchNum; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
void @VERSION_GEN_NAMESPACE@::Version::AppVersion::setMajorNum(int major) | ||
{ | ||
m_MajorNum = major; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
void @VERSION_GEN_NAMESPACE@::Version::AppVersion::setMinorNum(int minor) | ||
{ | ||
m_MinorNum = minor; | ||
} | ||
|
||
// ----------------------------------------------------------------------------- | ||
void @VERSION_GEN_NAMESPACE@::Version::AppVersion::setPatchNum(int patch) | ||
{ | ||
m_PatchNum = patch; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#pragma once | ||
|
||
#include "complex/complex_export.hpp" | ||
|
||
#include <string> | ||
|
||
namespace complex::Version | ||
{ | ||
|
||
COMPLEX_EXPORT std::string ApplicationName(); | ||
COMPLEX_EXPORT std::string Complete(); | ||
COMPLEX_EXPORT std::string Major(); | ||
COMPLEX_EXPORT std::string Minor(); | ||
COMPLEX_EXPORT std::string Patch(); | ||
COMPLEX_EXPORT std::string Suffix(); | ||
COMPLEX_EXPORT std::string Package(); | ||
COMPLEX_EXPORT std::string PackageComplete(); | ||
COMPLEX_EXPORT std::string BuildDate(); | ||
COMPLEX_EXPORT std::string GitHashShort(); | ||
COMPLEX_EXPORT std::string GitHash(); | ||
|
||
class COMPLEX_EXPORT AppVersion | ||
{ | ||
public: | ||
AppVersion(); | ||
AppVersion(int majorNum, int minorNum, int patchNum); | ||
|
||
AppVersion(const AppVersion&); | ||
AppVersion(const AppVersion&&) = delete; | ||
AppVersion& operator=(const AppVersion&); | ||
AppVersion& operator=(AppVersion&&) = delete; | ||
|
||
bool operator==(const AppVersion&); | ||
bool operator>(const AppVersion&); | ||
bool operator<(const AppVersion&); | ||
|
||
virtual ~AppVersion(); | ||
|
||
int getMajorNum(); | ||
int getMinorNum(); | ||
int getPatchNum(); | ||
|
||
void setMajorNum(int major); | ||
void setMinorNum(int minor); | ||
void setPatchNum(int patch); | ||
|
||
private: | ||
int m_MajorNum = -1; | ||
int m_MinorNum = -1; | ||
int m_PatchNum = -1; | ||
}; | ||
} // namespace complex::Version |
Oops, something went wrong.