Add versioning of library
[framework/api/sim.git] / debian / rules
index 561d7e5..4ca47e4 100755 (executable)
@@ -1,6 +1,8 @@
 #!/usr/bin/make -f
 
 CFLAGS = -Wall -g
+FULLVER ?= $(shell dpkg-parsechangelog | grep Version: | cut -d ' ' -f 2 | cut -d '-' -f 1)
+MAJORVER ?= $(shell echo $(FULLVER) | cut -d '.' -f 1)
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -O0
@@ -13,7 +15,7 @@ CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
 configure: configure-stamp
 configure-stamp:
        dh_testdir
-       mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && cmake ..
+       mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && cmake .. -DFULLVER=${FULLVER} -DMAJORVER=${MAJORVER}
        touch configure-stamp