diff --git a/CMakeLists.txt b/CMakeLists.txt index a3fe59e..8e75384 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,12 +94,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC") set(ANBOX_TRANSLATOR_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/anbox/translators) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTRANSLATOR_INSTALL_DIR=\\\"${CMAKE_INSTALL_PREFIX}/${ANBOX_TRANSLATOR_INSTALL_DIR}\\\"") -if (NOT VERSION) - set(VERSION 2) +if (NOT ANBOX_VERSION) + set(ANBOX_VERSION 2) if ("${cmake_build_type_lower}" STREQUAL "release") - set(VERSION_SUFFIX "") + set(ANBOX_VERSION_SUFFIX "") else() - set(VERSION_SUFFIX dev) + set(ANBOX_VERSION_SUFFIX dev) endif() endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/anbox/build/version.h.in diff --git a/src/anbox/build/version.h.in b/src/anbox/build/version.h.in index da4a288..e6dcbbd 100644 --- a/src/anbox/build/version.h.in +++ b/src/anbox/build/version.h.in @@ -26,12 +26,12 @@ namespace anbox { namespace build { /// @brief version_major marks the major version -static constexpr const std::uint32_t version_major{@VERSION@}; +static constexpr const std::uint32_t version_major{@ANBOX_VERSION@}; /// @brief version_suffix is an additional suffix which can be amended to /// the major version number to indicate a dev build for example. -static const std::string version_suffix{"@VERSION_SUFFIX@"}; +static constexpr const char *version_suffix{"@ANBOX_VERSION_SUFFIX@"}; /// @brief version queries the version of Anbox -std::string version(); +std::string print_version(); } // namespace build } // namespace anbox diff --git a/src/anbox/cmds/system_info.cpp b/src/anbox/cmds/system_info.cpp index d503cc0..ef90366 100644 --- a/src/anbox/cmds/system_info.cpp +++ b/src/anbox/cmds/system_info.cpp @@ -50,7 +50,7 @@ class SystemInformation { std::stringstream s; s << "version: " - << anbox::build::version() + << anbox::build::print_version() << std::endl; s << "os:" << std::endl diff --git a/src/anbox/cmds/version.cpp b/src/anbox/cmds/version.cpp index 3ce15e1..d8aef39 100644 --- a/src/anbox/cmds/version.cpp +++ b/src/anbox/cmds/version.cpp @@ -26,7 +26,7 @@ anbox::cmds::Version::Version() cli::Name{"version"}, cli::Usage{"version"}, cli::Description{"print the version of the daemon"}} { action([](const cli::Command::Context& ctxt) { - ctxt.cout << "anbox " << build::version() << std::endl; + ctxt.cout << "anbox " << build::print_version() << std::endl; return 0; }); }