Skip to content

Commit

Permalink
Include H5Version.hpp in the sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
1uc committed Aug 4, 2023
1 parent 3449d3d commit 92e1aa0
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 7 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/version_file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: HighFive Check Version File

on:
push:
branches:
- ci_test
- release/**
pull_request:
branches:
- master
- release/**

jobs:
CheckVersion:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: true

- name: "Install libraries"
run: |
sudo apt-get -qq update
sudo apt-get -qq install libhdf5-dev ninja-build
- name: Build
run: |
# Will trigger `configure_file` for H5Version.hpp.
cmake -DHIGHFIVE_USE_BOOST=Off -B build .
- name: Test
run: |
# Check that the file hasn't changed, i.e. was updated
# after changing the version number.
! git status | grep include/highfive/H5Version.hpp
1 change: 0 additions & 1 deletion CMake/HighFiveTargetExport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ add_library(libheaders INTERFACE)

target_include_directories(libheaders INTERFACE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

# Combined HighFive
Expand Down
7 changes: 1 addition & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif()
project(HighFive VERSION 2.7.1)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/highfive/H5Version.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/include/highfive/H5Version.hpp)
${CMAKE_CURRENT_SOURCE_DIR}/include/highfive/H5Version.hpp)
# INCLUDES
list(APPEND CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/CMake
Expand Down Expand Up @@ -104,11 +104,6 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION "include"
PATTERN "*.in" EXCLUDE)

# Installation of configured headers
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
DESTINATION "include")


# Preparing local building (tests, examples)
# ------------------------------------------

Expand Down
33 changes: 33 additions & 0 deletions include/highfive/H5Version.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c), 2020
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
*/
#pragma once

#define HIGHFIVE_VERSION_MAJOR 2
#define HIGHFIVE_VERSION_MINOR 7
#define HIGHFIVE_VERSION_PATCH 2

/** \brief Concatenated representation of the HighFive version.
*
* \warning The macro `HIGHFIVE_VERSION` by itself isn't valid C/C++.
*
* However, it can be stringified with two layers of macros, e.g.,
* \code{.cpp}
* #define STRINGIFY_VALUE(s) STRINGIFY_NAME(s)
* #define STRINGIFY_NAME(s) #s
*
* std::cout << STRINGIFY_VALUE(HIGHFIVE_VERSION) << "\n";
* \endcode
*/
#define HIGHFIVE_VERSION 2.7.2

/** \brief String representation of the HighFive version.
*
* \warning This macro only exists from 2.7.1 onwards.
*/
#define HIGHFIVE_VERSION_STRING "2.7.2"

0 comments on commit 92e1aa0

Please sign in to comment.