Add version header.
This commit is contained in:
parent
2ec7809a7d
commit
59778f0d75
@ -1,5 +1,9 @@
|
|||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
# Write version in header.
|
||||||
|
configure_file ("version.hpp.in"
|
||||||
|
"${PROJECT_BINARY_DIR}/version.hpp" @ONLY)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME})
|
add_library(${PROJECT_NAME})
|
||||||
|
|
||||||
file(GLOB_RECURSE sources_lib *.cpp)
|
file(GLOB_RECURSE sources_lib *.cpp)
|
||||||
|
15
src/version.hpp.in
Normal file
15
src/version.hpp.in
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#ifndef MASTODONPP_VERSION_HPP
|
||||||
|
#define MASTODONPP_VERSION_HPP
|
||||||
|
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
|
namespace mastodonpp
|
||||||
|
{
|
||||||
|
|
||||||
|
using std::string_view;
|
||||||
|
|
||||||
|
static constexpr string_view version = "@PROJECT_VERSION@";
|
||||||
|
|
||||||
|
} // namespace mastodonpp
|
||||||
|
|
||||||
|
#endif // MASTODONPP_VERSION_HPP
|
Loading…
x
Reference in New Issue
Block a user