From 6a188289c209a3c905dc5209640904a91165c879 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 22 Jan 2017 14:26:59 -0800 Subject: [PATCH] CMake: Add ability to just print version string --- CHANGES | 1 + version.cmake | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index d221135bb..e5aac5658 100644 --- a/CHANGES +++ b/CHANGES @@ -50,6 +50,7 @@ Misc: - Core: Add generic checksum function - Feature: Support ImageMagick 7 - All: Move time.h include to common.h + - CMake: Add ability to just print version string 0.5.2: (2016-12-31) Bugfixes: diff --git a/version.cmake b/version.cmake index 0bd13337b..ea0adb380 100644 --- a/version.cmake +++ b/version.cmake @@ -43,7 +43,9 @@ if(NOT GIT_BRANCH) set(GIT_BRANCH "(unknown)") endif() -if(NOT VERSION_STRING_CACHE OR NOT VERSION_STRING STREQUAL VERSION_STRING_CACHE) +if(DEFINED PRINT_STRING) + message("${${PRINT_STRING}}") +elseif(NOT VERSION_STRING_CACHE OR NOT VERSION_STRING STREQUAL VERSION_STRING_CACHE) set(VERSION_STRING_CACHE ${VERSION_STRING} CACHE STRING "" FORCE) if(CONFIG_FILE AND OUT_FILE)