Skip to content
Browse files

cmake: consolidate version strings

  • Loading branch information...
1 parent 46f03fd commit 9206a60e8840ce9c7e3877f2fd07b03fbb5e0904 @ebfe ebfe committed with jd
Showing with 15 additions and 6 deletions.
  1. +1 −1 awesome-version-internal.h.in
  2. +1 −1 awesomeConfig.cmake
  3. +10 −1 common/version.c
  4. +1 −0 common/version.h
  5. +0 −2 config.h.in
  6. +2 −1 lua.c
View
2 awesome-version-internal.h.in
@@ -1,7 +1,7 @@
#ifndef _AWE_VERSION_INTERNAL_H_
#define _AWE_VERSION_INTERNAL_H_
-#define AWESOME_VERSION_INTERNAL "@AWESOME_VERSION_INTERNAL@"
+#define AWESOME_VERSION "@AWESOME_VERSION@"
#define AWESOME_COMPILE_MACHINE "@AWESOME_COMPILE_MACHINE@"
#define AWESOME_COMPILE_BY "@AWESOME_COMPILE_BY@"
#define AWESOME_COMPILE_HOSTNAME "@AWESOME_COMPILE_HOSTNAME@"
View
2 awesomeConfig.cmake
@@ -161,7 +161,7 @@ ENDIF()
IF(DEFINED PREFIX)
SET(CMAKE_INSTALL_PREFIX ${PREFIX})
ENDIF()
-SET(AWESOME_VERSION_INTERNAL devel )
+SET(AWESOME_VERSION ${VERSION} )
SET(AWESOME_COMPILE_MACHINE ${CMAKE_SYSTEM_PROCESSOR} )
SET(AWESOME_COMPILE_HOSTNAME $ENV{HOSTNAME} )
SET(AWESOME_COMPILE_BY $ENV{USER} )
View
11 common/version.c
@@ -32,7 +32,7 @@
void
eprint_version(const char *const executable)
{
- printf("%s (awesome) " AWESOME_VERSION_INTERNAL
+ printf("%s (awesome) " AWESOME_VERSION
" (" AWESOME_RELEASE ")\n"
"built",
executable);
@@ -50,4 +50,13 @@ eprint_version(const char *const executable)
exit(EXIT_SUCCESS);
}
+/** Get version string.
+ * \return A string describing the current version.
+ */
+const char*
+version_string(void)
+{
+ return AWESOME_VERSION;
+}
+
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
View
1 common/version.h
@@ -23,5 +23,6 @@
#define AWESOME_COMMON_VERSION_H
void eprint_version(const char *const executable) __attribute__ ((noreturn));
+const char *version_string(void);
#endif
View
2 config.h.in
@@ -1,10 +1,8 @@
#ifndef _CONFIG_H_
#define _CONFIG_H_
-#define AWESOME_RELEASE "@AWESOME_RELEASE@"
#define AWESOME_LUA_LIB_PATH "@AWESOME_LUA_LIB_PATH@"
#define AWESOME_CONF_PATH "@AWESOME_CONF_PATH@"
-#define VERSION "@VERSION@"
#cmakedefine WITH_DBUS
#cmakedefine WITH_IMLIB2
View
3 lua.c
@@ -45,6 +45,7 @@
#include "screen.h"
#include "layouts/tile.h"
#include "common/socket.h"
+#include "common/version.h"
extern awesome_t globalconf;
@@ -540,7 +541,7 @@ luaA_init(void)
luaA_openlib(L, "keybinding", awesome_keybinding_methods, awesome_keybinding_meta);
lua_pushliteral(L, "AWESOME_VERSION");
- lua_pushliteral(L, VERSION);
+ lua_pushstring(L, version_string());
lua_settable(L, LUA_GLOBALSINDEX);
luaA_dostring(L, "package.path = package.path .. \";" AWESOME_LUA_LIB_PATH "/?.lua\"");

0 comments on commit 9206a60

Please sign in to comment.
Something went wrong with that request. Please try again.