Commit 7541ca00 authored by peastman's avatar peastman
Browse files

Merge pull request #93 from peastman/master

Get the version number from the CMake script
parents 9d11cedc 54ef6b4c
......@@ -130,8 +130,8 @@ ENDIF (NOT CMAKE_CXX_FLAGS_RELEASE)
# and make it available to the code so it can be built into the binaries.
SET(OPENMM_LIBRARY_NAME OpenMM)
SET(OPENMM_MAJOR_VERSION 1)
SET(OPENMM_MINOR_VERSION 0)
SET(OPENMM_MAJOR_VERSION 5)
SET(OPENMM_MINOR_VERSION 2)
SET(OPENMM_BUILD_VERSION 0)
SET(OPENMM_COPYRIGHT_YEARS "2008")
......
......@@ -279,8 +279,12 @@ const string& Platform::getDefaultPluginsDirectory() {
return directory;
}
// Some bizarre preprocessor magic required to convert a macro to a string...
#define STRING1(x) #x
#define STRING(x) STRING1(x)
const string& Platform::getOpenMMVersion() {
static const string version = "5.1";
static const string version = STRING(OPENMM_MAJOR_VERSION) "." STRING(OPENMM_MINOR_VERSION);
return version;
}
......
......@@ -21,8 +21,9 @@ set(STAGING_OUTPUT_FILES "") # Will contain all required package files
file(GLOB STAGING_INPUT_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/MANIFEST.in"
"${CMAKE_CURRENT_SOURCE_DIR}/README.txt"
"${CMAKE_CURRENT_SOURCE_DIR}/*.py"
"${CMAKE_CURRENT_SOURCE_DIR}/filterPythonFiles.py"
)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py ${OPENMM_PYTHON_STAGING_DIR}/setup.py)
###########################################################
### Check the git revision of the source, and write it ###
......
......@@ -13,9 +13,9 @@ import sys
import platform
from distutils.core import setup
MAJOR_VERSION_NUM='5'
MINOR_VERSION_NUM='1'
BUILD_INFO='0'
MAJOR_VERSION_NUM='@OPENMM_MAJOR_VERSION@'
MINOR_VERSION_NUM='@OPENMM_MINOR_VERSION@'
BUILD_INFO='@OPENMM_BUILD_VERSION@'
IS_RELEASED = False
......@@ -67,7 +67,7 @@ def uninstall(verbose=True):
sys.path=save_path
def write_version_py(filename="simtk/openmm/version.py", major_version_num=MAJOR_VERSION_NUM,
def writeVersionPy(filename="simtk/openmm/version.py", major_version_num=MAJOR_VERSION_NUM,
minor_version_num=MINOR_VERSION_NUM, build_info=BUILD_INFO):
"""Write a version.py file into the python source directory before installation.
If a version.py file already exists, we assume that it contains only the git_revision
......@@ -238,7 +238,7 @@ def main():
uninstall()
except:
pass
write_version_py()
writeVersionPy()
setupKeywords=buildKeywordDictionary()
setup(**setupKeywords)
......
Markdown is supported
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