Skip to content

Commit

Permalink
Make sure ARBORX_VERSION and ARBORX_VERSION_STRING always match
Browse files Browse the repository at this point in the history
  • Loading branch information
aprokop committed Jan 11, 2025
1 parent aefa0f5 commit b53ecf5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,12 @@ install(EXPORT ArborXTargets
DESTINATION ${CMAKE_INSTALL_DATADIR}/cmake/ArborX
)

set(ARBORX_VERSION "10799")
set(ARBORX_VERSION_STRING "2.0 (dev)")
set(ARBORX_VERSION_MAJOR 1)
set(ARBORX_VERSION_MINOR 7)
set(ARBORX_VERSION_PATCH 99)
math(EXPR ARBORX_VERSION "${ARBORX_VERSION_MAJOR} * 10000 + ${ARBORX_VERSION_MINOR} * 100 + ${ARBORX_VERSION_PATCH}")
set(ARBORX_VERSION_STRING "${ARBORX_VERSION_MAJOR}.${ARBORX_VERSION_MINOR}.${ARBORX_VERSION_PATCH}")
message(STATUS "ArborX version: ${ARBORX_VERSION_STRING}")

# Make sure that the git hash in ArborX_Version.hpp is considered to be always
# out of date, and thus is updated every recompile.
Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.22)
project(ArborXExamples CXX)
find_package(ArborX 2.0 REQUIRED)
find_package(ArborX 1.7.99 REQUIRED)
enable_testing()
endif()

Expand Down
9 changes: 8 additions & 1 deletion src/ArborX_Config.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
#ifndef ARBORX_CONFIG_HPP
#define ARBORX_CONFIG_HPP

#cmakedefine ARBORX_VERSION @ARBORX_VERSION@
// ARBORX_VERSION % 100 is the patch level
// ARBORX_VERSION / 100 % 100 is the minor version
// ARBORX_VERSION / 10000 is the major version
#define ARBORX_VERSION @ARBORX_VERSION@
#define ARBORX_VERSION_MAJOR @ARBORX_VERSION_MAJOR@
#define ARBORX_VERSION_MINOR @ARBORX_VERSION_MINOR@
#define ARBORX_VERSION_PATCH @ARBORX_VERSION_PATCH@

#cmakedefine ARBORX_ENABLE_ROCTHRUST
#cmakedefine ARBORX_ENABLE_ONEDPL
#cmakedefine ARBORX_ENABLE_MPI
Expand Down

0 comments on commit b53ecf5

Please sign in to comment.