diff --git a/CMakeLists.txt b/CMakeLists.txt index c831788..f5b0125 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.5) -project(BoostAssert LANGUAGES CXX) +project(BoostAssert VERSION 1.69.0 LANGUAGES CXX) add_library(boost_assert INTERFACE) add_library(Boost::assert ALIAS boost_assert) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index be878b5..d91307f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,3 +3,4 @@ # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt boost_test_jamfile(FILE Jamfile.v2 LIBRARIES Boost::assert Boost::core) +boost_test(SOURCES check_cmake_version.cpp ARGUMENTS ${PROJECT_VERSION} LIBRARIES Boost::core Boost::config) diff --git a/test/check_cmake_version.cpp b/test/check_cmake_version.cpp new file mode 100644 index 0000000..2fd4648 --- /dev/null +++ b/test/check_cmake_version.cpp @@ -0,0 +1,27 @@ +// Check whether the version in CMakeLists.txt is up to date +// +// Copyright 2018 Peter Dimov +// +// 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 + +#include +#include +#include + +int main( int ac, char const* av[] ) +{ + BOOST_TEST_EQ( ac, 2 ); + + if( ac >= 2 ) + { + char version[ 64 ]; + std::sprintf( version, "%d.%d.%d", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100 ); + + BOOST_TEST_CSTR_EQ( av[1], version ); + } + + return boost::report_errors(); +}