feat: single version file

- Определение версий каждого модуля настраивалось в отдельном файле сборке.
  Решено что версии всех модулей будут одинаковы.
This commit is contained in:
amazing-hash 2024-04-19 00:51:04 +04:00
parent e1ea77c604
commit c87f04f7da
10 changed files with 19 additions and 30 deletions

View File

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.21)
project(va)
project(va VERSION 0.3.0)
configure_file (version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/version.h @ONLY)
add_subdirectory(va-recorder dist/va-recorder)
add_subdirectory(va-hls dist/va-hls)

View File

@ -1,7 +1,7 @@
#ifndef VERSION_H_IN
#define VERSION_H_IN
#define PROJECT_NAME "va-recorder"
#define PROJECT_NAME "va"
#define VERSION_MAJOR "0"
#define VERSION_MINOR "2"
#define VERSION_PATCH "0"

View File

@ -60,8 +60,6 @@ set(SRC_FILES
src/utils.cpp
)
configure_file (version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h @ONLY)
add_executable(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} pico)

View File

@ -6,10 +6,10 @@
#include <csignal>
#include <thread>
#include "../../version.h"
#include "server.h"
#include "settings.h"
#include "state/state.h"
#include "version.h"
namespace opt = boost::program_options;
namespace logging = boost::log;
@ -62,7 +62,7 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
signal(SIGINT, siginthandler);
BOOST_LOG_TRIVIAL(info) << "application " << PROJECT_NAME << " has been started "
BOOST_LOG_TRIVIAL(info) << "module va-hls has been started "
<< "ver." << VERSION_MAJOR << "." << VERSION_MINOR << "." << VERSION_PATCH;
BOOST_LOG_TRIVIAL(info) << "boost version " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "."
<< BOOST_VERSION % 100;

View File

@ -1,9 +0,0 @@
#ifndef VERSION_H_IN
#define VERSION_H_IN
#define PROJECT_NAME "va-hls"
#define VERSION_MAJOR "@va-hls_VERSION_MAJOR@"
#define VERSION_MINOR "@va-hls_VERSION_MINOR@"
#define VERSION_PATCH "@va-hls_VERSION_PATCH@"
#endif

View File

@ -68,8 +68,6 @@ set(SRC_FILES
include_directories(${FFMPEG_INCLUDE_DIRS})
configure_file (version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/version.h @ONLY)
add_executable(${PROJECT_NAME} ${SRC_FILES})
target_link_libraries(${PROJECT_NAME} ${FFMPEG_LIBRARIES} ${Boost_LIBRARIES})

View File

@ -1,8 +1,8 @@
#pragma once
#include "../../version.h"
#include "capture/capture.h"
#include "capture/ffmpeg/backend.h"
#include "source/source.h"
#include "version.h"
#include <boost/log/trivial.hpp>
#include <boost/version.hpp>
#include <thread>
@ -11,7 +11,7 @@ namespace va {
class App final {
public:
App() {
BOOST_LOG_TRIVIAL(info) << "application " << PROJECT_NAME << " has been started"
BOOST_LOG_TRIVIAL(info) << "module va-record has been started"
<< " ver." << VERSION_MAJOR << "." << VERSION_MINOR << "." << VERSION_PATCH;
BOOST_LOG_TRIVIAL(info) << "boost version " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000
<< "." << BOOST_VERSION % 100;

View File

@ -1,9 +0,0 @@
#ifndef VERSION_H_IN
#define VERSION_H_IN
#define PROJECT_NAME "va-recorder"
#define VERSION_MAJOR "@va-recorder_VERSION_MAJOR@"
#define VERSION_MINOR "@va-recorder_VERSION_MINOR@"
#define VERSION_PATCH "@va-recorder_VERSION_PATCH@"
#endif

View File

@ -1,9 +1,9 @@
#ifndef VERSION_H_IN
#define VERSION_H_IN
#define PROJECT_NAME "va-hls"
#define PROJECT_NAME "va"
#define VERSION_MAJOR "0"
#define VERSION_MINOR "1"
#define VERSION_MINOR "3"
#define VERSION_PATCH "0"
#endif

9
version.h.in Normal file
View File

@ -0,0 +1,9 @@
#ifndef VERSION_H_IN
#define VERSION_H_IN
#define PROJECT_NAME "va"
#define VERSION_MAJOR "@va_VERSION_MAJOR@"
#define VERSION_MINOR "@va_VERSION_MINOR@"
#define VERSION_PATCH "@va_VERSION_PATCH@"
#endif