Commit 54ef6b4c authored by peastman's avatar peastman
Browse files

Get the version number from the CMake script

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