diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f701c7..cebeb15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.17) -PROJECT(OpenMMNonbondedSlicing) +PROJECT(OpenMMNonbondedSlicing VERSION 0.1) # We need to know where OpenMM is installed so we can access the headers and libraries. SET(OPENMM_DIR "/usr/local/openmm" CACHE PATH "Where OpenMM is installed") diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 9625d6d..ee03c42 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -1,5 +1,6 @@ set(WRAP_FILE NonbondedSlicingWrapper.cpp) set(MODULE_NAME nonbondedslicing) +configure_file(nonbondedslicing.i ${CMAKE_CURRENT_BINARY_DIR}) # Execute SWIG to generate source code for the Python module. @@ -10,8 +11,8 @@ add_custom_command( -doxygen -o "${WRAP_FILE}" "-I${OPENMM_DIR}/include" - "${CMAKE_CURRENT_SOURCE_DIR}/nonbondedslicing.i" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/nonbondedslicing.i" + "nonbondedslicing.i" + DEPENDS "nonbondedslicing.i" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" ) diff --git a/python/nonbondedslicing.i b/python/nonbondedslicing.i index ed0fad9..cf9f558 100644 --- a/python/nonbondedslicing.i +++ b/python/nonbondedslicing.i @@ -17,6 +17,8 @@ %pythoncode %{ from openmm import unit + +__version__ = "@CMAKE_PROJECT_VERSION@" %} /*