From 45124ba69914e2874164fcb0de1aed136cc34b24 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 21 Sep 2022 10:22:57 +0200 Subject: [cmake] let CMake handle the version number The CPack module automatically uses the version information set for the current project. While at it include the CPack module to get targets like "make package". set PACKAGE_VERSION to $PROJECT_VERSION ($CMAKE_PROJECT_VERSION available starting with cmake 3.12.x (?)) github: closes #119 --- CMakeLists.txt | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index a78ff7e7..8845104c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ -project(lighttpd C) - cmake_minimum_required(VERSION 3.7.0 FATAL_ERROR) +project(lighttpd VERSION 1.4.68 LANGUAGES C) + # use C11 with CMake >= 3.1 set(CMAKE_C_STANDARD 11) @@ -11,11 +11,6 @@ include(CTest) enable_testing() -set(CPACK_PACKAGE_VERSION_MAJOR 1) -set(CPACK_PACKAGE_VERSION_MINOR 4) -set(CPACK_PACKAGE_VERSION_PATCH 68) -set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") - set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING") set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README") set(CPACK_PACKAGE_VENDOR "jan@kneschke.de") @@ -23,7 +18,7 @@ set(CPACK_PACKAGE_VENDOR "jan@kneschke.de") set(CPACK_SOURCE_GENERATOR "TGZ") set(CPACK_SOURCE_IGNORE_FILES "/\\\\.;~$;/_;build/;CMakeFiles/;CMakeCache;gz$;Makefile\\\\.;trace;Testing/;foo;autom4te;cmake_install;CPack;\\\\.pem;ltmain.sh;configure;libtool;/config\\\\.;missing;autogen.sh;install-sh;Dart;aclocal;log$;Makefile$") -set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") +include(CPack) include(GNUInstallDirs) -- cgit v1.2.1