Make CMake emit PACKAGE_VERSION in config.h

This is required for the upcomming freefare_version() function, and
mimics what is produced by the autotools.
This commit is contained in:
Romain Tartière 2019-01-25 15:20:54 -10:00
parent 4deb8c998a
commit 26754f8042
3 changed files with 22 additions and 0 deletions

View file

@ -1,6 +1,16 @@
project(libfreefare C) project(libfreefare C)
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
SET(VERSION_MAJOR "0")
SET(VERSION_MINOR "4")
SET(VERSION_PATCH "0")
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
SET(PACKAGE_NAME "libnfc")
SET(PACKAGE_VERSION ${VERSION})
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
add_definitions("-std=c99") add_definitions("-std=c99")

View file

@ -9,5 +9,11 @@
#cmakedefine HAVE_BYTESWAP_H @_HAVE_BYTESWAP_H@ #cmakedefine HAVE_BYTESWAP_H @_HAVE_BYTESWAP_H@
#cmakedefine HAVE_COREFOUNDATION_COREFOUNDATION_H @_HAVE_COREFOUNDATION_COREFOUNDATION_H@ #cmakedefine HAVE_COREFOUNDATION_COREFOUNDATION_H @_HAVE_COREFOUNDATION_COREFOUNDATION_H@
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
#cmakedefine _XOPEN_SOURCE @_XOPEN_SOURCE@
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
#endif /* !__CONFIG_POSIX_H__ */ #endif /* !__CONFIG_POSIX_H__ */

View file

@ -30,4 +30,10 @@
#define ENOTSUP WSAEOPNOTSUPP #define ENOTSUP WSAEOPNOTSUPP
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
#cmakedefine PACKAGE_STRING "@PACKAGE_STRING@"
#cmakedefine _XOPEN_SOURCE @_XOPEN_SOURCE@
#cmakedefine SYSCONFDIR "@SYSCONFDIR@"
#endif /* !__CONFIG_WINDOWS_H__ */ #endif /* !__CONFIG_WINDOWS_H__ */