Skip to content

Commit

Permalink
Read in project version from the hdr_histogram_version.h file.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Apr 27, 2023
1 parent 72c04b3 commit a478212
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
cmake_minimum_required(VERSION 3.12)
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)
endif()

file(STRINGS "include/hdr/hdr_histogram_version.h" HDR_VERSION_HEADER)
string(REGEX MATCH ".*#define HDR_HISTOGRAM_VERSION \"(.*)\".*" HDR_BLACK_HOLE ${HDR_VERSION_HEADER})

project(hdr_histogram
VERSION 0.11.6
VERSION ${CMAKE_MATCH_1}
LANGUAGES C
DESCRIPTION "C port of the HdrHistogram"
HOMEPAGE_URL "http://hdrhistogram.github.io/HdrHistogram/")
Expand All @@ -21,7 +28,7 @@ include(CMakePackageConfigHelpers)

set(HDR_SOVERSION_CURRENT 6)
set(HDR_SOVERSION_AGE 1)
set(HDR_SOVERSION_REVISION 2)
set(HDR_SOVERSION_REVISION 3)

set(HDR_VERSION ${HDR_SOVERSION_CURRENT}.${HDR_SOVERSION_AGE}.${HDR_SOVERSION_REVISION})
set(HDR_SOVERSION ${HDR_SOVERSION_CURRENT})
Expand Down
2 changes: 2 additions & 0 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
configure_file(hdr/hdr_histogram_version.h hdr/hdr_histogram_version.h @ONLY)

set(HDR_HISTOGRAM_PUBLIC_HEADERS
hdr/hdr_histogram.h
hdr/hdr_histogram_log.h
Expand Down
2 changes: 1 addition & 1 deletion include/hdr/hdr_histogram_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
#ifndef HDR_HISTOGRAM_VERSION_H
#define HDR_HISTOGRAM_VERSION_H

#define HDR_HISTOGRAM_VERSION_H "0.11.6"
#define HDR_HISTOGRAM_VERSION "0.11.7"

#endif // HDR_HISTOGRAM_VERSION_H

0 comments on commit a478212

Please sign in to comment.