From 4e2da287053dd8e1dc5f616eafc83d25623c5929 Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Sat, 23 May 2015 11:02:18 +0200 Subject: [PATCH] read VERSION file only if it exists --- bootstrap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap.py b/bootstrap.py index a8f56fd..8a716ea 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -176,8 +176,10 @@ def gen_cmakelists(config, relative_path, list_of_modules): s.append('# in a file and not as cmake variable') s.append('# is that cmake-unaware programs can') s.append('# parse and use it (e.g. Sphinx)') - s.append('file(READ "${PROJECT_SOURCE_DIR}/VERSION" PROGRAM_VERSION)') - s.append('string(STRIP "${PROGRAM_VERSION}" PROGRAM_VERSION)') + s.append('if(EXISTS "${PROJECT_SOURCE_DIR}/VERSION")') + s.append(' file(READ "${PROJECT_SOURCE_DIR}/VERSION" PROGRAM_VERSION)') + s.append(' string(STRIP "${PROGRAM_VERSION}" PROGRAM_VERSION)') + s.append('endif()') s.append('\n') s.append('# generated cmake files will be written to this path')