CMake: Add ability to just print version string

This commit is contained in:
Vicki Pfau 2017-01-22 14:26:59 -08:00
parent d8687d32c4
commit 6a188289c2
2 changed files with 4 additions and 1 deletions

View File

@ -50,6 +50,7 @@ Misc:
- Core: Add generic checksum function - Core: Add generic checksum function
- Feature: Support ImageMagick 7 - Feature: Support ImageMagick 7
- All: Move time.h include to common.h - All: Move time.h include to common.h
- CMake: Add ability to just print version string
0.5.2: (2016-12-31) 0.5.2: (2016-12-31)
Bugfixes: Bugfixes:

View File

@ -43,7 +43,9 @@ if(NOT GIT_BRANCH)
set(GIT_BRANCH "(unknown)") set(GIT_BRANCH "(unknown)")
endif() 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) set(VERSION_STRING_CACHE ${VERSION_STRING} CACHE STRING "" FORCE)
if(CONFIG_FILE AND OUT_FILE) if(CONFIG_FILE AND OUT_FILE)