diff options
author | Rolf Eike Beer <eb@emlix.com> | 2022-09-21 10:22:57 +0200 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2022-09-23 03:39:22 -0400 |
commit | 45124ba69914e2874164fcb0de1aed136cc34b24 (patch) | |
tree | 52779991528a81aee344e5875fe67d1fcc56b2c1 | |
parent | f98cc6743821b8bfa342dabb9a7d5a06ce6b93fe (diff) | |
download | lighttpd-git-45124ba69914e2874164fcb0de1aed136cc34b24.tar.gz |
[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
-rw-r--r-- | CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 |
2 files changed, 4 insertions, 9 deletions
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) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1b52fa4c..b3399e04 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -831,7 +831,7 @@ endif() set(LIGHTTPD_VERSION_ID 10400) set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}") -set(PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}") +set(PACKAGE_VERSION "${PROJECT_VERSION}") if(NOT SBINDIR) set(SBINDIR "sbin") |