/* 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@"
#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
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
#