Skip to content

Commit 00ea9d3

Browse files
author
Dilawar Singh
committed
Close #169. Renamed MOOSE_VERSION to _MOOSE_VERSION.
Since only developers uses it, it is safe to leave it undocumented in CMakeLists.txt. This variable is automatically set by git when building from git repisitory. When git is not found, then one needs to pass this information from command line. This may break the build in `moose-package` repository in future. Linux builds are safe on Open Build Service since cmake available on those platforms are now new enough.
1 parent da0db90 commit 00ea9d3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

CMakeLists.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ include(FindPkgConfig)
2020
set(VERSION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/VERSION)
2121
find_program(GIT_EXEC "git")
2222
message( STATUS "Looking for git ${GIT_EXEC}" )
23-
if( (NOT __VERSION__) AND GIT_EXEC)
23+
if( (NOT _MOOSE_VERSION) AND GIT_EXEC)
2424
execute_process(
2525
COMMAND ${GIT_EXEC} describe --tags --long
2626
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
27-
OUTPUT_VARIABLE __VERSION__
27+
OUTPUT_VARIABLE _MOOSE_VERSION
2828
OUTPUT_STRIP_TRAILING_WHITESPACE
2929
)
30-
message(STATUS "+ Writing ${__VERSION__} to ${VERSION_FILE}" )
31-
file(WRITE ${VERSION_FILE} ${__VERSION__})
32-
elseif( (NOT __VERSION__) AND (NOT GIT_EXEC) )
30+
message(STATUS "+ Writing ${_MOOSE_VERSION} to ${VERSION_FILE}" )
31+
file(WRITE ${VERSION_FILE} ${_MOOSE_VERSION})
32+
elseif( (NOT _MOOSE_VERSION) AND (NOT GIT_EXEC) )
3333
message(STATUS "+ Reading ${VERSION_FILE}" )
3434
file(READ ${VERSION_FILE} GIT_VERSION_OUTPUT )
35-
elseif(__VERSION__)
36-
message(STATUS "+ Using user specified VERSION = ${__VERSION__}" )
37-
file(WRITE ${VERSION_FILE} ${__VERSION__})
35+
elseif(_MOOSE_VERSION)
36+
message(STATUS "+ Using user specified VERSION = ${_MOOSE_VERSION}" )
37+
file(WRITE ${VERSION_FILE} ${_MOOSE_VERSION})
3838
else()
39-
message(FATAL_ERROR "Could not determine __VERSION__" )
39+
message(FATAL_ERROR "Could not determine _MOOSE_VERSION" )
4040
endif( )
4141

42-
add_definitions( -D__VERSION__="${__VERSION__}")
43-
message( STATUS "MOOSE Version ${__VERSION__}" )
42+
add_definitions( -DMOOSE_VERSION="${_MOOSE_VERSION}")
43+
message( STATUS "MOOSE Version ${_MOOSE_VERSION}" )
4444

4545
# This snippet is from LLVM project.
4646
# Sanity check our source directory to make sure that we are not trying to

0 commit comments

Comments
 (0)