From 6f2e144658f00a1e36215d853341aba0bb0fcb0c Mon Sep 17 00:00:00 2001 From: Matthew Chaplain Date: Wed, 27 Apr 2022 19:11:33 +0200 Subject: [PATCH] Version number can be set as a cmake property. It is usually gleaned from the git history, but this makes it settable outside of a repository (e.g. in someone elses CI build) --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba97d31c..d7cac6cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,12 @@ message("Building Terminal++ with only documentation: ${TERMINALPP_DOC_ONLY}") set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") -include(function-git_version) -git_version(TERMINALPP) +# If the version is not passed in, then determine it from git history. +if (NOT TERMINALPP_VERSION) + include(function-git_version) + git_version(TERMINALPP) +endif() + message(STATUS "Terminal++ Version: ${TERMINALPP_VERSION}") project(TERMINALPP VERSION ${TERMINALPP_VERSION})