Commit cc92c54a authored by Atkins, Charles Vernon's avatar Atkins, Charles Vernon
Browse files

Merge branch '4-part-version-string' into release

* 4-part-version-string:
  Revert bp3 version changes
  Use a 4 part version string in between releases
parents 9c94bbb0 5bf3a268
......@@ -12,7 +12,11 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
"separate from the source directory")
endif()
project(ADIOS2 VERSION 2.4.0)
include(${CMAKE_CURRENT_LIST_DIR}/cmake/ADIOSFunctions.cmake)
setup_version(2.4.0)
project(ADIOS2 VERSION ${ADIOS2_VERSION})
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
......@@ -63,7 +67,6 @@ add_subdirectory(cmake/install/pre)
#------------------------------------------------------------------------------#
# Top level options
#------------------------------------------------------------------------------#
include(ADIOSFunctions)
# Default to a debug build if not specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
......
......@@ -120,10 +120,7 @@ PYBIND11_MODULE(adios2, m)
m.attr("GlobalValue") = false;
m.attr("LocalValue") = true;
std::ostringstream versionss;
versionss << ADIOS2_VERSION_MAJOR << "." << ADIOS2_VERSION_MINOR << "."
<< ADIOS2_VERSION_PATCH;
m.attr("__version__") = versionss.str();
m.attr("__version__") = ADIOS2_VERSION_STR;
// enum classes
pybind11::enum_<adios2::Mode>(m, "Mode")
......
......@@ -3,6 +3,34 @@
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#
function(setup_version BASE)
set(ver_tweak)
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/.git)
if(NOT GIT_COMMAND)
find_program(GIT_COMMAND git)
endif()
if(GIT_COMMAND)
execute_process(
COMMAND git
--git-dir=${CMAKE_CURRENT_LIST_DIR}/.git
describe --tags --match v${BASE}
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET
)
if(res EQUAL 0 AND out MATCHES "[^-]*-([^-]*)-g[a-f0-9]*")
set(ver_tweak ${CMAKE_MATCH_1})
endif()
endif()
endif()
if(ver_tweak)
set(ADIOS2_VERSION ${BASE}.${ver_tweak} PARENT_SCOPE)
else()
set(ADIOS2_VERSION ${BASE} PARENT_SCOPE)
endif()
set(ADIOS2_LIBRARY_VERSION ${BASE} PARENT_SCOPE)
endfunction()
function(adios_option name description default)
set(ADIOS2_USE_${name} ${default} CACHE STRING "${description}")
set_property(CACHE ADIOS2_USE_${name} PROPERTY
......
......@@ -224,7 +224,7 @@ endif()
# Set library version information
set_target_properties(adios2 PROPERTIES
VERSION ${ADIOS2_VERSION}
VERSION ${ADIOS2_LIBRARY_VERSION}
SOVERSION ${ADIOS2_VERSION_MAJOR}
)
......
......@@ -7,10 +7,11 @@
#define ADIOSCONFIG_H_
/* ADIOS Version Information */
#define ADIOS2_VERSION_STR "@ADIOS2_VERSION@"
#define ADIOS2_VERSION_MAJOR @ADIOS2_VERSION_MAJOR@
#define ADIOS2_VERSION_MINOR @ADIOS2_VERSION_MINOR@
#define ADIOS2_VERSION_PATCH @ADIOS2_VERSION_PATCH@
#define ADIOS2_VERSION @ADIOS2_VERSION@
#cmakedefine ADIOS2_VERSION_TWEAK @ADIOS2_VERSION_TWEAK@
/*
* ADIOS Build Information:
......
......@@ -33,7 +33,7 @@ endif()
# Set library version information
set_target_properties(sst PROPERTIES
OUTPUT_NAME adios2_sst
VERSION ${ADIOS2_VERSION}
VERSION ${ADIOS2_LIBRARY_VERSION}
SOVERSION ${ADIOS2_VERSION_MAJOR}
)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment