Skip to content
Snippets Groups Projects
Commit cc8759c2 authored by Dilawar Singh's avatar Dilawar Singh
Browse files

Squashed 'moose-core/' changes from 4f391e1..6099142

6099142 Added missing Revision macro file from chamcham branch.
d0a81a4 Merge commit 'b4d20b7c'
79d7a4c Fixed revision issue.
985e8b5 Cmake changes from chamcham branch. Build for launchpad.

git-subtree-dir: moose-core
git-subtree-split: 6099142d63632177056c3077d6d84035388cb93f
parent b4d20b7c
No related branches found
No related tags found
No related merge requests found
......@@ -11,9 +11,11 @@ endif(COMMAND cmake_policy)
project(MOOSE)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
include(CheckCXXCompiler.cmake)
include(CheckIncludeFileCXX)
include(FindPkgConfig)
include(GetRevision)
# If from command line, version info is not passed, use the git to generate a
# version file. If GIT fails, use the previous known version.
......@@ -27,19 +29,14 @@ if( (NOT MOOSE_VERSION) AND GIT_EXEC)
OUTPUT_VARIABLE MOOSE_VERSION
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( )
endif( )
# Default to current date.
if( (NOT MOOSE_VERSION) )
NOW(TIMESTAMP)
set(MOOSE_VERSION "nightly-${TIMESTAMP}" )
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( )
......@@ -47,6 +44,9 @@ 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
......@@ -103,9 +103,6 @@ option(WITH_MPI "Enable Openmpi support" OFF)
option(WITH_BOOST "Use boost library instead of GSL" OFF)
option(WITH_GSL "Use gsl-library. Alternative is WITH_BOOST" ON)
################################# CMKAE MACROS #################################
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
############################ BUILD CONFIGURATION #################################
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
MACRO(NOW RESULT)
IF(CMAKE_VERSION VERSION_GREATER "2.8.10")
STRING(TIMESTAMP ${RESULT} "%Y%m%d")
ELSE()
IF(WIN32)
EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME)
IF(NOT DATETIME MATCHES "ERROR")
STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}")
ENDIF()
ELSEIF(UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE DATETIME)
STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}")
ELSE()
MESSAGE(SEND_ERROR "date not implemented")
SET(${RESULT} "00000000")
ENDIF()
ENDIF()
ENDMACRO()
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment