diff --git a/cmake/modules/SRSLTEVersion.cmake b/cmake/modules/SRSLTEVersion.cmake index 6a26644d2..86d6cbd8f 100644 --- a/cmake/modules/SRSLTEVersion.cmake +++ b/cmake/modules/SRSLTEVersion.cmake @@ -21,4 +21,4 @@ SET(SRSLTE_VERSION_MAJOR 001) SET(SRSLTE_VERSION_MINOR 000) SET(SRSLTE_VERSION_PATCH 000) -SET(SRSLTE_VERSION "${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}.${SRSLTE_VERSION_PATCH}") +SET(SRSLTE_VERSION_STRING "${SRSLTE_VERSION_MAJOR}.${SRSLTE_VERSION_MINOR}.${SRSLTE_VERSION_PATCH}") diff --git a/srslte/include/srslte/version.h.in b/srslte/include/srslte/version.h.in index 770569bcf..66174eee9 100644 --- a/srslte/include/srslte/version.h.in +++ b/srslte/include/srslte/version.h.in @@ -32,7 +32,20 @@ #define SRSLTE_VERSION_MAJOR @SRSLTE_VERSION_MAJOR@ #define SRSLTE_VERSION_MINOR @SRSLTE_VERSION_MINOR@ #define SRSLTE_VERSION_PATCH @SRSLTE_VERSION_PATCH@ -#define SRSLTE_VERSION @SRSLTE_VERSION@ +#define SRSLTE_VERSION_STRING @SRSLTE_VERSION_STRING@ + +#define SRSLTE_VERSION_ENCODE(major, minor, patch) ( \ + ((major) * 10000) \ + + ((minor) * 100) \ + + ((patch) * 1)) + +#define SRSLTE_VERSION SRSLTE_VERSION_ENCODE( \ + SRSLTE_VERSION_MAJOR, \ + SRSLTE_VERSION_MINOR, \ + SRSLTE_VERSION_PATCH) + +#define SRSLTE_VERSION_CHECK(major,minor,patch) \ + (SRSLTE_VERSION >= SRSLTE_VERSION_ENCODE(major,minor,patch)) #include "srslte/config.h"