From 26754f80423d600b20be0b5492cf474a38967602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Fri, 25 Jan 2019 15:20:54 -1000 Subject: [PATCH] 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. --- CMakeLists.txt | 10 ++++++++++ cmake/config_posix.h.cmake | 6 ++++++ cmake/config_windows.h.cmake | 6 ++++++ 3 files changed, 22 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4757bc1..4c921e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,16 @@ project(libfreefare C) 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/") add_definitions("-std=c99") diff --git a/cmake/config_posix.h.cmake b/cmake/config_posix.h.cmake index 470acea..ec4579f 100644 --- a/cmake/config_posix.h.cmake +++ b/cmake/config_posix.h.cmake @@ -9,5 +9,11 @@ #cmakedefine HAVE_BYTESWAP_H @_HAVE_BYTESWAP_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__ */ diff --git a/cmake/config_windows.h.cmake b/cmake/config_windows.h.cmake index c59c63b..f5d4975 100644 --- a/cmake/config_windows.h.cmake +++ b/cmake/config_windows.h.cmake @@ -30,4 +30,10 @@ #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__ */