diff options
Diffstat (limited to 'cmake/modules/MacrosAutotools.cmake')
-rw-r--r-- | cmake/modules/MacrosAutotools.cmake | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/cmake/modules/MacrosAutotools.cmake b/cmake/modules/MacrosAutotools.cmake index ff30eaf9..68e8ae51 100644 --- a/cmake/modules/MacrosAutotools.cmake +++ b/cmake/modules/MacrosAutotools.cmake @@ -23,6 +23,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 # |