Generate project version file for native builds

- The header file exposes a function that provides version information
   for native binaries
This commit is contained in:
Abhishek Aggarwal 2021-05-17 17:41:59 +02:00 committed by abhi-agg
parent 2e5880d3d4
commit 0ad583cc34
2 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,7 @@
# Generate version file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project_version.h.in
${CMAKE_CURRENT_SOURCE_DIR}/project_version.h @ONLY)
add_library(bergamot-translator STATIC
byte_array_util.cpp
text_processor.cpp

View File

@ -0,0 +1,19 @@
#pragma once
/*
* File project_version.h is generated using CMake. Do not modify project_version.h manually!
* Edit project_version.h.in file instead.
*/
#include <string>
namespace marian {
namespace bergamot {
std::string bergamotBuildVersion() {
// e.g. v1.2.3-alpha.1.1+abc123d
return "@PROJECT_VERSION_STRING_FULL@";
}
} // namespace bergamot
} // namespace marian