From 6f98039492c8de0c9d0dc7670248cd1678a0c7e4 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Thu, 23 May 2024 11:19:01 -0400 Subject: [PATCH] Don't include the -pre in install dir path. We version the docs install path, but there's no reason to include the -pre and git sha in the version for the path. With the git sha in particular, it could result in having a bunch of dirs for each separate git commit (annoying). This resolves #1928. --- CMakeLists.txt | 5 ++++- cmake/Conky.cmake | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38249316..a83b3ff3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) # 'core' CMake stuff include(Conky) +# Set project version, languages +project(conky VERSION ${RELEASE_VERSION} LANGUAGES C CXX) + # Handle build options include(ConkyBuildOptions) @@ -76,7 +79,7 @@ if(BUILD_TESTS) endif() if(NOT DEFINED DOC_PATH) - set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${VERSION}") + set(DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${RELEASE_VERSION}") endif(NOT DEFINED DOC_PATH) set(DOC_FILES extras/convert.lua data/conky_no_x11.conf data/conky.conf) diff --git a/cmake/Conky.cmake b/cmake/Conky.cmake index 18ee3646..f6e80e08 100644 --- a/cmake/Conky.cmake +++ b/cmake/Conky.cmake @@ -176,11 +176,13 @@ execute_process(COMMAND ${APP_GIT} rev-parse --short HEAD OUTPUT_VARIABLE GIT_SHORT_SHA OUTPUT_STRIP_TRAILING_WHITESPACE) +set(RELEASE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") + if(RELEASE) - set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") + set(VERSION ${RELEASE_VERSION}) else(RELEASE) set(VERSION - "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-pre-${GIT_SHORT_SHA}") + "${RELEASE_VERSION}-pre-${GIT_SHORT_SHA}") endif(RELEASE) set(COPYRIGHT "Copyright Brenden Matthews, et al, 2005-2024")