less assumptions about the generated CMakeLists.txt

This commit is contained in:
Radovan Bast
2015-06-04 14:13:25 +02:00
parent ea10164306
commit 77f6b62829
4 changed files with 25 additions and 30 deletions

9
modules/version.cmake Normal file
View File

@ -0,0 +1,9 @@
# determine program version from file, example: "14.1"
# the reason why this information is stored
# in a file and not as cmake variable
# is that cmake-unaware programs can
# parse and use it (e.g. Sphinx)
if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION")
file(READ "${PROJECT_SOURCE_DIR}/VERSION" PROGRAM_VERSION)
string(STRIP "${PROGRAM_VERSION}" PROGRAM_VERSION)
endif()