cmake: consolidate version strings
This commit is contained in:
parent
46f03fd6a6
commit
9206a60e88
|
@ -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@"
|
||||
|
|
|
@ -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} )
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -23,5 +23,6 @@
|
|||
#define AWESOME_COMMON_VERSION_H
|
||||
|
||||
void eprint_version(const char *const executable) __attribute__ ((noreturn));
|
||||
const char *version_string(void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
3
lua.c
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\"");
|
||||
|
|
Loading…
Reference in New Issue