diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f0268ea45b523fa87998935464b0d47e96fac0b..51a2009e6e05b4376caa9fe7895880915b06dc31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,25 +17,30 @@ include(FindPkgConfig) # 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. -set(VERSION_FILE ${CMAKE_SOURCE_DIRECTORY}/VERSION) +set(VERSION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/VERSION) find_program(GIT_EXEC "git") message( STATUS "Looking for git ${GIT_EXEC}" ) -if( (NOT VERSION) AND GITEXEC) +if( (NOT MOOSE_VERSION) AND GIT_EXEC) execute_process( COMMAND ${GIT_EXEC} describe --tags --long WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - OUTPUT_VARIABLE GIT_VERSION_OUTPUT + OUTPUT_VARIABLE MOOSE_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) - file(WRITE ${VERSION_FILE} ${GIT_VERSION_OUTPUT}) - add_definitions( -DMOOSE_VERSION="${GIT_VERSION_OUTPUT}") -elseif( (NOT VERSION) AND (NOT GIT_EXEC) ) - file( READ ${VERSION_FILE} GIT_VERSION_OUTPUT ) - add_definitions( -DMOOSE_VERSION="${GIT_VERSION_OUTPUT}") + 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}" ) + file(READ ${VERSION_FILE} GIT_VERSION_OUTPUT ) +elseif(MOOSE_VERSION) + message(STATUS "+ Using user VERSION ${MOOSE_VERSION}" ) + file(WRITE ${VERSION_FILE} ${MOOSE_VERSION}) else() - add_definitions( -DMOOSE_VERSION="${VERSION}") + message(FATAL_ERROR "Could not determine MOOSE_VERSION" ) endif( ) +add_definitions( -DMOOSE_VERSION="${MOOSE_VERSION}") +message( STATUS "MOOSE Version ${MOOSE_VERSION}" ) # This snippet is from LLVM project. # Sanity check our source directory to make sure that we are not trying to diff --git a/VERSION b/VERSION new file mode 100644 index 0000000000000000000000000000000000000000..8dd31a6df1b65b4741cf70e90d685d8edeffaa45 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +3.1.0-119-g835bf9a \ No newline at end of file diff --git a/python/setup.py b/python/setup.py index 18638088a537bb88ba1b7bcdedafb9ef92e64a61..92ef412c7d1319d2aa71be809b2cd129379ae852 100644 --- a/python/setup.py +++ b/python/setup.py @@ -31,6 +31,9 @@ __status__ = "Development" import os from distutils.core import setup +with open( '../../VERSION', 'r' ) as f: + version = f.read( ) + try: import importlib.machinery suffix = importlib.machinery.EXTENSION_SUFFIXES[0] @@ -39,21 +42,23 @@ except Exception as e: setup( name='moose', - version='3.0.2', + version=version, description='MOOSE python scripting module.', - author='Dilwar Singh', - author_email='dilawars@ncbs.res.in', + author='MOOSERes', + author_email='bhalla@ncbs.res.in', + maintainer='Dilawar Singh', + maintainer_email='dilawars@ncbs.res.in', url='http://moose.ncbs.res.in', packages=[ 'rdesigneur' , 'moose' + , 'moose.SBML' , 'moose.neuroml' , 'moose.genesis' ], package_dir = { 'moose' : 'moose' , 'rdesigneur' : 'rdesigneur' - , 'genesis' : 'genesis' }, package_data = { 'moose' : ['_moose' + suffix] }, )