From 5ace57bada7de969aa41ef0c8544a3b4f867c117 Mon Sep 17 00:00:00 2001
From: Dilawar Singh <dilawars@ncbs.res.in>
Date: Sun, 23 Apr 2017 14:19:39 +0530
Subject: [PATCH] Cmake changes from chamcham branch. Build for launchpad.

---
 moose-core/CMakeLists.txt | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/moose-core/CMakeLists.txt b/moose-core/CMakeLists.txt
index 7e4a21d1..a9f04454 100644
--- a/moose-core/CMakeLists.txt
+++ b/moose-core/CMakeLists.txt
@@ -28,25 +28,21 @@ if( (NOT MOOSE_VERSION) AND GIT_EXEC)
         OUTPUT_STRIP_TRAILING_WHITESPACE
         )
     message(STATUS "+ Writing ${MOOSE_VERSION} to ${VERSION_FILE}" )
-    file(WRITE ${VERSION_FILE} ${MOOSE_VERSION})
 elseif( (NOT MOOSE_VERSION) AND (NOT GIT_EXEC) )
     message(STATUS "+ Reading ${VERSION_FILE}" )
-    if(EXISTS ${VERSION_FILE} )
-        file(READ ${VERSION_FILE} MOOSE_VERSION )
-    else()
-        string(TIMESTAMP MOOSE_VERSION "nightly-%Y%m%d" )
-        set(GIT_VERSION_OUTPUT "nightly" )
-    endif( )
+    string(TIMESTAMP MOOSE_VERSION "nightly-%Y%m%d" )
+    set(GIT_VERSION_OUTPUT "nightly" )
 elseif(MOOSE_VERSION)
     message(STATUS "+ Using user specified VERSION = ${MOOSE_VERSION}" )
-    file(WRITE ${VERSION_FILE} ${MOOSE_VERSION})
 else()
     message(FATAL_ERROR "Could not determine MOOSE_VERSION" )
 endif( )
-
 add_definitions( -DMOOSE_VERSION="${MOOSE_VERSION}")
 message( STATUS "MOOSE Version ${MOOSE_VERSION}" )
 
+# Write VERSION to a file VERSION so that setup.py can use it.
+file(WRITE ${VERSION_FILE} ${MOOSE_VERSION} )
+
 # This snippet is from LLVM project.
 # Sanity check our source directory to make sure that we are not trying to
 # generate an in-tree build (unless on MSVC_IDE, where it is ok), and to make
-- 
GitLab