diff --git a/CMakeLists.txt b/CMakeLists.txt index 04ed2bff..e53d2045 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.4) project( "ViennaLS" - VERSION 1.0.0) + VERSION 1.1.1) + +add_definitions(-DVIENNALS_VERSION=${PROJECT_VERSION}) include(GNUInstallDirs) diff --git a/Wrapping/CMakeLists.txt b/Wrapping/CMakeLists.txt index c834b9e5..a77e00eb 100644 --- a/Wrapping/CMakeLists.txt +++ b/Wrapping/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.4) # lowercase viennaLS is the python export -project(ViennaLSPython) +project("ViennaLSPython" + VERSION ${CMAKE_PROJECT_VERSION}) # include viennals set(ViennaHRLE_DIR $ENV{VIENNAHRLE_DIR}) diff --git a/Wrapping/pyWrap.cpp b/Wrapping/pyWrap.cpp index 3853c94c..1338b817 100644 --- a/Wrapping/pyWrap.cpp +++ b/Wrapping/pyWrap.cpp @@ -10,6 +10,9 @@ #define TOKENPASTE_INTERNAL(x, y, z) x##y##z #define TOKENPASTE(x, y, z) TOKENPASTE_INTERNAL(x, y, z) #define VIENNALS_MODULE_NAME TOKENPASTE(viennaLS, VIENNALS_PYTHON_DIMENSION, d) +#define STRINGIZE2(s) #s +#define STRINGIZE(s) STRINGIZE2(s) +#define VIENNALS_MODULE_VERSION STRINGIZE(VIENNALS_VERSION) #include #include @@ -89,7 +92,7 @@ class PylsFastAdvectDistribution : public lsFastAdvectDistribution { } }; -// REFERNCE HOLDING CLASS WRAPPERS +// REFERENCE HOLDING CLASS WRAPPERS // maybe needed wrapper code once we move to smart pointers // https://github.com/pybind/pybind11/issues/1389 @@ -109,6 +112,9 @@ class PylsFastAdvectDistribution : public lsFastAdvectDistribution { PYBIND11_MODULE(VIENNALS_MODULE_NAME, module) { module.doc() = "ViennaLS python module."; + // set version string of python module + module.attr("__version__") = VIENNALS_MODULE_VERSION; + // lsAdvect pybind11::class_>(module, "lsAdvect") // constructors