api: Adjust and fix version stuff

Update correct version number. Remove extra uvgrtp from file/function
names.
This commit is contained in:
Joni Räsänen 2021-08-30 15:25:29 +03:00
parent c265fdbd41
commit d5c2212b40
7 changed files with 33 additions and 33 deletions

View File

@ -1,3 +1,3 @@
set(uvgrtp_VER 2.0.0)
set(uvgrtp_VER 2.0.1)
set(uvgrtp_DESCR "uvgRTP is an Real-Time Transport Protocol (RTP) library written in C++ with a focus on simple to use and high-efficiency media delivery over the internet")
set(uvgrtp_URL "https://github.com/ultravideo/uvgRTP")

View File

@ -21,11 +21,11 @@ else()
set (LIBRARY_VERSION ${PROJECT_VERSION}${uvgrtp_GIT_HASH})
endif()
configure_file(cmake/uvgrtp_version.cpp.in uvgrtp_version.cpp
configure_file(cmake/version.cpp.in version.cpp
@ONLY
)
add_library(${PROJECT_NAME}_version OBJECT
${CMAKE_CURRENT_BINARY_DIR}/uvgrtp_version.cpp)
${CMAKE_CURRENT_BINARY_DIR}/version.cpp)
target_include_directories(${PROJECT_NAME}_version
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include
)

View File

@ -1,16 +0,0 @@
#include "uvgrtp_version.h"
#include <cstdint>
#include <string>
namespace uvgrtp {
std::string get_uvgrtp_version() { return "@uvgrtp_VERSION@"; }
uint16_t get_uvgrtp_version_major() { return @uvgrtp_VERSION_MAJOR@; }
uint16_t get_uvgrtp_version_minor() { return @uvgrtp_VERSION_MINOR@; }
uint16_t get_uvgrtp_version_patch() { return @uvgrtp_VERSION_PATCH@; }
std::string get_git_hash() {return "@uvgrtp_GIT_HASH@";}
} // namespace uvgrtp

16
cmake/version.cpp.in Normal file
View File

@ -0,0 +1,16 @@
#include "version.h"
#include <cstdint>
#include <string>
namespace uvgrtp {
std::string get_version() { return "@uvgrtp_VERSION@"; }
uint16_t get_version_major() { return @uvgrtp_VERSION_MAJOR@; }
uint16_t get_version_minor() { return @uvgrtp_VERSION_MINOR@; }
uint16_t get_version_patch() { return @uvgrtp_VERSION_PATCH@; }
std::string get_git_hash() {return "@uvgrtp_GIT_HASH@";}
} // namespace uvgrtp

View File

@ -1,12 +0,0 @@
#pragma once
#include <cstdint>
#include <string>
namespace uvgrtp {
std::string get_uvgrtp_version();
uint16_t get_uvgrtp_version_major();
uint16_t get_uvgrtp_version_minor();
uint16_t get_uvgrtp_version_patch();
std::string get_git_hash();
} // namespace uvgrtp

12
include/version.h Normal file
View File

@ -0,0 +1,12 @@
#pragma once
#include <cstdint>
#include <string>
namespace uvgrtp {
std::string get_version();
uint16_t get_version_major();
uint16_t get_version_minor();
uint16_t get_version_patch();
std::string get_git_hash();
} // namespace uvgrtp

View File

@ -1,6 +1,6 @@
#include "uvgrtp_version.h"
#include "version.h"
#include <gtest/gtest.h>
TEST(DefaultTest, ctor) {
EXPECT_STREQ("2.1.0", uvgrtp::get_uvgrtp_version().c_str());
EXPECT_STREQ("2.0.1", uvgrtp::get_version().c_str());
}