summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge+fdio@cisco.com>2019-02-04 13:33:33 +0000
committerGerrit Code Review <gerrit@fd.io>2019-02-04 13:33:33 +0000
commite5d186cd59f471ef8c97ce341e231c7663ac92b9 (patch)
tree2b95151f559169d76e87c1c3c9aedc6ac06fa6c5
parent9a7a239ed9d70513580d2104f2a70e77d03d91be (diff)
parent7cf1f75bb113353f9a35b0d20302a9d32383154e (diff)
Merge "[HICN-9] Fix version number in libhicn doc."
-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@ \