check_cmake_version.cpp 654 B

12345678910111213141516171819202122232425
  1. // Check whether the version in CMakeLists.txt is up to date
  2. //
  3. // Copyright 2018 Peter Dimov
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt
  8. #include <boost/core/lightweight_test.hpp>
  9. #include <boost/version.hpp>
  10. #include <cstdio>
  11. int main(int ac, char const* av[]) {
  12. BOOST_TEST_EQ(ac, 2);
  13. if (ac >= 2) {
  14. char version[64];
  15. std::sprintf(version, "%d.%d.%d", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000,
  16. BOOST_VERSION % 100);
  17. BOOST_TEST_CSTR_EQ(av[1], version);
  18. }
  19. return boost::report_errors();
  20. }