mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 11:08:03 +02:00
Generate autotools provided PACKAGE_.. and VERSION defines by a cmake macro.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=67072 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
5366a920f4
commit
b1579df4ce
3 changed files with 74 additions and 1 deletions
|
|
@ -19,6 +19,14 @@ autoversion(../configure.ac dbus)
|
|||
# used by file version info
|
||||
set (DBUS_PATCH_VERSION "0")
|
||||
|
||||
# set PACKAGE_... variables
|
||||
autopackage(
|
||||
dbus
|
||||
${DBUS_VERSION_STRING}
|
||||
"http://dbus.freedesktop.org"
|
||||
"https://bugs.freedesktop.org/enter_bug.cgi?product=dbus"
|
||||
)
|
||||
|
||||
include(Macros)
|
||||
TIMESTAMP(DBUS_BUILD_TIMESTAMP)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,12 @@
|
|||
/* indicate that we are building with cmake */
|
||||
#define DBUS_CMAKE 1
|
||||
|
||||
@AUTOPACKAGE_CONFIG_H_TEMPLATE@
|
||||
|
||||
/*
|
||||
* Variables defined by AC_DEFINE in ../configure.ac
|
||||
* should be placed in this file
|
||||
*/
|
||||
#cmakedefine HAVE_GNUC_VARARGS 1
|
||||
|
||||
#cmakedefine DBUS_CONSOLE_AUTH_DIR "@DBUS_CONSOLE_AUTH_DIR@"
|
||||
|
|
@ -18,7 +24,6 @@
|
|||
#cmakedefine DBUS_SESSION_BUS_CONNECT_ADDRESS "@DBUS_SESSION_BUS_CONNECT_ADDRESS@"
|
||||
#cmakedefine DBUS_MACHINE_UUID_FILE "@DBUS_MACHINE_UUID_FILE@"
|
||||
#cmakedefine DBUS_DAEMONDIR "@DBUS_DAEMONDIR@"
|
||||
#cmakedefine PACKAGE "@PACKAGE@"
|
||||
|
||||
#cmakedefine DBUS_ENABLE_STATS
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,66 @@ macro(autoversion config prefix)
|
|||
|
||||
endmacro()
|
||||
|
||||
#
|
||||
# Defines package related variables (PACKAGE_..., PACKAGE and VERSION)
|
||||
# as done by autotools.
|
||||
#
|
||||
# Additional it defines a cmake variable named PACKAGE_CONFIG_H_TEMPLATE
|
||||
# which could be placed in config.h templates to have those variables
|
||||
# defined at code level like shown below:
|
||||
#
|
||||
# config.h.template
|
||||
# ...
|
||||
# @AUTOPACKAGE_CONFIG_H_TEMPLATE@
|
||||
# ...
|
||||
#
|
||||
macro(autopackage name version url support_url)
|
||||
# Define to the full name of this package.
|
||||
set(PACKAGE_NAME ${name})
|
||||
|
||||
# Define to the version of this package.
|
||||
set(PACKAGE_VERSION ${version})
|
||||
|
||||
# Define to the home page for this package.
|
||||
set(PACKAGE_URL ${url})
|
||||
|
||||
# Define to the address where bug reports for this package should be sent.
|
||||
set(PACKAGE_BUGREPORT ${support_url})
|
||||
|
||||
# Define to the full name and version of this package.
|
||||
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
|
||||
|
||||
# Define to the one symbol short name of this package.
|
||||
set(PACKAGE_TARNAME ${PACKAGE_NAME})
|
||||
|
||||
set(PACKAGE ${name})
|
||||
set(VERSION ${DBUS_VERSION_STRING})
|
||||
|
||||
set(AUTOPACKAGE_CONFIG_H_TEMPLATE "/* generated by cmake macro autopackage */\n
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT \"@PACKAGE_BUGREPORT@\"
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME \"@PACKAGE_NAME@\"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING \"@PACKAGE_STRING@\"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME \"@PACKAGE_TARNAME@\"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL \"@PACKAGE_URL@\"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION \"@PACKAGE_VERSION@\"
|
||||
|
||||
/* defined by autotools package */
|
||||
#define PACKAGE \"@PACKAGE@\"
|
||||
#define VERSION \"@VERSION@\"
|
||||
")
|
||||
endmacro(autopackage)
|
||||
|
||||
#
|
||||
# parses config.h template and create cmake equivalent
|
||||
# not implemented yet
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue