aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-02-04 14:06:58 +0100
committerMauro Sardara <msardara@cisco.com>2019-02-04 14:07:48 +0100
commit7cf1f75bb113353f9a35b0d20302a9d32383154e (patch)
tree351ecf463b4cb0898efe3140f36c437790b51d2a /lib
parent9eefff3b484dd46e1244d0201844fc91e2b78a62 (diff)
[HICN-9] Fix version number in libhicn doc.
Change-Id: I7b136665e12951604da2a08ae0af5fe506fa62dd Signed-off-by: Mauro Sardara <msardara@cisco.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/CMakeLists.txt4
-rw-r--r--lib/doc/CMakeLists.txt12
-rw-r--r--lib/doc/Doxyfile.in2
3 files changed, 13 insertions, 5 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 44d8526c6..796de8df8 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -32,10 +32,6 @@ endif()
include (Packaging)
-set(CMAKE_VERSION_MAJOR 0)
-set(CMAKE_VERSION_MINOR 1)
-set(CMAKE_VERSION_PATCH 1)
-
option(CMAKE_BUILD_TEST "Build unit tests" OFF)
if (NOT CMAKE_BUILD_TYPE)
diff --git a/lib/doc/CMakeLists.txt b/lib/doc/CMakeLists.txt
index 9b4660337..135addc09 100644
--- a/lib/doc/CMakeLists.txt
+++ b/lib/doc/CMakeLists.txt
@@ -11,6 +11,18 @@ if(BUILD_DOCUMENTATION)
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+ # extract version from git
+ execute_process(
+ COMMAND git describe --long --match v*
+ WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+ OUTPUT_VARIABLE VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+
+ if (NOT VERSION)
+ set(VERSION "v1.0-1-gcafe")
+ endif()
+
configure_file(${doxyfile_in} ${doxyfile} @ONLY)
add_custom_target(doc
diff --git a/lib/doc/Doxyfile.in b/lib/doc/Doxyfile.in
index ce352c734..a28fb3a1a 100644
--- a/lib/doc/Doxyfile.in
+++ b/lib/doc/Doxyfile.in
@@ -1,5 +1,5 @@
PROJECT_NAME = "Hybrid ICN (hICN)"
-PROJECT_NUMBER = v@CMAKE_VERSION_MAJOR@.@CMAKE_VERSION_MINOR@.@CMAKE_VERSION_PATCH@
+PROJECT_NUMBER = @VERSION@
STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@ \
@PROJECT_BINARY_DIR@
INPUT = @doxy_main_page@ \